Your Home Digital Twin: Interactive floor 3d plan

I’m now working on the card wiki:

Part 1

Part 2

Part 3

1 Like

Thank you for the quick reply.
Thanks a lot. Great plugin.
best regards

1 Like

Yes, it worked like a charm :slight_smile:
many thx for the fast response

1 Like

Hello,
I’m trying the latest version of this awesome integration and it’s pretty much perfect.
I would like to know if it is possible to add object animations, I have a fan chandelier and I would like the fan blades to spin when I turn it on.
Could such a thing be achievable?

2 Likes

Dear Andy,

I think that I found a bug… It took me almost two days to reproduce it but finally I made it at 3.30am :frowning: :-). It seems that the bug is related with the size of the configuration file that the ‘Live 3D Floor’ can have. If this size/limit is exceeded then the 3D models starts to deteriorate and usually many (if not all) objects are represented as black. In order for you to be able to reproduce it I am supplying you with my configuration and my 3D model. File ‘PartAB’ have the complete configuration which causes problems to the 3D objects due to the limitation that I have explained. Though, if I reduce the size of the configuration file then it works fine. For instance PartA and Part B (which are subsets of PartAB) works excellent, though Part AB which is the unions does not. I will maintain the 3D model in Google Drive for a limited time in case you need it; or anyone else to take ideas [3dHome.zip - Google Drive].

I hope that you can find a resolution for these. Again excellent work.

BR,

Christos

file: PartAB

type: custom:floor3d-card
entities:
  - entity: light.18120855d8bfc0d38f6d
    type3d: light
    object_id: back_1954
    light:
      lumens: '500'
  - entity: switch.sonoff_1000abba78
    type3d: light
    object_id: sweethome3d_window_pane_69_1864
    light:
      lumens: '300'
  - entity: switch.sonoff_10009c1d23
    type3d: light
    object_id: '689'
    light:
      lumens: '1000'
  - entity: switch.light_three
    type3d: light
    object_id: <Dining_light>
    light:
      lumens: '200'
  - entity: light.sonoff_1000dbbf11
    type3d: light
    object_id: <Sconse>
    light:
      lumens: '700'
  - entity: switch.sonoff_1000ab81e5
    type3d: light
    object_id: <Corridor_light>
    light:
      lumens: '800'
  - entity: light.00808780ecfabc554424
    type3d: light
    object_id: <Barrel_one>
    light:
      lumens: '300'
  - entity: light.00808780ecfabc5624f6
    type3d: light
    object_id: <Barrel_two>
    light:
      lumens: '300'
  - entity: light.00808780ecfabc5524a8
    type3d: light
    object_id: <TV_light>
    light:
      lumens: '700'
  - entity: light.sonoff_1000dbbf11
    type3d: gesture
    object_id: wall_5_29
    gesture:
      domain: light
      service: toggle
  - entity: light.00808780ecfabc5524a8
    type3d: gesture
    object_id: wall_3_17
    gesture:
      domain: light
  - entity: media_player.lg_living_room_tv
    type3d: gesture
    object_id: tv_set_Circle_15304_358
    gesture:
      domain: media_player
      service: turn_on
  - entity: media_player.lg_living_room_tv
    type3d: gesture
    object_id: Picture_1866
    gesture:
      domain: media_player
      service: turn_off
  - entity: media_player.lg_living_room_tv
    type3d: hide
    object_id: Picture_1866
    hide:
      state: 'off'
  - entity: light.00808780ecfabc554424
    type3d: gesture
    object_id: '2449'
    gesture:
      domain: light
      service: toggle
  - entity: light.00808780ecfabc5624f6
    type3d: gesture
    object_id: '2389'
    gesture:
      domain: light
      service: toggle
  - entity: switch.sonoff_1000a4adcd
    type3d: gesture
    object_id: <Chandelier_small>
    gesture:
      domain: switch
      service: toggle
  - entity: switch.sonoff_10009c1d23
    type3d: gesture
    object_id: <Chandelier_big>
    gesture:
      domain: switch
      service: toggle
