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

Make chamber image camera domain type #595

Merged

Conversation

jawilson
Copy link
Contributor

@jawilson jawilson commented Sep 29, 2024

Makes the chamber "image" a camera domain type.

Fixes #365, #423, #531.

@jawilson jawilson changed the title Make chamber image camera type Make chamber image camera domain type Sep 29, 2024
@AdrianGarside AdrianGarside merged commit 169d1df into greghesp:develop Oct 21, 2024
2 checks passed
@jawilson jawilson deleted the make-chamber-image-a-camera branch October 21, 2024 17:53
@steveneaston
Copy link

@AdrianGarside sorry to hijack this PR, but in the release notes for 2.0.23 you mention:

I found that in order to continue to show 'live' video in my dashboard inside a Picture-Elements, I had to apply a workaround to contain the camera image instead a custom layout card as picture-elements didn't natively support the camera card.

Both picture elements and picture card are working for me with live video with the new camera entity:

type: picture-entity
entity: camera.p1s_camera
camera_image: camera.p1s_camera
camera_view: live
show_state: false
show_name: false
type: picture-elements
elements: []
camera_image: camera.p1s_camera
camera_view: live

With picture-elements, I found that if you add any elements, you need to use camera_view: auto. But for my use case, picture-entity is preferrable anyway.

@AdrianGarside
Copy link
Collaborator

@steveneaston thanks I will give that a go.

@AdrianGarside
Copy link
Collaborator

This is what I currently have. If I replace that custom:layout-card with anything else the camera doesn't render.

type: custom:tabbed-card
options: {}
tabs:
  - card:
      type: vertical-stack
      cards:
        - type: picture-elements
          elements:
            - type: custom:layout-card
              layout_type: masonry
              cards:
                - type: picture-entity
                  entity: camera.p1p_XXX_camera
                  show_state: false
                  show_name: false
                  camera_view: live
              style:
                left: 50%
                top: 50%
                width: 104%
                height: 107%
        ....

Ah, I was trying to insert the camera as a card within the elements list, but I see you can just have the camera as a background for the entire picture-elements at the top level:

type: custom:tabbed-card
options: {}
tabs:
  - card:
      type: vertical-stack
      cards:
        - type: picture-elements
          camera_image: camera.XXX_camera
          camera_view: auto
          elements:
      ...

More compact, doesn't have the weird sizing problems I had with custom:layout-card so much better.

@kaandorp
Copy link

After the update the camera image doesn't render at all. Not on a dashboard, but also not directly on the device page.

The link to the image is https://[domain]/api/camera_proxy_stream/camera.bambu_labs_a1_camera?token=b319ff977dddd5bc34927da7c7adfdsfe17dfc3f1df59f8505bd9fd5e633bfea047e2f9c803a4

If tried restarting HA and the printer. Other sensors seem to be working with the exception of the camera.

@AdrianGarside
Copy link
Collaborator

AdrianGarside commented Oct 25, 2024

Anything in the debug logs? What version of home assistant? Does downgrading to the version where it's an image work again?

@kaandorp
Copy link

Anything in the debug logs? What version of home assistant? Does downgrading to the version where it's an image work again?

I have to admit that after clearing the Safari cache it seems to work again :)

@kaandorp
Copy link

Anything in the debug logs? What version of home assistant? Does downgrading to the version where it's an image work again?

I have to admit that after clearing the Safari cache it seems to work again :)

Whoops. A bit too fast. It seems to be working in the native app on macOS and on my iPhone. It also seems to work on Chrome. It just doesn't work very well on Safari. If you clear the cache it works again. If you keep the image open you suddenly see the entire page reloading and the image is broken. There is nothing in the debug log. HA is the latest version. I can try some earlier versions, but I'm actually doubting if these problems were not in Safari before.

@AdrianGarside
Copy link
Collaborator

Since it's a standard HA camera entity at this point, there's likely nothing I can do to fix Safari mishandling rendering it :(

@kaandorp
Copy link

Since it's a standard HA camera entity at this point, there's likely nothing I can do to fix Safari mishandling rendering it :(

It seems to be a known issue for quite some time:
home-assistant/core#13995

So nothing we can do about it I’m afraid.

@AdrianGarside
Copy link
Collaborator

AdrianGarside commented Oct 30, 2024

Please open an issue for this - I'll likely add in a configuration to have the older image 'fake' camera sensor active instead. I'm not sure how quickly I'll be able to get to it though - work got crazy again. Apparently firefox misbehaves if you have too many printer videos displaying at once where the image approach worked. So misbehaving web browsers is a theme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants