Does this work with android formatting options? You can do some extra things with Android… I did get it installed for the end of MNF and got the closing score. Wont be able to test again until TNF. Thanks for pulling this together!!
What kinds of things would you want? I’m not opposed to adding options, but I don’t have an Android device to test with. At the moment, the code as it is released is only using platform-agnostic features (namely groups and tags). Talking about improvements: I’m thinking I’d like to include a url field, so the notification could link to a specific Home Assistant dashboard view or an external website like the ESPN or NFL websites.
Does anyone have an automation (or preferably Nodered flow) for flashing lights (wled) when your team scores?
Also, what’s the possibility of having this functionality for NCAA Football??
I don’t use NodeRed, but here’s my take at a wled flasher (uses the team colors present in the data):
I’m not using wled, but using a combination of rgb bulbs (philips hue, zigbee, etc), so not quite sure how to adapt this. Plus, all of my automations are in Node Red, so I would love some help trying to decipher this.
The wled stuff I shared above was more of a personal project and I don’t think I’ll be turning that into a polished/finished blueprint or automation any time soon - it’s way too customized to my specific environment. But zacs recently accepted a contribution I made to the ha_nfl repository for a simple Home Assistant rgb light flasher blueprint. It’s very easy to set up and use. You just have to select one or more nfl entities (this integration), and select one or more home assistant light entities when setting up the blueprint. It will flash the light(s) a configurable number of times in the team colors and then return it(them) to the original state(s). It’s quite simple, nothing fancy, but does the job well enough.
NFL Game Score Light Color Flasher
This blueprint will flash one or more lights using the team (or opponent) colors provided by the api on any score change (td, field goal, extra point), optionally excluding opponent scores.
You can track as many games and control as many lights as you’d like, just select them in the automation. You can also select the number of times to cycle through the team colors (1-15 times).
Works great! I tested it on the Eagles/Texans game last night. Amazing how delayed the Amazon Prime broadcast was though. The lights flashed almost a minute before the TV scores. Might need to figure out a delay based on what network is broadcasting.
Yeah, when I watched games via Comcast cable before switching to Youtube TV, every network was also pretty delayed compared to the ESPN data feed. YouTube TV with RedZone and local network games has generally been only 5-10 seconds off, which is probably as good as it gets. The integration polls every 5 seconds during live game time, so it’s almost never going to be a perfect match. When I have some free time I’ll see about adding an optional delay field to the blueprint so users can fine-tune for themselves.
Not sure if this is the right thread, but the kickoff day is wrong on some of the game cards. IS there a way to custom change this? I.E Kickoff in a day when its actually two days away.
No, there’s currently no way. But which ones? Would like to look into why.
I looked at the code for this this morning. It uses the ‘arrow’ python library, which has a ‘humanize’ function (this turns a date/time object into a human readable relative time, e.g 13:00:00EST on 2022-11-04 becomes “in a day”). Since it becomes an approximation of an exact time, inaccuracy is expected at times. The humanize function does have a granularity option, so it might be possible to change it, but without testing, I’m not sure if that might introduce other unusual display states (e.g. a kickoff in a few minutes could end up being shown as “in 0 days, 0 hours and 3 minutes”.
it sorted itself out when it got to today. Its counting correctly now. I had Jets Vs Vikings and Eagles vs titans were showin up a day early… but like i siad they just reset themselves today and they are accurate now. Thanks for the response ! Love this integration. Im having headaches tryin to get lifx bulbs to flash green for jets and blue for ny rangers… but i think thats a limitation of lifx… go figure lol. Right now I have it set for when Jets score a touch down … I have a media clip play J-E-T-S JETS JETS JETS . Id love the light bulbs to flash green though with it
I have an lifx bulb flash green for the packers like this
- service: lifx.effect_pulse
data:
mode: strobe
brightness: 255
rgb_color:
- 3
- 171
- 0
period: 0.5
cycles: 20
target:
entity_id: light.family_room_lamp
Thanks ! Ill give it a whirl
Error:
‘two or more values in the same group of exclusion ‘color descriptors’ @ data[]. got none’
strange… not working for me . Changed the entity Id of course too. Im a noob to Yaml and code in general . Please let me know if anything stands out. Also… Noob question… Is it okay to skip a line for a new service , action, trigger, etc ? Or will that mess it up
That looks right to me. The error doesn’t make sense since you’ve only used rgb_color
and not xy or color temp, etc in addition to rgb_color. I’m not sure what you mean by skip a line?
You could try editing the automation in the UI and set the values I shared in the yaml. The bulb I have is the A19 and it was added using the lifx integration.
GOT IT. It works with just human color name. RGB value isnt working. Thanks for all your help though !
How did you pass the human color name into the automation?
Is there anyway to have the script converty the array of hex values into something the automation can read or successfully pass along?
I too am using LIFX bulbs.
Using @gonzotek’s work above, you can set the r
, g
, b
values using templates:
red: '{{ state_attr(team,''team_colors'')[1][1:3] |int(0,base=16)}}'
green: '{{ state_attr(team,''team_colors'')[1][3:5] |int(0,base=16)}}'
blue: '{{ state_attr(team,''team_colors'')[1][5:7] |int(0,base=16)}}'
So using @D34DC3N73R’s pulse service call as an example, you could do:
- service: lifx.effect_pulse
data_template:
mode: strobe
brightness: 255
rgb_color:
- {{ state_attr(sensor.nfl,'team_colors')[0][1:3] |int(0,base=16)}}
- {{ state_attr(sensor.nfl,'team_colors')[0][3:5] |int(0,base=16)}}
- {{ state_attr(sensor.nfl,'team_colors')[0][5:7] |int(0,base=16)}}
period: 0.5
cycles: 20
target:
entity_id: light.family_room_lamp
I haven’t tested that, but it should work. If you wanted to flash your team’s secondary color you would change the [0]
to [1]
on all three lines.