I have an automation triggered by an android phone next alarm. This was working ok before updating to core 2021.6.6. Has anyone encountered similar problem?
I have a lovelace card showing the phone next alarm, when I set it in the phone the value is updated properly (to the alarm time) and when the alarm initializes, the value is changed properly (to Unavailable) but for some reason my automation doesn’t trigger anymore.
Phone alarm monitor card:
There is something wrong in the next alarm triggering. I made a helper and automation:
Automation:
alias: Fill alarm time -1
description: ''
trigger:
- platform: state
entity_id: sensor.sm_g981b_next_alarm
condition: []
action:
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.heratyshelper
data:
timestamp: '{{ as_timestamp(states.sensor.sm_g981b_next_alarm.state) - 1}}'
mode: single
If I use the input_datetime.heratyshelper as a trigger instead of sensor.sm_g981b_next_alarm I can start automations based on the phone alarm. The alarm time filler didn’t work if I set it to the actual alarm time but works if I set it to -1 seconds before the phone alarm time (’- 1’ above)
What I think happens is that nanosecond before the alarm time, the phone alarm sets the next alarm to snooze-delay time. Samsung, tested both with Samsung own alarm clock and Google clock.
Now I have the problem that the helper value is set to the snooze-delayed value and I haven’t figured out how to unset the helper value after running the alarm actions…
Workaround, call script as part of the alarm automation to set the helper value to 1970’s: