openHAB 3.0 Milestone 5 discussion

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

Thanks, there was still old path /var/lib/openhab2. It should be included somewhere in info, or updated during deploy.

1 Like

+1 on that. I planned to mention that somewhere but I think I didn’t.

Also, for the record, I followed instructions (don’t remember exactly where) on how to purge OH2 data and then recreate the openhab user using scripts in the OH3 package, still the user was created using the wrong path.

I’m using apt packages in Debian. Thinking about it though, this might be the wrong thread, maybe it’s more package related than pure OH3. Something for @Benjy?

1 Like

I have no Blockly button in script windows (Ctrl-D does nothing). I run OH3 snapshot in docker. Is this a bug or I need something else installed to see Blockly button (script is empty)? I cannot see blocky on Windows setup either (Windows 10 20H0), Zulu 11 latest.
It was an issue with M4, yet in M5 but right now Build #2050 is isntalled and still no Blockly. This may not be related to M5 only…

I have imported(Developer-Tool) a Group-Item with Aggregation-Function:

Group:Switch:OR(ON,OFF)           gLight          "Licht [MAP(de.map):%s]"                <light>               (Home)
Group:Contact:OR(OPEN,CLOSED)     gDoor           "Türen [MAP(de.map):%s]"                <door>                (Home)
.........

and got an Error-Message in the Logger:

2020-12-08 00:15:22.813 [ERROR] [e.internal.items.GroupFunctionHelper] - Group function 'OR' requires two arguments. Using Equality instead.
2020-12-08 00:15:22.820 [ERROR] [e.internal.items.GroupFunctionHelper] - Group function 'OR' requires two arguments. Using Equality instead.
2020-12-08 00:15:22.826 [ERROR] [e.internal.items.GroupFunctionHelper] - Group function 'OR' requires two arguments. Using Equality instead.
......

What’s wrong ? Any idea ?

Sorry, I wasn’t aware of this bug. Created openhab-linuxpkg/#191 to fix and am currently testing before merge.

4 Likes

Completely my fault. I did never report it :sunglasses:

3 Likes

Does anybody else have problems with mapdb persistence in M5 ?

Mine doesn’t work and has a “waiting” status in console. A feature:uninstall .... feature:install for me results in

2020-12-08 15:44:24.066 [DEBUG] [pdb.internal.MapDbPersistenceService] - MapDB persistence service is being activated
2020-12-08 15:44:24.271 [ERROR] [org.openhab.persistence.mapdb       ] - bundle org.openhab.persistence.mapdb:3.0.0.202012071005 (287)[org.openhab.persistence.mapdb.internal.MapDbPersistenceService(373)] : The activate method has thrown an exception
java.lang.RuntimeException: java.lang.ClassNotFoundException: org.openhab.persistence.mapdb.internal.MapDBitemSerializer cannot be found by org.openhab.persistence.mapdb_3.0.0.202012071005
        at org.mapdb.SerializerPojo.classForName(SerializerPojo.java:99) ~[?:?]
        at org.mapdb.SerializerPojo.<init>(SerializerPojo.java:116) ~[?:?]
        at org.mapdb.Store.getSerializerPojo(Store.java:113) ~[?:?]
        at org.mapdb.EngineWrapper.getSerializerPojo(EngineWrapper.java:135) ~[?:?]
        at org.mapdb.EngineWrapper.getSerializerPojo(EngineWrapper.java:135) ~[?:?]

EDIT: SOLVED. I had to delete the mapdb files - whyever.

DateTime is basically a numerical value, it represents an amount of time from epoch. I created an issue to add support for it to rrd4j: [rrd4j] add support for DateTimeType · Issue #9292 · openhab/openhab-addons · GitHub

For a while now, I’ve been seeing sporadic high CPU and memory utilization on my OH3 environment. Only yesterday I was able to determine that the behavior occurs whenever I save changes to an items file. It’s especially severe (high CPU and memory for several minutes) when the items file contains a large number of items (e.g. > 100).

I’m not sure if this really is a M5 issue, as it was occurring before M5. I suppose it also could be an issue with my installation.

