I believe I set the cutoff day as Wednesday… so as long as a game doesn’t get pushed past that, things should work. If the sensor shows unavailable, it means that the team acronym isn’t in the feed (eg. PHI), so if you want to file a bug on GitHub, it would help to include the contents of the ESPN JSON file. That way I might be able to put in a workaround, depending on what the data looks like.
Once the playoffs start, I’ll probably need to patch the component since (if I remember right) they change the format of the JSON slightly at that point.
Sorry, I noticed it was unavailable this morning right before I went in to work, and by the time I got a chance to dig in to check the json feed and the forum here, it had resolved itself. If I see it happen again, I’ll try to grab a copy of the json right then to share with you. Thanks once again for all the work on this all season!
No worries at all, I appreciate the report. I’m curious if there is ever a point during the week (it seems like Weds at 8am is when they cycle the feed) when neither the games from last week or the games for the following week show up. If that’s the case I could suppress the “unavailable” at that specific time of the week or something.
alias: NFL - Input Boolean Control - Turn On/Off Win Input Boolean
description: Turns on input boolean for five minutes when team wins
trigger:
- platform: state
entity_id: sensor.nfl
from: IN
to: POST
condition:
- condition: template
value_template: >-
{{ state_attr('sensor.nfl', 'team_score') > state_attr('sensor.nfl',
'opponent_score') }}
action:
- service: input_boolean.turn_on
data: {}
entity_id: input_boolean.nfl_win_detector
- delay: '00:05:00'
- service: input_boolean.turn_off
data: {}
entity_id: input_boolean.nfl_win_detector
mode: single
Do you see anything wrong with this? I cant figure it out. I have used developer tools to change game to IN and then to POST. Sometimes it will trigger and sometimes it wont. I’m also changing the Bears score
edit: I’m finding that I need to set it to IN and then change the score to something higher than I just tested while changing to post in order for it to fire.
Why wont it fire on any team score over the opp score?
So, the issue with the card might be the same issue you’re running into. We see numbers, but they’re technically strings, not integers. Try this and then change the state from IN to POST in dev tools to see if it works
{{ state_attr('sensor.nfl', 'team_score') | int > state_attr('sensor.nfl', 'opponent_score') | int }}
I just tested it out with the bears and it seemed to work for me.
It worked but when I turn off the boolean and try again nothing. Shouldn’t it fire each time it is changed to post and bears score is greater than opp?
The automation could still be on the delay step of the action. You could change the mode to parallel for testing, but it wouldn’t make much of a difference in a real-life scenario.
@zacs looks like we now have playoff data to work with. Everything pre-game seems to work fine. However, it doesn’t appear that bye teams are included in the json, but that really only affects two teams. Also, the NOT_FOUND state doesn’t appear to be working. Instead, the sensor is in an unavailable state.
The good thing is, assuming they do get included, the component will just work automatically. At least unless they decide to change the name of the bye properties, which they might do.
I’m sure the Titans and Packers will be there next week, but I’m pretty doubtful they add the 1 seeds to the wildcard week json. Notice how they list bye teams on the bottom (week 14) but not for the playoffs: NFL Football Scores - NFL Scoreboard - ESPN