what is your sensor.phone_next_alarm what does it say in the Developer tools area
I dont have that sensor i have
sensor.stephan_phone_next_alarm which came from my phone
my understanding is it wont get trigger as there is no trigger its telling you the state of the next alarm
and the state only changes when the next alarm is reset to the next one which wont nevery be now
but what we can do is create a sensor that counts down to the next alarm
minutes_next_alarm_stephan:
friendly_name: "Minutes until Next Alarm Stephan"
unit_of_measurement: "m"
value_template: >-
{% set dummy = states("sensor.time") %}
{{((states('sensor.stephan_phone_next_alarm')|as_timestamp|int - now()|as_timestamp|int)/60)|int}}
availability_template: "{{ not is_state('sensor.stephan_phone_next_alarm','unavailable') }}"
attribute_templates:
time: "{{ state_attr('sensor.stephan_phone_next_alarm','Local Time') }}"
the maths of the sensor is
{{((states('sensor.stephan_phone_next_alarm')|as_timestamp|int - now()|as_timestamp|int)/60)|int}}
which take the sensor.stephan_phone_next_alarm minis now() from it which give us a minutes left
now we right a automation and watch the tigger
- id: '85cf493e-b8eb-4a8b-8645-b384b752d0fd'
alias: My Phone Alarm about to go off
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.minutes_next_alarm_stephan
below: '2'
condition:
- condition: state
entity_id: light.kitchen
state: 'off'
action:
bla bla bla
and as for say
they do work on his system but we dont know what the
sensor.phone_next_alarm is
those example are pointer so you see how to do it
here is a other one
- trigger:
platform: state
entity_id: binary_sensor.motion
to: 'on'
so it always trigger
but
- trigger:
platform: state
entity_id: binary_sensor.motion
form: 'off'
to: 'on'
will only trigger when change form off to on
and there a big differance
and
trigger:
- entity_id:
- binary_sensor.garage_side_door
- binary_sensor.garage_door
- binary_sensor.front_door
- binary_sensor.cupboard_door
- binary_sensor.linen_door
- binary_sensor.washing_door
- binary_sensor.dryer_door
platform: state
so when any of these state CHANGE the automation is triggered