Sonoff: ESP not so easy?

Everything about esp8266 and more.

Moderator: leecollings

Post Reply
MikeF
Posts: 350
Joined: Sunday 19 April 2015 0:36
Target OS: Raspberry Pi / ODroid
Domoticz version: V2022.2
Location: UK
Contact:

Sonoff: ESP not so easy?

Post 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!

ImageImageImage
Pino77
Posts: 4
Joined: Friday 04 September 2015 8:39
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8742
Location: The Netherlands
Contact:

Re: Sonoff: ESP not so easy?

Post 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?

Image

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.
Raspberry Pi 3 with RFlink and RaZberry
MikeF
Posts: 350
Joined: Sunday 19 April 2015 0:36
Target OS: Raspberry Pi / ODroid
Domoticz version: V2022.2
Location: UK
Contact:

Re: Sonoff: ESP not so easy?

Post 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
kimot
Posts: 104
Joined: Saturday 25 November 2017 17:18
Target OS: Raspberry Pi / ODroid
Domoticz version: v3.8153
Location: Czech Rep.
Contact:

Re: Sonoff: ESP not so easy?

Post by kimot »

And what is so difficult with ESPeasy?
You select Domoticz HTTP, device as a switch input, set Domoticz IDX .... et voila! :o)
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/
RPi2 Domoticz v 4.10717
10 x Sonoff Basic - ESPeasy
1 x Wemos D1 - ESPeasy
1 x Shelly Plus Plug S
1 x Sonoff S26 - ESPeasy
1 x Shelly 1
1 x MySensors HC-SR04
1 x MySenosrs wifi gateway
1 x RFLink
4x Cam IPC-T240H
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest