Repository navigation
Autostart von pytes_serial unter Home Assistant OS (HAOS 17.3, VirtualBox) issue #46 #49
Unanswered
chinezbrun
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hallo @chinezbrun,
vielen Dank für das Projekt — mit https://github.com/chinezbrun/pytes_serial konnte ich meine PYTES‑Batterien erfolgreich auslesen.
Kurz zu meiner Umgebung:
Home Assistant OS (HAOS) haos_ova-17.3.vdi, läuft unter Linux in VirtualBox
Zugriff per SSH auf den Home Assistant Host (HAOS)
Wechselrichter: Deye
Batterien: 3 × PYTES E-BOX-48100R-C
Ich habe pytes_serial unter /homeassistant/www/pytes_serial-main installiert und kann das Skript manuell per SSH starten. Mein Start‑Script ist unten angehängt.
Das manuelle Starten funktioniert, jedoch finde ich keine Möglichkeit, das Skript automatisch beim Hochfahren von HAOS zu starten. Auf HAOS sind klassische Optionen wie crontab oder systemd nicht verfügbar.
Meine Frage:
Gibt es eine Möglichkeit, pytes_serial beim Booten von HAOS automatisch zu starten? Wenn ja: wie würdest du es empfehlen einzurichten?
Vielen Dank und beste Grüße
Werdomi
Start‑Script:
cd /homeassistant/www/pytes_serial-main
source venv/bin/activate
nohup python3 pytes_serial.py > /homeassistant/pytes_serial.log 2>&1 &
Activity
chinezbrun
added
question
Further information is requested
2w ago
chinezbrun
self-assigned this
2w ago
chinezbrun commented 2 weeks ago
@chinezbrun
chinezbrun
2w ago
Owner
Hi @Werdomi,
Thank you for using pytes_serial, and thanks for taking the time to provide such a detailed description. It's always helpful to receive feedback from users running the project in different environments.
I'm also glad to hear that pytes_serial works correctly when started manually.
At the moment, pytes_serial is not packaged as a Home Assistant OS add-on, so I don't have an officially supported method for starting it automatically on HAOS. The current startup instructions are intended for standard Linux systems (e.g. Raspberry Pi OS, Debian, Ubuntu) where systemd or cron are available.
One approach you could experiment with is using a Home Assistant automation that runs on startup and calls a shell_command, which in turn executes a shell script to start pytes_serial.
The following example is only meant as a starting point. Since I don't have a HAOS environment available for testing, it may require some adjustments depending on your Home Assistant version and setup.
configuration.yaml
shell_command:
start_pytes_serial: "bash /config/www/pytes_serial-main/start_pytes_serial.sh"
automation.yaml
alias: Start pytes_serial on Home Assistant startup
description: ""
triggers:
event: start
actions:
minutes: 1
mode: single
start_pytes_serial.sh
#!/bin/bash
cd /config/www/pytes_serial-main || exit 1
source venv/bin/activate
nohup python3 pytes_serial.py >/config/pytes_serial.log 2>&1 &
I haven't tested this on HAOS, so I can't confirm that it will work as-is. Since shell_command is not really intended to manage long-running background processes, reliability may vary between HAOS versions.
If you try this and get it working reliably, please let me know what changes (if any) were required. I'd be happy to document the solution for other HAOS users.
The most robust long-term solution would be a dedicated Home Assistant Add-on, but that is currently outside the scope of this project.
Werdomi commented 2 weeks ago
@Werdomi
Werdomi
2w ago via email
Author
Hallo
Danke für die schnelle Antwort
Leider hat es nicht funktioniert. Ich bin bei HAOS und jeglicher Art von
Programmierung sehr unerfahren. Sollte ich noch Erfolg haben werde ich
mich natürlich nochmals melden.
Ich bin schon froh das dieses Programm wenigsten nach manuellem Start
zuverlässig läuft.
Am 29.06.26 um 19:40 schrieb Dan Popescu:
…
chinezbrun commented 2 weeks ago
@chinezbrun
chinezbrun
2w ago
Owner
Thank you for trying it and for letting me know.
Unfortunately, I don't have a Home Assistant OS environment available to test this myself, so I can't provide a verified solution for automatic startup on HAOS.
I'm glad to hear that pytes_serial is running reliably when started manually. If you or someone else in the community eventually finds a reliable way to start it automatically on HAOS, I'd be happy to document it in the project for other users.
For now, I'll leave this issue open in case someone with more HAOS experience can contribute a working solution.
Thanks again for your feedback and for using pytes_serial.
All reactions