thomasloven / lovelace-state-switch

🔹Dynamically replace lovelace cards depending on occasion
MIT License
382 stars 27 forks source link

Issue with picture entities (camera feeds) not working on Fire 10 Tablet (state based on user entity) #73

Open domenicdistefano opened 2 years ago

domenicdistefano commented 2 years ago

Strange problem here. I am going to try to describe what's going as best I can. Code examples below. Note - where you see bullets in the code they are actually dashes (-). This editor is displaying them as bullets.

I have a number of camera feeds (eight total) I need to display both on a PC & on a tablet within a 2x4 Grid Card. For brevity purposes in my examples below I will just include the first two camera entities. In Figure A below everything is stock vanilla & works great on a PC. Problem is these are a mix of 4K & 1440p cameras so the tablet can't keep up. To solve the issue I can create a separate view and substitute an alternate stream dumbed down to 720p which the tablet handles fine. See Figure B.

Instead of having redundant views for each resolution / device I want to use state-switch via user name to present the proper code to the proper device. Easy right? Not so much....

Again just to reiterate independently without using state-switch all of this code works fine & displays properly. When combined however (as shown in Figure C with my full code / eight cameras) using state-switch the tablet (720p version of the code) just shows with black boxes on the tablet. I am scratching my head because state-switch is doing its job and using the proper version of the code on the tablet but for some reason the actual payload / view of the live stream is breaking somehow. Even if do another version for troubleshooting just showing a single feed (one regular and one 720) I get the same result.

At the very bottom is a picture of what the tablet screen looks like with the only variable being state-switch. If I use the same code (720 entities only in a regular view) everything looks great as you can see in the second picture.

Makes no sense. Any ideas?

Thanks in advance for the help with your GREAT PRODUCT!

Figure A --------------example without state-switch-------------- type: grid square: false columns: 2 cards:

Figure B --------------example without state-switch-------------- type: grid square: false columns: 2 cards:

Figure C --------------example WITH state-switch-------------- type: custom:state-switch entity: user default: default states: Domenic: type: grid square: false columns: 2 cards:

Working: image