Automation yaml not working anymore zha.set_zigbee_cluster_attribute

Why is my automation yaml not working anymore ? It stopped working a few updates back, I was too busy to look into it and make modification. Now that it’s summer and I have some free time, I went to look at it and don’t understand why not good anymore.

If I go in developper and manually call the service to one of my thermostat, it works. But when I have it in an automation it doesn’t work,. I don’t know if it’s the trigger.to_state.state that’s the issue ?
I could change it for the device directly but not the best if I ever change the device trigger name etc…
Error I get is simply : Error: Failed to set attribute: value: 2340 attribute: 16 cluster_id: 65281 endpoint_id: 1

repeat:
  count: "{{thermostats|length}}"
  sequence:
    - service: zha.set_zigbee_cluster_attribute
      data:
        ieee: "{{ thermostats[repeat.index-1] }}"
        endpoint_id: 1
        cluster_id: 65281
        cluster_type: in
        attribute: 16
        value: "{{ ( trigger.to_state.state|float * 100 ) |int }}"

Minor thing, you are casting it to a float and then to an int. Just do:

"{{ trigger.to_state.state | int * 100 }"

Otherwise if there is something that looks like a number in the state of the trigger (This is out of context so I cannot tell) and if the data for that service is right, that looks usable asis. Also thermostats have to have a list of IEEE numbers.

This device stuff is such a pain to deal with.

Why and how to avoid device_ids in automations and scripts.