Reliably synchronizing target temperature of multiple thermostat devices

Hi.

Just dropping this here, so i can find it when i will ever look for it again :slight_smile:
It recreates the “sync“ of my older smart home, and i belive it should be part of homey itself.
But it wasn’t, so i had to make it myself.

I’m very open to feeback for improving the script! Not doing much HomeyScript stuff.
Maybe i’ll make an app from it one day.

’Hope this helps’ :smiley:

For the Search-Keywords:
// Purpose of this script, is to automatically
// synchronize updates of the target temperature
// of multiple specific thermostat devices which are listed
// in an advanced flow as triggers.
//
// When the script runs, it looks for all thermostat
// target_temperature_changed triggers in the flow that
// is passed as an argument, finds the newest temperature
// update between them, and synchronizes the temperature
// to the other devices. All this while allowing for multiple
// updates coming in after each other (When the device sent
// an update while you are still changing the value) and
// avoiding the sync itself causing an additional sync
// process in an infinite loop.