#Turn on 1 hour after sunrise
1 messages · Page 1 of 1 (latest)
I'm not sure if a + is recognized syntax
perhaps try offset: "01:00:00"
Maybe + works, IDK
That was the first thing I tried and that didn't work either.
Hmm seems fine to me 😕
Hmm, I'll set it back up that way and see tomorrow am..
Yea, not working.
Can you share the entirety of your automation, you're positive it didn't trigger?
It does work, I have a post-sunrise trigger that works fine.
Do you have your location set correctly? I'd assume so if you can get pre-sunrise triggers working but worth checking
that it works for me. (With or without +)
Here is my automation.
alias: WLED On at sunrise
description: ""
triggers:
- event: sunrise
offset: "01:00:00"
trigger: sun
conditions: []
actions:
- type: turn_on
device_id: <redacted>
entity_id: <redacted>
domain: light
mode: single
I gotta ask... Why redact the device/entity id? It's not like they're ip addresses...
Anyway
alias: Sunrise test
description: ""
triggers:
- trigger: sun
event: sunrise
offset: "01:00:00"
conditions: []
actions:
- action: persistent_notification.create
metadata: {}
data:
message: Sunrise + 1hr
mode: single
Works fine for me
Can you check the traces for the automation?
That note is for time trigger, not sun trigger.
Habit working in the InfoSec industry. How do I check traces ? Sorry, still learning, so please bare w/ me.
nvm, I found the traces
Is this what you are asking for ?
Seems like its firing off "realtime" earlier than it thinks it is..
I'd say 2 hours-ish early.
I set to 03:00:00 and will see tomorrow.
Yeah that's the one, that's weird...
So still coming on around 6am PST even with 03:00:00..
I'm just gonna change it to a fixed time that it turns on I guess..
Is that sunrise for you then? Because the previous screenshot you shared has it going off at nearly 8am
You can check the traces to find out when it actually went off
But your screenshot earlier says 7.49 am - which is an hour after sunrise if that's at 6.48
Yea, I'm not sure what is going on.
Can you go into the template editor in developer tools and type in {{now()}} - that will let us see what time your home assistant thinks it is, and so can work out if it's wrong
@sterile stone Sorry just saw this. Where do I find that ?
I think I found it.. This is what is currently in there..
{## Imitate available variables: ##}
{% set my_test_json = {
"temperature": 25,
"unit": "°C"
} %}
The temperature is {{ my_test_json.temperature }} {{ my_test_json.unit }}.
{% if is_state("sun.sun", "above_horizon") -%}
The sun rose {{ relative_time(states.sun.sun.last_changed) }} ago.
{%- else -%}
The sun will rise at {{ as_timestamp(state_attr("sun.sun", "next_rising")) | timestamp_local }}.
{%- endif %}
For loop example getting entity values in the weather domain:
{% for state in states.weather -%}
{%- if loop.first %}The {% elif loop.last %} and the {% else %}, the {% endif -%}
{{ state.name | lower }} is {{state.state_with_unit}}
{%- endfor %}.
Adding that to bottom, I get this in results
The temperature is 25 °C.
The sun will rise at 2025-02-01T06:43:04.199010-08:00.
For loop example getting entity values in the weather domain:
The forecast home is cloudy.
2025-01-31 18:43:00.421768-08:00
its 18:43 right now