Your Home Digital Twin: Interactive floor 3d plan

Added v0.9.6 (actionable objects) works only with mouse double click when in non-editing mode.

Let me try to be clearer:

If you have already done a lot of binding based on a model you exported, any change to the model (especially removing objects) generates new objects_id that have to be bound back inside the card configuration (I know this is an annoying limit, but I am trying to overcome it based on our disucssion thread with uss above).

I gave you a dirty (yet working) way to overcome the other problem you raised. Complex objects are not grouped together with one object_id. This means that to make a complex object disappear you need to create as many hide bindings as the number of composing objects. If you follow my procedure you should change the obj file from:

g winshield
v …x…
v …y…
g trunk
v …w…
v…z…
g …
v …

to:

g car
v …x…
v …y…
v …w…
v…z…
v …

of course by removing your old car object and put your new car ojbect, you get into the first problem, objects_id get re-organized.

So my suggestion is: for all the objects that needs to be grouped, do my “export change import” trick. Only after, build the final version of the plan putting all your new objects and do the card binding inside Home Assistant. In other words stabilize your plan before binding 100s of objects…

Hope it helps.

1 Like

Release 0.9.7 is out:

I wanted to get out as much new features as possible even with crappy code. I will take care of cleaning during summer if the adoption rate grows

Release 0.9.10 is out: added object groups to apply entities bindings to multiple objects at the same time.

Dear @adizanni Thanks for this project. I followed your tutorial but get this result:

My model looks like:

I can open it in 3d viewe of windows … any idea what’s wrong here? my files are located here: :

/config/www/3d-floorplan/… I don’t have any jpeg files when exporting with Sweet home 3D.

EDIT: Works now but it looks a bit strange:

Do I have to color differently?

I also have this strange 1/2 message, how did you get it working?

1 Like

add a front_slash behind /local/home/ <<<<< like this :slight_smile:

1 Like

I’m having trouble with using object_groups:

My Yaml

type: custom:floor3d-card
entities:
  - entity: light.garage_light
    type3d: light
    object_id: Light_Fluorescent_Light_Fluorescent_Fluorescent_2133
    light:
      lumens: 500
  - entity: binary_sensor.garage_kiosk_motion
    type3d: hide
    object_id: Object01_1259_2341
    hide:
      state: 'off'
  - entity: binary_sensor.garage_kiosk_motion
    type3d: hide
    object_id: Object01_2340
    hide:
      state: 'off'
  - entity: binary_sensor.garage_kiosk_motion
    type3d: hide
    object_id: Object01_4419_2342
    hide:
      state: 'off'
  - entity: cover.garage_door
    type3d: hide
    object_id: Door_47
    hide:
      state: open
  - entity: cover.garage_door
    type3d: hide
    object_id: Grooves_46
    hide:
      state: open
  - entity: cover.garage_door
    type3d: hide
    object_id: Handle_30_45
    hide:
      state: open
  - entity: cover.garage_door
    type3d: hide
    object_id: Handle_44
    hide:
      state: open
  - entity: sensor.car_charger_sensor
    type3d: hide
    show:
      state: Charging
object_groups:
  - object_group: sensor.car_charger_sensor
    objects:
      - object_id: '2330'
      - object_id: '2331'
      - object_id: '2332'
      - object_id: '2333'
      - object_id: '2334'
path: /local/floorplan/garage/
objfile: garage-3D.obj?rtuy
mtlfile: garage-3D.mtl?ruty
backgroundColor: '#202020'
globalLightPower: 0.4
name: Garage

The Result:

The Error:

Yes, I’ve still the problem of the final “/” in the path.

I suggest your put some textures / colors on the wall and floors, but the rendering is strange it is like it is losing some elements

Hello Jamper,
the object_group solutions is not the easiest to understand:

This is the way to make it work:

entities:
  - entity: sensor.car_charger_sensor
    type3d: hide
    object_id: <car>
    show:
      state: Charging
object_groups:
  - object_group: car
    objects:
      - object_id: '2330'
      - object_id: '2331'
      - object_id: '2332'
      - object_id: '2333'
      - object_id: '2334'

you need to put an object_id in the entity configuration but you can now reference and object_group by enclosing the object_group name into <>. It is not very intuitive but I’ve tried a solution to have object groups without impacting those who are not using them.

1 Like

I did put some textures / colors on walls floor etc but no change :frowning: It won’t show it…

That’s my model

Perhaps you have the same issue I had, I had to have the sh3d file in the folder also.

A very strange issue here. When changing something in the sweet home and saving it it is well saved:

image

I added this walls. saved and created theobject. BUT in lovelace it still loks without the added walls :frowning: Something is going very strange / wrong here… any idea?

Got it … the magic is: Clear Cache of Browser :slight_smile: I have some difficulties to add lightsources. I have some downlights in my ceiling and would like to add them but they don’t appear on the floorplan if I add it… any suggestions?

Another question. How can I zoom in to make the floorplan bigger to fill the max of the panel mode dasboard?

it is a bit small:

You are right the cache, instead of clearing the browser cache you can invalidate it by adding the ?ver=1 and subsequently 2, 3 for any new version to the name of the model and material file ex. Mymodel.obj?ver=1.

The ceiling lamps in the model are appearing as far as they are set within the floor limits. I will do some test to understand the behavior but I have a few in my own model.

Last the zoom. I have not yet given the possibility to record the zoom level. Until then you can zoom using the mouse wheel

  1. Check the position of the lights. It happened to me. The lights were above the height of the wall.

  2. Try the mouse wheel.

Thanks for the hint… will try this… I am missing some more models for laps somehow… also led strips etc… some ideas?

@adizanni another question… why does the object change the names each time i save the floorplan ?

looking good so far …Will now add the lights bit as the object name seems changi each time… i need to finish my floorplan before. how is it possible to “group” multiple lamp in one group so that if entity: lamps.dining_room_wall turns on both lamps atthe wall ? can you give me an example? Awesom you piece of work by the way :slight_smile:

somethiing mybe more “preofessional” could be adding something like a waiting picture / animation while the floorplan is loading?

I just figured it out how to group. I have to admit the syntax is a bit “new” but i can get used :slight_smile:

1 Like

Yes, the object ids are messed up, if, between 2 exports, you remove one or more objects. Adding or modifying objects should not change the ids. For this problem I’m working to a new plugin for Sweethome3d, but it will take some time to implement. In the meantime, try to spend time to make your Sweethome3D model as close as possible to your final home, so that minor changes will not mess up the ids.
For the lamp problem, if you have only 2 lamps, you can always create 2 “light” entities with the same entity id (in your case lamps.dining_room_wall) and two different object_id. The new feature to have object_groups can also be used. You can create an object group with your 2 lamps objects and then reference it into your light entity with this yaml:

entities:
  - entity: lamps.dining_room_wall
    type3d: light
    object_id: <diningroomlamps>
object_groups:
  - object_group: diningroomlamps
    - object_id: lamp_obj_1
    - object_id: lamp_obj_2

let me know if you have trouble.