After some more extensive tests I can confirm that the brand new floor3d card is now built according to a more standard Typescript template, I’ve also optimized the code and eliminated some useless operations, this has a noticeable effect on the CPU and GPU consumption. For those who started to test in the previous version, the configutation of the card is still valid, you just need to update the type of the card from visualization-card-3dfloor to floor3d-card. Important to note that the card is still in a very early stage, so I apologize in advance if you are going to experience trivial issues…
Full manual in the README
This project is only possible thanks to the JS library Three.js
Hello all, I really invite you to test it and give feedback, also hints, issues and feature requests are welcome. I’m not a Javascript expert I may have coded poorly or without performance optimizations
Hello Flipso, I’m not sure I get your question, this card is not about importing images, instead, you integrate the model exported from Sweet Home into home assistant using the library Three.js which can be used interactively. Lights and objects animates inside the model based on the state of the entities.
Look at this video to see the final result: Home Assistant Custom Card 3D Floor Plan - YouTube
well thats nice, but the quality of the model isnt as nice as the rendered picture, so if it would be possible to have the full rendered pic with this lightsources illumination would be awesome
You need to know that the workload is in the browser JS library. So the bigger the model, the slower will be the rendering and the higher will be the browser CPU/GPU consumption. Also the model is stored into the config/www folder of HA, if you have trouble with storage space it may be a problem. Otherwise it is pretty stable and smooth (my model weights 50Mb). If you have trouble, try to remove from the model complex objects. Another important point is: Sweet Home tends to mess up the Object_ids when you remove/replace objects from the model. Do the Home Assistant binding only to a model that you consider stable…
I’ve not yet played with all the three.js settings and parameter but the rendering is not that far from the one you get in the Sweet Home 3D View. I will see what I can do quality-wise, or if there is an expert in 3D rendering in the forum, I hope he will help up improve
It is a big library, but it does a lot more thing than what is required for the HA card. I may come up indicating the minimal set of required js file to make it work…
Apologies, my instructions were not tested with the master.zip I was doing wrong assumptions. Waiting for a better instruction guide, please follow these instructions:
keep only the “build” and “examples” folders under “three.js-master” (remove everything else)
rename the “three.js-master” to “three”
At the end you should have a directory structure looking like this:
Remove the “entities” and wait a little, if I remind, you told your model is big, it may take a while to load. The biggest I’ve tried is 50 Mb and it takes a few seconds
Try to open your .obj with 3dpaint or 3dviewer in windows, iIf it is working there it should work also in three.js. Tomorrow if you have more time you may try to do some tests (ex. splitting the floors in sweet home 3D, etc)
At least I know it works.
I’ll probably add a few lights just to see if I get it to work properly then I will wait until I get the new floor plan in the new apartment.
And paint3d has been working on opening the file for about 30 minutes now…