Everthing is installed but when the script runs, I get the following error:
Error loading script stib2mqtt.py: Line 314: ānameā is an invalid variable name because it starts with ā_ā
I think I made a mistake, I just copy the files into the python_scripts directory and used the service python_scripts.stib2mqtt.
How to install this in ha ?
Iām afraid it doesnāt work in HA, itās meant to run in its own session. I run it in a tmux session so I can run it forever. It pushes the data to my mqtt server and HA gets the data from there.
Maybe @helldog136 can have a look and make it a custom integrationā¦
@nxd4n I try the latest version of your python script but the command āpython3 stib2mqtt.pyā give me the following error:
Traceback (most recent call last):
File "/root/stib2mqtt/stib2mqtt.py", line 8, in <module>
import async_timeout
ModuleNotFoundError: No module named 'async_timeout'
You might need to do this for other modules.
And please re-download the script, I just found out that it didnāt update the second sensor. I just updated the git.
yes, there was a missing ] on line 429. I have uploaded a new version.
Please try again and open an issue on Github if you have any other issues.
Thanks
Daniel
@nxd4n
The module paho canāt be installed on my system:
root@odroidhc4:~/stib2mqtt# python3 stib2mqtt.py
Traceback (most recent call last):
File "/root/stib2mqtt/stib2mqtt.py", line 16, in <module>
from paho.mqtt import client as mqtt_client
ModuleNotFoundError: No module named 'paho'
root@odroidhc4:~/stib2mqtt# pip3 install paho
ERROR: Could not find a version that satisfies the requirement paho
ERROR: No matching distribution found for paho
There are several ways, but I have installed tmux (sudo apt install tmux).
This permits to launch a script in a sort virtual terminal that stays running even if you close your initial terminal.
pi@raspberrypi:/samba/shares $ tmux
pi@raspberrypi:/samba/shares $ python3 stib2mqtt.py
[ctrl + B D to exit the instance]
With
pi@raspberrypi:/samba/shares $ tmux a
you can return to this instance from any other terminal window. Screen is also an alternative.
hello, thank you for your work
I test it, and it working good ! i used tmux to maintain the session running but the probleme is the script stop after like 2 hours ! the stop behouvior is similair to clt - c
as workaround, i used cron to be sure that the script run, but i got another probleme with aiohttp connection, i got this error āUnclosed client sessionā
do you have any solution for this?
is there any project t intgrate this to custum componant of ha, to run it on hassio?
Hi,
Iām afraid thereās a bug in the published version. As soon as a line is out of service, the script stops working (key errror). Iām working on a new version which works with a different approach and corrects different bugs.
Iām testing it now, and will soon upload it to Github.
Next step I will try to get a custom integration working.