HABApp - Easy automation with openHAB

Unfortunately, we are in the process of moving and my OpenHAB system is more or less dismantled right now.
I may be able to test and have an opinion a month from now…
@Spaceman_Spiff Thanks for asking!

1 Like

I think consistency is important. I don’t use group items myself, but IMO, there is no reason not to treat them as normal items as well. As HABapp is wrapping Openhab, we could generate the ValueUpdateEvent as well.

Sorry for the delyed answer.

From the logic view a group item should be the same behavior than an “normal” item. From the compatibility view hapapp should follow the openHAB behavior and add nothing new to the logic.

Maybe it is a good idea to open an issue or somethjing like this, so that the openHAB behavior follows the expected logic.

Thomas

Already did, but the api issues in general are often not getting solved because there is no volunteer working on them.

Currently I’m thinking the same way as @yfaway .
It’s a workaround but at least from the HABApp point of view things will then be consistent.

At least a ValueUpdateEvent should be emitted, but I am not sure if it should be a ItemStateEvent.

At the end i am fine with every solution as long as it is documented somewhere. Unfortunately something thing are hard to find even if they are documented.

DateTime Item not implemented in HABApp

Is there any specific reason why DateTime items are not implemented in HABApp?
The workaround is simple, i.e. to converting to string with the isoformat method (e.g. datetime.now().isoformat()) , but I was wondering why.

It is - it’s just missing in the docs.

from HABApp.openhab.items import DatetimeItem

I was trying to move an astro event from DSL to HABApp, thinking it would be easy, but it seems to not think that the item is created. Is there something I need to do in HABApp to make it aware of the channel?

2021-09-24 10:40:10.755 [WARN ] [HABApp.Rule                         ] - Item "astro:sun:local:set#event" does not exist (yet)! self.listen_event in "AstroEvents" may not work as intended.
2021-09-24 10:40:10.756 [WARN ] [HABApp.Rule                         ] - Item "astro:sun:local:rise#event" does not exist (yet)! self.listen_event in "AstroEvents" may not work as intended.

You can create a Switch and link it to the channel. That’s the easiest and fastest solution.
The switch will turn on and immediately off again when the event is triggered.

As an alternative you can use the scheduler with self.run.on_sunrise or self.run.on_sunset to directly run a function.
I’ve migrated all my sunrise/sunset rules away from the astro binding and into the internal scheduler because it’s much more flexible with the offset and earliest/latest option.

Giving this a try!

Just set it up and then an hour later had a vague recollection that the HABApp config file had long/lat settings in it. Thus if you decide to go this way be sure to set those values. Unsure if HABApp can get those from the OH config.

That’s not possible (yet), you have to set the values yourself (or get some really funny sunrise/sunset times).

Removing HABApp_events.log file/ how to check from openhab if habapp is operating

I recently switched to OH3 and implemented a set of rules in HABApp which work fine.
After several days, I realized that rules were not triggering anymore. Logs stopped at a certain time, even though openhab was still operating. On the other hand the habapp service was crashed. The status log showed that the file system was read-only. I then realized that zram was full: i am using a raspberry pi v4 with openhabian and zram. As my persistence is rrdj4 i am sure it was a problem related to the logs.
I had to rapidly restore the functionality of the system and i rebooted, so i am not exactly sure what was causing so many logs. I’ll check in the next days what’s going on. Meanwhile I noticed that
the HABApp_events.log is pretty big: is there a way to periodically remove it ( by modifying the logrotate system: I do not know this very much)?

A second related question is: how can I check from openhab that habapp is running, i.e. is there some smart way to implement an heartbeat? I was thinking of an openhab rule that periodically changes an item and checks if a corresponding habapp rule reacts to that item change.

Final question: would it be possible to make the habapp service continue working even if logs cannot be written?

Thank you

Just set a corresponding size in the logging configuration

Just enable the ping in the HABApp configuration

It’ll crash eventually - there is no way around it.

Good news everyone!

I just released HABApp 0.31.0!

4 Likes

you are awesome, and habapp is fantastic. Thank you!

1 Like

Copy that!
And I do not give a flyining fuck that “mee too” is not wanted on this forum.
It is very well deserved!

3 Likes

Thank you @dan12345 and @NilsOF for the very kind words!
They are specially motivating because creating the last version was very exhausting since I’m currently really lacking time.
Thanks guys!

3 Likes

I am testing HABApp and I wanted to open a https connection to openhab. But I guess that currently only mqtt has the TLS support. Is that correct?

That is currently correct.
What are your plans on how to use HABApp? Do you want to connect through a reverse proxy?

I would like to eventually replace the DSL Rules with the HABapp. Openhab is only accessible via a reverse proxy, since I have switched all my HTTP connections to HTTPS.