Hi everybody.
I’m trying to implement an electrical shutter with a sonoff dual flashed with tasmota (and shutter configuraton). In configuration.yaml I added this code for my cover:
It works fine and everthing is alligned if I use home assistant, tasmota web interface or physical button. Only when I start home assistat, the cover state is “unknown”! But if I move it, no matter how, home assistant get the correct state and position.
I had the same problem with the other sonoffs I use for the lights, and I resolved by this automation:
Every sonoffs (lights and covers) has the same group topic “sonoffs”. Maybe there’s a different topic to pubblish? Or something else wrong in my configuration?
Some have different practices for using the MQTT retain flag, but for me I want the status sent by a device to be retained in MQTT (so that HA gets the status on restart), and similarly any commands sent by HA I want to be retained when sending (so the device gets the command when it restarts). For the Sonoff Dual, I’m not sure. Check their wiki for commands to see what may need to be set.
Hi, I have tried various things like retain power and sensor as well as trying to call the states by various means.
The device reports its position normaly by “stat/window1/RESULT” but only when operating i.e moving. I tried sending a simple stop command to see if it would update it’s position but no.
The device posts its position regularly but the problem is that it posts as a sensor “tele/window1/SENSOR” which Homeassistant isn’t listening to.
So one solution is to take that mqtt message and relay it to “stat/window1/RESULT” which can be easily done by mqtt in and out nodes in Node red.
Another solution is to send “stat/window1/STATUS8” but that returns “10:16:56 MQT: stat/window1/STATUS8 = {“StatusSNS”:{“Time”:“2020-09-21T10:16:56”,“Shutter1”:{“Position”:6,“Direction”:0,“Target”:6},“Shutter2”:{“Position”:100,“Direction”:0,“Target”:100}}}”
Then you need to isolate "={“StatusSNS} away and send it as an stat/window1/RESULT” which I use a json node to turn it on to json objects plus change node to move “payload.StatusSNS” to payload and then I send it back out. I however have not yet implemented it to fire automatically on Homeassistant startup but I’ve seen some ideas and I will post an update when I implement it
I hope somebody understands my gibberish and if someone can make a Homeassistant automation or something better than this solution please post it.
The first part is for kown sonoffs basic state, the second is for shutters position. Obviously, for every sonoff the “group_topic” has to be “sonoffs”.
came across from google.
currently switching from shelly to tastmota also for my shutters.
Your config help me alot, but used a bit diff.
may its just because, this topic is 4 years old.