#NFL Team Score Automation

1 messages · Page 1 of 1 (latest)

untold badger
#

I loaded the NFL integration from HACS. https://github.com/zacs/ha-nfl I would like to trigger my WLED Playlist when a touchdown is scored by my team. I see the stats coming through to HA, but there doesn't seem to be an obvious way to know if a touchdown is scored or not for the correct team. So I am figuring calculations with the "Team Score" attribute which is my teams score is how I'd need to do this.

What is the best suggested way to track the value of the attribute changing so that when the score increases by 6 points it triggers my automation to start the WLED playlist?

I thought somehow saving the previous value of the team score and checking that value whenever it changes for the 6 number difference. So I have general logic, but not how to actually implement it.

visual ferry
#

A simple state trigger for the attribute should do it

#
trigger:
- platform: state
  entity_id: sensor.whatever
  attribute: team_score
untold badger
#

that is what I was starting with but then the from and to values i didnt know how to say "if it increased by >= 6"

visual ferry
#

Don't put them there

#

That will trigger any time that attribute changes

#

You can then handle any further logic in a template condition, using the state objects

untold badger
#

i dont want the tree to blink for a field goal...(3 points) just touchdowns 6+

untold badger
#

gotcha, as the troigger just that

visual ferry
stark lily
untold badger
#

Thanks man I am excited about it... just need a bit of logic for the condition

untold badger
visual ferry
#

No, but you need to provide them with the full details of the attributes ... that's all that matters

#
{{ trigger.to_state.attribute.whatever|int(0) - trigger.from_state.attribute.whatever|int(0) >= 6 }}