home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.76k stars 30k forks source link

Error importing generic IP camera platform config #69809

Closed dgomes closed 2 years ago

dgomes commented 2 years ago

The problem

I have a "camera" which is actually a weather map. Works OK except the new config_flow can't import it

What version of Home Assistant Core has the issue?

core-2022.4.1

What was the last working version of Home Assistant Core?

core-2022.3

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Generic Camera

Link to integration documentation on our website

https://www.home-assistant.io/integrations/generic/

Diagnostics information

No response

Example YAML snippet

- platform: generic
  name: weather sat peninsula 
  still_image_url: http://meteomaps.s3.amazonaws.com/eltiempo/datamaps/eltiempo_spain-satelite-{{ (as_timestamp(now()) | float -3600) |timestamp_custom('%Y%m%d%H00', False) }}.jpg
  limit_refetch_to_url_change: true

Anything in the logs that might be useful for us?

2022-04-10 18:49:05 ERROR (MainThread) [homeassistant.components.generic.config_flow] Error getting camera image from http://meteomaps.s3.amazonaws.com/eltiempo/datamaps/eltiempo_spain-satelite-202204101600.jpg: HTTPStatusError
2022-04-10 18:49:05 ERROR (MainThread) [homeassistant.components.generic.config_flow] Error importing generic IP camera platform config: unexpected error '['unable_still_load']'

Additional information

No response

probot-home-assistant[bot] commented 2 years ago

generic documentation generic source (message by IssueLinks)

probot-home-assistant[bot] commented 2 years ago

Hey there @davet2001, mind taking a look at this issue as it has been labeled with an integration (generic) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

davet2001 commented 2 years ago

@dgomes When I try to load

http://meteomaps.s3.amazonaws.com/eltiempo/datamaps/eltiempo_spain-satelite-202204101600.jpg

I get this:

NoSuchBucketThe specified bucket does not existmeteomapsANRQXRDMGGGZ1RFG1MTAm+Zee3B2wdljveBtFltlGsrOGvOG5jtoix5bCTQjmoThrFhRGEGj5dET1FvGMQ2ZfV042Ds=

Are you sure the rendered URL template is valid?

dgomes commented 2 years ago

Yeh somehow everything coincided (URL no longer works and migration to 2022.04), Sorry!

BTW we could use the option to write in the name (old CONF_NAME)

The slug_url is very bad generating very long strings for some URL's

davet2001 commented 2 years ago

It should already use the name value if one was defined in the YAML. There is a test for this, so I expected it was working.

dgomes commented 2 years ago

sorry I'm referring to a new config done 100% through the UI

davet2001 commented 2 years ago

Yes, that was in there initially, but got removed in review since the user can change it with the rename function.

I am planning a further enhancement where the user can preview the feed in the final step.

Maybe could show them the autogenerated name there and allow them to edit it (same way as zha joining works).

dgomes commented 2 years ago

at least cap the generated name length to something that can fit in the list of entities in the Integration page card.