[Update]
My bad.
I just realized when posting I used “sonne.elevation” instead of “sonne_elevation”.
Fixed it and will wait if it fires now.
[/UPDATE]
Hi,
I am trying to get an automation working based on numeric value. I read a lot of threads regarding the numeric value trigger but none really helped.
So I have a sensor which shows the current sun elevation:
mqtt:
sensor:
- state_topic: hzg/status
name: "sonne_elevation"
unit_of_measurement: "°"
force_update: true
value_template: '{{value_json.sonne.elevation}}'
My HomeAssistant display the value of the sensor really nicely in Grafana. Works fine so far.
Now I tried to create an automation based on this.
The automation should switch the christmas lights on, when the above sensor crosses the “-23” value from below to higher, so sun is raising soon.
This is the automation, it only fires when the time trigger steps in:
- id: '1700628469118'
alias: Weihnachtsbeleuchtung AN
description: ''
trigger:
- platform: time
at: 05:45:00
- platform: numeric_state
entity_id:
- sonne.elevation
above: -23
- platform: sun
event: sunset
offset: 0
condition: []
action:
- type: turn_on
device_id: 734130f3fb63d63f3350c97b94808a0a
entity_id: 7457c62c6fb61ddf76d5b7b7937a0540
domain: light
mode: single
The “-23” has been crossed this morning around 5:28am so the time trigger should not have taken place.
See stats of the light:
The value is a float, should I use “-23.0” instead?
Any idea what I did wrong?
/Knebb