Hello all,
First post, and noob for HA. I’ve finally taken the chance to amalgamate all my smart kit into one place. I’m pretty happy with where I’m at, I’ve used HACS to add additional devices using API’s etc.
I’m now looking to build some automation between devices now they’re all in one place.
We’ve got a 2 year old that goes to bed around 19:00, so figured it would be cool to prompt on our phones that when the TV is turned on, do we want to enable ‘night mode’ on our sonos Beam.
I’ve read up on a few threads/tutorials, and have built the following using the UI rather than editing configuration.yaml directly. But what I’m not sure on is why I can’t trigger the entity ‘switch.sonos_lounge_night_sound’ to on when pressing the actionable push notification?
Script below:
- id: '1651129291824'
alias: Sonos Night Mode Push Notification
description: ''
trigger:
- platform: device
device_id: 849e6b384a1f992c69e179841d38c5ca
domain: media_player
entity_id: media_player.lounge_tv
type: turned_on
condition:
- condition: time
after: '19:00:00'
action:
- service: notify.notify
data:
title: Sonos Night Mode
message: Do you want to enable Night Mode, Oliver may be in bed?
data:
actions:
- action: switch.sonos_lounge_night_sound
title: Enable
- wait_for_trigger:
- platform: event
event_type: ios.notification_action_fired
event_data:
actionName: switch.sonos_lounge_night_sound
timeout: '10'
- condition: state
entity_id: switch.sonos_lounge_night_sound
state: 'On'
mode: single