Giter VIP home page Giter VIP logo

Comments (10)

solidgonk avatar solidgonk commented on June 14, 2024 1

Actually, the use case I was proposing was to keep the card as is, and just use the dockerised JS version as an HA addon for modelling. This could potentially allow any minor changes to be directly imported into the viewer card through a mounted location, given that HA's addon architecture is already based around docker containers.

This would make minor updates (like adding a plant, refrigerator or sensor) much more trivial. Of course, integrating the JS viewer directly into the card would be neat, but it ain't broke, and it's already got a solid user base at this stage.

I realise now that this would require the plugin to be compiled or integrated into the JS version, which probably isn't a small undertaking. There's a comment here from 2017 indicating that there is no plug-in capability in 7.1, but it might be worthwhile nudging the community over there to see what comes out. I admit that I'm not a JS or Java expert, but that does seem like a limiting factor.

(IMO, SweetHome3DJS has an opportunity to become the draw.io of 3D home design. It's no-frills, but it's stable, concise, and could easily supplant paid applications like SketchUp, as well as a whole host of junk 3D home and garden design applications that have barely innovated since the era of CD-ROM software. The self-hosting community would jump on it if there was a smooth pathway towards home automation visualisation.)

from floor3d-card.

adizanni avatar adizanni commented on June 14, 2024 1

In theory you do not need a dockerized solution, I can create a custom card with the SH3D editor inside, I've just to see how to manage the persistence of the models. Following that, I have to analyze if I can easily port the plugin to JavaScript, based on the services provided by the JS API.

Stay tuned.

from floor3d-card.

solidgonk avatar solidgonk commented on June 14, 2024 1

Just installed - bravo! I haven't been able to get the export working, but I'll raise an issue in the new repo.

from floor3d-card.

adizanni avatar adizanni commented on June 14, 2024

Hello @solidgonk, very good idea. It will be difficult to port the plugin though, unless they have the Java engine working behind the scene at server level.

from floor3d-card.

solidgonk avatar solidgonk commented on June 14, 2024

So, I've updated the Dockerfile to build a Tomcat-based image:

# Use the official Tomcat image as the base image
FROM tomcat:latest

# Set the working directory
WORKDIR /app

# Download all files from SweetHome3DJS project folder on SourceForge
RUN curl -s https://sourceforge.net/projects/sweethome3d/rss\?path\=/SweetHome3DJS | grep "<link>.*</link>" | sed 's|<link>||;s|</link>||' | while read url; do url=$(echo "$url" | sed 's|/download$||'); wget "$url"; done

# Move the extracted contents to the default web server directory
RUN mv SweetHome3DJS*.war /usr/local/tomcat/webapps/sweethome3d.war

# Add configuration to catalina.properties to skip unnecessary JARs during TLD scanning
RUN echo "tomcat.util.scan.StandardJarScanFilter.jarsToSkip=*" >> /usr/local/tomcat/conf/catalina.properties

# Start the Tomcat server
CMD ["catalina.sh", "run"]

Build and run the container:
docker build -t sweethome3djs-tomcat .

docker run -p 80:8080 sweethome3djs-tomcat

New URL:
http://localhost/sweethome3d/

from floor3d-card.

solidgonk avatar solidgonk commented on June 14, 2024

Hello @solidgonk, very good idea. It will be difficult to port the plugin though, unless they have the Java engine working behind the scene at server level.

I realise what you meant now - the sh3p needs to go somewhere, and there's no obvious way to load it into the JS version.

That said, there's a couple of promising leads that might help with integrating plug-in functionality, which I'll look into when/if I get the time or interest:

https://gitlab.com/nicolalandro/study-sweethome3djs

http://www.sweethome3d.com/support/forum/viewthread_thread,6708_offset,20

from floor3d-card.

adizanni avatar adizanni commented on June 14, 2024

I was assuming you knew exactly what I was talking about, this plugin: https://github.com/adizanni/ExportToHASS .
It is possible, but difficult, to use the card without the plugin.
On the other hand it is true that SH3D JS they offer a real model viewer and, when I initially started the development of the card, I thought that I could reuse it, instead of developing the card with Three.js. At that time, the documentation was poor and I preferred to stick to three.js.
As an alternative to the current card, instead of developing the 3d viewer as a card in home assistant we can develop inside SH3D JS using Home Assistant APIs......

from floor3d-card.

adizanni avatar adizanni commented on June 14, 2024

By doing my researches, I have now understood your point about a dockerized service. In fact the full SH3D JS solution is a client server model. The server is needed in order to implement the homerecorder API which deals with saving and loading SH3D models in the server. A custom card does not provide this capability as it is fully based on a client communicating with the Home Assistant back-end. The only viable solution is to make a HA add-on with the docker scripts as you were proposing. I'm now looking into this documentation. Still the ExportToHASS plugin needs to be ported and I'm looking into this additional option. If you have already done some progress do not hesitate to share, I realized how good your idea is, thanks

from floor3d-card.

adizanni avatar adizanni commented on June 14, 2024

Hello @solidgonk , I took a few hours work but I managed to create the addon based on your idea: https://github.com/adizanni/sh3d-ha. Give it a try in your test system and let me know .....

from floor3d-card.

adizanni avatar adizanni commented on June 14, 2024

I close it as implemented even though some test should be done

from floor3d-card.

Related Issues (20)

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.