shadow: 'yes'
backgroundColor: '#000001'
globalLightPower: '0.3'
name: 3Dmodel
path: /local/3Dhome
objfile: 3dHome.obj
mtlfile: 3dHome.mtl
object_groups:
  - object_group: Dining_light
    objects:
      - object_id: Object08_662_2_2496
      - object_id: Object08_662_2_2494
      - object_id: Object08_662_2_2492
      - object_id: Object08_662_2_2490
  - object_group: Corridor_light
    objects:
      - object_id: Object08_662_2_2221
      - object_id: Object08_662_2_2223
  - object_group: Sconse
    objects:
      - object_id: top_1903
      - object_id: top_1909
      - object_id: top_1915
  - object_group: Barrel_one
    objects:
      - object_id: top_1921
      - object_id: top_1933
  - object_group: Barrel_two
    objects:
      - object_id: top_1939
      - object_id: top_1945
  - object_group: amplifier
    objects:
      - object_id: Model_38_3_1869
      - object_id: Model_4_2_1868
  - object_group: Chandelier_small
    objects:
      - object_id: Support_Circle_444
  - object_group: Chandelier_big
    objects:
      - object_id: '436'
  - object_group: TV_light
    objects:
      - object_id: top_1879
      - object_id: top_1891
      - object_id: top_1901

file: PartA

type: custom:floor3d-card
entities:
  - entity: light.18120855d8bfc0d38f6d
    type3d: light
    object_id: back_1954
    light:
      lumens: '500'
  - entity: switch.sonoff_1000abba78
    type3d: light
    object_id: sweethome3d_window_pane_69_1864
    light:
      lumens: '300'
  - entity: switch.sonoff_10009c1d23
    type3d: light
    object_id: '689'
    light:
      lumens: '1000'
  - entity: switch.light_three
    type3d: light
    object_id: <Dining_light>
    light:
      lumens: '200'
  - entity: light.sonoff_1000dbbf11
    type3d: light
    object_id: <Sconse>
    light:
      lumens: '700'
  - entity: switch.sonoff_1000ab81e5
    type3d: light
    object_id: <Corridor_light>
    light:
      lumens: '800'
  - entity: light.00808780ecfabc5524a8
    type3d: light
    object_id: <TV_light>
    light:
      lumens: '700'
  - entity: light.sonoff_1000dbbf11
    type3d: gesture
    object_id: wall_5_29
    gesture:
      domain: light
      service: toggle
  - entity: light.00808780ecfabc5524a8
    type3d: gesture
    object_id: wall_3_17
    gesture:
      domain: light
  - entity: media_player.lg_living_room_tv
    type3d: gesture
    object_id: tv_set_Circle_15304_358
    gesture:
      domain: media_player
      service: turn_on
  - entity: media_player.lg_living_room_tv
    type3d: gesture
    object_id: Picture_1866
    gesture:
      domain: media_player
      service: turn_off
  - entity: media_player.lg_living_room_tv
    type3d: hide
    object_id: Picture_1866
    hide:
      state: 'off'
  - entity: switch.sonoff_1000a4adcd
    type3d: gesture
    object_id: <Chandelier_small>
    gesture:
      domain: switch
      service: toggle
  - entity: switch.sonoff_10009c1d23
    type3d: gesture
    object_id: <Chandelier_big>
    gesture:
      domain: switch
      service: toggle
shadow: 'yes'
backgroundColor: '#000001'
globalLightPower: '0.3'
name: 3Dmodel
path: /local/3Dhome
objfile: 3dHome.obj
mtlfile: 3dHome.mtl
object_groups:
  - object_group: Dining_light
    objects:
      - object_id: Object08_662_2_2496
      - object_id: Object08_662_2_2494
      - object_id: Object08_662_2_2492
      - object_id: Object08_662_2_2490
  - object_group: Corridor_light
    objects:
      - object_id: Object08_662_2_2221
      - object_id: Object08_662_2_2223
  - object_group: Sconse
    objects:
      - object_id: top_1903
      - object_id: top_1909
      - object_id: top_1915
  - object_group: amplifier
    objects:
      - object_id: Model_38_3_1869
      - object_id: Model_4_2_1868
  - object_group: Chandelier_small
    objects:
      - object_id: Support_Circle_444
  - object_group: Chandelier_big
    objects:
      - object_id: '436'
  - object_group: TV_light
    objects:
      - object_id: top_1879
      - object_id: top_1891
      - object_id: top_1901

