openHAB 3.0 Release discussion

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.

Maybe the question about the comment should be another: How to mark comments in yaml?

YAML only supports inline comments using the number (#) symbol.

ie.

# This is a comment
config:
  label: Page Label
  sidebar: true
  order: "1"
blocks:
  - component: oh-block   # This is another comment

I think the root problem is the UI is transforming between YAML and JSON and that conversion is unable to handle the comments so the comments get stripped out. Yannick posted a comment about that somewhere I can’t find anymore. It’s a technical challenge that has not been solved yet.

Ah, sounds reasonable.

Thanks for the quick reply.

As far as I can see there is currently no dynamic syntax check in the rules (so that errors are highlighted in red) and no IntelliSense in the main UI rule editor. This currently only seems to work with Visual Studio Code. If this should work then maybe there is something wrong with my installation?

Regarding the Sitemap comments. When I create a sitemap in the main UI the code is shown in Javascript just like in the sitemap files and not as YAML. So I was able to just copy & paste my sitemap file in there.
I’ve commented out elements in the sitemap using the // characters. The advantage of the main ui editor would be that I can change the sitemap from a browser and get a nice hierarchical view of the sitemap which would help sometimes because my sitemap has grown quite large.