zacs / ha-nfl

NFL game scores custom component for Home Assistant
42 stars 32 forks source link

Integration Requires internet acces to 104.16.125.175 on client. #34

Closed brokenarrow03 closed 1 year ago

brokenarrow03 commented 1 year ago

I have this integration in my home assistant and it works really well. However I have some devices, samsung tablets, that have no access to the internet and connect to home assistant internally only. When I try to access the dashboard that is configured in home assistant, which has internet access, the entity: sensor.nfl reports as "custom element does not exist" on the tablet dashboard. I have validated this by allowing internet access, then working backward by allowing only certain IP addresses.

This IP address is used by Cloudfare, and I have attached a screenshot of the error! Thank you! Screenshot_20221109-145229_Home Assistant

zacs commented 1 year ago

This is very weird. Can you paste in the contents of sensor.nfl from the States tab in the Developer part of the UI when the internet is disabled?

I think this is an error with the card itself. @D34DC3N73R does your card load images or something from the internet?

brokenarrow03 commented 1 year ago

Ah I see where the card itself is most likely at fault. After a quick test, both of my sensor.nfl both still say PRE after checking them when the internet was blocked. I appreciate the insight!

D34DC3N73R commented 1 year ago

Yes, it grabs the team logos from ESPN. I suppose I could package them with the card itself, but I haven't fully considered that yet.

brokenarrow03 commented 1 year ago

@D34DC3N73R would you like me to open an issue on your page? I understand that it pulls images from ESPN, but I dont understand why the device that connects to home assistant needs that access when home assistant has the capability to get the images.

brokenarrow03 commented 1 year ago

I do appreciate both of your comments!

gonzotek commented 1 year ago

Suggestion/thought: Could the integration pull and cache the images on demand to the home assistant server, for the card to then access over local area network? This way the images wouldn't need to be packaged with either the card or the integration and the client doesn't need internet. Should also avoid any copyright issues as well since then it's only temporarily cached data.

/edit: I realize this would require some serious extra plumbing in the integration, and might not be a trivial fix. I'd be willing to help, but it might take me some serious time to get a handle on the best "python-y" / "home assistant-y" way to go about this.

On Thu, Nov 10, 2022 at 11:22 AM brokenarrow03 @.***> wrote:

I do appreciate both of your comments!

— Reply to this email directly, view it on GitHub https://github.com/zacs/ha-nfl/issues/34#issuecomment-1310549761, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB53X5M4JMSUIIYQZQXD6LWHUONJANCNFSM6AAAAAAR4CGRVA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

brokenarrow03 commented 1 year ago

@gonzotek I agree, I can assist as needed as well. That is what I thought would happen as far as image flow, or if the request comes from a client, home assistant goes out to get it and gives it to the client. Cache is nice, but not necessary!

D34DC3N73R commented 1 year ago

The integration only provides team logo image URLs. The frontend card grabs and displays the URLs using the client browser. My main concern is redistribution/packaging, so if server caching is a viable solution, it would be ideal in my opinion.

With that said, if this isn't a common request it would be possible to edit the card to use a manually downloaded directory of team images. With some work it would also be possible to add local_image: true and image_path: /path/to/team/logos variables to the card itself, but that would still require the user to manually save the images in an accessible location on the HA server. I'm open to other suggestions.

zacs commented 1 year ago

Closing since this is related to the card, and not the integration itself.