For my use case I don’t need the detached option. Here is what I want to achieve:
I want a motion sensor to turn on the relay of the shelly which will also be automatically turned off after 30 seconds if there is no longer a motion. I also have a physical switch that can turn on the light if I don’t want the motion sensor to turn off the light after 30 seconds.
For this to work I need an automation that looks for the input value of the shelly.
So after 30 seconds it should see if the input value is “on” and then the motion sensor won’t turn off the switch even if there is no motion.
This would all work, but the problem is that if I turn off the light using Alexa or the shelly button within HA, the input value won’t be affected. This way the switch shows the light is off whereas the input still shows on. It is only possible to change the input value using the actual light switch.
This is why I need to directly change the input value. So I wanted to make an automation that the input goes to “off” as soon as the switch (relay) goes from “on” to “off”. This way it doesn’t matter if I use the actual light switch to turn the light off or use Alexa or the shelly button within HA.
I hope my description isn’t too complicated too understand as it is actually very simple.
OK, now I understand your problem. It seems to me that topic input informs about the state of the physical switch. It can’t be changed without using this physical switch. Only Shelly developers may change this.
Just bought myself a few Shellies. Because I already have some ESP8266 I wanted to flash them with ESPHome, before I came across this discovery script.
What are the pros and cons of this script compared to ESPHome?
I had a similar problem with one component. It disappeared suddenly from HACS. I removed hacs file from .storage folder and restarted HA and component returned.
I have a problem with the discovery script, it never launches for some reason. I can see in Node red that my shelly is sending shellies.announce to the MQTT broker, but that’s it. How can I troubleshoot the problem? Couldn’t find anything in the logs…
Would appreciate any help!
shellies_discovery automation doesn’t start while after shellies_announce?
What Shellies do you use?
They have updated firmware and correctly configured MQTT? Script works only if Shellies use default topics. Do you change topics in Shellies configuration?
Can you show topics that Shellies send to MQTT broker.