NHL Game Sensor and Card

Hello All,

Thanks to the awesome work done by @zacs and @D34DC3N73R on the NFL game sensor and card. I wanted to do the same thing with triggering lights and other things based off of the NHL games. I had updated the code to work to use the same API but made changes to work with the NHL feed and available variables. I have published both the sensor and the card over at my github. I have been given permission by both of them to publish these for everyone to use.



You should be able to install these both via HACs.

If you find anything issues feel free to file them on the github or post within this thread.

Screen Shots


1 Like

Great, but Card is not working. Sensor shows Data.

Does it give an error or just not show anything? I just ran a fresh install and it is showing for me.

just take a look again and now it works. maybe it took some time. Perfect.

1 Like

Unfortunately it only worked for a short time. Last night everything went well, and this morning the same thing again, the card is not displayed. no error in Logs.

Does the card just not display at all? I just pushed a new version a short moment ago to fix something small. Did you hard refresh your browser? Which browser? Have you tried Incognito and see if it loads? If not in the logs what about your browsers inspect mode? Does that show any java errors? If so, which ones? Which team did you use? I can try using the same.

The Card not display at all. i have chrome and i just tried incognito mode. i also tried to clear cache etc. still the same. team i uses EDM (Edmonton Oilers). just tried safari browser the same, and no java errors in browser.

Status of the sensor? I’ll try here and see.

Card is without Data Showing

Just tried another Team and it works. So i think it´s about the “Postponed” state or?
The Anaheim State is “Post” and Card is shown

I just had it work with POSTPONED image
Let me push the card to get hub. You should see a version v0.2 in a moment, try that and let me know.

Thanks :slight_smile: now it works

1 Like

Since Today the Sensor for Edmonton is unavailable. I tried another Team and everything is ok. Only Edmonton has a Problem. Do you know why?

Logger: homeassistant.components.sensor
Source: custom_components/nhl/sensor.py:160
Integration: Sensor (documentation, issues)
First occurred: 07:34:46 (8 occurrences)
Last logged: 07:40:00

Error adding entities for domain sensor with platform nhl
Error while setting up nhl platform for sensor
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 382, in async_add_entities
await asyncio.gather(*tasks)
File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 613, in _async_add_entity
await entity.add_to_platform_finish()
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 748, in add_to_platform_finish
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 505, in async_write_ha_state
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 541, in _async_write_ha_state
extra_state_attributes = self.extra_state_attributes
File “/config/custom_components/nhl/sensor.py”, line 160, in extra_state_attributes
attrs[“team_period_1”] = self.coordinator.data[“team_period_1”]
KeyError: ‘team_period_1’

I started also getting this error as of this morning. Currently checking what had occurred.

ok thanks, so i´m not the only fan of edmonton :slight_smile:

Flyers fan here. Finishing some testing but I believe I have it fixed. Pushing a new release shortly.

New release has been put up. Please let me know.

The Sensor for Edmonton works. :+1:

1 Like

today card shows the result of game yesterday, after a while sensor is unavailable again, only edmonton. also other team.