GithubHelp home page GithubHelp logo

adizanni / floor3d-card Goto Github PK

View Code? Open in Web Editor NEW
420.0 17.0 59.0 5.96 MB

Your Home Digital Twin: aka floor3d-card. Visualize Home Assistant state and perform actions using objects in a 3D home model based on Three.js.

Home Page: https://github.com/adizanni/floor3d-card

License: MIT License

JavaScript 1.49% TypeScript 98.51%
card 3d-models entity-bindings home-assistant

floor3d-card's Introduction

floor3d-card (aka Your Home Digital Twin)

hacs_badge

"Buy Me A Coffee"

Javascript Module for the Home Assistant visualization Card for 3D Models with bindings to entity states.

New Tutorial Alt text Your First Card Alt text

Installation

The card is now accepted in the default repositories of HACS just search for floor3d in the HACS frontend section and install.

You can also download the compiled floor3d-card.js file from the latest release here (https://github.com/adizanni/floor3d-card/releases) and upload it to your www Home Assistant folder

It's required to load this card as module.

- url: /local/pathtofile/floor3d-card.js
  type: module

See Home Assistant documentation for adding custom cards (https://developers.home-assistant.io/docs/frontend/custom-ui/custom-card) and registering JavaScript resources (https://developers.home-assistant.io/docs/frontend/custom-ui/registering-resources).

Model Design and Installation

Use a 3D modeling software. As you have to model your home I would suggest this software (the one I tested): http://www.sweethome3d.com/. Model your home with all needed objects and furniture (I will post here some hints on how to better design your home for best results with the custom card). For further instruction I assume you will use SweetHome3D. At the end of your modeling, you need to export the files in obj format using '3D View \ Export to OBJ format ...', specify the folder where you want to store the output (be careful there are multiple files) Copy the full set of files (minimum is the .obj file and .mtl file) to a sub folder of /config/www in Home assistant. Be aware that when you remove objects from the model the object ids get reassigned: This means that after a modification and re-export of your model it is possible you need to redo the bindings with the new object names. The new feature (#7) is now available in this repository https://github.com/adizanni/ExportToHASS. It is a new plugin for Sweethome3D. It is still very experimental, use at your own risk, and please follow the instructions. It could be also good practice to make the objects invisble instead of removing them (not yet tested if this solution preserves the objects ids).

If you want to have an object that groups together other objects (ex a mannequin is composed by 100s of objects you want to treat it as one), you can follow this trick: https://community.home-assistant.io/t/live-3d-floor-plan-with-interactive-objects/301549/78?u=adizanni.

Based on some feedback there are some open issues which I will try to fix, please follow these rules if you want things to go smooth:

  • Place the upper left corner of your 2D floor model at 0,0 coordinates otherwise the camera setting will work weirdly (due to calculation on the coordinates that I need to fix)

When you are finished, configure a new card (either in panel mode or regular) with the following options:

Note: GLB format

If you want to generate a glb file instead of the wavefront (obj) file to load the card (it is faster and more optimized), you can follow this procedure in Windows: Install nodejs here https://nodejs.org/dist/v16.14.2/node-v16.14.2-x64.msi Once installed you can open a command prompt (or powershell) and type the following command:

npm install -g obj2gltf

Then (always in the same command prompt) you just have the full wavefront obj model (either created with the builtin function or with my plugin) to a folder (obj, mtl, pictures), move to the folder (cd ) and type the following command:

obj2gltf --checkTransparency -i home.obj -o home.glb

Assuming your model is called home.obj. You wait for some time (from few seconds to minutes) and when it is completed you can take the glb file and copy it to the www folder of Home Assistant. It is a self containing binary object so you just need that one file to load the model.

Options

Name Type Default Description
type string Required custom:floor3d-card.
name string Floor 3d the name of the card.
entities array none list of enitities to bind to 3D model objects.
object_groups array none list of object groups to apply grouped entity bindings.
style string none the style that will be applied to the canvas element of the card.
path string Required path to the Waterforont obj (objects), mtl (material) and other files.
objfile string Required object file name (.obj) for Waterfront format or glb file name for the binary (condensed) 3d format (still experimental).
mtlfile string Required material file name (.mtl) Waterfront format. Only relevant when objefile has obj extension (no glb)
backgroundColor string '#aaaaaa' canvas background color: #RGB notation (ex #aaaaaa), color name (ex. 'white') or 'transparent' for a transparent background
header string 'yes' if the header will be displayed or not
editModeNotifications string 'yes' 'yes' to use the double click in edit mode to pop up the object ids or the camera position, 'no' to stop displaying popups
selectionMode string 'no' 'yes' to activate the selection mode and select group of objects, the list of selected objects will appear in the console
globalLightPower float 0.5 intensity of the light illuminating the full scene it can also the name of a numeric sensor
shadow string no 'yes' if lights cast shadow on object. This is realistic but impacts performances. By default wall, floors and objects with "door" in the name, receives and cast shadows
extralightmode string no 'yes' to activate the extra light mode. In this mode the max number of light who cast shadow at the same time (max texture unit image) is limited to the light that are switched with performance penalties
overlay string no 'yes' if you want to show an overlay panel for displaying data on the objects on click
click string no 'yes' if you want to enable the click event. This will automatically disable the double click, you can manage the click behaviour at entity level via the action parameter
lock_camera string no 'yes' to stop the zoom and rotate camera actions on the model
show_axes string no 'yes' to show the axes in the scene. It can help define the direction vector for the spotlight
sky string no 'yes' to show a sky a ground and a sun to reproduce a photorealistic home representation with sun position determined by the sun.sun entity
north string see desc north is the direction of the north on the x-z plane. ex. {x: 0, z: 1} (this is the default) for a north in the z positive direction (see axes explanation). Goes with sky yes
overlay_<style> string various allow to manage the aspect of the overlay panel (colors, fonts, etc.)

*Note: with the introdction of the sky, the illumination will behave strangely when the sun will go above the ceiling. I've given the possibility to manage what I call a transparent slab. In sweethome3d put a transparent slab object (transparent box) on top of your floor and call it transparent_slab. If you use my plugin (Export to HA) this will be managed by the card by stopping the sunlight to come through from the above. It is also possible to activate the ceiling in Sweethome3d. **

**Note 2: a valid north setting example:

north:
  x: -1
  z: 0

For each entity in the entities list you need to specify the following options:

Name Type Default Description
entity string Required your entity id or reference to an object_group via <object_group> reference (this last feature is not applicable for text and gesture
entity_template string none a JavaScript template formatted as follow: [[[ template]]]. Template is a valid Javascript command. With $entity you specify the state of the entity
action string none on-click behaviour: it can be 'more-info' to open the more-info dialog for the entity associated to the clicked objec; it can be 'overlay' to display the state of the entity in the ovelay panel; it can be 'default' to do the same action that used to be associated to the double click action.
object_id string Required the name of the object in the model to bind to your entity.
type3d string Required the type of object binding. Values are: light, hide, color, text, gesture, door, rotate

Note: to facilitate the configuration you can load the model without entity bindings and you will be able to show the object_id you want to bind to by double clicking on the object

For each object_group in object_groups:

Name Type Default Description
object_group string Required your object group name to be referenced by the entity field via <object_group> reference (braces <> have to wrap the object_group name)
objects array Required the list of object_ids in your group.

The objects array contains a list of

Name Type Default Description
object_id string Required object_id of the object in the group

Here is a Tutorial for Object Groups:

Object Groups Tutorial
Alt text

For each zoom in zoom_areas

Name Type Default Description
zoom string Required the name of the zoom area (ex. Kitchen).
object_id string Required the object id of the target of the zoom (ex. room_1_1)
rotation object {x:0, y:0, z:0} the rotation of the camera pointing to the area.
direction object {x:0, y:0, z:0} the direction vector of the canera pointing to the area.
distance number 500 the number of cm from the camera to the target point
level number - the index of the level. If set, selecting this zoom level will show the level and hide the other levels.

Client Side Javascript template example

- entity: sensor.temperature
  type3d: color
  colorcondition:
    - color: red
      state: hot
  object_id: your_object
  entity_template: '[[[ if ($entity > 25) { "hot" } else { "cool" } ]]]'

The example above shows a potential usage of the Client Side Javascript template example. If the state of the entity is greater than 25, the templated state of the entity will be 'hot' thus the object 'your_object' will become red

Camera Rotation, Camera Position and Camera direction

For camera rotation and position recording config:

camera_position:
  x: <x coordinate of the recorded camera positioon>
  y: <y coordinate of the recorded camera positioon>
  z: <z coordinate of the recorded camera positioon>
camera_rotate:
  x: <x coordinate of the recorded camera rotation>
  y: <y coordinate of the recorded camera rotation>
  z: <z coordinate of the recorded camera rotation>
 camera_target:
  x: <x coordinate of the recorded camera target>
  y: <y coordinate of the recorded camera target>
  z: <z coordinate of the recorded camera target>

When in edit mode you can double click in an empty model space to retrieve the current postition and rotation of the camera. You can retrieve the 2 sets of coordinates from the prompt box that will appear. You can then manually copy the content and paste to the card config in code editor mode. Thanks to this the new default position of the camera will be set to the configured coordinates.

An image explaining the coordinate concepts:

image

Overlay and action

You first put overlay yes in the Appearance section of the card visual editor. Then a few other Overlay parameters appear to customize the overlay: alignment, size, fonts, colors, etc. All this will create a panel that will sit on top of the model canvas. You will also have to put the click parameter to yes for it to work. Then in each entity you have the action parameter; this tells what to do when you click on the object associated to the entity. If action = overlay for an entity, it means that when you click on it, it will display the name and state of the entity inside the overlay.

Example:

........
overlay: 'yes'
overlay_bgcolor: transparent
.........
click: 'yes'
entities:
  - entity: <your_entity>
    object_id: <your_object_id>
    action: overlay
    .........

When you click on the object, the entity name and state will appear in the overlay panel

In this other example the click will trigger the pop of the more-info dialog (overlay not needed):

.........
click: 'yes'
entities:
  - entity: <your_entity>
    object_id: <your_object_id>
    action: more-info
    .........

Camera

For camera, example config:

entities
  - entity: camera.<camera name>
    type3d: camera
    object_id: <an object_id in the model you want to associate with the camera>

there are no specific parameters. Double clicking on the object will show a pop-up dialog with the camera picture.

Lights

For light example config:

entities:
  - entity: <a light entity id>
    type3d: light
    object_id: <an object id in the 3D model you want to postion the light on>
    light:
      lumens: <max light lumens range: 0-4000 for regular led/bulb lights>
      color: <light color, if the light is a led with variable color this parameter will be ignored in favor of color and temperature attributes>
      decay: <0-2, the speed of decay for the light between the light source and the distance>
      distance: <number of cm for which the light will have an effect on the scene>
      shadow: <'no', if you do not want this light to case a shadow. This is to cope with the limit of max lights casting shadow in a model>
      vertical_alignment: <'top', 'middle', 'bottom', when you activate shadows it allows to avoid that the lamp itself block the light>
      light_target: when this parameter is filled, the light becomes a spotlight, you need to put here the object_id of the target of the spot
      light_direction: when this parameter is filled, the light becomes a spotlight, you put here the direction vector of the spotlight. It can only be changed in the code editor. in the format x: xxx, y: yyy, z: zzz. See coordinate explanation above

Light behaviour is obvious: the light_name will illuminate when the bound entity in Home Assistant will be turned on and viceversa. If the light has color and brightness attributes they will be used to render the light. A double click on the light object will toggle the light (so far the events in iOS and Android are not yet managed as the events are captured by the OrbitContol of Three.js library and I have not yet fully understood the behaviour)

Hide

For hide example config:

entities
  - entity: <a binary sensor entity id>
    type3d: hide
    object_id: <an object_id in the model you want to hide if condition is true>
    hide:
      state: <the state of the entity triggering the hiding of the object: ex 'off'>

Hide behavour: the object_id will be hidden when the state of the bound entity will be equal to the state value

Show

For show example config:

entities
  - entity: <a binary sensor entity id>
    type3d: show
    object_id: <an object_id in the model you want to show if condition is true>
    show:
      state: <the state of the entity triggering the showing of the object: ex 'off'>

Show behavour: the object_id will be visible when the state of the bound entity will be equal to the state value

Color

For color example config:

entities:
  - entity: <a discrete sensor entity id>
    type3d: color
    object_id: <the object id in the 3D model that has to change color based on the state of the entity>
    colorcondition:
      - color: <color to paint if condition for the entity id in the stat to be true, it can be in Hex, html or rgb format (ex. '#ff0000' or 'red' or '255, 0, 0' >
        state: <state of the entity>
      .......

Color behavour: the object_id will be painted in the color when the state of the bound entity will be equal to the state value

Text

For text example config:

entities:
  - entity: <a numeric or text sensor entity id>
    type3d: text
    object_id: <the plane object id in the 3D model that will allow the display of the state text>
    text:
      span: <percentage span of text in the object plane> (ex. 50%)
      font: <name of the font text ex:'verdana'>
      textbgcolor: <background color for the text. ex: '#000000' or 'black'>
      textfgcolor: <foreground color for the text. ex: '#ffffff' or 'white'>
      attribute: the optional attribute of the entity you want to show on the object
      .......

Text behaviour: the object_id representing the plane object (ex. mirror; picture, tv screen, etc) will display the state text for the entity

Room

For room example config:

entities:
  - entity: <an entity>
    type3d: room
    object_id: <a room object (generally the floor) with a name containing "room". >
    room:
      eleveation: <Number of cm going from the floor to the ceiling to set the parallelepiped height of the new room object>
      transparency: <Percentage of transparency of the room object>
      color: <color of the parallelipiped: ex: '#ff0000' or 'red'>
      label: <yes or no, default no: shows a label with the state of the entity or attribute (see below)>
      span: <percentage span of text in the object plane> (ex. 50%)
      font: <name of the font text ex:'verdana'>
      textbgcolor: <background color for the text. ex: '#000000' or 'black'>
      textfgcolor: <foreground color for the text. ex: '#ffffff' or 'white'>
      attribute: the optional attribute of the entity you want to show on the object
    colorcondition:
      - color: <>
        state: <>

Room will draw a parallelipiped highlighting the room. Pretty static for the moment, it will become more dynamic with new parameters. It works with all room (floor) objects containing the word "room" in the object name. Rooms that have not a rectangular shape will have a paralllipiped anyway (not managing complex shapes).

You can add a colorcondition section for rooms.

image

Gesture

For gesture (action) example config:

entities:
  - entity: <an actionable entity>
    type3d: gesture
    object_id: <an object id in the 3D model you want to double click to trigger the gesture/action>
    gesture:
      domain: <the domain of the service to call>
      service: <the service to call>

when you double click on the object, the domain.service is called with data { entity_id: entity } (so far the iOS and Android events are not yet managed as the events are captured by the OrbitContol of Three.js library and I have not yet fully understood the behaviour)

Door

For door example config:

entities:
  - entity: <a on/off  entity>
    type3d: door
    object_id: <an object or object_group id representing the door>
    door:
      doortype: <'slide' for sliding doors/windows, 'swing' for swinging doors windows>
      side: 'up', 'down', 'left' and 'right', the border of the door that is the axis of rotation
      direction: 'inner' and 'outer', the direction of rotation
      hinge: the object_id of the door/window hinge
      pane: the object_id of the pane (main component) of the door/window
      degrees: the degrees of the door opening

a door/window object/entity is rotated by the sepcified degrees (swing) or slid (slide) along the axis defined in 'side' and the direction defined in 'direction'. You can use the object group to list the moving objects of the door. If you do that you can now select the hinge object or the pane object. When you select the hinge object only the direction parameter is used as the side and axix of rotation are bound to the hinge position and shape. Time allowing I will try to do a tutorial. It is getting complex.....

Different cases here:

For a Swing door:

Type Direction Side Degrees Comment
hinge object specified x x -
pane object specified x x x -
no object specified x x x the object_id is taken as a pane or the first object of the group

For a slide door (only pane object):

Type Direction Side Percentage Comment
pane object specified x x x -
no pane object specified x x x the object_id is taken as a pane or the first object of the group

Example of configuration for a window (Double French Window) exported using the ExportToHass plugin:

image

The entity section:

- entity: your_domain.your_door_entity
  object_id: <WindowDiningRoomLeft>
  type3d: door
  door:
    doortype: swing
    direction: inner
    degrees: '50'
    hinge: WindowDiningRoomLeft_4

And the related object group:

- object_group: WindowDiningRoomLeft
  objects:
    - object_id: WindowDiningRoomLeft_7
    - object_id: WindowDiningRoomLeft_6
    - object_id: WindowDiningRoomLeft_5

Result:

image

image

Cover

entities:
  - entity: <cover.your_cover_entity>
    type3d: cover
    object_id: <object_id or group of the moving parts of the cover, the blades and base of a roller shutter>
    cover:
      pane: <object_id represents the moving parts that have to fully disappear when the cover is fully opened>
      side: <up or down, direction of opening

It is an experimental implementation of cover entities.

image

image

Rotate

For rotate example config:

entities:
  - entity: <a on/off  entity>
    type3d: rotate
    object_id: <an object or object group id representing the thing to be rotated>
    rotate:
      axis: <'x', 'y' and 'z', along which axis the object should rotate>
      round_per_seconds: 1-4, speed of rotation. Use a negative number to spin the other direction.
      percentage:
      hinge: the object acting as a pivot when you use an object group to represent the moving parts.

an object to rotate (animation) when the associated entity will be 'on'. If you use an object group and you specify the hinge, all moving parts in the group will rotate aroung the hinge center point.

Object group example

entities:
  - entity: light.bulb
    type3d: light
    object_id: <lamp> (refers to the object_group defined below, braces <> have to wrap the object_group name)
    light:
      lumen: 900
object_groups:
  - object_group: lamp
    objects:
      - object_id: lamp_base_20
      - object_id: lamp_bulb_1

Example

To give it a try please, load the example folder files in a folder within /config/www of your Home Assistant. Create a new Panel View add Floor3d-card and cut and paste the following config:

type: 'custom:floor3d-card'
entities:
  - entity: <your light entity id>
    type3d: light
    object_id: sweethome3d_opening_on_hinge_2_LampSide_31
    light:
      lumens: 500
  - entity: <your binary sensor entity id (example a magnet sensor for a window)>
    type3d: color
    object_id: sweethome3d_window_pane_on_hinge_1_50
    colorcondition:
      - state: 'on'
        color: '#00ff00'
      - state: 'off'
        color: '#ff0000'
path: /local/home2/
objfile: MyExampleHome2.obj
mtlfile: MyExampleHome2.mtl
backgroundColor: '#000001'
globalLightPower: 0.4

Working with levels (> v1.3.0)

If your Sweethome3d model has levels and you use the ExportToHass (Download) plugin, the card will show the levels with some buttons appearing at the top left of the 3d canvas. There is one button for each level and one butto for "all" levels. When you click on the button of the level, only that level will become visible in the card, and if you click on the "all" button all levels will appear in the card in a total view of your model. All other functionalities will work as before.

Note about GPUs

For one who has a computer with 2 (or more) gpus, like in laptops with a second NVIDIA gpu, one may notice that either Chrome or Firefox actually use the internal Intel UHD Graphics instead of NVIDIA. That makes the rendering slow and the experience frustrating. Steps to dramatically improve the rendering.

  • A. Firefox In NVIDIA Control Panel 3D Settings->Manage 3D Settings->Program Settings Tab->1. Select a program to customise->Mozilla Firefox โ†’ 2. Select The preferred graphics processor->High performance NVIDIA โ†’ 3. OpenGL rendering GPU โ†’ NVIDIA; In Firefox address bar, type about:config. Search โ€˜webgl.disable-angleโ€™ and set it to true (that instructs Firefox to use OpenGL).

  • B. Chrome In NVIDIA Control Panel 3D Settings->Manage 3D Settings->Program Settings Tab->1. Select a program to customise->Google Chrome-> 2. Select The preferred graphics processor->High performance NVIDIA โ†’ 3. OpenGL rendering GPU โ†’ NVIDIA; In Chrome address bar, type chrome://flags/#use-angle. Select OpenGL. Restart Chrome; In Chrome address bar, type chrome://gpu. Search for โ€˜GL_RENDERERโ€™ and check if it say 'ANGLE (NVIDIA โ€ฆ OpenGL โ€ฆ ); I still experiment with โ€˜chrome://flags/#enable-drdcโ€™.

  • C. Edge In NVIDIA Control Panel 3D Settings->Manage 3D Settings->Program Settings Tab->1. Select a program to customise->Edge-> 2. Select The preferred graphics processor->High performance NVIDIA โ†’ 3. OpenGL rendering GPU โ†’ NVIDIA; In Chrome address bar, type edge://flags/#use-angle. Select OpenGL. Restart Edge; I couldnโ€™t figure out how to do it in Edge. It should be like chrome, because Edge is chromium. But for some reason it doesnโ€™t work. Checking edge://gpu GL_RENDERER shows Direct3D11 instead of OpenGL.

floor3d-card's People

Contributors

adizanni avatar jvital2013 avatar ndbroadbent avatar uspass avatar vladm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

floor3d-card's Issues

3D floor plan is not showing

Hi,
I followed the YouTube tutorial to install the custom card, but my floor plan is not displayed in the Home Assistant GUI. I got this error:

Source: components/system_log/__init__.py:190 
First occurred: 12:29:30 (17 occurrences) 
Last logged: 12:37:51

https://my_domain.duckdns.org:8123/hacsfiles/floor3d-card/floor3d-card.js:739:547477 Error
https://my_domain.duckdns.org:8123/hacsfiles/floor3d-card/floor3d-card.js:739:546060 TypeError: undefined is not an object (evaluating 't.states[e.entity].state')
https://local_ip:8123/hacsfiles/floor3d-card/floor3d-card.js:739:547365 Uncaught Error
https://local_ip:8123/hacsfiles/floor3d-card/floor3d-card.js:739:545973 Uncaught TypeError: Cannot read property 'state' of undefined

And this is displayed when I'm configuring the card via GUI:
Screen Shot 2021-06-16 at 12 50 39

I attached a copy of my SweetHome floor plan exported like Obj.

Plano 3D-apto.zip

Thank you for your help to resolve this issue.

Object ID of ceiling lights

I would like to know how I can find the ID of simple ceiling 'down lights' that arent visible on the model.

Plan doesnt show up

Hi,

i use a raspi4 with M2 ssd.
Core and Supervisor 6.6, home assistant os 6.1

Roomplan made with sweet home 3d.

I can see the preview in the card, but the room doesnt show up in lovelace?

Allways the same error:

Logger: frontend.js.latest.202106030
Source: components/system_log/init.py:190
First occurred: 14:11:52 (3 occurrences)
Last logged: 14:12:50

http://xxx/hacsfiles/floor3d-card/floor3d-card.js?hacstag=3617765380911:1005:586839 Uncaught Error

SC of preview:

image

Any suggestions? Thanks in advance!

Interaction with entities

Hiya,

This is really nice and easy to get started with, beats trying to render models into SVGs.

Is there a plan to add interaction with entities? I think you're mostly there, since clicking on an object within the model pops up a dialog box presenting the name of the entity, all I would think this would need, is some code adding in to check whether an object has a <tap/hold/hover>_action configuration, if not present the pop up that currently exists, but if so follow the action configuration?

I'd love to kill out ha-floorplan and picture elements + card-tools altogether !

3D Card limitation

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 ๐Ÿ˜ฆ :-). 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
https://drive.google.com/file/d/1w20TOZnNC4lVxxC2Dl9a-k9XOMnjaElh/view?usp=sharing)

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

BR,
Christos

PartAB.txt
PartA.txt
PartB.txt

You have 1 Lovelace items not loading properly

Checklist:

  • I updated to the latest version available
  • I cleared the cache of my browser

Release with the issue:

Last working release (if known):

Browser and Operating System:

Description of problem:

Javascript errors shown in the web inspector (if applicable):


Additional information:

Gestures - popup box instead of service call

When using gestures - I get a popup box with the object name when double clicking it instead of it doing the action requested.

- entity: light.office_fan_lights
type3d: gesture
object_id: CeilingFan6820_3_3_1099
gesture:
domain: light
service: turn_off

When I double click the fan, a pop-up box appears like below and the entity does not turn off.

image

image

Feature Request: Colored lights, support for "r, g, b" color format, template support for color

Is your feature request related to a problem? Please describe.
Supporting this format would be a good preparation before template support will be added.

The marked lamp glows blue. The problem is that the light body itself is not colored in blue. Just for this reason it would be important that this body shines in the corresponding color. This would be possible with colorconditiontemplates.
grafik

Something like this could be possible to adjust the color dynamically with a Jinja2 Template when template support is added:
{{ state_attr("light.wled_light", "rgb_color") | regex_replace('[()]+', '') }}

Describe the solution you'd like
Adding colorcondition to light. Adding the (r, g, b) support for colorcondition.

Describe alternatives you've considered
NaN

Additional context

Configuration with (r, g, b) support:

- entity: light.wled_light
  type3d: color
  object_id: mylightobjectid
  colorcondition:
    - color: "100, 255, 20"
      state: on

Configuration with (r, g, b) and template support:

- entity: light.wled_light
  type3d: color
  object_id: mylightobjectid
  colorcondition:
    - colorrgbtemplate: "{{ state_attr("light.wled_light", "rgb_color") | regex_replace('[()]+', '')  }}"
      state: on

Typescript example to convert rgb to hex:

function componentToHex(c: number) {
  var hex = c.toString(16)
  return hex.length == 1 ? "0" + hex : hex
}

function rgbToHex(r: number, g: number, b: number) {
  return "#" + componentToHex(r) + componentToHex(g) + componentToHex(b)
}


console.log(rgbToHex(100, 51, 255)); // #6433ff

Use entity state for `globalLightPower`

Is your feature request related to a problem? Please describe.
I would like to set the global lighting value based on an entity state so that my floorplan outside lighting matches real life.

Describe the solution you'd like
Attach the globalLightPower to an entity state

Describe alternatives you've considered
So far not something that can be configured dynamically

Additional context
Add any other context or screenshots about the feature request here.

type3d:text - always default values

Checklist:

  • [ x] I updated to the latest version available
  • [ x] I cleared the cache of my browser

Release with the issue:

Last working release (if known):

Browser and Operating System:

Description of problem:
When setting type3d:text , font, bg,fg colors are ignored
I've debugged a little and in _updateTextCanvas looks like entity.text is an array and data is on element 0, so it always reverts to the default values

Javascript errors shown in the web inspector (if applicable):


Additional information:
P.S. type3d:text works only on simple objects, with names made only out of numbers, otherwise the object becomes black and no text is displayed.
Capture

Mouse position when double click is wrong.

Checklist:

  • I updated to the latest version available
  • I cleared the cache of my browser

Release with the issue:
Any
Last working release (if known):
None
Browser and Operating System:
All, windows 10

Description of problem:
Computed mouse position when double click on an object is wrong. To get the action one has to double click on the left of the object (related to the viewport).
The issue gets worse when camera is far.

Javascript errors shown in the web inspector (if applicable):


Additional information:

Light Power, Browser Display problem

Hi, this is a really nice card! I want to report some small problems to help you improve the final effect. The light is too strong (the lumens used are different from those in the real world), the light is too concentrated in a small area, a more diffused effect would be better. Sometimes, if I set too large a lumen value, the light will pass through the wall and illuminate other rooms.
Another problem is that browsers (both firefox and chrome) often block the page and it is necessary to reload the page (I'm using HA on a raspberry 4 with 4GB of RAM and view the browser on another pc - 32GB RAM, good graphics card, etc - in the same local network).
Another problem is the rendering of some furniture textures in Firefox 90.0 which maybe don't load, because the custom furniture (built from cube, cylinder, etc on SH3D) is white. In Chrome all textures are loaded correctly.
Thanks for your work, I hope you will continue to work on this fantastic project!

JavaScript error about Promise TypeError - property 'attributes' of undefined

floor3d-card.js:1062 Uncaught (in promise) TypeError: Cannot read property 'attributes' of undefined
at floor3d-card.js:1062
at Array.forEach ()
at HTMLElement.set hass [as hass] (floor3d-card.js:1062)
at HTMLElement.value (76a58ed6.js:1189)
at 76a58ed6.js:1189
at Array.map ()
at HTMLElement.value (76a58ed6.js:1189)
at HTMLElement.value (76a58ed6.js:1189)
at HTMLElement.value (76a58ed6.js:1189)
at HTMLElement.performUpdate (app.f08a72d3.js:1)

Since 1.1.0 the 3D axis is being rendered on the model

Checklist:

  • I updated to the latest version available (1.1.0)
  • I cleared the cache of my browser

Release with the issue: 1.1.0

Last working release (if known): 1.0.6

Browser and Operating System: Chrome + Windows 10

Description of problem: Since 1.1.0 the 3D axis is being rendered on the model

Screen shot provided below:
image

Javascript errors shown in the web inspector (if applicable):

There is an error on z index, not sure if its related.

  FLOOR3D-CARD   Version 1.1.0    
floor3d-card.js?hacstag=361776538110:1062 New Card
floor3d-card.js?hacstag=361776538110:1062 Set Config
floor3d-card.js?hacstag=361776538110:1062 First updated start
floor3d-card.js?hacstag=361776538110:1062 Start Build Renderer
floor3d-card.js?hacstag=361776538110:1062 Path: /local/floorplan/
floor3d-card.js?hacstag=361776538110:1062 End Build Renderer
floor3d-card.js?hacstag=361776538110:1062 First updated end
floor3d-card.js?hacstag=361776538110:1062 Material loaded start
floor3d-card.js?hacstag=361776538110:1062 Material loaded end
floor3d-card.js?hacstag=361776538110:1062 New Card
floor3d-card.js?hacstag=361776538110:1062 Set Config
floor3d-card.js?hacstag=361776538110:1062 First updated start
floor3d-card.js?hacstag=361776538110:1062 Start Build Renderer
floor3d-card.js?hacstag=361776538110:1062 Path: /local/floorplan/
floor3d-card.js?hacstag=361776538110:1062 End Build Renderer
floor3d-card.js?hacstag=361776538110:1062 First updated end
floor3d-card.js?hacstag=361776538110:1062 Material loaded start
floor3d-card.js?hacstag=361776538110:1062 Material loaded end
floor3d-card.js?hacstag=361776538110:1062 Object loaded start
floor3d-card.js?hacstag=361776538110:1062 Add Objects Start
floor3d-card.js?hacstag=361776538110:1062 Add 3D Object End
floor3d-card.js?hacstag=361776538110:1062 Object loaded end
floor3d-card.js?hacstag=361776538110:1062 Show canvas
floor3d-card.js?hacstag=361776538110:1062 Resize canvas start
floor3d-card.js?hacstag=361776538110:1062 Resize canvas end
floor3d-card.js?hacstag=361776538110:1062 Object loaded start
floor3d-card.js?hacstag=361776538110:1062 Add Objects Start
floor3d-card.js?hacstag=361776538110:1062 Add 3D Object End
floor3d-card.js?hacstag=361776538110:1062 Object loaded end
floor3d-card.js?hacstag=361776538110:1062 Show canvas
floor3d-card.js?hacstag=361776538110:1062 Resize canvas start
floor3d-card.js?hacstag=361776538110:1062 Resize canvas end
floor3d-card.js?hacstag=361776538110:1062 Uncaught TypeError: Cannot read properties of null (reading 'constructor')
    at HTMLElement._getZIndex (floor3d-card.js?hacstag=361776538110:1062)
    at HTMLElement._getZIndex (floor3d-card.js?hacstag=361776538110:1062)
    at HTMLElement._getZIndex (floor3d-card.js?hacstag=361776538110:1062)
    at HTMLElement._getZIndex (floor3d-card.js?hacstag=361776538110:1062)
    at HTMLElement._zIndexChecker (floor3d-card.js?hacstag=361776538110:1062)
    at floor3d-card.js?hacstag=361776538110:1062
_getZIndex @ floor3d-card.js?hacstag=361776538110:1062
_getZIndex @ floor3d-card.js?hacstag=361776538110:1062
_getZIndex @ floor3d-card.js?hacstag=361776538110:1062
_getZIndex @ floor3d-card.js?hacstag=361776538110:1062
_zIndexChecker @ floor3d-card.js?hacstag=361776538110:1062
(anonymous) @ floor3d-card.js?hacstag=361776538110:1062
setInterval (async)
_onLoaded3DModel @ floor3d-card.js?hacstag=361776538110:1062
(anonymous) @ floor3d-card.js?hacstag=361776538110:1062
(anonymous) @ floor3d-card.js?hacstag=361776538110:1062
load (async)
load @ floor3d-card.js?hacstag=361776538110:1062
load @ floor3d-card.js?hacstag=361776538110:1062
_onLoaded3DMaterials @ floor3d-card.js?hacstag=361776538110:1062
(anonymous) @ floor3d-card.js?hacstag=361776538110:1062
(anonymous) @ floor3d-card.js?hacstag=361776538110:1062
load (async)
load @ floor3d-card.js?hacstag=361776538110:1062
load @ floor3d-card.js?hacstag=361776538110:1062
display3dmodel @ floor3d-card.js?hacstag=361776538110:1062
firstUpdated @ floor3d-card.js?hacstag=361776538110:1062
_$AE @ floor3d-card.js?hacstag=361776538110:25
performUpdate @ floor3d-card.js?hacstag=361776538110:25
scheduleUpdate @ floor3d-card.js?hacstag=361776538110:25
_$EC @ floor3d-card.js?hacstag=361776538110:25
async function (async)
_$EC @ floor3d-card.js?hacstag=361776538110:25
requestUpdate @ floor3d-card.js?hacstag=361776538110:25
o @ floor3d-card.js?hacstag=361776538110:25
u @ floor3d-card.js?hacstag=361776538110:25
Z @ floor3d-card.js?hacstag=361776538110:37
dc @ floor3d-card.js?hacstag=361776538110:1062
s @ 425647f8.js:3103
(anonymous) @ 425647f8.js:3103
d @ 425647f8.js:3103
c @ 425647f8.js:3103
a @ 425647f8.js:3103
value @ 76a58ed6.js:1189
value @ 76a58ed6.js:1189
t.addEventListener.once @ 76a58ed6.js:1189
i @ app.f08a72d3.js:5264
(anonymous) @ 425647f8.js:3103
Promise.then (async)
(anonymous) @ 425647f8.js:3103
d @ 425647f8.js:3103
c @ 425647f8.js:3103
a @ 425647f8.js:3103
value @ 76a58ed6.js:1189
(anonymous) @ 76a58ed6.js:1189
value @ 76a58ed6.js:1189
value @ 76a58ed6.js:1189
value @ 76a58ed6.js:1189
performUpdate @ app.f08a72d3.js:1
_$EC @ app.f08a72d3.js:1
async function (async)
_$EC @ app.f08a72d3.js:1
requestUpdate @ app.f08a72d3.js:1
o @ app.f08a72d3.js:1
_ @ app.f08a72d3.js:1
r @ 76a58ed6.js:1189
value @ e6e55a55.js:2043
(anonymous) @ e6e55a55.js:2043
setTimeout (async)
(anonymous) @ f6ff03da.js:1
(anonymous) @ 8da16d75.js:1
requestAnimationFrame (async)
window.requestAnimationFrame @ 8da16d75.js:1
i @ f6ff03da.js:1
value @ e6e55a55.js:2043
_$AE @ app.f08a72d3.js:1
performUpdate @ app.f08a72d3.js:1
_$EC @ app.f08a72d3.js:1
async function (async)
_$EC @ app.f08a72d3.js:1
requestUpdate @ app.f08a72d3.js:1
o @ app.f08a72d3.js:1
_ @ app.f08a72d3.js:1
u @ app.f08a72d3.js:5264
r @ e6e55a55.js:1516
p @ app.f08a72d3.js:5264
T @ app.f08a72d3.js:5264
_$AI @ app.f08a72d3.js:5264
O @ app.f08a72d3.js:5264
update @ app.f08a72d3.js:5264
performUpdate @ app.f08a72d3.js:1
_$EC @ app.f08a72d3.js:1
async function (async)
_$EC @ app.f08a72d3.js:1
requestUpdate @ app.f08a72d3.js:1
set @ app.f08a72d3.js:1
value @ e6e55a55.js:2759
async function (async)
value @ e6e55a55.js:2759
value @ e6e55a55.js:2759
_$AE @ app.f08a72d3.js:1
performUpdate @ app.f08a72d3.js:1
_$EC @ app.f08a72d3.js:1
async function (async)
_$EC @ app.f08a72d3.js:1
requestUpdate @ app.f08a72d3.js:1
o @ app.f08a72d3.js:1
_ @ app.f08a72d3.js:1
u @ app.f08a72d3.js:5264
r @ e6e55a55.js:2537
value @ app.f08a72d3.js:29560
value @ app.f08a72d3.js:29560
_currentLoadProm.l.then._currentLoadProm @ app.f08a72d3.js:29560
Promise.then (async)
value @ app.f08a72d3.js:29560
performUpdate @ app.f08a72d3.js:1
_$EC @ app.f08a72d3.js:1
async function (async)
_$EC @ app.f08a72d3.js:1
requestUpdate @ app.f08a72d3.js:1
o @ app.f08a72d3.js:1
_ @ app.f08a72d3.js:1
r @ app.f08a72d3.js:29560
i @ app.f08a72d3.js:35925
p @ app.f08a72d3.js:5264
T @ app.f08a72d3.js:5264
_$AI @ app.f08a72d3.js:5264
O @ app.f08a72d3.js:5264
update @ app.f08a72d3.js:5264
performUpdate @ app.f08a72d3.js:1
_$EC @ app.f08a72d3.js:1
async function (async)
_$EC @ app.f08a72d3.js:1
requestUpdate @ app.f08a72d3.js:1
o @ app.f08a72d3.js:1
_ @ app.f08a72d3.js:1
u @ app.f08a72d3.js:5264
n @ app.f08a72d3.js:35925
p @ app.f08a72d3.js:5264
T @ app.f08a72d3.js:5264
_$AI @ app.f08a72d3.js:5264
O @ app.f08a72d3.js:5264
update @ app.f08a72d3.js:5264
performUpdate @ app.f08a72d3.js:1
_$EC @ app.f08a72d3.js:1
async function (async)
_$EC @ app.f08a72d3.js:1
requestUpdate @ app.f08a72d3.js:1
set @ app.f08a72d3.js:1
value @ app.f08a72d3.js:30632
(anonymous) @ app.f08a72d3.js:30632
s @ core.9dd583b2.js:1
(anonymous) @ core.9dd583b2.js:1
Promise.then (async)
i @ core.9dd583b2.js:1
d @ core.9dd583b2.js:1
subscribe @ core.9dd583b2.js:1
E @ core.9dd583b2.js:1
(anonymous) @ core.9dd583b2.js:1
Promise.then (async)
(anonymous) @ core.9dd583b2.js:1
(anonymous) @ core.9dd583b2.js:1
(anonymous) @ core.9dd583b2.js:1
floor3d-card.js?hacstag=361776538110:1062 Resize canvas start
floor3d-card.js?hacstag=361776538110:1062 Resize canvas end

Additional information:

Feature request to animate objects

Is your feature request related to a problem? Please describe.
Hello,
the possibility of animating objects would be very interesting,
I have a fan chandelier and I would like the fan blades to spin when I turn it on.

Describe the solution you'd like
You should have settings regarding the axis of rotation, the direction of rotation and its speed.

Describe alternatives you've considered
n/n
Additional context
n/n

"Door" are not function correct

Hello,
I try to use "door" in 3Dflorplan. If I chose one part of door, is animated only this part, no glass, no holder :-). Issue you can see in image.

image

Numerical Object Id is not being accepted

I have the latest version of this card. The following is one of the entity config.

      - entity: switch.thashin_g1c
        type3d: hide
        object_id: 668
        hide:
          state: 'off'

Since the object id is just a 3 digit number I get the following error.
n.object_id.charAt is not a function

iOS and Android gestures management

Is your feature request related to a problem? Please describe.
No it is to enable actions on the card in the iOS and Android versions

Describe the solution you'd like
Manage tap actions on objects. Switch on lights or "gesture" type binding

Describe alternatives you've considered
N/A

Additional context
N/A

Remember camera state

Awesome work! I've longed for something like this for a long time, after modelling my house in sweethome3d :)

My first (of many, I fear) feature request, is to persist the camera state (possibly utilizing localStorage or the likes).
Perhaps also making it possible to set a default camera position in the card config.

Extend the recently introduced feature.

Is your feature request related to a problem? Please describe.
With version 1.0.5 the animations in the background are blocked in case you open a new Lovelace dashboard, would it be possible to block the animations in the background when you go to edit mode?
When I'm editing, the preview of what I'm doing already appears, I don't need to have two animations that work simultaneously, slowing down the PC.
Under normal conditions it takes a few seconds to load the 3D screen, even if there are moving objects; when I go to edit it takes at least 3 minutes to load the 3D screen in the edit window not to mention that the use of the GPU then becomes constant (in my case I arrive at 76%), without animations the use of the GPU varies between 27 % and 46%.

Describe the solution you'd like
Stop background animations when editing screen loads.

Describe alternatives you've considered
Stop all animations while the edit screen is open.

Additional context
n/n

Color and text types can't be used simultaneously on the same object_id

Checklist:

  • I updated to the latest version available
  • I cleared the cache of my browser

Release with the issue:
v1.1.1
Last working release (if known):
None
Browser and Operating System:
Any
Windows 10

Description of problem:
Say one has the following configuration:

          - entity: sensor.climate_living_hvac_mode
            type3d: color
            object_id: LivingTemperature
            colorcondition:
              - state: 'cool'
                color: '#D4F3FF'
              - state: 'heat'
                color: '#FFBDBB'
              - state: 'off'
                color: '#FFFFFF'
              - state: 'fan_only'
                color: '#B5FFC1'
          - entity: sensor.climate_living_temperature
            type3d: text
            object_id: LivingTemperature
            text:
              span: 50%
              font: Arial
              textfgcolor: black
              textbgcolor: white

Floor3D does the background color set in the first entity and overwrites everything with the background color (black) in the second entity. If change order of the entities then the text is not shown at all (only the background color set in the color condition).
Possible solutions: Either have transparent background to text type or color condition to the text type background (as in color type) related to a different entity.

Javascript errors shown in the web inspector (if applicable):


Additional information:

Clickable Switches and Lights Showing in 3D based on Switch and Bulb State.

I love the clickable lights and light groups. It would be great to also be able to click objects (and object groups) to be able to control switches as well as to run scripts/automations/scenes.

To go along with this, I would also love to be able to set a condition as to whether a light appears illuminated in the 3d model based on a switch state and bulb state.

Here's a little more contest to this request: Because I have other people in the house who prefer to use physical switches on the wall to control my lights, I have installed smart switches along with my Zigbee smart bulbs. I have automations set so when a switch is powered on it activates a scene that makes sure the bulbs come on at full brightness and a specific set color temp. I also have an automation so when all the lights have been shut off via Zigbee, the smart switch on the wall turns off as well.

The problem I'm having is when a wall switch gets shut off, Home Assistant and zigbee2mtqq just see the bulb as unreachable but the state is still registering as "ON" since that was its state before the power was cut. Since Home Assistant sees the state of the bulb as "ON" it stays on in the 3D card.

Eventually I'd like to swap out all of my wall switches for a smart switch that keeps the bulbs powered but I am waiting for the
Inovelli Zigbee Dimmer Switch (Blue Series) but that isn't available yet.

Failure to Load obj File

Checklist:

  • I updated to the latest version available
  • I cleared the cache of my browser

Release with the issue: 0.9.10

Last working release (if known): 0.9.10

Browser and Operating System:
Chrome Windows
Home Assistant iPadOS App

Description of problem: I added more to my model in SweetHome3D and exported it. The card loads, shows "2/2 100%" then sits. Looking in the console, looks like there's an error.

Javascript errors shown in the web inspector (if applicable):

floor3d-card.js:976 End Build Renderer
floor3d-card.js:976 Material loaded start
floor3d-card.js:976 Material loaded end
floor3d-card.js:976 Object loaded start
floor3d-card.js:976 Add Objects
floor3d-card.js:976 element: {"object_id":"Door_499"}
floor3d-card.js:976 element: {"object_id":"sweethome3d_opening_on_hinge_1_doorOutside_528"}
floor3d-card.js:976 element: {"object_id":"sweethome3d_opening_on_hinge_1_doorOutside_516"}
floor3d-card.js:976 Uncaught Error
    at floor3d-card.js:976
    at Object.onLoad (floor3d-card.js:976)
    at XMLHttpRequest.<anonymous> (floor3d-card.js:976)```

Additional information: Seems like some try..catch or something could help. But a better indicator in the UI would be good, too...

Obviously it's something in my model, I'm slowly removing items and re-exporting to see which part is breaking it.

Bind actions to objects

There is no direct way to access the user interaction within the model. It would be useful for such things as adding external info panels, popping up entity controls, etc.

Bind actions (I.e., via cardtools bindActionHandler) to entity-mapped objects in the model.

Other similar features requests have been made (like showing panel on hover). The approach of binding actions provides greater flexibility and would be a good starting point for the other requests as you could provide requested features as default behavior that users could override using custom actions.

Render is Blank

First of all, thank you for all of the work you have put into this customization.

I am having a problem with a large complex multi floor model created in sweethome3d. When I place the new floor3d card into a panel, all that renders is a grey screen. I've attempted renaming the files thinking it had something to do with spaces, but that did not fix the issue. My guess is the problem is because of multiple floors, but I can't be for certain.

Canvas aspect ratio incorrect

Checklist:

  • I updated to the latest version available
  • I cleared the cache of my browser

Release with the issue:
0.9.18

Last working release (if known):
0.9.14

Browser and Operating System:
Chrome on Windows and Mac; Safari on iPhone

Description of problem:

When the card is in panel mode, the canvas does not render with the correct aspect ratio. It seems to be expecting the aspect ratio of the Card view, but the ratio can vary wildly in panel mode. Depending on the browser size this is OK, but it looks particularly bad on phones: the canvas only takes up the top part of the screen and is very small. This issue did not exist in 0.9.14.

Example: https://imgur.com/a/GRENHr4

Javascript errors shown in the web inspector (if applicable):

None

Additional information:

Light switches on, but it the image is showing light in a wrong place

Description of problem:

I have managed to export my sweethome3d plan into obj's and successfully installed it in HA. The house shows perfectly on the card and I can turn it around and zoom in/out just fine.

However, when I double-click on a light, the correct light switches on, but the display shows a wrong room as lit by the light.

For example, I double click on the ceiling-light in th emiddle of the image:
image

The room on the LEFT of the room the light is in, is lit up.
image

Additional information:

type in instructions

Typo in the instructions page. For the SHOW section you have this snippet

entities
  - entity: <a binary sensor entity id>
    type3d: hide
    object_id: <an object_id in the model you want to hide if condition is true>
    show:
      state: <the state of the entity triggering the showing of the object: ex 'off'>

the type3d: is incorrect and should be show instead of hide

Feature Request: Multiple objects inside "object_id" field

Is your feature request related to a problem? Please describe.
This feature request is realted to my comment on issue: #1 (comment)

I wrote about that some some furniture inside Sweet Home 3D are constructed with multiple objects with having a group objects feature inside SH3D in mind.

Until the Sweethome3D plugin comes, I would suggest/request a "multiple objects in the object_id field feature".

Describe the solution you'd like
Multiple objects inside "object_id" field separed by spaces/commas.

Describe alternatives you've considered
Waiting for the Sweethome3D plugin @adizanni mentioned

Double click on object A and light on/off on object B.

Is your feature request related to a problem? Please describe.
Double click on object A and light on/off on object B.

Describe the solution you'd like
Double click on object A and light on/off on object B.

Describe alternatives you've considered
None.

Additional context
None.

Add show config attribute

Similar to hide could we have a show attribute for config so an object can be hidden by default and shown when an entity reaches a particular state?

For example I would like to show my EV charger object only when the state is Charging so I imagine the config could look something like this:

  - entity: sensor.car_charger
    type3d: show
    object_id: car_charge_obj
    show:
      state: 'Charging'

Text entity: font size as a percentage of the available plane space

Is your feature request related to a problem? Please describe.
It is not possible to set the font size inside the object

Describe the solution you'd like
Text entity: include a font size as a percentage of the available plane space

Describe alternatives you've considered

Additional context

Color problem

Below is a video demonstrating the problem. When the kettle is in a heating state, it turns orange. When the kettle is off, it should return to its silvery color. After refreshing the browser page, the color of the model is correct. I think this is a bug.

https://youtu.be/ofSqNL5Z8Jw

Feature request to open a window on a selected object

Is your feature request related to a problem? Please describe.
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.

Describe the solution you'd like
Double clicking on an object should open a window and show the status of the object or in my case the stream of a webcam.

Describe alternatives you've considered
n/n

Additional context
n/n

Manage trailing "/" in path issue (error message and trailing slash automatic add)

Is your feature request related to a problem? Please describe.
The model is not visualized if the path do not contain the trailing "/"

Describe the solution you'd like
When the model files are not found, a message should be displayed.
When no trailing slash in the path, it should be added automatically

Describe alternatives you've considered

Additional context

suggestions: Groups, dropdown sort

Hi,

thanks for the new release. I noticed you made a dropdownmenu for the entitiys, cool idea. Now the broken entitiys wont show up :)

Maybe better with the possibility to search in the dropdown. At the moment its sorted by the first letter and the first hit.
F.e. i search for "light.wohnzimmer", it stops at the first hit with letter l. If i search for "wohnzimmer" theres no hit.
image
Would be better to be able to search for "light" or "wohnzimmer" and all entitys show up with these words.

And i made a group for my speakers in the livingroom. Ive noticed its important to add the <> at the object id, without it doesnt work. I havent found a hint in the manual related to this, maybe you can have a look at the description. Heres the working example:

  • entity: cover.shellyrogso
    entity_template: cover.shellyrogso
    type3d: hide
    object_id: sweethome3d_opening_on_rail_1_Roller_Shutter_Foot_back_119_6_993
    hide:
    state: open
  • entity: media_player.wohnzimmer
    entity_template: media_player.wohnzimmer
    type3d: color
    object_id: < lautsprecher >
    ** group only works with <>**
    colorcondition:
    • color: yellow
      state: 'on'
      object_groups:
  • object_group: lautsprecher
    objects:
    • object_id: '455'
    • object_id: '469'
    • object_id: '477'
    • object_id: '437'
    • object_id: '407'
    • object_id: '423'
    • object_id: Boolean_6_2_371
    • object_id: Boolean_6_2_492
    • object_id: '719'

Thanks in advance.

Enable source light group (object selection) - Sweet Home 3D

Hi,
Can you enable source light group like an object to turn it on like a strip light in floor3d custom card? Inside my Sweet Home 3D model I created a group of lights on a cornice to simulate an indirect light, but there is not an object to select in the moment to configure the custom card. Or there is a way to get the object name inside the mtl or obj file? Thanks.

Screen Shot 2021-06-17 at 9 25 35

Possible to remove name header when not using panel mode?

Is your feature request related to a problem? Please describe.
I have a mobile dash that I'd prefer not to use panel mode with and the header looks ugly and wastes a lot of space.

Describe the solution you'd like
Any ideas how to remove?

Describe alternatives you've considered
Tried panel mode and I know it's preferred for this card but custom slider row with custom buttons disappear in panel mode for unknown reason. I've tried removing the name from .yaml and it just replaces with original name header.

Additional context
Appreciate your work, this card's amazing. Thankyou :)

Swing window in wrong position

Checklist:

  • [x ] I updated to the latest version available
  • [ x] I cleared the cache of my browser

Release with the issue:
1.0.1 Alfa
Last working release (if known):

Browser and Operating System:
Any browser windows 10

Description of problem:

          - entity: binary_sensor.sensor_window_1
            type3d: door
            object_id: Window1
            door:
              doortype: swing
              side: right
              direction: outer

Swing window in wrong position for right and outer.

Window

The other 3 combinations work (right/inner, left/outer and left/inner).
NB. In my case inner and outer are the other way around inner is outside and outer is inside.

Javascript errors shown in the web inspector (if applicable):


Additional information:

The lamp turns on/off by clicking anywhere on the house.

Checklist:

  • [x ] I updated to the latest version available
  • [x ] I cleared the cache of my browser

Release with the issue:
Latest release v0.10.1b
Last working release (if known):

Browser and Operating System:
Google Chrome 92.0.4515.131
Windows 10 OS Version 2009 (Build 19043.1151)

Description of problem:
I am trying this fabulous project but I have encountered a problem on the actions (gesture); on the test floorplan I am trying to manage a chandelier with a fan, a table lamp and a door sensor.
I want to light up the room when I turn on the light of the chandelier and this works well, I want to turn on / off the light of the desk lamp and this works for me by clicking anywhere on the house also if I click on the chandelier it turns off the light of the chandelier that I had not set for turn on turn off and turn off the desk too.

Javascript errors shown in the web inspector (if applicable):
I have no error in the web console.

I have attached the code of the card I created.


Additional information:
Home Assistant is installed as supervised on docker, the HA version is 2021.8.1, as Hardware I use a Raspberry PI 4 with o.s. Raspbian OS 32-bit version of May 7, 2021.

I hope it is enough to understand where the problem is.
my_floor3d.txt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.