Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maps Static API in the Generic Camera platform broken #93566

Closed
mikulik86 opened this issue May 25, 2023 · 3 comments
Closed

Maps Static API in the Generic Camera platform broken #93566

mikulik86 opened this issue May 25, 2023 · 3 comments

Comments

@mikulik86
Copy link

The problem

Since last release the map picture fetched with the generic camera integration (as described here: https://www.home-assistant.io/examples/google_maps_card) is missing a map marker.

Before:
image

After:
image

Used URL: https://maps.googleapis.com/maps/api/staticmap?center=50.36069647591754,14.476514889982804&zoom=18&size=493x300&maptype=roadmap&markers=color:blue%7Clabel:S%7C50.36069647591754,14.476514889982804&style=feature:poi|element:labels|visibility:off&key=API_KEY

What version of Home Assistant Core has the issue?

core-2023.5.4

What was the last working version of Home Assistant Core?

core-2023.5.3

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Generic Camera platform

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

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!

Code owner commands

Code owners of generic can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign generic Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


generic documentation
generic source
(message by IssueLinks)

@davet2001
Copy link
Contributor

I can reproduce this on 2023.5.4 on an RPi 4.

I'm pretty sure that it's something to do with the | (pipe) characters in the URL you posted, which should be encoded as %7C.

When I try your string which includes literal pipe characters:
https://maps.googleapis.com/maps/api/staticmap?center=50.36069647591754,14.476514889982804&zoom=18&size=493x300&maptype=roadmap&markers=color:blue%7Clabel:S%7C50.36069647591754,14.476514889982804&style=feature:poi|element:labels|visibility:off&key=MY_API_KEY

It doesn't work on 2023.5.4, but when I try this string which swaps them for %7C, it works:

https://maps.googleapis.com/maps/api/staticmap?center=50.36069647591754,14.476514889982804&zoom=18&size=493x300&maptype=roadmap&markers=color:blue%7Clabel:S%7C50.36069647591754,14.476514889982804&style=feature:poi%7Celement:labels%7Cvisibility:off&key=MY_API_KEY

Between 2023.5.3 and 2023.5.4 httpx was upgraded from 0.24.0 to 0.24.1 in #93396
So this issue could be related to a change in the way in the way URL characters are handled
encode/httpx#2701
Although I can't directly see the cause.

Oddly I can't reproduce the problem by running 2023.5.4 on my desktop dev machine.

@mikulik86 Please can you try using %7C instead of pipe characters and see if that fixes the issue?

@issue-triage-workflows
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@issue-triage-workflows issue-triage-workflows bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 1, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Oct 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants