Page 1 of 1
Sonoff: ESP not so easy?
Posted: Monday 12 February 2018 17:56
by MikeF
I've looked at flashing Sonoff WiFi switches with ESPeasy in order to use these with Domoticz (including the Domoticz Switch Tutorial here:
https://www.letscontrolit.com/wiki/inde ... icz_Switch), and I have to say I don't find it easy!
I have now successfully flashed 9 Sonoffs (Basic / S20) using Theo Arends' Tasmota firmware see
https://github.com/arendst/Sonoff-Tasmota/wiki), which has Domoticz support built in. Once you have set up a dummy switch in Domoticz, all you need to do is select Configuration > Configure Domoticz from the Tasmota main menu, and enter the Domoticz Idx, et voila!



Re: Sonoff: ESP not so easy?
Posted: Monday 12 February 2018 19:18
by Pino77
Hi MikeF,
indeed the Tasmota firmware works better on the Sonoff. But with only the IDX of a virtual switch will it not work for me. Do you use MQTT? (Domoticz needs to know in some way the IP adress of the Sonoff switch i think.) And how have you setup the MQTT part?
This is in the log file:
RSL: domoticz/in = {"idx":183,"nvalue":1,"svalue":""}
RSL: stat/sonoff/RESULT = {"POWER":"ON"}
RSL: stat/sonoff/POWER = ON
RSL: domoticz/in = {"idx":183,"nvalue":0,"svalue":""}
RSL: stat/sonoff/RESULT = {"POWER":"OFF"}
RSL: stat/sonoff/POWER = OFF
How is the sonoff sending the 'on' 'off' to domoticz? Can't find in Tasmota a place where you put the ipadres of the domoticz server.
I am running domoticz 3.8742 on RPi3 Raspbian GNU/Linux 9 (stretch).
Maybe you help me to get it also working.
Re: Sonoff: ESP not so easy?
Posted: Tuesday 13 February 2018 16:20
by MikeF
OK, this is not quite as simple as I made out!
You need to amend user_config.h in the Tasmota sonoff folder, to use your WiFi SSID and password (look for #define STA_SSID1 and #define STA_PASS1 in the WiFi section) and also your MQTT details (#define MQTT_HOST and #define MQTT_PASS in the MQTT section). However, you only need to do this once - you can then flash any subsequent Sonoffs without further changes.
Further down, under MQTT - Domoticz, the standard Domoticz MQTT topics: domoticz/in, domoticz/out are defined - Tasmota is sending / receiving commands via MQTT (i.e., publishing / subscribing to MQTT topics), and so doesn't need to know Domoticz's ip address. (The wiki suggests that you can configure these topics via the web interface, but I can't find this in my version.)
You also need to ensure that you have set up hardware type 'MQTT Client Gateway with LAN interface' on the Domoticz Hardware page.
Hope this helps,
Mike
Re: Sonoff: ESP not so easy?
Posted: Tuesday 20 February 2018 20:51
by kimot
And what is so difficult with ESPeasy?
You select Domoticz HTTP, device as a switch input, set Domoticz IDX .... et voila!

)
And you have got more features then Tasmota, I think.
Better tutorials with correct GPIOs for Sonoff:
https://www.letscontrolit.com/wiki/inde ... noff_Touch
https://rutg3r.com/sonoff-firmware-tuto ... -esp-easy/