Blink a light when someone new follow me on instagram (no ifttt)

Hello everyone, first post form me.
I try to make an automation who is trigged when i have a new follower on Instagram.
Exemple: The number of followers increase from 70 to 71 (whawoo!) -> switch on and off the light.

I figured out how to gate the number of followers and create a sensor (Thank napsio)

- platform: scrape
    name: instagram followers
    select: 'meta[name="description"]'
    attribute: content
    value_template: '{{ value.split(" ")[0] }}'

Ok now i have the sensor. So i try this:

 - alias: 'instagram'
   initial_state: False
     platform: template
       value_template: '{{ states.sensor.instagram_followers | int + 1 }}'
     - service: scene.turn_on
       entity_id: scene.flash_instagram
     - delay: '00:00:03'
     - service: light.turn_off
       entity_id: light.neopixel_light

But it doesn’t work.
If someone can help me. thank by advance.

Please read this, particularly point 11: How to help us help you - or How to ask a good question

Your template will never trigger. All this does:

value_template: '{{ states.sensor.instagram_followers | int + 1 }}'

is add 1 to your current sensor value. Or it would if it was correctly reading the sensor state. It should be: states.sensor.instagram_followers.state , or preferably states('sensor.instagram_followers')

You could use the trend sensor:

1 Like

Also see this post for another option:

1 Like