file: PartB

type: custom:floor3d-card
entities:
  - entity: light.00808780ecfabc554424
    type3d: light
    object_id: <Barrel_one>
    light:
      lumens: '300'
  - entity: light.00808780ecfabc5624f6
    type3d: light
    object_id: <Barrel_two>
    light:
      lumens: '300'
  - entity: light.00808780ecfabc554424
    type3d: gesture
    object_id: '2449'
    gesture:
      domain: light
      service: toggle
  - entity: light.00808780ecfabc5624f6
    type3d: gesture
    object_id: '2389'
    gesture:
      domain: light
      service: toggle
shadow: 'yes'
backgroundColor: '#000001'
globalLightPower: '0.3'
name: 3Dmodel
path: /local/3Dhome
objfile: 3dHome.obj
mtlfile: 3dHome.mtl
object_groups:
  - object_group: Barrel_one
    objects:
      - object_id: top_1921
      - object_id: top_1933
  - object_group: Barrel_two
    objects:
      - object_id: top_1939
      - object_id: top_1945

Hello Christos,

good that you give me an example of some kind of limit the card is reaching. This will help me understand if there is something wrong on my management of the Javascript library I’m using (three.js) or there is really some limits associated with three.js and people are reaching them at different level of their card/models just because they are using different resources at home (CPU, GPU, memory, etc.).
I tend to say that as I’m relatively new to javascript and to the use of three.js it is probably the first. I’m also confirming some strange behaviour for very complex cards and the impossibility to load textures beyond a certain limit. It may take a while, but I will try to debug this point and come back with either a better optimized card or with some known limitations due to limited resources…
Please post an issue with the same info on github.
Thanks.

Hi Christos, Andy,

