Help with automation using sensor alarm attribute as trigger for turning the light on

Trying to use the new sensor data for my Android phone to turn on my light, but I do not know how to set the trigger.

If the device “sensor.sm_g973f_next_alarm” atteribute “Local_Time” is now, turn on “light.bedroom”

My sensor data:

Entity_id: "sensor.sm_g973f_next_alarm"
State: "2020-09-02T03:45:00.000Z"

Atteributes:
Local Time: 'Wed Sep 02 05:45:00 GMT+02:00 2020'
Package: com.urbandroid.sleep
Time in Milliseconds: '1599018300000'
friendly_name: SM-G973F Next Alarm
icon: 'mdi:alarm'
device_class: timestamp

See if: How to use next alarm sensor helps

2 Likes

Take a look at the Custom Component ‘Attribute’ which allow to create Entities from others Entitie’s Attributes. :wink:

An old skool method would be to create a template sensor from the attribute and then build a simple automation with the new sensor as a trigger. No need for any components. Just a little jinja magic.