Dynamic Opacity for Room SVG Rects when Lights are Toggled - Request for Help #441
-
I've spent hours researching this and if I'm missing a relevant resource, please feel free to point me in the right direction. I'd like to make the apparent darkness of the rooms more realistic to time of day and weather. Anything I've found so far looks good but relies on supporting multiple png files, but I'm hoping to stay with a pure SVG and CSS approach. If I must create multiple room images within the SVG, I will, but I'm hoping there's a code-based solution and I'm missing something in my research. What I have:
What I want:
Has anyone found a way to do this within HA, ha-floorplan, and CSS without creating a variety of images that can, each, become obsolete whenever items are moved, bought, or otherwise? I'm okay supporting a background image, but I hope to avoid having 1 (or more) room-specific images. Also: Is this a variable scope issue? If so, is there a cute or clever way to work around it? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 7 replies
-
I'll work on this more tomorrow, but I think I found the process within one of the examples. One of them uses 'entities["light.garage"].last_changed)' and that may give me the insights I need for what I hope to do with the sensor. I'm both happy to think I have a solution and a little confused about all of my entities being exposed on the local/www. That said, for now, I'll think I'll take the win (pending some development and testing). |
Beta Was this translation helpful? Give feedback.
-
I can personally only think of two may way to make the shading more fancy, if it should fit to the rooms itself. As shaders and more, wouldn't align in CSS-based solutions, with the actual shadows in the room. The two solutions:
However, for suggestion no. 2, I actually think we had someone asking about how this is possible to do in the past, and did ran into a problem. But i think it was related to something more specific. I'll see if I can find that. |
Beta Was this translation helpful? Give feedback.
-
This is almost exactly what I've been doing; one gray polygon per room. It works well and I got to this point by following the YouTube videos. I'm sure you know the ones. ;-) I have a working solution. This is a little hacky, and I'm sure it can be improved. I've borrowed from posts in the discussion boards, the youtube vids, the examples, and a little bit of setting out to research topics that are rusty or new to me. To outline what I've done:
Then within the yaml for the lights:
It seems odd to do two different style_sets when one would work, but... this is functional. I want to figure out how to push the sensor.opacity_floorplan_general to the rooms without smart bulbs - that's next on the list. If anyone has pointers on that, I'll be happy to accept them. I suspect that will be more difficult. Can I name all the inert elements in Inkscape, then use the yaml to put the elements into a "rule" with... no entities(?) and use the style_set? Hmmm... Physical chores beckon. I'm going to figure all of this out, though. Thank you (all) for the awesome integration - and for jumping in to help. :-) |
Beta Was this translation helpful? Give feedback.
This is almost exactly what I've been doing; one gray polygon per room. It works well and I got to this point by following the YouTube videos. I'm sure you know the ones. ;-)
I have a working solution.
This is a little hacky, and I'm sure it can be improved. I've borrowed from posts in the discussion boards, the youtube vids, the examples, and a little bit of setting out to research topics that are rusty or new to me.
To outline what I've done:
Sensors: