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.
Sensor:
Card:
You should be able to install these both via HACs.
Issues/Bugs?
If you find anything issues feel free to file them on the github or post within this thread.
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.
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
self.async_write_ha_state()
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 505, in async_write_ha_state
self._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’