shmuelzon / home-assistant-floor-plan

Home Assistant Floor Plan Generator Plugin For Sweet Home 3D
MIT License
264 stars 8 forks source link

Door/Window show opened in 3d view #21

Open Zerogiven opened 4 months ago

Zerogiven commented 4 months ago

Hi,

Is it possible instead of the state icon to show door/window as open and save images like for the lights? :) However, it works perfect as it is :)

shmuelzon commented 4 months ago

Hey,

I looked into this in the past and it seemed to me then that (a) the openings would need to be in their open state (just like the lights are configured with their "on" power) and then I can "close" them from this plugin and (b) it would mean that I need to render all of the possible combinations of open/closed doors/windows and every combination of lighting for those which makes me think that it's not worth the effort. Unless someone can think of a nice solution for reducing the number of required renders...

Zerogiven commented 4 months ago

I understand your point with the mass of renderings, but if you have a big house and you have about 10 or 20 lights you already have a lot of renderings.

For me that's the big difference why not using ha-floorplan. I have nice renderings instead of a "simple" svg plan.

And your plugin makes it much easier to create the different renderings :D 👍 Also you can choose which you want get extra rendered by do not open it (like give the light 0% power) :)

hahnet commented 4 months ago

Hi all, i dont need a rendered version with light effect, for me it would be enough to have to states like a open window and a closed one without render lights

Zerogiven commented 4 months ago

Just give the Windows the Name of the binary sensor and you will see a state icon above :) (which shows an Icon for closed and another for open windows)

guimatheus92 commented 3 months ago

Hi all, i dont need a rendered version with light effect, for me it would be enough to have to states like a open window and a closed one without render lights

I think I agree with him @shmuelzon, what if we generate different images for window/door/blinds opened, only to them according to their open state (10%, 20%, etc) without combining with lights?

braintimeException commented 2 months ago

Hi all, maybe as an idea on how to avoid explosion in number of renderings, I have painted the doors and windows in bright yellow and rendered them in open state with all lights on. This gave me a single rendering, from which I than manually extracted the doors/windows (did it a while ago before this plugin was created, would be amazing if this step could be automated) and placed them an a transparent background and place them on top of the plan when the corresponding sensors show "open". I picked yellow color deliberately, because I treat open state of a door or window as abnormal and want to see at a glance if anything is open. At least for those doors, for which it's worth attaching a sensor in the first place :) Here's an example: door closed: door_closed door overlay on transparent background: door_open_overlay door open: door_open_result

shmuelzon commented 2 months ago

Even with this method, the lights and shadows will be off without rendering them with the doors open and closed. Even in your example the "door closed" image isn't the background used for the "door open" imaged. It's not the same the the closed image with the overlay on top of it. The door's yellow color will also look different depending on the light state of the room it's in.

richard-kramer commented 1 week ago

I, for my part, would also really like this feature and would be totally fine with waiting around longer to render more images.

In my (probably naive) thinking it's mostly wasting more compute resources, but should be absolutely doable from a coding perspective (the rendering of multiple images of course, not the feature itself)?

shmuelzon commented 1 week ago

Yes, it should all be doable and I started looking into it today. I have a basic idea of how I want to implement it but ran into issues today with actually controlling the door/window state from the plugin code. Unless I'm missing something, it's quite complex where, since opening/closing a door/window changes it's size (bounding box) I actually need to scale the door/window accordingly so it's frame will remake at the same size and location. I'm still trying to figure it out...