I’m new to Home Automation, so please assume I know nothing.
Here’s what I’ve done:
Raspberry Pi 2 B configured running Raspbian
4ch relay connected to the Pi and door motors
Python scripts execute and open/close doors
PHP configured and I have a very simple web page to execute said scripts
I also have my alarm panel connected to show the current status of the alarm
Now this all works well. but the interface doesn’t look great. An interface like OpenHAB would greatly improve the experience. My question is, will OpenHAB execute python scripts and how?
You can execute external CPython scripts with the exec binding or related actions and you can embed Jython scripts using the JSR223 binding. Depending on how you are controlling the relays there might be other non-Python options as well. For example, there’s a GPIO binding.
the header has to include in first line: #!/usr/bin/env python
Item definion:
Number DiehlWtemp “Diehl W” (gDiehl) {exec=“<[/usr/bin/python /opt/openhab/configurations/scripts/diehl.py:60000:REGEX((.*?))]”}
you need to make sure that the full path to the python file is in the call to the script. As well you need the exec binding been loaded tothe addon folder.