I have 2 climate entities in the same room:
- A thermostat, which is linked up to a temperature sensor and boiler control.
- A TRV to control the flow through the radiator.
I want an automation such that when the target temperature is changed on the thermostat, it updates the TRV to match, and when the target temperature on the TRV is changed it updates the thermostat to match.
I have created an automation that is triggered on the target changing on either device and sets the target on the other device, but the automation’s change to the other device re-triggers the automation.
At the moment, I have the automation set up to abort if the destination device is already set to the same temperature as the source, e.g.:
- User changes the thermostat target from 17° to 18°.
- Automation triggers on the thermostat change and sets the TRV to 18°.
- Automation triggers on the TRV change, aborts because the thermostat is already set to 18°.
This sort of works, but breaks if there isn’t enough time between thermostat updates (e.g. if someone if repeatedly pressing the + button) - I end up with:
- User changes the thermostat target from 17° to 18°.
- Automation triggers on the thermostat change and sets the TRV to 18°
- User changes the thermostat target from 18° to 19°.
- Automation triggers on the TRV change to 18° and sets the thermostat back to 18°
Is there a neat way of preventing the automation from re-triggering itself?