OpenHAB2 Plugin

I’ve created a plugin which uses the Rest API of OpenHAB2 to read the items and interact with it.

Prequisites:
You have to put all the items you want to see in the plugin in a OpenHAB Group. When you install the plugin you will be asked for the Base URL of OpenHAB (usually something like http://192.168.1.xxx:8080) without trailing slash and the name of the OpenHAB Group containing the items. If you configured your group fine the devices will be read from OpenHAB and you should see them in the plugin. If no devices are found, check the log for errors. Most probably you have some spelling error in the group or URL.

How to use it
Each device you see has 2 attributes: “Command” and “State”. This directly relates to OpenHAB2 commands and states of the items. To execute an action set the “.Command” attribute to the value of an OpenHAB2 command of the device. On the other hand the plugin is polling the “State” of the items from OpenHAB2 and updates the “.State” attribute accordingly. You can also update a “State” field to a new value if this is required by some rules or triggers in OpenHAB2 but this will not trigger any direct action in OpenHAB2. It just updates the Items state value.

Limitations
The plugin does not support any capabilities as there are only few of them in OpenHAB2 anyhow and they do not match the HomeRemote ones and it’s generally not needed, I don’t even know if they are exposed. Also channels of OpenHAB2 items are not directly supported. Of course feel free to improve on this points if you have a need and share it but I think for 99% of the cases the plugin should do fine.

Download plugin here.
openhab.plugin (2.7 KB)

2 Likes

Hi Marc,

thank for your openhab plugin.
I just installed it and prepared my openhab with a dedicated group for home remote including a single item. Settings were accepted by the designer, so it seem the group and URL seem to be correct.
When I add a new variable within the designer, the designer crashes.
What kind of debugging options do I have to identify the root cause?

Thanks in advance,
Sven

Solved: It was related to the “is legacy” issue discussed here:

Now I have a new issue.
My configured openhab item is visible to HomeRemote: “ArbeitszimmerRoom_Helligkeit”.
The dropdown table for value device binding is shown below:
2020-10-05 16_30_52-MqttClient_SE.hrp - Home Remote Designer
I’m trying to assign this openhab item to a slider in home remote.
I need to select either “ArbeitszimmerRoom_Helligkeit.Command” or “ArbeitszimmerRoom_Helligkeit.State” from the dropdown list.
If I select “x.state”, updating the slider works, but I can’t set any value.
The URL includes “/state/” in this case, so the wrong function inside the plugin’s javascript code is called,
when moving the slider button.
If I select xxx.command the value is empty.

Received HTTP POST request at ‘items/ArbeitszimmerRoom_Helligkeit’ with an invalid status value ‘’.