Now, my question:
I’d like to run this python script within home-assistant os (running HA OS as a generic install on an older HP I5).
What is the best/easiest way to do this? can I do this using the python integration, do I need an addon like pyscript/appdeamon? or am I missing something? (is it maybe easier/better to run the docker image instead?)
The import statement in the py script likely won’t work on the built-in python scripting, you will probably need pyscript or appdaemon (I prefer pyscript myself). The built in python system is nice but doesn’t have the freedom to import additional libraries (unless this has changed recently), but pyscript will.
I wouldn’t really call that a python script. It’s build like a service that runs in the background and it can be ran as it’s own docker container. With that being said, I would try to make an addon for it and run that. This will be the “best” way to run it because it’ll run next to home assistant and restarting won’t impact it. Doing this might be a bit hard depending on your skillsets though. Either way, here is a tutorial building an addon.
Your other option is to try to run it with appdaemon. This would be the second best option in my opinion because appdaemon runs along side of home assistant. This route will require you to write code in order to run the script using python.
Lastly, you can try using pyscript. This does not run along side home assistant, it’s built into home assistant. Not sure what goofiness you’ll run into but this is probably the easiest route. Keep in mind that when home assistant is off, the states will not update to MQTT because script is not running. The other 2 options will still have states updating when home assistant core is off because they do not rely on core.
Since I am quite a nood when it comes to python, for now i’m going with an intermediate solution (trying to run the docker on a seperate raspberry or qnap nas).
As soon as i got some spare time (or frustrated enough with the intermediate solution) I might dive into appdeamon or building my own addon.
Im sure you’ll see mee back here with (some) question doing so!
Anyway, thanks for the quick replies!
p.s. if anyone runs this hewalex script or finds this topic and builds his/her solution it would be great it you reply in this topic! it might be a great help for me and/or others
Hi BjornH.
Any luck integrating your Hewalex device with HA?
I have RPi4 with HA OS and would like to use that to keep monitoring Hewalex Heat Pump.
I do have an option to run the script on separate box but that does not make much sense to separate this functionality from HA server. I think it should be located there for the solution to be consistent.
Please let me know whether you have succeeded setting it up.
Also new to the HA enviroment, trying to migrate from Domoticz to HA.
I have the Python script running, and all is shown in MQTT explorer.
But… Hoe to show things in Home-Assistant?