openHAB 3.0 Release discussion

I knew that it was replaced but not very familiar with Java. Didn’t knew I could use getMonthValue.

Still don’t understand why a number item is represented in a log file as JANUARY but that doesn’t matter now. I replaced getMonth with getMonthValue succesfully.

Thanks for the help and explanation!

1 Like

Thanks a lot to all the devs who worked on this! And to @Kai for starting this wonderful project in the first place! :+1: :beers:

Their selfless dedication is the only reason we can have Nice Things™! :grinning:

1 Like

When getMonth() is called on a ZonedDateTime object, a Month enum value is returned. So it is not a number. If you log this Month, the logging implementation calls toString on it, which will return “JANUARY”. Instead of calling getMonthValue() on the ZonedDateTime you can also call getValue() on the Month enum value.

3 Likes

I just updated to 3.0.0 and I am thinking to get rid of at least some of my config files. Actually I was using paperui for things and configfile for items so far. I recognized now in 3.0.0 that once I ignore things in my inbox they are not ignored anymore after a openhab reboot. So I guess some of my config files have a higher prio then OH3 db things and therefor the files are used on OH reboot.
I am wondering now and sorry if I have missed some guideline on this how would be the smartest way to get rid of my config text files. Background I run OH in a docker and always kept on updates the “userdata”, “config” and “addons” folder which I also did now with the update to 3.0.0.

Would be the following workflow be the best way to switch to fully 3.0 UI:

  1. Use the Bulk import for items in the new 3 UI
  2. Shutdown OH and delete my items and things (just mail action and amazonechocontrol thing in there anyhow) file and restart OH

Is this the right approach?
Which other files do I need to delete to ensure 3.0 db is used for things and items and a behaviour like described above with ignored things re-apperaring after a reboot is fixed?
What about my rules which i like to further create/modify in Visual Studio Code. Do I need to somehow import them as well and can still use VSCode with the same syntax?
I would like to still use my sitemap until I got a new page created (and decide then which one I like more). Is this still possible after I imported my items?

Sigh many questions sorry but I am a bit worried that the work I put in the setup so far might be lost and I would have to start from scratch (like many hours just for my rules). The update to 3.0 was kinda ok so far (just some modification for pushover, ZonedDateTime Joda and influxdb was required). But changing to the new world in 3 completly now worries me a bit since everything is working ok so far … :slight_smile:

NoTechi

1 Like

Files always take precedence. One you move stuff to the ui you must remove the files.

Rename the files first and then import them. There is no need to restart OH.

Anything in the conf folder.

This is probably not related to the files. The Inbox shoes discovered Things, not Things from files.

You can continue to use any text config with the the exact same syntax as 2.5. There are just some minor changes for rules outlined in the release notes.

Sitemaps still work as does BasicUI.

You don’t have to move anything to the ui. You can leave them all in the same config files they are in now.

1 Like

I can’t find an equivalent to now.plusMillis(x) though.

You could convert milliseconds to nanoseconds and use plusNanos.

1 Like

Hi Wouter,

(at least) for me clicking on the platform icons on Download openHAB | openHAB does not work (= the clicked icon will not be selected and the page doesn’t change) - when using Download openHAB | openHAB it does. When looking into the Firefox console when loading Download openHAB | openHAB i see this message:

Uncaught (in promise) ChunkLoadError: Loading chunk 29 failed.
(error: https://www.openhab.org/assets/js/29.bb5abd30.js)

Thanks for the heads up! It’s broken for me too again. :slightly_frowning_face: Perhaps @Kai or @ysc can have a look at it?

2 Likes

Hoping Remove assets caching by ghys · Pull Request #267 · openhab/website · GitHub fixed it for good, and @Kai has to clear the CF cache for the last time.

2 Likes

For some reason the writers of Java didn’t offer Millis. In addition to Mark’s suggestion to use plusNanos, you can use the ChronoUnit

import java.time.temporal.ChronoUnit

...

ZonedDateTime.now.plus(500, ChronoUnit.MILLIS)

In JavaScript it would be something like

var ChronoUnit = Java.type("java.time.temporal.ChronoUnit");
var ZonedDateTime = Java.type("java.time.ZonedDateTime");
...

ZonedDateTime.now().plus(500, ChronoUnit.MILLIS);

4 Likes

A post was split to a new topic: Thermostat issue

@Kai you mention that you plan minor releases of OH3 every 6 months or so; by contrast in OH2 you were releasing new bindings and fixes every 1 month; can you please clarify? It seems to me that 6 months is too slow for innovations in bindings…

6 months is about releases i.e. 3.1, 3.2 just like it was 6 months between OH 2.4 and 2.5.
Anybody that wants anything earlier can choose milestones (due about every month) or even snapshot (daily more or less).

4 Likes

I just upgraded from 2.5 to 3.0 and wanted to clean up some things - like renaming items. Previously I could just change the name in my items file and after a while the name was properly updated - so e.g. was reflected in grafana etc. I did this yesterday, but what was happening is: nothing :). When I look at the UI there also seems the link missing. If I adapt the items file and rename it back, the link is back again.

So I’m wondering now, what is the official way of renaming items now? And: what is the recommendation about linking now? E.g. I created an item in my items file pointing to a thing (like I did before with 2.5). But If I look in the UI, it is not showing as linked. So also the item does not work when I use it in a rule.

I guess I simply missed something in the release notes?

Are you sure that the items as written in the (old) file uses the correct syntax for the channel? If not, this link can’t be used.
Renaming items ( as in using another UID) is not possible, changing the laber however is!

Renaming is a delicate point. See this Thread for more info.

I just want to thank all of you involved in the making (and future maintenance) of OH3.
It looks great and initially I’ve found a lot of nice features. For example I’m considering skipping Grafana in favor of the UI graph views.
Although the UI based programming is not for me, I could really see how it could be a way for non-programmers to start with home automation.
Keep up the great work, I love it :+1:

3 Likes

I have several general questions about the Openhab 3.0 release:

  1. Is there an advantage when I transfer my DSL rules from the .rule files into the new rule engine in the main UI? I read somewhere that the rules will be executed (or compiled) faster if they are defined in the UI. Also will there be a syntax check and IntelliSense for DSL rules in the main UI in the future?

  2. The new main can also display YAML code for items, things etc. Does this mean that an ESPHome integration could be a possibility in the future like the implementation in HomeAssistant?

  3. Sitemaps can now also be defined in the main ui. In my sitemap I’ve commented out several items that are not needed at the moment and I would not like to delete them all because I could use them again in the future. Sadly those commented lines trigger an error in the main ui. Is there another way to disable sitemap items that are not needed in the moment?

  1. You can view, modify, enable and disable the rules through the UI remotely. You can split up your rules into a then and but only if clause which sometimes can greatly simplify the rules. I think there already is some syntax checking an intellisensce in the Web UI.

  2. No. The mere use of YAML does not make openHAB any closer or farther away from supporting integration with any third part tool or technology. And in this case, the use of YAML is only used by the UI. The underlying data is encoded in JSON.

  3. What style of comment did you use? If the sitemap is defined in a .sitemap file does it really matter if MainUI is complaining about it? MainUI can’t show sitemaps anyway, only BasicUI and the phone apps do.