Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running in Home Assistant as addon #15

Open
SBRK opened this issue May 23, 2024 · 15 comments
Open

Running in Home Assistant as addon #15

SBRK opened this issue May 23, 2024 · 15 comments

Comments

@SBRK
Copy link
Contributor

SBRK commented May 23, 2024

Hey there, I am running Home Assistant on my S1, and I managed to get your script running inside an addon (if you're not familiar with how Home Assistant addons run, it's basically just running in a Docker container).

I have two issues (well, more, but two main issues):

  1. The screen and LCDs are not found at path 1-8:1.1. How can I know which path to use ? The /dev/ttyUSB0 device is forwarded to the Docker container and should be accessible
  2. I can access the GUI, but all text is displayed in square. I imagine there's a missing font file.

One thing I would like to be able to do in the future is display a Home Assistant dashboard, but I don't know if it's easily doable with the current code using node-canvas.
I have experience with using CEF (Chromium Embedded Framework) to draw webpages and use them as bitmaps, and that would probably be the solution, but I don't know how hard it would be to implement this in Node.

@SBRK
Copy link
Contributor Author

SBRK commented May 23, 2024

I resolved both my issues

  1. Had to forward /dev/bus/usb/001/007 too
  2. Installed ms fonts in my Dockerfile

I would still be interested to hear what you think could be possible to display any arbitrary webpage to the screen.

@tjaworski
Copy link
Owner

I am not familiar with the Home Assistant dashboard. However, you can gather any information you want and display it. You will just need to create your own 'sensor' to gather the desired information. Inside the sensor, you can call any API, including making HTTP requests. Alternatively, if you plan to render a webpage into an image, you can use that image as a wallpaper or create a custom 'widget' to display it. Either way, I made this to be very customizable. The only drawback I see with using an image is that the drawing can be painfully slow.

Also you have to think about the screen burn in. This is the reason why I created ability to rotate through multiple info screens.

@SBRK
Copy link
Contributor Author

SBRK commented May 24, 2024

image
image

Made some big progress, here's the thing running and showing a Home Assistant sensor (here, my bedroom temperature)

I made some minimal changes to the configuration and code, I will fork and try to do a proper addon in the coming days.

@tjaworski
Copy link
Owner

that's really cool.

@lcava000
Copy link

@SBRK SBRK

How did you find the display location on Home Assistant? I would like to install it on DSM but it gives me this type of error
CleanShot 2024-07-19 at 18 36 36

I think it can't find the route.. How do I find which bus device corresponds to the display?
CleanShot 2024-07-19 at 18 37 57

@tjaworski
Copy link
Owner

in addition to the kernel driver missing for usb serial, you also don't have libusb package:

libusb-1.0.so.0: cannot open shared object file: No such file or directory

you will need to install this package.

@SBRK
Copy link
Contributor Author

SBRK commented Sep 13, 2024

@lcava000 in the add-on config you have to enable USB devices. Can't remember exactly the line, I will look it up later.

@tjaworski are you working on a HA add-on yourself ?

@tjaworski
Copy link
Owner

@SBRK no, I am not, been busy with other work. but seems like you have most of it working?

@elpoeta2405
Copy link

"Hello, I have several of these machines running Home Assistant OS. One of them has already had its screen burned out because it was constantly displaying 'mini PC'. On others, I disconnected the screen to prevent it from burning out. I have no experience in creating add-ons, so if someone would be interested in making this interesting project available as an add-on, it would solve a major problem."

@tjaworski
Copy link
Owner

Burn-in typically occurs when a static image remains on the screen for an extended period. To mitigate this, the s1panel app allows you to display multiple screens in a slideshow format, rotating images at 1-minute intervals. This ensures that no single image stays on the screen for too long. Additionally, avoiding the use of bright colors can further reduce the risk of burn-in. Currently, there doesn’t appear to be an option to turn off the LCD screen entirely. The best alternative is to set the display to black.

@elpoeta2405
Copy link

El efecto burn-in generalmente ocurre cuando una imagen estática permanece en la pantalla por un período prolongado. Para mitigar esto, la aplicación s1panel le permite mostrar múltiples pantallas en formato de presentación de diapositivas, rotando las imágenes en intervalos de 1 minuto. Esto garantiza que ninguna imagen permanezca en la pantalla por mucho tiempo. Además, evitar el uso de colores brillantes puede reducir aún más el riesgo de efecto burn-in. Actualmente, no parece haber una opción para apagar la pantalla LCD por completo. La mejor alternativa es configurar la pantalla en negro.

"Yes, I understand, but as I mentioned, I can't install your application because I'm running Home Assistant OS. I’ve read that it can be run as an add-on, but I don’t have the knowledge to do that. If you could help me, I would really appreciate it. For me, it's not so important that the screen is off, I just want to be able

@VitalyIak
Copy link

VitalyIak commented Nov 16, 2024

It's really need to publish this addon for HA! @SBRK if you have smth - please share!

@beemerspb
Copy link

beemerspb commented Jan 26, 2025

It's really need to publish this addon for HA! @SBRK if you have smth - please share!

If you are not going to use sensors from Home Assistant , then I recommend using a card "iframe"
Most likely @SBRK won't make an addon. This is frustrating, I would do it myself, but unfortunately I don't have enough knowledge
This is one of the ways to customize the display from Home Assistant

@SBRK
Copy link
Contributor Author

SBRK commented Jan 26, 2025

I'll try and publish an usable version as soon as I can

@BalooDK
Copy link

BalooDK commented Jan 27, 2025

I'll try and publish an usable version as soon as I can

How is the add-on coming along ? I would really love to have this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants