openHAB 3.0 Milestone 2 discussion

Also need to make sure to Validate JSON data… this tool may help https://codebeautify.org/jsonvalidator

1 Like

I tend to use https://jsonlint.com/

1 Like

Still getting a null back. I dumped the deviceinfourl out to the log file and it looks fine. I ran the curl script manually and it returns no issues.

    var String url = ""
    var String deviceinfourl = ""

            url = s.get(1)
            deviceinfourl = "'" + url + "query/device-info'"
            var String deviceinfo = executeCommandLine(Duration.ofSeconds(5),"curl","-s","-X","GET",deviceinfourl)

If you are using a language other than Rules DSL, the item registry is available as the variable ir so you can just use ir.getItem(I.name). If you are using the image registry to get at an Item’s state you can use items: items[I.name].

There is no reason to call toString on I.name, name is already a String.

When you’re ready, we’d like to see your logs too. Why is this always such hard work. All of us make typos we can’t spot etc.

1 Like

Let me know what you want dialed up. I get no logging errors at all when this runs.

I HATE making typoes in messages meant to correct somebody else’s typo. :roll_eyes:

This is in the rules DSL hence the need for it. Agreed on the toString, I probably had it in there a long time ago for some reason and just never pulled it out.

I enabled debugs and I see this now.

2020-11-09 21:44:41.533 [DEBUG] [rg.openhab.core.io.net.exec.ExecUtil] - exit code '6', result '', errors '  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                             Dload  Upload   Total   Spent    Left  Speed
0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: 'http

I removed the single ’ in the url and I get the correct reply as per the debug back but I still get exit code 6 which is making it return null.

Edits on top of edits. When I send the URL as a string variable, without the ', it seems to work.

I’m seeing the same thing. I can manually remove the subject MergeList item and I can then run upgrade, but running apt update adds the list back.

Consequently, I recently updated Ubuntu to 20.04.01 (both for OH2 and OH3). Both environments have the same error message for the Test repository.

Is this possibly an Ubuntu thing?

In the new Rule Editor, how do you delete a rule? There doesn’t seem to be an option available other than to disable it.

will run openhab on raspberry 3b +

@DeanC: Settings -> Rules -> Upper right corner click button SELECT

If I understand the question correctly you are asking if OpenHAB 3 will run on a Raspberry Pi 3b. I am currently running it in a 3b+ as my test system. It will not work with the old Java 8 required by OpenHAB 2 but it works with Java 11.

From the main rules page that lists all the rules, click on “Select” at the upper right corner, select the rule(s) you want to delete and click “delete” at the bottom of the screen.

1 Like

I saw this is inconsistent with things and opened an issue to address this, you know :wink:

i cant add fmiweather as thing

i get this error:

and i only have these items in my oh3 installation:

You’re probably trying to add another Thing with the UID fmiweather:forecast when one with that UID apparently already exists, that’s why you get a HTTP 409 Conflict error.

I’m in the process of converting my script based rules over to the NGRE. I have one rule that triggers a morning routine on workdays. In the script I use !Ephemeris.isBankHoliday() to not trigger on public holidays.

With the NGRE, under But only if, I only have a choice of it is a weekday or it is a holiday. Looking in the code, it is a weekday is implemented as !ephemerisManager.isWeekend(target). Digging further, this is resolved as isInDayset(CONFIG_DAYSET_WEEKEND, date);. So this would return true for a weekday that is a holiday.

It looks like there is no way to define a schedule rule that triggers on weekdays that are not holidays in NGRE.

Anything that can be done in code can be done through the UI too. If there isn’t an option to choose the specific Ephemeris condition in the drop down list, choose “a given script evaluates to true” and write the condition in code. If you are using JavaScript see openHAB 3.0 my getting started notes: Rules and I’ve an example for how to call Ephemeris Actions. Just call the isBankHoliday().