I’m posting to see if anyone else has seen this behavior. It manifests itself a couple different ways.

  • If I try to shutdown openHAB immediately after I save an .items file, it takes 1.5 minutes for OH to shutdown. And, it only shuts down because the systemctl timeout causes systemctl to kill the openHAB process (the timeout is currently 90 seconds).

  • After saving changes to one items file, if I immediately save changes to another items file, the normal “Loading model…” log message doesn’t show up in the log file right away. It shows up a few minutes later after OH finishes whatever it’s doing with the first file.

  • Looking at cpu utilization in top or pidstat, I see elevated cpu utilization for anywhere from 30 seconds to several minutes, depending on the number of items in the file.

Here’s an example from VisualVM. You can see very stable/normal cpu and memory utilization. The red arrows represent when I saved the items file, and you can see where something is consuming 1 of the 4 cpus in my box for about 3 minutes.

Looking at thread utilization in VisualVM, I see the OH-file-processing-NN thread consuming large amounts of CPU and memory for several minutes.

Is anyone else seeing behavior like this? If not, maybe it’s an issue with my installation, so maybe I should blow away the install and start from scratch.

Edit: I should note that this installation currently has no rules defined.

Edit: I opened an issue as I was able to reproduce the problem on a fresh install with nothing but a single items file containing 405 items.

Edit: This issue is fixed in build 2060. Thanks @wborn!!

4 Likes

Wasn’t it like that ever ? All rules files that used any of the items from the file you changed get recompiled, causing the load you see.
I took the opportunity and imported my .items in the Main GUI rather than to load them as files.
Haven’t encountered that issue since (because the Xtend-internal dependency is gone).

I currently don’t have any rules files.

I should explain this a bit. The system in question is a test system that I’ve been using to test OH3. At this time, I haven’t created any rules yet.

1 Like

Perhaps I’m misinterpreting your comment, and if so I’m sorry. But, I don’t think it’s correct to determine blame without knowing the true cause. It didn’t take minutes to load an items file in 2.5, and 2.5 used xtend.

1 Like

There is definitely a bug here I think. You should file an issue.

When you create a new “Script” and select ECMAScript as the language it will give you the option to use Blockly.

However, that doesn’t appear if you create a Rule and script action there using ECMAScript.

Ideally, Blockly would be an option from the list of languages.

True but it’ll still be “half backed” since there is no support for String, Player, Location, Image, etc?

True but it’ll still be “half backed” since there is no support for String, Player, Location, Image, etc?
[/quote]

But it’s getting more baked :laughing: There are methods where you could store a location as a numeric value. For example here’s on I found in JavaScript

pairCoordinates = function(lat, lng) {
  return lat * 1e7 << 16 & 0xffff0000 | lng * 1e7 & 0x0000ffff;
}

It does (it’s shown in my demo) but you have to click on that little “Edit script” icon on the right to get the same full-screen script editor, the one you access from the action popup module is a basic one:

But this requires the rule to exist so you have to save it first, then the icon appears and you can click it. Convoluted, I know.

1 Like

All things considered, given the Blockly is intended for the new and not programmer type user, we should really make it more prominent and obvious how to get to it. Is there no way to just make it as a selection along side ECMAScript and Rules DSL? I understand how that might be difficult given what I know about how it all works (as limited as my knowledge extends in that regard) but I think we need to make getting to Blockly super obvious for the users who would be drawn to use Blockly in the first place.

Also, why does it work differently if I click on the Script Action and then click on Edit or the [ ] options from clicking on the edit icon? I’d have expected at least the [] option to take me to the same place but apparently it does not because the code color coding doesn’t even work there.

Here is what a simple script action I have looks when I click on the edit icon:

Here is what it looks like when I select the action and then choose “Edit Script”

And here is what it looks like when I select the [] option.

I was actually going to file an issue this evening about the fact that the code highlighting wasn’t working everywhere. But I think something else is going on now.

3 Likes

Yes, it’s not good, and it’s not only about Blockly.

I’m not particularly happy about this UX when you add a module:

It takes some effort to parse the list to figure out which module to pick and it’s often the same thing, something happening to items, most likely, or doing something to them. So the list could remain as a fallback but what should be presented here is something much more friendly. A series of buttons with the most popular actions, including a scripted action with or without Blockly, and not some generic way of configuring a module like that.

If there will be improvement before the release candidate, I’m not sure.

3 Likes

Yes that would be an UX improvement. Personally, I like the way Bosch has implemented this. Transferring this idea into OH3 would mean:
For triggers you could select from all available points grouped by Sematic Property from the model ie. temperature for example.
Conditions: Would be state of available items or a selector for time and day of the week.