Skip to the content.

Web Endpoints

Application

curl -X GET http://<esp-ip>/api/app
{
  "debug": true,
  "firmware": "YaSolR-local-pro-esp32-debug",
  "id": "A1C48",
  "manufacturer": "Mathieu Carbou",
  "model": "Pro",
  "name": "YaSolR",
  "trial": false,
  "version": "main_14640c10_modified"
}

Configuration

curl -X GET http://<esp-ip>/api/config
{
  "admin_pwd": "",
  "ap_mode_enable": "false",
  "button_action": "restart",
  "button_enable": "true",
  "button_pin": "23",
  "buzzer_enable": "false",
  "buzzer_pin": "19",
  "debug_enable": "true",
  "dp_clock_pin": "22",
  "dp_data_pin": "21",
  "dp_enable": "true",
  "dp_powsave": "0",
  "dp_rotation": "0",
  "dp_type": "SH1106",
  "grid_freq": "0",
  "grid_pow_mqtt": "homeassistant/states/sensor/grid_power/state",
  "ha_disco_enable": "true",
  "ha_disco_topic": "homeassistant/discovery",
  "hostname": "yasolr-a1c48",
  "jsy_enable": "true",
  "jsy_rx_pin": "17",
  "jsy_tx_pin": "16",
  "lights_enable": "true",
  "lights_g_pin": "0",
  "lights_r_pin": "15",
  "lights_y_pin": "2",
  "mqtt_enable": "true",
  "mqtt_port": "1883",
  "mqtt_pub_itvl": "5",
  "mqtt_pwd": "********",
  "mqtt_secure": "false",
  "mqtt_server": "192.168.125.90",
  "mqtt_topic": "yasolr_a1c48",
  "mqtt_user": "homeassistant",
  "ntp_server": "pool.ntp.org",
  "ntp_timezone": "Europe/Paris",
  "out1_aut_enable": "false",
  "out1_bp_enable": "true",
  "out1_bp_pin": "32",
  "out1_bp_type": "NO",
  "out1_dim_auto": "false",
  "out1_dim_enable": "true",
  "out1_dim_limit": "100",
  "out1_dim_pin": "25",
  "out1_dim_type": "TRIAC",
  "out1_end_time": "06:00",
  "out1_start_time": "22:00",
  "out1_tmp_enable": "true",
  "out1_tmp_high": "60",
  "out1_tmp_low": "50",
  "out1_tmp_pin": "18",
  "out1_wdays": "sun,mon,tue,wed,thu,fri,sat",
  "out2_aut_enable": "true",
  "out2_bp_enable": "true",
  "out2_bp_pin": "33",
  "out2_bp_type": "NO",
  "out2_dim_auto": "true",
  "out2_dim_enable": "true",
  "out2_dim_limit": "100",
  "out2_dim_pin": "26",
  "out2_dim_type": "TRIAC",
  "out2_end_time": "06:00",
  "out2_start_time": "22:00",
  "out2_tmp_enable": "true",
  "out2_tmp_high": "60",
  "out2_tmp_low": "50",
  "out2_tmp_pin": "5",
  "out2_wdays": "sun,mon,tue,wed,thu,fri,sat",
  "portal_timeout": "180",
  "relay1_enable": "true",
  "relay1_pin": "13",
  "relay1_power": "0",
  "relay1_type": "NO",
  "relay2_enable": "true",
  "relay2_pin": "12",
  "relay2_power": "0",
  "relay2_type": "NO",
  "sys_tmp_enable": "true",
  "sys_tmp_pin": "4",
  "wifi_pwd": "",
  "wifi_ssid": "IoT",
  "wifi_timeout": "15",
  "zcd_enable": "true",
  "zcd_pin": "35"
}
# Configuration Update:
curl -X POST \
  -F "hostname=foobarbaz" \
  -F "admin_password=" \
  -F "ntp_server=fr.pool.ntp.org" \
  -F "ntp_timezone=Europe/Paris" \
  [...]
  http://<esp-ip>/api/config
# Backup configuration config.txt:
curl -X GET http://<esp-ip>/api/config/backup
# Restore configuration config.txt:
curl -X POST -F "data=@./path/to/config.txt" http://<esp-ip>/api/config/restore

Grid Electricity

curl -X GET http://<esp-ip>/api/grid
{
  "frequency": 49.99000168,
  "online": true,
  "power": 1519.915039,
  "voltage": 233.6410065
}

Network

curl -X GET http://<esp-ip>/api/network
{
  "ip_address": "192.168.125.120",
  "mac_address": "B0:B2:1C:0A:1C:48",
  "state": "STA_CONNECTED",
  "wifi_bssid": "00:17:13:37:28:C0",
  "wifi_signal": 78,
  "wifi_rssi": -43,
  "wifi_ssid": "IoT"
}

NTP

curl -X GET http://<esp-ip>/api/ntp
{
  "synced": true
}

Relays

curl -X GET http://<esp-ip>/api/relays
{
  "relay1": {
    "enabled": true,
    "state": "off",
    "switch_count": 2
  },
  "relay2": {
    "enabled": false,
    "state": "off",
    "switch_count": 0
  }
}
# Change relay state for a specific duration (duration is optional)
curl -X POST \
  -F "state=on" \
  -F "duration=20000" \
  http://<esp-ip>/api/relays/relay1

Router

curl -X GET http://<esp-ip>/api/router
{
  "energy": 0.768999994,
  "power_factor": 0,
  "power": 0,
  "thdi": 0,
  "virtual_grid_power": 3433.758789,
  "output1": {
    "apparent_power": 0,
    "current": 0,
    "enabled": true,
    "energy": 0,
    "power_factor": 0,
    "power": 0,
    "resistance": 0,
    "state": "Idle",
    "thdi": 0,
    "voltage": 0,
    "bypass_relay": {
      "enabled": true,
      "state": "off",
      "switch_count": 0
    },
    "dimmer": {
      "enabled": true,
      "level": 0,
      "state": "off"
    },
    "temp_sensor": {
      "enabled": true,
      "temperature": 22.62999916,
      "valid": true
    }
  },
  "output2": {
    "apparent_power": 0,
    "current": 0,
    "enabled": true,
    "energy": 0,
    "power_factor": 0,
    "power": 0,
    "resistance": 0,
    "state": "Idle",
    "thdi": 0,
    "voltage": 0,
    "bypass_relay": {
      "enabled": false,
      "state": "off",
      "switch_count": 0
    },
    "dimmer": {
      "enabled": true,
      "level": 0,
      "state": "off"
    },
    "temp_sensor": {
      "enabled": false,
      "temperature": 0,
      "valid": false
    }
  }
}
# Set the dimmer to 0-100%
curl -X POST \
  -F "level=100" \
  http://<esp-ip>/api/router/output1/dimmer
# Change bypass relay state
curl -X POST \
  -F "state=on" \
  http://<esp-ip>/api/router/output1/bypass_relay

System

curl -X GET http://<esp-ip>/api/system
{
  "boots": 138,
  "chip_cores": 2,
  "chip_model": "ESP32-D0WD-V3",
  "chip_revision": 3,
  "cpu_freq": 240,
  "heap_total": 236908,
  "heap_usage": 52.25,
  "heap_used": 123792,
  "uptime": 9353,
  "buzzer": {
    "enabled": false
  },
  "lights": {
    "code": "🟢 ⚫ ⚫",
    "green": "on",
    "red": "off",
    "yellow": "off"
  },
  "temp_sensor": {
    "enabled": true,
    "temperature": 22.12999916,
    "valid": true
  }
}
# System Restart
curl -X POST http://<esp-ip>/api/system/restart