So this way I know the phone sends correct data to HA.
Next, my alarm rung and 8:15 of local time and the cover did not go up. This happens once a week on average.
I looked at the automation trace and there was no trigger for today morning, only my evening alarm. You can even see 10-minute snoozes on 22nd triggered correctly:
So our problem is, if you think this is acting up, how can we help if we can’t see the code? It would help if you could to provide some code so we can see what you’ve done so far… How to help us help you - or How to ask a good question.
@Sir_Goodenough , @LutzDe
Sorry guys, my bad. I thought I attached it in the original post.
Here are the YAMLs for cover (second target, enabled, position 70):
alias: Bedroom open shutters with alarm
description: ""
triggers:
- at: sensor.sm_s926b_next_alarm
trigger: time
conditions: []
actions:
- target:
entity_id:
- cover.guest_room
data:
tilt_position: 50
enabled: false
action: cover.set_cover_tilt_position
- target:
device_id: b0e4e6b223198b8fedc5ee3101cef9ac
data:
position: 70
action: cover.set_cover_position
mode: single
and for logging the sensor time sent from my HA companion app:
alias: Log alarm time
description: ""
triggers:
- trigger: time
at: "08:00:00"
weekday:
- mon
- tue
- wed
- thu
- fri
- sat
- sun
conditions: []
actions:
- action: system_log.write
metadata: {}
data:
level: info
message: "Alarm sensor state: {{states('sensor.sm_s926b_next_alarm')}}"
- action: system_log.write
metadata: {}
data:
level: info
message: "Alarm sensor state2: {{states.sensor.sm_s926b_next_alarm.state}}"
mode: single
FYI both were generated by HA (setup via HA GUI).
I have latest version of HAOS.
@petro Thanks for the idea. I think this shows a problem. And my hypotheses this is a concurrency issue:
Sensor value is set to 8:15 at 3:14am on 23rd
At 8:15 alarm rings and HA should execute the automation
This does not happen because phone updates the sensor value at 8:14:59.56 to the next alarm at 18:10, probably due to current alarm starting and thus becoming obsolete
After 18 seconds of ringing, I snooze the alarm and the sensor value is updated to 8:25 (+10min snooze)
After 10 minutes I kill snoozed alarm and the sensor value is updated to the next evening alarm 18:10
the 144ms premature setting happens here as well, that is why the snoozed alarm did not raise the cover too
Evening alarm at 18:10 sets the sensor value to 8:15 correctly, this time 456ms after the alarm time
I will think about some workaround, but I think the reporting from interface between companion app and phone should never update time sensors early, possibly introduce some minor delay.
@petro I can try a negative offset. I imagine positive offset would suffer the same fate. @Didgeridrew true - I hit that earlier this year and fixed it quickly by clearing “Routines” storage thanks to this gentleman’s comment.
This was however obviously a phone issue as the new alarm values were not visible in the companion app.