Trigger Automation When Alexa Alarm Goes off Using Node-RED

I would like to trigger a few things, such as lights turning on and blinds opening, when my Alexa alarm goes off.

I am using the “sensor.spare_room_dot_next_alarm” entity from the Alexa Media Player integration, but this outputs “2020-11-03T22:28:00+00 at Nov 2, 22:49”. The only part that is relevant to me is the “22:28:00” (which is the time the alarm is set for) but I don’t know how to extrapolate that part.

Any help would be greatly appreciated!

I’m not sure about Node-RED but I know how you could do it in YAML which might lead you on the right path.

You can put the time into a input_datetime and then call that in an automation.

  - trigger:
      platform: state
      entity_id: sensor.spare_room_dot_next_alarm
      - service: input_datetime.set_datetime
        entity_id: input_datetime.spare_room_alarm
          datetime: "{{ as_timestamp(states('sensor.spare_room_dot_next_alarm')) | timestamp_custom('%H:%M:%S') }}"

  - trigger:
      platform: time
      at: input_datetime.spare_room_alarm

      - service: ...