i have a climate device that changes an attribute named “temperature” from “0” to “30” if i turn it to maximum heating.
In an automation i want to use the “state” trigger to trigger an action. But the trigger doesn´t work.
This is the automation:
- id: '1630856677211'
alias: Heizungen Handtücher trocknen Start
description: ''
trigger:
- platform: state
entity_id: climate.az_jens
to: '30'
from: '0'
attribute: temperature
condition: []
action:
- type: toggle
device_id: 9ac82b202e2e5a739d0631a5dd7420b0
entity_id: switch.az_jens_lampe_on_off
domain: switch
mode: single
This is just a test and not the final automation. But it´s not triggering. I´ve checked in the dev tools the device state and i see that exactly this attribute changes. Same in the event listener for “state_changed”.
That will only trigger if that attribute goes from exactly the string 30 to exactly the string 0. It won’t if the attribute has the value 30.0 for example.
This is also working now! The “temperature” attribute was still in the automations.yaml file after i edited it in the frontend (i deleted it there and it wasn´t visible anymore).
After i tried adding the “temperature” attribute it´s not working anymore. Even if i restored it to something that worked… Now i´m really confused. Even tried deleting the automation and adding a new one withe the settings that worked. Am i missing something? What is wrong?
Sorry for the spam. One thing i learned is: I have to reload the automations.yaml after editing it manually. I tried again and only “heat” is working. “30” isn´t.
I can confirm that this also works. But i would like to use the “state” and not “numeric_state” because i want to have a specific change. From “0” to “30”. This one would also trigger if i change it from “20” to “30”.