Yes! It appears to be all better now! Thanks! Starting to roll…
Quick question, do you have an example of a timer rule - for instance, one that turns on a light as a result of motion detection and then turns it off after a period of time, perhaps using parameters for how long it should stay on based on time of day? I’m sure I could cobble one together but would love to see how properly done…
You have to import from HABApp.openhab.items and not from HABApp.core.items.
Also get an IDE (e.g.) PyCharm, that way you will get type hints and auto complete.
Do you get type hints and auto complete for HABApp?
If not you have to install it through settings → project interpreter and then add it to the packages.
Code complete for item names will not work though …
I do get type hints for OpenHAB, and love how it encourages me to have really clean (looking, at least) code. I’m not sure, however, how to best run/test code without checking for output in the logs just yet. I will try to figure that out.
The example linked below for a timer/motion imports ‘Item’ with I suspect was supported in an earlier version of the code, but has been deprecated?:
No, it’s a locally created proxy item in HABApp to share states e.g. between rules/files (see items).
You can run HABApp on your local machine, connect to your openhab instance and use the listen_only config switch.
But tbh I hardly have the need to test my rules any more:
I separate the logic into small parts with the MultiModeItem, syntax errors are caught through PyCharm.
Most of the errors that remain are complex logic errors that are not easy to catch through test cases.
And if there are errors I get a notification through Pushover directly on my mobile phone so I don’t have to look at the logs.
Oh, right! My bad… I can’t help but look at this through an OpenHAB lens. I need to think about how that other non-OH-related functionality can be leveraged for me.
And yes, now that I am getting rolling, I’m not sure I really need more debugging capability. I found DSL rules so difficult to troubleshoot but I’m very happy with HABApp (again, great work!).
Now I need to look at MultiModeItems as I think that might solve a question I was going to ask.
When coding, I learn best by finding examples that are close to my needs and modifying them. I have a hard time reading a manual without seeing the code in action. Thanks for your patience and support.
@alfista2600
Check out the new HABApp version 0.30.2.
I included a small fix which should make startup more robust so you shouldn’t get the error messages again.
Additionally there is a command line argument which will make HABApp wait until the specified os uptime before it connects.