I am trying to send a notification to my Sony TV ONLY when it is on. The automation was set up using the HA UI. When run it ALWAYS sends the notification even if the TV is off. I had assumed that by testing for the TV being on it would not send the notification if the test returned ‘false’.
What happens is if the TV is off the notification is sent and the TV turns on. Not exactly what I wanted at 4am!
YAML code below.
'alias: Front camera motion detected notification
description: ""
triggers:
- type: motion
device_id: 318f3f821eaeb03d4ec40457a7e31939
entity_id: c2efc6ad696f11a7c5ca5182c914a92a
domain: binary_sensor
trigger: device
conditions:
- condition: device
device_id: 3a89d22adad4f71cc3a22e4f03e09e8e
domain: media_player
entity_id: 285ce5d3e16128baea578cb69fcb780b
type: is_on
actions:
- action: notify.lr_sony_tv
metadata: {}
data:
message: Front Camera detected motion
mode: single'
I am a complete novice with YAML so any help would be greatly appreciated.
Thanks
Andrew
1 post - 1 participant