adizanni / floor3d-card

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.
https://github.com/adizanni/floor3d-card
MIT License
471 stars 67 forks source link

Interaction with entities #1

Closed martydingo closed 3 years ago

martydingo commented 3 years ago

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 !

adizanni commented 3 years ago

Hello Marty, I've set this feature for next release it will come soon. In the first versio it will be possible to switch on the light by clicking (or double clicking) on the light itself. In a future release I will do actionable objects (like switches).

martydingo commented 3 years ago

Fantastic news!

I'd also like to be able to interact with things like TV's, Soundbars and the like, but I think this will fall into a 'return more-info' when clicked category.

adizanni commented 3 years ago

Yes, unless you build a TV screen with subscreens (panels) each with its own simple actions......... Let me come back, I will try to keep up with the requirements....

adizanni commented 3 years ago

Added in v0.9.6. Check the description and let me know what do you think.

jesserockz commented 3 years ago

I just tested this out and works perfectly.

This card is amazing. So glad I built my original floorplan using sweethome3d and had the original files around still.

marrobHD commented 3 years ago

It would be cool if there would be a option to define a radius for an object_id for "gesture" detection. That would be useful because some lights for example a chandelier inside Sweet Home 3D are constructed with multiple objects. In addition it also would solve the issue (I guess) with only numeric object_ids

Edit:

adizanni commented 3 years ago

It would be cool if there would be a option to define a radius for an object_id for "gesture" detection. That would be useful because some lights for example a chandelier inside Sweet Home 3D are constructed with multiple objects. In addition it also would solve the issue (I guess) with only numeric object_ids

Edit:

  • highlight clickable object_ids

Almost impossible but I will post a message to describe how to group objects, waiting for a new Sweethome3D plugin (https://github.com/adizanni/floor3d-card/issues/7)

adizanni commented 3 years ago

Please let me know if you are ok with current implementation. Gesture with iOS and Android devices are difficult to customize as the default behavior is to rotate and move camera.

adizanni commented 3 years ago

I opened a feature for Mobile device: https://github.com/adizanni/floor3d-card/issues/12. The mouse is now covered with the "gesture" binding type.