tjaworski / AceMagic-S1-LED-TFT-Linux

ACEMAGIC S1 Mini TFT/LCD and LED Control for Linux
GNU General Public License v3.0
100 stars 10 forks source link

Running in Home Assistant as addon #15

Open SBRK opened 3 months ago

SBRK commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

that's really cool.

lcava000 commented 1 month ago

@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 commented 1 month ago

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.