Having a tough time getting started with HABapp. Have installed ver 1.1.2.
I have installed it following the docs on a Windows PC. My openHAB installation is on a Pi. The logs show that HABapp has connected to the openHAB instance which is great. Just having problems executing the first rule. The following appears in the logs whenever I save the file:
Found no instances of HABApp.Rule in D:\opt\habapp\rules\test.py
In HABApp not recognizing rules (Solved) - Apps & Services / 3rd Party - openHAB Community there is mention of instantiating the rule or installing habapp in the local python environment, but i’m struggling to understand how to achieve either. I just copied the script from the docs, so i expected it to work. I’m sure I missed something with my installation so just hoping for some tips.
The rule is this:
import HABApp
# Rules are classes that inherit from HABApp.Rule
class MyFirstRule(HABApp.Rule):
def __init__(self):
super().__init__()
# Use run.at to schedule things directly after instantiation,
# don't do blocking things in __init__
self.run.soon(self.say_something)
def say_something(self):
print('That was easy!')
I’m also not sure what it means to “watch the console”. At the moment all I can see is things being written to the HABapp.log file.
Help very much appreciated! Happy to provide any missing info.