How to configure items from OH1 binding

639 views
Skip to first unread message

Marcel Verpaalen

unread,
Dec 6, 2014, 7:11:14 AM12/6/14
to open...@googlegroups.com
Hi,

I'm trying to convert my OH1 setup to OH2. Struggleing a bit with getting the configuration.
I converted the openhab.cfg to the respectitive binding.cfg which seems to be fine.

However, how to define the things?

e.g. if I had in OH1:
Number Energy_Solar_T "Solar Energy Total [%.0f kW/h]" <sun> (Solar,Energy)   {mqtt="<[mymqtt:/solar/energy/T:state:default]"}

when I copy this 1:1 to OH2 I don't get updates. I assume I need to rewrite the   {mqtt="<[mymqtt:/solar/energy/T:state:default]"} part to point to a thing and create a thing...
Anyone quick pointer on how this should be rewritten?

Kai Kreuzer

unread,
Dec 6, 2014, 11:08:17 AM12/6/14
to Marcel Verpaalen, open...@googlegroups.com
Hi,

If you are using the OH1 binding, it should be exactly the same binding configuration - no need to change anything in the item file.
So best would be to check with the debugger why nothing is happening. I am not sure, if the mqtt binding works correctly with the compatibility layer as it requires the io.transport.mqtt bundle, which is now under ESH namespace…

Regards,
Kai

--
You received this message because you are subscribed to the Google Groups "openhab2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhab2+u...@googlegroups.com.
To post to this group, send email to open...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openhab2/46962fc5-2130-442d-af24-d964af027286%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Marcel Verpaalen

unread,
Dec 8, 2014, 3:43:33 AM12/8/14
to open...@googlegroups.com, marcel.v...@gmail.com
Hi Kai,

Thanks, indeed the mqtt binding is not compatible at the moment that was the cause that it did not work. 
The  io.transport.mqtt bundle move to ESH namespace broke the stuff.

Marcel


Op zaterdag 6 december 2014 17:08:17 UTC+1 schreef Kai Kreuzer:

Kai Kreuzer

unread,
Dec 8, 2014, 3:56:53 AM12/8/14
to open...@googlegroups.com, marcel.v...@gmail.com
Hi Marcel,

As the io.transport.mqtt bundle is an addon in openHAB 1.x, does it maybe simply work if you add this bundle additionally to your openHAB 2 runtime?

Regards,
Kai

Marcel Verpaalen

unread,
Dec 10, 2014, 2:58:56 PM12/10/14
to open...@googlegroups.com, marcel.v...@gmail.com
Hi Kai,

Yes, after bit of troubles it worked  Thanks for the pointer.
(I tried it first but forgot that I had a failed attempt to re-write of the binding to OH2 still in the folder ;( , second issue I faced that I copied the working setup too literally hence I had 2 configs refering to the same clientID. That was the cause of the connectivity issues to the mqtt server) 

I'll update the compatibility matrix

For anyone trying:  the key is that besides the copy of the OH1 to copy the transport jar:

Hence your addons folder should contain both 
 org.openhab.binding.mqtt-1.7.0-SNAPSHOT.jar
AND
org.openhab.io.transport.mqtt_1.7.0.*.jar

The 2nd file you can copy from your OH1 server/plugins/ folder.




Op maandag 8 december 2014 09:56:53 UTC+1 schreef Kai Kreuzer:

Kai Kreuzer

unread,
Dec 11, 2014, 10:24:32 AM12/11/14
to open...@googlegroups.com, marcel.v...@gmail.com
Thanks for the analysis, Marcel!
I am not sure, whether we should suggest taking the io.transport.mqtt bundle from the 1.x runtime or if I should rather enhance the compatibility layer to offer these classes directly and route them to the ESH version of the bundle. I think that would be the nicer solution, what do you think?

Regards,
Kai


Marcel Verpaalen

unread,
Dec 12, 2014, 4:53:36 PM12/12/14
to open...@googlegroups.com, marcel.v...@gmail.com
Yes, that would definitely be the better solution. 
In that case I do believe we need to improve the OH1 mqtt bundle as well as it  has a requirement for a specific version of the transport bundle and I assume that version can't be matched. 
Require-Bundle: org.openhab.io.transport.mqtt;bundle-version="1.3.0"

'


Op donderdag 11 december 2014 16:24:32 UTC+1 schreef Kai Kreuzer:

Kai Kreuzer

unread,
Dec 13, 2014, 4:41:34 AM12/13/14
to open...@googlegroups.com, marcel.v...@gmail.com
Indeed, that needs to be adapted as well!

--
You received this message because you are subscribed to the Google Groups "openhab2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhab2+u...@googlegroups.com.
To post to this group, send email to open...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages