Sorry for newbie question, just working on understanding HA and Sonoff (Tasmota) integration. Hass.io 0.93 on Raspberry Pi 2 + Sonoff Basic on Tasmota 5.12.0, generic inte
Is GPIO 14 what you have mapped to the state_topic of each switch ?
Actually I’m going to guess NO.
I just did some searching on tasmota and realised why I like ESPEasy so much. Sheesh !
If you get the tasmota sorted, drop me a line. I’d be happy to help you with the single and double clicks
In my case switch (single for Sonof Basic) is mapped to relay state, it is not related to GPIO14, every change of relay is published to mosquitto MQTT. I’m able (for now) publish “cmnd/sonof-151/POWER1” from GPIO14 of Sonoff-151 in the proper mode (clik and release) - “SwitchMode 4” and “SwitchTopic sonoff-151” as web console command. GPIO01 and GPIO03 as well (POWER2 and POWER3) but for some reason published twice (left something to tune).
My question is rather related to HA configuration (kind of trigger: … and action: …). I do not know ESPEasy but I think the home logic should to be implemented in HA, not on Sonoff. Except logic related to clicks -
single, double, tripple and long clicks should IMHO on Sonoff FW. So you can help me with this :-).
Sonoff-151 is toggling itself, propably taking POWER1 from MQTT just before HA can handle it. I’m not sure the publish that is done by GPIO14 (on Sonoff-151) is properly formed, maybe it has no payload (ON).
Yes. It is working exactly as before, the only change I can see is in HA where now there is “Sonoff Test2 Toggle”. That is why I expect sonoff-151 has taken the messane for itself before HA.
Thanks for help, I will dig into this till I do this, or change Sonof firmware :-).
Do you think ESPEasy is easier to configure with HA ? I’m going to implement all logic inside HA, Sonoff FW is for relay switch and 3-4 sensors (switches).
Not necessarily easier, just that I’m familiar with it.
Also it has its own ‘rules’ section where you can build logic.
It can also talk directly with other ESPeasy devices.
What is Command Unknown and what is wrong with it (how to fix it) ?
And how to configure Home Assistant to catch POWER2, POWER3 and POWER4 messages to change the state of another relay, for example from sonoff-152 mentioned above ?
If I remember it correctly (tested it 2-3 day ago) SwitchMode 1 works fine for default GPIO01 and GPIO14, the only difference is that SwitchMode 1 is using MQTT instead of direct change to relay state. SwitchMode 1 requires holding the button to keep the relay closed, what I want to get is one press to turn on, next one to turn off. Taht is why I need SwitchMode 4 - it is working exactrly as I want.
Also unique topics for switches are working fine, no problem to configure GPIO01 as “cmnd/sonoff-151_switch3”, GPIO03 as “cmnd/sonoff-151_switch4” (or “cmnd/sonoff-151/switch3”, “cmnd/sonoff-151/switch4”), just wanted to have POWER2/3/4 for distinguish them - but maybe you are right becasue I can’t remember “Command Unknow” error in this case. Can’t check this right now, I have to install properly MQTT in Hassbian - there is something wrong in my mosquitto installation. Hass.io for some reason is not stable on Raspbery Pi 2 (hangs after day or two).
21:58:04 MQT: stat/sonoff-151/RESULT = {"POWER":"ON"}
21:58:04 MQT: stat/sonoff-151/POWER = ON
21:58:06 MQT: stat/sonoff-151/RESULT = {"POWER":"OFF"}
21:58:06 MQT: stat/sonoff-151/POWER = OFF
21:58:07 MQT: cmnd/sonoff-151-SWT/POWER2 = ON
21:58:09 MQT: cmnd/sonoff-151-SWT/POWER2 = OFF
21:58:10 MQT: cmnd/sonoff-151-SWT/POWER3 = ON
21:58:10 MQT: cmnd/sonoff-151-SWT/POWER3 = OFF
21:58:11 MQT: cmnd/sonoff-151-SWT/POWER4 = ON
21:58:13 MQT: cmnd/sonoff-151-SWT/POWER4 = OFF
First 4 lines above are related to GPIO00, the other to GPIO14/01/03 as extra three switches.
Finaly changed SwitchMode to 2 because I can (propably) detect long-click using Home Assistant.
My problem was related to using as SwitchTopic “sonoff-151/switch” or “sonoff-151” - as it was default topic closing and releasing GPIOs result was { “Command” : “Unknown” }.