I cross-over this black thing bug.
It is not related to the size of the config file. My config is by far bigger than yours.

  - title: Floor3D
    path: floor3d
    panel: true
    visible:
      - user: 25998ce24d234aeff16a826875
      - user: abc9df9ada884504b1b20a1aef
    badges: []
    cards:
      - type: custom:floor3d-card
        entities:
          - entity: light.birou_parter
            type3d: light
            object_id: BirouParterLumina
            light:
              lumens: '500'
              vertical_alignment: bottom
          - entity: light.debara_parter
              lumens: '250'
              vertical_alignment: bottom
          - entity: light.aplice_sufragerie
            type3d: light
            object_id: <SufragerieApliceLumina>
            light:
              lumens: '250'
          - entity: light.bucatarie
            type3d: light
            object_id: BucatarieLumina
            light:
              lumens: '250'
              vertical_alignment: bottom
          - entity: light.front_bucatarie_1
            type3d: light
            object_id: <BucatarieFront1Dulap>
            light:
              lumens: '100'
              vertical_alignment: bottom
          - entity: light.front_bucatarie_2
            type3d: light
            object_id: <BucatarieFront2Dulap>
            light:
              lumens: '100'
              vertical_alignment: bottom
          - entity: light.garsoniera
            type3d: light
            object_id: GarsonieraLumina
            light:
              lumens: '250'
              vertical_alignment: bottom
          - entity: light.hol_garsoniera
            type3d: light
            object_id: GarsonieraHolLumina
            light:
              lumens: '250'
              vertical_alignment: bottom
          - entity: light.baie_garsoniera
            type3d: light
            object_id: BaieGarsonieraLumina
            light:
              lumens: '250'
              vertical_alignment: bottom
          - entity: light.toaleta
            type3d: light
            object_id: ToaletaLumina
            light:
              lumens: '250'
              vertical_alignment: bottom
          - entity: light.hol_garaj
            type3d: light
            object_id: HolGarajLumina
            light:
              lumens: '250'
              vertical_alignment: bottom
          - entity: light.spalatorie
            type3d: light
            object_id: SpalatorieLumina
            light:
              lumens: '250'
              vertical_alignment: bottom
          - entity: light.garaj
            type3d: light
            object_id: <GarajLumina>
            light:
              lumens: '250'
          - entity: light.hol_parter
            type3d: light
            object_id: <HolParterLumina>
            light:
              lumens: '250'
              vertical_alignment: bottom
          - entity: light.hol_parter
            type3d: light
            object_id: HolParterLuminaProiector
            light:
              lumens: '250'
          - entity: light.scara_parter
            type3d: light
            object_id: <HolParterScaraLumina>
            light:
              lumens: '250'
              vertical_alignment: bottom
          - entity: light.intrare
            type3d: light
            object_id: IntrareLumina
            light:
              lumens: '750'
              vertical_alignment: bottom
          - entity: light.terasa_fata
            type3d: light
            object_id: <TerasaFataLumina>
            light:
              lumens: '400'
              vertical_alignment: bottom
          - entity: light.alei_laterale
            type3d: light
            object_id: <AleiLateraleLumina>
            light:
              lumens: '400'
          - entity: light.terasa_spate
            type3d: light
            object_id: <TerasaSpateLumina>
            light:
              lumens: '400'
              vertical_alignment: bottom
          - entity: light.uv
            type3d: light
            object_id: TerasaSpateUVCort
            light:
              lumens: '400'
          - entity: light.pitici_fata
            type3d: light
            object_id: <PiticiFataLumina>
            light:
              lumens: '750'
          - entity: light.pitici_spate
            type3d: light
            object_id: <PiticiSpateLumina>
            light:
              lumens: '750'
          - entity: light.casuta_gradina
            type3d: light
            object_id: CasutaGradina
            light:
              lumens: '750'
        name: Home
        camera_position:
          x: '-0.002745837888462193'
          'y': '2745.7164587400353'
          z: '0.0000018384561486696918'
        camera_rotate:
          x: '-1.5707963261253244'
          'y': '-0.0000010000442250414633'
          z: '-1.5701267840364996'
        path: /local/Floor3D/
        objfile: home.obj
        mtlfile: home.mtl
        globalLightPower: '0.35'
        backgroundColor: Black
        objectlist: home.json
        object_groups:
          - object_group: LivingLumina
            objects:
              - object_id: LivingLumina1
              - object_id: LivingLumina2
          - object_group: SufragerieLumina
            objects:
              - object_id: SufragerieLumina1
              - object_id: SufragerieLumina2
          - object_group: SufragerieApliceLumina
            objects:
              - object_id: SufragerieApliceLumina1
              - object_id: SufragerieApliceLumina2
              - object_id: SufragerieApliceLumina3
              - object_id: SufragerieApliceLumina4
          - object_group: BucatarieFront1Dulap
            objects:
              - object_id: BucatarieDulap8
              - object_id: BucatarieDulap9
              - object_id: BucatarieDulap10
              - object_id: BucatarieDulap11
          - object_group: BucatarieFront2Dulap
            objects:
              - object_id: BucatarieDulap14
              - object_id: BucatarieDulap15
              - object_id: BucatarieDulap16
              - object_id: BucatarieDulap17
          - object_group: GarajLumina
            objects:
              - object_id: GarajLumina1
              - object_id: GarajLumina2
              - object_id: GarajLumina3
              - object_id: GarajLumina4
              - object_id: GarajLumina5
          - object_group: HolParterLumina
            objects:
              - object_id: HolParterLumina1
              - object_id: HolParterLumina2
              - object_id: HolParterLumina3
              - object_id: HolParterLumina4
              - object_id: HolParterLumina5
              - object_id: HolParterLumina6
              - object_id: HolParterLumina7
          - object_group: HolParterScaraLumina
            objects:
              - object_id: HolParterScaraLumina1
              - object_id: HolParterScaraLumina2
          - object_group: TerasaFataLumina
            objects:
              - object_id: TerasaFataLumina1
              - object_id: TerasaFataLumina2
          - object_group: AleiLateraleLumina
            objects:
              - object_id: AleiLateraleLumina1
              - object_id: AleiLateraleLumina2
              - object_id: AleiLateraleLumina3
              - object_id: AleiLateraleLumina4
              - object_id: AleiLateraleLumina5
          - object_group: TerasaSpateLumina
            objects:
              - object_id: TerasaSpateLumina1
              - object_id: TerasaSpateLumina2
              - object_id: TerasaSpateLumina3
          - object_group: PiticiFataLumina
            objects:
              - object_id: PiticiFataLumina1
              - object_id: PiticiFataLumina2
          - object_group: PiticiSpateLumina
            objects:
              - object_id: PiticiSpateLumina1
              - object_id: PiticiSpateLumina2

