openHAB 3.0 Milestone 5 discussion

I have something similar to:

Contact garageDoor1Contact
DateTime garageDoor1TimeStamp 

I’m setting the value of garageDoor1TimeStamp via a rule when garageDoor1Contact is changed to OPEN or CLOSED. When I restart the system, the value of garageDoor1Contact is restored but garageDoor1TimeStamp remains NULL. I’m using rrd4j. Shouldn’t garageDoor1TimeStamp get restored as well?

I originally tried using both timestamp-update and timestamp-change, and on restart it would set the timestamp to the system start time.

I don’t know if rrd4j stores DateTimeTypes. rrd4j is only capable of storing numerical data that can be decimated (e.g. as it gets older ten entries will get replaced with the average of those ten entries). That probably doesn’t make sense for date time values so you need something else to do restoreOnStartup. MapDB excels at this task as it only saves one value (so it never grows) and can save and restore all Item types.

That’s the point I don’t think it does. It’s also the default persistence layer installed by openHAB 3 and is providing restoreOnStartup for some data types, but not others.

Except for being the default (OH 2 didn’t come with any persistence be default) that is as it has always been. rrd4j can only store numeric data. It’s a fundamental limitation and not something that can change.

The default persistence layer shouldn’t leave the system in a half baked state at startup. I created issue Default persistence doesn't persist all data types · Issue #1902 · openhab/openhab-core · GitHub for it.

1 Like

Given that the default persistence needs to be embedded and rrdj4 and mapdb are the only two embedded databases the only solution is to not provide any default at all and require all users to pick and install one. In the mean time all the analysis functions will not work in Pages and people will complain about OH shipping with “half backed” UI functionality.

1 Like

One issue I see is that if you set an item to belong to more than one group, at the Semantic Model view it is shown only in one of those groups (not able to get the pattern of which one).

Actually for me the semantic model is capable to show the same item in two groups:Bildschirmfoto 2020-12-07 um 21.04.00

Just go into items → Group → Direct Group Members → Change and add the item to a second group.

EDIT: I notice, if you attempt to add the item into a third group it is indeed not shown in all groups.

The smal and nifty things.

If you look at the right side of your screen in main UI, you might recognize some small letters.

image

The are shortcuts to navigate faster in a large list. I really like that! @ysc Thanks

1 Like

@jensflorian I’m afraid there is no need to have item in three groups.
At least in my case it fails with 2 groups:

It fails to be shown into semantic model tree. Into new UI it seems to be able to know the item is in both groups (the “group per physical device at room” and the “group per all sensors at room”
imagen
imagen

Why do you need “Sensors del dormitorio” and, if you do need it, why does it need to be part of the model? But putting the sensor Equipment or Points into that room it’ll already be a sensor in that room. There is no need to create yet another Group to represent the sensors of the room, at least not for the model’s sake.

The way the model is designed to work is:

  • Room
    • Equipment
      • Point
        With the information presented, I think your gDL_Sensors should not be a part of the model in the first place. It is not required nor even expected that all Items and Groups will be part of the model.
1 Like

Thank you @rlkoshak for your comment. I’ll look into it but, if you don’t mind: if an item is allowed to belong to several groups (and it is allowed by “Direct Parent Groups”/“Direct Group Members” options), why is not showing them in those groups but only in one an expected behavior?

I mean, based in your comment it is clear I misunderstood the way the model is designed to work (I’ll change my layout accordingly) but still wondering the use case of having the chance in GUI (and text item definition) to have the same item in several groups if what I thought was the usecase turns out not to be the expected one.

Thank you

Because the model isn’t about Groups. It’s about meaning. You are giving meaning to your Items and that meaning is represented by tags and Group membership. To important part of the model is the relationships. And any model has to make assumptions about certain things. It seems perfectly reasonable to me that one assumption would be that a given sensor or actuator cannot belong to more than one equipment at the same time. After all, you can’t do that in the real world and the model is supposed to represent the real world. Similarly you can’t have a sensor or actuator that resides in more than one location at a time (though that becomes a little more hazy when you have a light switch that controls lots of lights in different room, but in that case the switch and the bulbs would probably most appropriately be modeled as separate Equipment).

As awesome as having the UI built for you and having the nice hierarchy of Items in the model view is, and they are super, the power of the model comes when natural language processing gets introduced (which you can play with now if you install HABot.) Then you can type in (or say with speech to text) stuff like:

  • “Turn off all the lights on the ground floor.” You don’t need a special Group for all the lights. It knows which lights are on the Ground floor because it knows which equipment are lights, which Items on the equipment control the lights, and which equipment are on the ground floor based on the model.

  • “What’s the average temperature in the house?” (I’m not positive it can calculate the average on the fly but it would be theoretically possible).

  • “What’s playing on the Master Bedroom TV?”

But beyond that, the UIs that are generated automatically don’t need the extra Groups either. For example, if I want to see the temp in a certain room I can go to the Locations tab.

If I want to see all the sensor equipment I can look at the Equipment tab (note I’ve not properly tagged my sensors in the model yet so they just show up under Equipment instead of something more meaningful.

And if I want to see all the thermometers at once I can go to the Properties tab.

I didn’t create separate Groups for these different views. The software is able to figure out what goes where based on the model. So, unless there is some rule or you have sitemaps or something that needs a separate “all sensors” Group there is no need to create one. The model can figure out all the sensors without it. And if you do have a rule or sitemap that needs such a Group, there is no need to add that Group to the model.

3 Likes

Thank you @rlkoshak for your elaborated comment! It helps to get things clearer now :+1:

I’m not sure if I’m in the right place, but I noticed that the Developer Sidebar does not update properly.
Example:
via the Dev Sidebar I called a rule; next i’Ve deleted this rule; … and the link to the deleted object remains in the sidebar.

Definitely a small thing with lowest prio…

To be sure it is handled, open a issue on GitHub for the UI.

That is how I work out my model, I ask myself what I would want to do and how I want it to work if I am speaking to an AI. It makes it easiest to make the right choice and create the model how I want to ask HABbot to do things. It is modelling the real world.

I really like the openHAB way far better than Hass, which you can choose to use openHAB as a flat location list if you want, or you can step it up to something far more powerful. Extra choice.

Unfortunately, I can’t put that in the items list, where it would be most useful, same for the initials headers, because this list is a special “virtual list” and these are not compatible with each other :disappointed:

That was the master plan :wink: there was little incentive in building a model just for HABot in OH2, and there was little UI support to help doing it, so it’s not been not successful. But now that you do have more incentive and it’s become the recommended way to organize items, you basically get HABot functionality for free!

1 Like

I’m getting:

[org.jline ] - Failed to save history
java.nio.file.AccessDeniedException: /var/lib/openhab2

Why it’s pointing to /var/lib/openhab2 - not /var/lib/openhab ?

Check the home dir location for the openhab user. I had the same error after upgrading and found out that it was still set to /var/lib/openhab2. After changing that the error disappeared.

1 Like