Hey everyone,
I am trying to set up an automation that changes my light in my room to visualize my Follower train on Twitch. Anyway I can’t seem to figure it out. I thought maybe someone could help.
I set up the Twitch integration and it works well. I can see my followers and everything.
This is the automation I came up with but it seems not to trigger.
The idea is: everytime the state for followers of the twitch sensor changes, the automation is triggered. It looks if I am streaming and if the state is now higher than before.
However as I said it doesn’t trigger. I think I might have made a mistake with the trigger itself.
Here is my yaml:
alias: Twitch new follower (Train)
description: ''
trigger:
- platform: event
event_type: state_changed
event_data:
entity_id: sensor.jlnbln
attribute: followers
condition:
- condition: state
entity_id: sensor.jlnbln
state: streaming
- condition: template
value_template: '{{ trigger.to_state.state | int > trigger.from_state.state | int }}'
action:
- service: light.turn_on
data:
brightness_pct: 100
rgb_color:
- 100
- 40
- 39
entity_id: light.office_light
Help would be much appreciated!
Cheers!