I have a state trigger to listen state change on input boolean and calls script to pass data using variables but I am not getting correct status in my script. Script always shows status as ON and time stamp also stays same.
I tried to get state using two different ways but both shows ON. Not sure what I am missing please?
Outcome is always like:
Test message on : 16:21:35.445, 1, on
Thanks
- alias: Testing Toggle
trigger:
- platform: state
entity_id: input_boolean.testing_toggle
action:
- service: homeassistant.turn_on
entity_id: script.notify_master
data_template:
variables:
notify_type: "1"
new_state: "{{ trigger.to_state.state }}"
message: "Test message {{ states.input_boolean.testing_toggle.state }} : {{ now.strftime('%H:%M:%S.%f')[:-3] }}"
notify_master:
alias: Notify Master
sequence:
- service: notify.pushbullet_xxxxxx
data_template:
message: "{{ message }}, {{ notify_type }}, {{new_state}}"
target: "channel/xxxxxxxxx"