the path needs a trailing /. In your case it should be “/local/www/home/”. Be advised that in home assistant, the file system folder /config/www is mapped to /local. Unless you have created an additional subfolder called www (/config/www/www) your path should be /local/home/
I need to fix this stupid thing about the path, but I always forget to fix it whenever I do a new release.
I have spent countless hours trying to find the mistake, I tried finally / and nothing else. finally had to / local / home / and not / local / www / home /
Thank you very much
the easiest: change color based on the state of the TV entity (I put it a light blue
In sweethome put a frame in front of the television and put a image as texture. In home assistant floor3d card you show the frame when the TV is on and hide it when is is off using either the hide or show type of entity.
If you want a sort of light effect you need to put a light entity associated to the TV screen and linked to the TV switch …
I’ve just discovered this plugin. From what I’ve been able to achieve so far is awesome!
I do have a couple of issues though:
Export to OBJ Format
This works well. I get a fully-rendered 3D view.
Trying to select a light in the 3D view to turn on from my entity is a bit of a nightmare however.
I understand that this is due to the way SweetHome 3D labels it’s objects (Why it can’t use the name I’ve given it in the software is beyond me).
I did not manage to get a light entity to interact with the 3D plan.
Export obj to HASS
Initially, this didnt do anything for me. No zip file was created.
Then saw a previous poster mention that it was to do with object groups. Luckily, I only had one group, so that was easy to remedy.
Removing this grouping correctly resulted in a zip file being created.
Setting the “Object list JSON” to the JSON file generated from the plugin correctly listed the much more usable object id’s in the “Object id” dropdown.
That is so helpful!
However, when using the .obj and .mtl files generated from the plugin, I lost all textures. This ended up in a greyscale 3D view.
I tried re-exporting via the “export to obj” option in SW3D, and copied just the images/textures across, but this did not do anything.
"Shadow" option
When setting the shadow option to “no”, or to blank, the light correctly lightens the room. The light does bleed out through the walls though.
Setting “shadow” to “yes” resulted in the light no longer working.
I realise this is still in alpha stage, but from what I’ve seen, this is very promising.
This is much more useful than using picture cards and hacking CSS values!
thanks for encouragement and thanks for the feedback: it is this kind of comments that allow a constant improvement especially knowing that I develop in my spare time and I do not have a lot of that.
With the help of another contributor we managed to debug the material generator but only when using the # character at the end of the name of the object. If you are not using the # as explained in the plugin README, there is something wrong elsewhere. Please download the last version of the plugin:
In order to debug the plugin and understand the problem with the texture, I would need the sh3d file of your model.
Also please whenever you reference a new version of the files .obj .mtl and .json add a version URL query to them in order to be sure you are not picking an old cached version of the files (ex home.obj → home.obj?ver=1 and subsequent numbers for each new version of the file)
Related to lights and the shadow parameter you are right. The behaviour of the lighr is really unpredictable because the pointlight is placed at the center of the box containing the light object. If the center of the box falls inside the object and the object is solid, the object will shadow the light and no beam will get out of it. For half sphere lamps the shadow works well but for other light objects this might not work. I’m thinking to an elegant way to manage this, but I do not want to force the usage of the plugin (ex to name the light objects with a special tag and to disable shadowing for them). Ideas are welcome.
Thanks for the reply, adizanni - you are most welcome.
re: Material generator / plugin.
My apologies, I must not have read the readme fully.
So for any texture I’ve used, I append the # after the name? - is this the same case for colours?
I believe I’ve only used one texture, and thats for the flooring. everything else is either solid colours, or whatever colours/textures the object had when I used it.
The zip file does correctly have the textures in it.
a quick browse of the obj/mtl files suggests that the correct textures are being referenced.
re: shadows.
Ahh, that makes a lot of sense actually. I used a spotlight object as my light source. I’ll try again with different style light (like a half sphere lamp as you suggest).
Edit: Changing the light source to be an ‘open’ light has done the trick. Thanks for the tip off.
As a side-note, is there a way to have the light functionality without having to have a “light” model in the 3d view?
I did try unticking the ‘visible’ checkbox, but then the objects were not output to the json file.
It’s no big deal if I need to have a light object, I just think it would look better if I didnt have to.
My SH3D file is just shy of 10mb. Where would be the best place for me to put it for you? (I dont appear to be able to attach .zip files to my posts)
re: Plugin.
the # at the end of the object name in sweethome will tell the plugin to use only the object name for the entire object and not naming all the children components. If you do not put the # you will have the subcomponents name with an appended unique identifier (objname_1, objname_2, …). This depends if in the home assistant card you want to act on the full object or on each or any of the sub-components. In both cases texture should be applied consistently.
re: light functionality in the floor3d card can be applied to any object in the model. Results may vary but the behaviour is the one I explained below. THe card will compute the box containing the object and it will place a pointlight at the position of the box center.
To share your sh3d you can put it in a file sharing cloud service (ex google drive) and send me the link in private message here in the forum.
re: plugin
Understood. Maybe I’ll have use for that at a later date. Good to know!
re: lights
Ahh, I see. Doesn’t explicitly have to be a light. Would be nice if objects marked as ‘invisible’ were also exported into the JSON file… I could then have the “light” effect without having to have a light fixture in my model.
If that’s not possible, then no big deal, I’m happy with what I’ve got.
I’ll send you a PM with a link to my SH3D.
Thanks for your help so far, much appreciated!
Edit: Hmm, I was unable to PM you. (Said I was unable to ‘message that user’).
so, here’s the link here: home.zip - Google Drive
re: lights
Even if you make them invisible than I have to show them in the card if I want to perform an action on them. Maybe instead you can create visible objects but very small or with mymetic colors…
re: your model. I have exported your model using the plugin and referenced it inside a new card. I have not loaded the json file but this cannot affect the texture. are you sure you have extracted all files generated by my plugin in a sub folder of /config/www in home assistant. I mean you need to put all files: mtl, obj, json (if you use it), jpg, png, etc.
I tried your code, and that worked. Upon closer inspection of my code, I noticed I’d got the .obj file as the parameter for the “mtlfile” property.
(so both the “objfile” and “mtlfile” properties were both referencing the same file) sigh
I also tried your suggestion of having with small sizes. set my lights to 1px height/width/depth. Works well!
Excellent card - congrats & keep up the good work.
Question: I have tried to use the gesture option for let’s say turn on a switch but I couldn’t make it. I have read the relevant GitHub readme but there is no real example to see how it works. For instance I do not understand the term “domain”. Has anyone managed to use this, and if yes can s/he share an example ? Finally, is there a way to call a script or use 3d objects as part of automations eg. if I double click on an object do something?
Hello Christos, the answer to all your questions is the gesture entity.
when you call a service in HA you need to put a domain (ex: switch) and an action (ex. toggle).
an example:
HWelcome.
I have such a problem. I want to use gesture and when I declare two different variables as gestures on two different objects, clicking on the 3d model in any place, the state of both cold ones changes.
In my opinion it should only work on clicking on the declared object, but it works on all declared variables. Any ideas.
My code below