just wondering what you’re trying to achieve. If you create an automation to change the value, as soon as your sonoff sends a new message it will be overwritten…
It may be best to create a template sensor that takes the value of your sonoff sensor and use conditions to set the value to something else?
This sensor is changed by a sonoff with tasmota … When pressing the button in the sonoff it changes the sensor to “11879”, when this happens I execute the automation …
However, it is necessary to return the sensor to any position .... so when the button is pressed and the sensor is again "11879" run the automation again.
Therefore, I need to change the sensor status through automation. I hope you have explained it better.
got it, then you don’t really want to change the value, you just want to trigger the automation every time you press the button right?
Then use the signal_received event:
I understand. It’s usually a bad idea to write to a sensor which is why there is no function to write to a sensor in HA
However since this is mqtt, nothing stops you from sending a message on the sensor topic:
thats an interesting event, never saw that before, but would certainly be able to use in several settings. where did you find info on that, I’ve checked Events - Home Assistant but no signal_received is available ? If you have a pointer, Id certainly appreciate it, thx.