Fristi
(Fristi)
1
The goal is todo an action when the max temperature of the day is higher then 24 degrees.
I have added following condition
above: '24.0'
condition: numeric_state
entity_id: sensor.temperature_max
I extract the parameter from met.no integrated in HASSIO.
- platform: template
sensors:
temperature_max:
friendly_name: "met.no Max Temperatur home"
value_template: "{{ state_attr('weather.w1ss3l', 'temperature')}}"
But for some reason the condition is always true even if the ‘temperature_max’ reads for example 14.4
Fristi
(Fristi)
3
Hi Tom,
I see that the issue is been closed, i am running 0.116.4 know but still have this issue.
condition:
- condition: numeric_state
entity_id: sensor.city_temperature_max
above: '14'
So when the sensor.city_temperature_max is like 11 is still triggers this automation, what am i doing wrong?
tom_l
4
Try removing the quotes from around 14.
Also make sure your sensor sensor.city_temperature_max
state does not have a unit in the state (check the developer tools/ states menu).
Edit: just saw your sensor definition. It needs a unit_of_measurement. Otherwise it is treated as a string, not a number.
Fristi
(Fristi)
5
Hi Tom,
I tried with another sensor and removing the quotes but still the automation triggers the action. Here is the data
Automation yaml
trigger:
- event: sunrise
platform: sun
condition:
- condition: numeric_state
above: 14
entity_id: sensor.w1ss3l_realfeel_temperature_max_0d
action:
- data:
The state of the sensor
Running 0.116.4
tom_l
6
Wait a minute. How are you testing these automations?
I assume you did not wait for sunrise and triggered the automation manually?
If so, that skips the conditions.
Try the trigger automations service in the developer tools services menu. Make sure skip_conditions is set to false.
1 Like
Fristi
(Fristi)
7
Ok, that is something I didn’t know and now everything works as expected.
Many thanks
1 Like