im writing down for others my experiences with the upgrade to Openhab 4.0.1 because im thinking others could have benefit from my experiences how to successfully do the upgrade:
upgrading after docker pull the new image told me successful and some problems then were waiting for me to solve:
i had to install addon Nashorn Engine for getting my ecma-scripts again running.
[WARN ] [penhab.core.library.items.NumberItem] - Failed to update item 'Sensor_HelligkeitWesten' because '8197.12 °C' could not be converted to the item unit 'lx'
my knx channels with illuminance were automaticly detected as °C. This means that no more values were updated to the item. To change this i had to redefine the channels with the correct DPT:
example: <31/1/0 change to 9.004:<31/1/0
also this was nessecary for humidity to add 5.001 as DPT.
i had some items which had Power in W in there. This where automaticly taken as kW.
I had to go to the item and had to set the unit manually as W and then all was fine.
excessive Logging in event.log “updated to” (multiple lines per second same Item) 2023-08-03 19:16:17.540 [INFO ] [openhab.event.ItemStateUpdatedEvent ] - Item 'xxx' updated to OFF
you have to add 2 lines to openhab_userdata/etc/log4j2.xml if you have this outside on a volume (See case )
For your point about persistence and unit, it is strange that you have to force a unit to W as the default for Power dimension is W and not kW. https://www.openhab.org/docs/concepts/units-of-measurement.html
Was your item and your binding channel of type Number:Power?
Is your item managed by UI or define in a config file?
Hi @Lolodomo , log4j2.xml: it was on my docker-install on a volume and thats why possibly not updated by pull the new container. Power: These were calculated by a rule from voltage and current measurements since a long time and saved to persistence. It did wrong graphs with doing nothing. And so it was nessecary because the 2 year retention would be bad if i would change calculation to kw and saving to the historical data. So i deciced to enter a “W” in Unit and all was fine for me.
This is prometheus monitoring of “cpu busy” (from node exporter dashboard) and you can see impact in middle of img. left side was openhab 3.4.3 and right side openhab 4.0.1 (about 30 or more container on a raspi4 8GB and the only change was updating openhab). Baseline changed from 20% to 30% with upgrade on my side. The upper higher parts i guess from some rules which i rebuilded. But baseline is a good indicator for what the new version did. On my side cpu is not a problem but i noticed it too.
Very interesting, it clearly shows the difference when moving from OH3 to OH4.
Maybe the move from Java 11 to Java 17 has increased the CPU usage ?
By the way, the CPU usage remains low in your case as in mine.
this i cannot say because java is bundled in your docker-container-image. but could possibly be.
my install is about 500 items, 75 things, about 800 ruleruns per hour and about 3000 itemchanges per hour that you can imagine about size. i could imagine that the 2 lines would have an impact with slow harddisks/sd-cards which some users could have and filling up their diskqueue. this makes high cpu normally. But this was not on my side because i have a very fast ssd in there.
I updated today from 3.4.4 to 4.0.2 and got the same problem. The 2 lines for the logger in the log4j2. xml are missing.
I don‘t know how to add them manually. When I try to edit the log4j2. xml file I got an error because of missing permissions.
How can I update the file?
hi @dirkdirk had the same issue and did it for first time correctly today the team @Wolfgang_S and @Scriptwriter here helped me understand how and here is the more noob level data to share.
i am assuming you can use putty or the equivalent to ssh into the enviroment and you are on an RPI to find the file
sudo bash (this gives you root access be careful what you do with it)
enter your pass (probably openhabian)
*use the short cut to read file - enter log4j2.xml
navigate to the xml using keyboard keep same format/lines/tabs - add your logger item.
use write command from the shortcuts
use exit short cut
type exit to leave the root access
restart your system either via sudo shutdown -r or the service itself via sudo systemctl restart openhab service (didnt check this 2nd one but i think it is the same effect)
hope this helps. (btw always keep a backup if you can of the file you mess with and you can check the permissions via ls - l while in the correct folder.