Hello everyone,
not sure if I am in the right place or not. In Discord there is an area for automations but somehow I prefer the forum.
So, I have two questions regarding scripts and automations.
Number one:
I would like to create a feedback to the device that ran a script or automation. However, I use the same user across multiple devices, so the user_id is not helpful. So I need to somehow notify the mobile_app that ran the script.
Does anybody know if this is possible and if it is, how I can achieve this?
Number two:
I have found that scripts do not always run reliably or rather, the script runs but the recipient of the broadcast is not listening/reacting.
In my case, I send commands to my thermostats (TRV) via MQTT. And I find that if I address multiple ones at once (e.g. turn all off), that I have to run the script 2-3 times to ensure that each one actually performs the action I requested.
Is there a way to automatically run the script again, if the targets did not react as planned? Ideally built in to the script itself?
Alternatively, a global automation that is trigger when a script is called and then checks the content of the script, checks if everything has been performed, and then runs the script again if not. So the automation would see that I am calling the action
You could use the while loop and condition the state (set_temperature) of the TRV.
Just remember to add a delay for a few seconds in the loop also so that you don’t send commands too quickly