Ресерч по контролю перепрошитого SONOFF Basic R2 на Tasmota. Нужные ссылки по взаимодействию http://localhost:8080
- Host - <PC_IP_FROM_WIFI>
- Port - 1883
- Topic - main
Go приложение читает сообщения о подключении
# имитация запроса реле
$ mosquitto_pub -h localhost -t tele/main/LWT -m "Online"
$ mosquitto_pub -h localhost -t tele/main/LWT -m "Offline"Включить можно будет через запрос GET http://localhost:8080/power/on
# имитация чтения реле
$ mosquitto_sub -h localhost -t cmnd/main/Power -v
cmnd/main/Power ON
cmnd/main/Power ONВыключить можно будет через запрос GET http://localhost:8080/power/off
# имитация чтения реле
$ mosquitto_sub -h localhost -t cmnd/main/Power -v
cmnd/main/Power OFF
cmnd/main/Power OFFПереключить можно будет через запрос GET http://localhost:8080/power/toggle
# имитация чтения реле
$ mosquitto_sub -h localhost -t cmnd/main/Power -v
cmnd/main/Power TOGGLE
cmnd/main/Power TOGGLEСтатистику можно получить через запрос GET http://localhost:8080/status
# имитация чтения реле, перед ответом
$ mosquitto_sub -h localhost -t cmnd/main/Status0 -v
cmnd/main/Status0 (null)
cmnd/main/Status0 (null)Будет ожидание. Либо получим timeout, либо ответ в виде JSON
# имитация чтения реле, перед ответом
$ mosquitto_pub -h localhost -t stat/main/STATUS0 -m "{\"message\": \"Hello\"}"Чтобы отключить физическую кнопку, нужно сделать запрос
# запрос на отключение или включение физического взаимодействия реле
$ mosquitto_pub -h localhost -t cmnd/main/SetOption73 -m "1"
$ mosquitto_pub -h localhost -t cmnd/main/SetOption73 -m "0"