I believe the attribute is team_colors_rbg correct? It should actually be RGB and not RBG. Meaning the middle value is green, not blue and the attribute is named incorrectly.
Also, you can use the RGB color array by itself without splitting the values.
With all that said, I find the color accuracy of the lifx bulbs a little off, and prefer to set the color for my team manually. But if you want it to dynamically change this would be the easiest way.
Ah - Unfortunately, neither of the Superbowl teams are my team! I’m just looking to have the lights flash the primary colors of whichever team scores.
In this case, I was trying to use the blueprint found here:
After updating it to use the “teamtracker” integration as opposed to the original “nfl” integration, it throws the error:
Stopped because an error was encountered at February 11, 2023 at 4:05:20 PM (runtime: 0.01 seconds)
None for dictionary value @ data[‘rgb_color’]
I’d originally thought it was because the teamtracker integration uses the attributes “team_colors” and “opponents_colors” as opposed to team_colors_rgb and opponent_colors_rgb, but correcting those to reflect the proper attribute names didn’t seem to resolve anything.
The RGB color options were added to this integration after team tracker forked it, and it doesn’t look like team tracker has included those. TT only has hex values for the colors. The LIFX integration doesn’t allow hex values so rgb and color_name are your only options.
Here’s an example of a score automation that uses CSS color names.
- alias: NFL - Team Score
trigger:
- platform: state
entity_id:
- sensor.nfl
attribute: team_score
condition:
- condition: state
entity_id: sensor.nfl
state: IN
- condition: template
value_template: '{{ (trigger.to_state.attributes.team_score | int) >= (trigger.from_state.attributes.team_score
| int + 1) }}'
- condition: template
value_template: '{{ (trigger.to_state.attributes.team_score | int) <= (trigger.from_state.attributes.team_score
| int + 6) }}'
- condition: template
value_template: '{{ (trigger.to_state.attributes.team_score | int) != (trigger.from_state.attributes.team_score
| int)}}'
action:
- service: lifx.effect_pulse
data:
mode: strobe
brightness: 255
color_name: red #CSS COLOR NAME HERE
period: 0.5
cycles: 20
target:
entity_id: light.lamp
mode: parallel
The conditions are just added to cut down on false positives if the integration drops for a moment. For the lights to flash with either team, you could add either one of the teams as the integration sensor and then a second automation similar to this, but use opponent_score in place of team_score.
My NFL Integration started erroring out recently. If I try to follow the link for documentation or known issues on github, it fails. The best I can tell is that it is trying to get to ha_nfl instead of ha-nfl (underscore vs. a dash). Would this also lead to the integration not loading with the following log entry? Or is this just normal at this point in between seasons?
Error setting up entry Green Bay Packers for nfl
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/config_entries.py”, line 387, in async_setup
result = await component.async_setup_entry(hass, self)
File “/config/custom_components/nfl/init.py”, line 66, in async_setup_entry
hass.config_entries.async_setup_platforms(entry, PLATFORMS)
AttributeError: ‘ConfigEntries’ object has no attribute ‘async_setup_platforms’
If anyone’s interested, I made a dashboard with dynamic cards for the whole league to follow all the games.
In addition to ha-nfl and ha-nfl-card, the custom card auto-entities is also needed.
I have a issue setup the NFL Game Score Light Color Flasher
I ran a test via the Automation and got a error of :
Stopped because an error was encountered Error rendering data template: UndefinedError: 'dict object' has no attribute 'entity_id'
You can’t test via the automation editor because the automation depends on trigger data that has to come from actual entity changes. Once it’s set up, it’s possible to manipulate the entity attributes via the States tab in Developer Tools to test. The sensor state has to be set to IN first (it is most likely PRE at the moment of writing this). Then you can change the team_score attribute of the nfl entity (and opponent_score if you’re also activating on it).
Yes, it’s intermittent. Looking at the logs it’s happened 75 times in the past 2 weeks. I first noticed when I went to view the score in my dashboard and it wasn’t available. I wasn’t sure if it’s something in my system or the ESPN API.
Not super familiar with that. It’s like Hyperion right? If they have a json api, you can check out this post to see an automation and shell command I used with Hyperion.
That would work for any team (and opposing team) using the RGB colors from the team sensor, make sure to change team_colors_rbg to team_colors_rgb as that was corrected after I made the automation.
I personally don’t really use it anymore, but call a custom effect in hyperion as well as some WLED strips. If you run into problems I can post the automation I use.
Please post the automation you use. Hyperhdr is just hyperion just enhanced for HDR. what i’m looking for is when my Cowboys play hyperhdr does team colors and effects when they score. Then when game done. go back to normal HyperHDR