JayBlackedOut / hass-nhlapi

NHL Stats API Integration Into Home Assistant
64 stars 18 forks source link

multiple teams issue #4

Closed typhoonss92 closed 4 years ago

typhoonss92 commented 4 years ago

Describe the bug First I would like to say this is an awesome integration. This works great with 1 team but when you add more than 1 team there is no way to give the pletform: nhl-api and the team_id: # a specific output like sensor.nhl_sensor(X) and have it stay that way. I created a customize for sensor.nhl_sensor with the teams name ex: penguins then created a sensor.nhl_sensor_2 ex: lightning and so on, I have 4 teams I follow. Then in the template you created I changed where it says states.sensor.nhlsensor..... the same way with the # after sensor. Where the problem comes is when I reboot the Raspberry pi the platform: nhl_api team_id will change the sensor.nhlsensor(#) and then the team name will change over the scores. Pictures included to show what I am talking about. This would be awesome if somehow you could make this work so we can have multiple teams scores and game status's. I have tried to rename the customized names to match but upon reboot they can change.

screenshots: sensor nhl_sensors lovelace-entities platform and template output in lovelace

Home Assistant Information

Configuration Add the relevent configuration.yaml entry.

Log Add the relevent Home Assistant log entries, if any.

Additional context Add any other context about the problem here.

CMaxim77 commented 4 years ago

This might not be the correct place to ask, I’m sorry I couldn’t find a better place. Is there anyway to convert this to the NFL? It would be awesome if I could display division records each week for my team. Thanks!

JayBlackedOut commented 4 years ago

@typhoonss92 Thanks for reporting your issue. Glad you're enjoying the custom component!

No need to complicate things. The component has a native configuration option that will change the "friendly name" in the front end and the entity_id. For example,

sensor:
  - platform: nhl_api
    team_id: 8
    name: Habs

This will create sensor.habs instead of sensor.nhl_sensor. You can then build your template sensor around this. Create as many sensors for as many teams as you'd like using this method. I recommend using the team name so that it's easy to remember which sensor is for which team. Let me know if this helps.

JayBlackedOut commented 4 years ago

This might not be the correct place to ask (...)

Hi @CMaxim77,

This custom component was built to poll the NHL's API. Unfortunately, it's not as simple as converting it to the NFL's API (if they even have a publicly accessible one, not sure). You can try asking in the r/homeassistant Reddit community, in the official Home Assistant forums or as a feature request on the official GitHub repository.

typhoonss92 commented 4 years ago

Thanks. Now I have 4 teams and the correct scores below them. Love the api

Sent from RPi2 apache


From: JayBlackedOut notifications@github.com Sent: Monday, September 23, 2019 3:51:50 PM To: JayBlackedOut/hass-nhlapi hass-nhlapi@noreply.github.com Cc: Typhoonss92 jrc9229@hotmail.com; Mention mention@noreply.github.com Subject: Re: [JayBlackedOut/hass-nhlapi] multiple teams issue (#4)

This might not be the correct place to ask (...)

Hi @CMaxim77https://github.com/CMaxim77,

This custom component was built to poll the NHL's API. Unfortunately, it's not as simple as converting it to the NFL's API (if they even have a publicly accessible one, not sure). You can try asking in the r/homeassistanthttps://www.reddit.com/r/homeassistant/ Reddit community, in the official Home Assistant forumshttps://community.home-assistant.io or as a feature request on the official GitHub repositoryhttps://github.com/home-assistant/home-assistant.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/JayBlackedOut/hass-nhlapi/issues/4?email_source=notifications&email_token=ADM6XS7XOHJVSD4HWVAMSHTQLEM5NA5CNFSM4IZN5INKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7MBZ5Y#issuecomment-534256887, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADM6XS33G3DXS45XFK4KNQTQLEM5NANCNFSM4IZN5INA.

JayBlackedOut commented 4 years ago

Great! I'll consider this closed.