Hey folks, thanks in advance for your help. ![:pray:t2: :pray:t2:]()
![:beer: :beer:]()
I’ve read through the script syntax here, but I can’t see where I’m going wrong.
I’m trying to send a notification that will appear on my TV.
To do it, I’m using most of this script … this bit works great.
I see the notification on the TV without a problem.
# ===============================================================
# Send a Notification to the Lounge TV
# ===============================================================
notification_to_lounge_tv:
alias: "Send a Notification to the Lounge TV"
mode: restart
sequence:
- choose:
- conditions:
- condition: state
entity_id: media_player.lounge_tv
state: "on"
sequence:
- service: notify.lounge_tv
data:
message: "This is a test message"
title: "TITLE"
However, what I really want to do is pass the message to it as a variable when its called from an automation. So in this case, I’m using this script which is almost the same …
# ===============================================================
# Send a Notification to the Lounge TV
# ===============================================================
notification_to_lounge_tv:
alias: "Send a Notification to the Lounge TV"
mode: restart
sequence:
- choose:
- conditions:
- condition: state
entity_id: media_player.lounge_tv
state: "on"
sequence:
- service: notify.lounge_tv
data:
message: "{{ message }}"
title: "{{ title }}"
and for the automation …
# ===============================================================
# Person detected in the Front Garden
# ===============================================================
- id: '5C43859D-5396-41E2-A93D-71F1020FD0BF'
mode: single
alias: "Person detected"
trigger:
- platform: state
entity_id: sensor.front_garden_camera_detected_object
to: person
action:
- service: script.notification_to_lounge_tv
data:
variables:
title: "TITLE"
message: "Person Detected"
- service: notify.mobile_app_iphone
data:
message: "Person Detected"
In this case, I get the notification on the iPhone, so I know the automation is firing, but I’m not getting the notification on the TV.
Clearly I’m missing a trick, but I just can’t see it. There are no errors in my logs.
Thanks in advance!
3 posts - 2 participants
Read full topic