Your Home Digital Twin: Interactive floor 3d plan

By the way, my model was dark when converting from obj to glb using the Online Viewer. Have you found a way to avoid this issue ? Is it the shiness in Sweethome3d ?

OV exported glb is dark when loaded in Floor3D. It is not dark when loaded in OV. Compared with a second OV loaded with obj shows no difference. But it is a difference in Floor3D.
The only way I could attenuate the darkness in Floor3D is to insert that line I have shown few posts above.
There is a problem with the way you use THREE lights, camera and viewpoint in Floor3D. I can’t figure out which yet.
For example, in OV, the OV.Viewer class has a Init method:

    Init (canvas)  {
        this.canvas = canvas;
        this.canvas.id = 'viewer';
        let parameters = {
            canvas : this.canvas,
            antialias : true
        };
        this.renderer = new THREE.WebGLRenderer (parameters);
        if (window.devicePixelRatio) {
            this.renderer.setPixelRatio (window.devicePixelRatio);
        }
        this.renderer.setClearColor ('#ffffff', 1.0);
        this.renderer.setSize (this.canvas.width, this.canvas.height);  
        this.scene = new THREE.Scene ();
        this.geometry = new OV.ViewerGeometry (this.scene);
        this.InitCamera ();
        this.InitLights ();
        this.Render ();
    }

where InitCamera and InitLights are:

    InitCamera () {
        this.camera = new THREE.PerspectiveCamera (45.0, this.canvas.width / this.canvas.height, 0.1, 1000.0);
        this.scene.add (this.camera);
        let canvasElem = this.renderer.domElement;
        let camera = OV.GetDefaultCamera (OV.Direction.Z);
        let obj = this;
        this.navigation = new OV.Navigation (canvasElem, camera);
        this.navigation.SetUpdateHandler (function () {
            obj.Render ();
        });
// Next line is not important
        this.upVector = new OV.UpVector ();
    }

    InitLights  ()
    {
        let ambientLight = new THREE.AmbientLight (0xFFFFFF,0.5);
        this.scene.add (ambientLight);
        this.light = new THREE.DirectionalLight (0xFFFFFF,0.5);
		this.scene.add (this.light);
    }

And that is all. No outputEncoding (RGB conversion), no toneMapping.
I know you wanted the sun influence over the canvas.
btw. The image looks the same in SH3D too.

I am looking on how to make OV programmatically loading a glb file.
It is not trivial if one wants to have OV offline and not to start a http server.
The problem is the CORS protection.

For a custom card this is not a problem, you can access the glb via url in the same domain as ha. I do it already for the current card. Not sure if the OV api provides the load function

I know is no problem when custom card.
I just want to play with OV offline and see the console. And I’m too lazy to open via window the glb. :blush:
There is load.

1 Like

This card is fantastic! It is so simple and quick to bring a significant advancement to my HA setup.

1 Like

Thanks @JoWink for your nice words, do not hesitate to ask for support and open issues if you encounter problems

Thanks for everyone’s help, especially Andy’s. I got the text feature working, at least for .obj models.

2 Likes

In case it’s useful: The Floor 3D Plan card for my main house has ~1300 lines of YAML code, when the opening of all the doors and windows and switching on all the lights are accounted for. Adding the last few frames with text taxed the ability of the card to be rendered faithfully. For text elements, either the entity state was not displayed, it picked up units from a different entity (e.g., temperature displaying with g/min), or it was reported as undefined. However, if I moved most of the text elements to the beginning of the list and sprinkled a few throughout the elements list, I could get it to report entity states faithfully. In other words, the sequence of how the entities are listed makes a difference. It was a reproducible phenomenon. I am running Home Assistant Operating System on a fairly powerful device (8th generation Intel Core I5 with built-in graphics).

2 Likes

If you do not mind to share. I do not think I have ever had a configuration that big. THere could be some side effects or bugs on the allocation of the data structures for the card.

Thanks. I just messaged you.


Thanks Vincenzo, I tried but the personal textures are not displayed well. I think my project is too heavy anyway. On Windows it works well with OBJ, I wanted to put a tablet as a command center, maybe if I use an MS Surface it can view the card even with OBJ

Can I render a project like this myself? I want to renovate my house, and a project like this would come in handy a lot. I am not sure my PC is good enough to render my whole house, but I will use an external online Blender Render Farm to help me finish the project. It uses external servers to do the job of my PC way faster. This system can process hundreds of frames each hour, and the such project would be complete in hours. Much faster than my PC would be able even to start processing the information.
So, is it difficult to build a project myself if I am not a designer and not a programmer?

Yes. Use sweet home 3D to create the floorplan.

Hi there, I have been using your card for several months with great pleasure. Since a few months the card was not loading anymore. I have re-installed all components and tried to get it running again. Without success! I even setup another system for a friend of mine and tried on this system again. Also no success. It always stucks at the loading of the card 1/2 100%. For testing I have even created some very simple Sweet Home 3D samples with only 4 walls. Does not work anymore. I have been going through your tutorials like 20 times and read all the online comments I can find…still no success for me. Any hint?

I have also tried to load some 3d samples I have downloaded from the Sweet 3D Home page. They are also not loading.

Here the error log I get after 2/2 100%:
Logger: frontend.js.latest.202209070
Source: components/system_log/init.py:227
First occurred: 11:47:01 AM (71 occurrences)
Last logged: 3:42:01 PM

Appreciate any feedback

Hello @rolschu1960, starting from a recent version, if you create the card from the card picker, the floor3d card comes with a pre-configured sample. Tell me if the sample is working. If not there is a problem with your home assistant config, if yes, it would be helpful to have your files (obj, mtl or glb and sh3d)

1 Like

Hi Andy, thanks for the quick reply! The default sample is working fine including zoom and turn!

My floor plan and the sample floor plans from Swwet 3D home are also loading somehow. Sometimes until 1/2 100% and sometimes it stops at 2/2 100% and the error message is shown in the log (posted in my message above.

How can I send you my files?

hey @uss
Thanks a lot for the explanation.
I’ll for sure recreat my build following your advice.
I don’t have as manu objects like you, but it won’t hurt on my side if I can optimize it using your tips.

Cheers :wink:

Hey all, I’m sorry my time on the card is not very limited, but I have to thanks some new contributors (and old supporters) that added some serious enhancement and new features in the v1.5.0 (ex. Tween animations, object selections, etc.). Please have some test and send feedback

2 Likes

Thanks to @ndbroadbent and @uss for updates. It appears that with or without the new selection mode, the object id is no longer visible after the object is clicked on in edit mode, except only in the console of the browser developer mode. Additionally, the clear/disable selection remains visible and selections are persistent even when not in edit mode. Screen snapshot below (after exiting edit mode). Previously, the object ID was shown only in edit mode in blank space of the card. Is this the intended behavior?