Your Home Digital Twin: Interactive floor 3d plan

I get this error:

my code:

  - type: 'custom:floor3d-card'
    entities:
      - entity: light.luz_cozinha
        type3d: light
        object_id: _Luz Cozinha
        light:
          lumens: 500
      - entity: binary_sensor.janela_cozinha
        type3d: color
        object_id: _Window_cozinha
        colorcondition:
          - state: 'on'
            color: '#00ff00'
          - state: 'off'
            color: '#ff0000'
    path: /local/floor3d/
    objfile: apto.obj
    mtlfile: apto.mtl
    backgroundColor: '#000001'
    globalLightPower: 0.4

model.obj

Hello Marcos, your YAML config seems right, do you mind share your exported home model ?

I added the link in the original post

I fix the error but I can’t link the objects, I believe the id used in yaml is not the same name used in sweet Hme 3d. How to know the object ID when I open the obj file?

When you are in edit mode in Lovelace double click on the objects to show the object id (which I confirm is different from the one in Sweethome)

Got it, but I use YAML mode. there is no other way? I have another doubt. “White light source” is not exported right? Do I need to add a “Spotlight” ?

In the model you just put the lamp and bulb objects. The light is then fully managed inside the card. I actually set a point light (illuminating in all directions) at the center of the object representing the light. Going forward I will be able to do more sophisticated things, such as directional lights, but so far the point light is not a big limitation

Even in Yaml mode when the card editor is opened you can double click in the preview panel.
Of course this is not going to work in Raw edit mode.

hello I just extended my floorplan. it now has more details / objects and a size of roound about 136 MB and it will not load anymore . it is stuck at 100% I will reduce again the objects and make it “cleaner” so save size and loading time. It becomes absolutely inreactive now. seems like let’s say 30-50 MB per floorplan is the limit. I have an AMD Ryzen Laptop with anough horse power to load this stuff but it seems that there are limitations in Chrome and Edge :slight_smile: Is there a way to compress the files / models / obejcts?

Hello Thundergreen; there is no such thing as a limit. I’ve played with this example: http://www.sweethome3d.com/examples/SweetHome3DExample15-HouseWithDormers.sh3d from the sweethome3d site, Obj file weights 230 MB, I have an old i5 4th generation and a poor GPU the model is showing after 10s and even if Chrome is using almost all resources from the PC, it is working. I have to test it with some entity bindings.

I removed a bit and it now works again … stupid question after I finish adding all lights I’d like something like open window notification… I didn’t watch into it bit maybe someone already played around ? Is it somehow possible adding invisible object’s? This would offer the way for actions (I think about browser mod opening some information) if someone has a few nice examples I’d highly appreciate as I will also share Mine once it’s finished :muscle:

1 Like

hello I just fineished my floorplan and it wouldn’t sho anymore. I uploaded my config… can someone see the error? :frowning:

https://pastebin.ddns.me/rizoxumoda.bash

I also get this in Colsole error log:

floor3d-card.js?hacstag=3617765380910:976 Uncaught (in promise) TypeError: Cannot read property 'state' of undefined
    at floor3d-card.js?hacstag=3617765380910:976
    at Array.forEach (<anonymous>)
    at HTMLElement.set hass [as hass] (floor3d-card.js?hacstag=3617765380910:976)
    at HTMLElement.value (chunk.53899b0337677dfbe7ab.js:2246)
    at chunk.53899b0337677dfbe7ab.js:2246
    at Array.map (<anonymous>)
    at HTMLElement.value (chunk.53899b0337677dfbe7ab.js:2246)
    at HTMLElement.value (chunk.53899b0337677dfbe7ab.js:2246)
    at HTMLElement.value (chunk.53899b0337677dfbe7ab.js:2246)
    at HTMLElement.performUpdate (app.bcb38ac1.js:1)

Not nice error. Try to clear cache, restart chrome. The config seams good

I was thinking it was this…

Cannot read property 'state' of undefined means nothing more than a wrong light entity_id :slight_smile: Fixed it! Sorry for the noise :slight_smile: Vut we learn all together

I need to improve error catching, clean code will arrive later ……

no probs but biggest “issue” is the renaming of the object_ids :stuck_out_tongue: i had to rename everything again :stuck_out_tongue:

1 Like

Agree, today I have compiled successfully the first version of the sh3d plugin to improve hass export. Now I have got the basics of plug-in development. I think that somewhere in July I may have a working export

sounds awesome… keep up going this way :slight_smile: here is my actual plan :frowning:

2 Likes

I just wanted to test it on my toucscreen (intel NUC i3) and it won’t update (light) the turned on lights :frowning: It also takes ages to load. unusable for me :frowning: I was so happy because on my laptop everything works fine but not on the intel NUC. is there a way to speed up everything? my intel NUC has windows 10 8 GB RAM …i might give more ram to the GPU?

Here is my plan : Nextcloud

I have an i5 4th gen, and I can load pretty much any model. Of course it is taking time and it is not very responsive if the model is really big (ex 230 Mb). I have an authentication error when I try to download your model