I reckon it is related to shadow: ‘yes’. If I set yes, I get an all black picture. If you delete that line, the result should be OK.

Cheers,
us

Hi uss, perhaps you might be right; nevertheless partA and partB works fine… the problem is when I merge the configurations for the same 3D model. In any case I will try to toggle the ‘shadows’ and I will come back in ~10 days (as I have just left for vacations)

Hello both,

yes shadow parameter may cause the impossibility for three.js to load some textures, and this based on the local client resources available.
Shadows require a lot of extra calculations multiplied by the number of light sources.
I need to check how this can be improved but I’m afraid there is not a lot that can be done except if a THREE.js expert start to analyze the code.

The answer to the last discussion:
if you want to activate the ‘shadow’ parameter (=‘yes’) then the number of lights you put in the model should not go over the limits set by this parameter (Max Texture Image Units) in your PC configuration.
Check it here: WebGL Report

Hello,
is there a way to view the status of an entity like a webcam maybe with a separate screen?
I have two webcams to check and it would be interesting to be able to do it with this card.

Hello, I was also thinking about an overlay window to be started on mouse over a specific object. I will see how to achieve this, please put a feature request on the github repository …

1 Like

Looks great! How do you make lights more focused? I tried with some lights of my model but looks like the light goes through the wall :sweat_smile:

Bathroom light off

Bathroom light on

Have you got any idea why is this happening?

In SH3D check 3D View → Modify 3D View → Walls transparency to opaque
Another reason might be the walls where you have corners. If the wall ends just when touching the other wall and is not going at least half into then SH3D leaves a tinny gap. Like in your second image at the corner just under the green arrow.

2 Likes

Also, for a perfect light rendering you need to put the parameter shadow to yes

@adizanni

Andy,

I was playing around with levels. :grinning:
For 2 levels it works.
Now I’ll try to get some 3 levels cause I have an intermediate level, a children playing room.
Let’s see how it goes.

1 Like

I can confirm now, levels are working. :+1:
I could find no issue in using them, except one little thing.
This is an old issue but it becomes more obvious.
For doors on any level but the ground level, one can see on the bottom of the door a “wobbling” view of the floor. This effect is very similar with the carpet effect we talked about some time ago and I reckon it is related to the way the global light is set, that is, global light is very strong coming from one direction and creates something similar with total reflection.
I don’t see this effect on doors (carpets, or any other objects) if I load the obj into 3D Viewer.
There is an workaround to doors issue.

1

2

Hi Mate, I’m a noob please be gentle, I’m not having any luck, My 3D model well not appear in HASS so I can’t go any further.
I’ve tried using SHD3 template same problem.

Under 3D Model there is an Object List JSON what do I enter here?

Any feedback well be a big help. Thanks

Screenshot 2021-10-02 202910

Hello nick, please paste your card config here (click the show code editor button). The JSON object list is optional.