Moving from openhab1 to openhab2 (not going well lol)

Ok, so I finally started my migration. I followed the instructions to bring all my legacy stuff over. So far… almost nothing is working.

Small things like the http binding are working. The xbmc is as well. Anything to control lights… not so much.

So here is what I have. Ubuntu 14. Fresh install of openhab2 as of last night. zulu for java. Working with just the flat files (expert mode) for fault tolerance reasons.

I have my thing file for hue

Bridge hue:bridge:1 [ ipAddress="192.168.2.42",userName= "H9sS6DbV-lefN08gg8qHEeVmzPFzP3yEPZpyIVyZ"]
{
0210 bulb1 [lightId="1"]
}

Simple enough.

My item file has

Switch Toggle_2   "Living bulb" (gLivingRoomLights,Switching) {channel="hue:010:1:bulb1:color"}

no issues there other than poor naming.

But in my log I see this.

2018-05-28 10:30:15.753 [hingStatusInfoChangedEvent] - 'hue:0210:1:bulb1' changed from OFFLINE: Hue bridge reports light as not reachable. to ONLINE
2018-05-28 10:30:56.797 [hingStatusInfoChangedEvent] - 'hue:0210:1:bulb1' changed from ONLINE to OFFLINE: Hue bridge reports light as not reachable.
2018-05-28 10:31:06.919 [hingStatusInfoChangedEvent] - 'hue:0210:1:bulb1' changed from OFFLINE: Hue bridge reports light as not reachable. to ONLINE
2018-05-28 10:36:20.916 [hingStatusInfoChangedEvent] - 'hue:0210:1:bulb1' changed from ONLINE to OFFLINE: Hue bridge reports light as not reachable.
2018-05-28 10:36:31.040 [hingStatusInfoChangedEvent] - 'hue:0210:1:bulb1' changed from OFFLINE: Hue bridge reports light as not reachable. to ONLINE

When I try to flip the light on or off. I see the state change. But the light doesn’t do anything.

But I also get this.

2018-05-28 11:00:24.282 [WARN ] [org.openhab.binding.upb             ] - FrameworkEvent WARNING - org.openhab.binding.upb
org.osgi.framework.ServiceException: org.apache.felix.scr.impl.manager.SingleComponentManager.getService() returned a null service object
        at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.factoryGetService(ServiceFactoryUse.java:232) [?:?]
        at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.getService(ServiceFactoryUse.java:111) [?:?]
        at org.eclipse.osgi.internal.serviceregistry.ServiceConsumer$2.getService(ServiceConsumer.java:45) [?:?]
        at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:496) [?:?]
        at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.getService(ServiceRegistry.java:461) [?:?]
        at org.eclipse.osgi.internal.framework.BundleContextImpl.getService(BundleContextImpl.java:619) [?:?]
        at org.apache.felix.eventadmin.impl.handler.EventHandlerProxy.obtain(EventHandlerProxy.java:286) [3:org.apache.karaf.services.eventadmin:4.1.3]
        at org.apache.felix.eventadmin.impl.handler.EventHandlerProxy.sendEvent(EventHandlerProxy.java:407) [3:org.apache.karaf.services.eventadmin:4.1.3]
        at org.apache.felix.eventadmin.impl.tasks.HandlerTask.runWithoutBlacklistTiming(HandlerTask.java:82) [3:org.apache.karaf.services.eventadmin:4.1.3]
        at org.apache.felix.eventadmin.impl.tasks.SyncDeliverTasks.execute(SyncDeliverTasks.java:104) [3:org.apache.karaf.services.eventadmin:4.1.3]
        at org.apache.felix.eventadmin.impl.tasks.AsyncDeliverTasks$TaskExecuter.run(AsyncDeliverTasks.java:166) [3:org.apache.karaf.services.eventadmin:4.1.3]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
        at java.lang.Thread.run(Thread.java:748) [?:?]

Not sure why. But it’s pretty consistent.

Anyone run in to this? I am sure this is a long day ahead of me trying to get over to 2. But I have coffee and snacks. Im ready.

do you use https://github.com/openhab/openhab1-addons/tree/master/bundles/binding/org.openhab.binding.upb ?

If yes: make sure that your config file is correct. If not: uninstall it :slight_smile:

I can’t help with the Hue binding… I don’t use it :frowning:

You need to use your serial number:

Bridge hue:bridge:0023456789a1d

I strongly recommend to use autodetection, works flawlessly for all 2.x bindings and especially for the hue binding … You still can use your items files to link the channels to the hue thing.

{ channel="hue:0210:0023456789a1d:1:color" }

uninstalled the upb. so that made atleast that much go away.

1 Like

alright. So I did that. It doesn’t seem to disconnect and reconnect. So that’s awesome :slight_smile:

but… still doesn’t turn my light on and off. lol

I tinkered around with things file for hue a lot and finally when using autodiscovering it worked right out of the box.
I also started with text files (coming from openHAB1), but quickly realized that it is a lot easier to use autodetection …

i have seen that. but i am not a fan of all the stuff from the UI going in to a single DB instead of the files. Harder to tinker with for me and could cause issues with my fault tolerance plans :confused:

You can set everything you like as internal bridge-name in the *.things file - so even “1” should be fine.
But theres a small typing error in your *.items file:

@crankycoder
It should be…

Switch Toggle_2   "Living bulb" (gLivingRoomLights,Switching) {channel="hue:0210:1:bulb1:color"}

instead of

Switch Toggle_2   "Living bulb" (gLivingRoomLights,Switching) {channel="hue:010:1:bulb1:color"}

You used a unknown bulb identification (010)

yep, found that. also had to change my thing file to…

Bridge hue:bridge:001788101202 [ipAddress = "192.168.2.42",userName="tLNHcDh6IzRvFPawtBsNAf70AbBO8UQxyZZakp8-" ]
{
0210 bulb1 [lightId="1"]
}

but!!! it’s working!!!

So i am making progress. I got my mqtt stuff working, which is a BIG part of my setup. so that’s good.

1 Like

Get everything working with the legacy bindings first. Then one by one move to the 2.x version bindings, if you want to. Don’t try to move everything over to the 2.x version of the bindings you are using all at once. It is too much to deal with.

Let me say this again because it always seems to come up. JSONDB is just a text file. You can open it with VIM and everything. You can manually edit it. You can check it into source control. You can write it by hand.

There is nothing you can do with .things files that you cannot do with the JSONDB file.

ah very cool. i may have to play with that a little then. I am sure using the UI would make this ALOT easier.

I have everything working so far from my legacy move over to 2 except i am fighting with my zwave stick. But im almost up and running on 2.

One important note is unless you are using the development branch of the zwave binding, you cannot define Things manually and much use autodetection (unless I missed that getting merged in 2.3).

The location of the files is /var/lib/openhab2/jsondb.

One important caveat I forgot to mention though is jsondb should probably only be manually edited when OH is not running. There have been reports of corruptions and such when editing it by hand with OH running.

Nope. I saw a post from Chris that it is planned to go into snapshot 2.4 shortly.

1 Like

Was actually just looking at his post about the things config. Ill try to get that setup via auto and see what I can do. Thanks!

Please have in mind:


So at the moment you will not be able to change config parameters of your devices if you are using text things files …

so I just did an apt-get update on my machine. Installed some openhab update. and now i am FLOODING my log at startup with this.

2018-05-29 16:41:20.116 [ERROR] [pse.smarthome.core.items.GenericItem] - Tried to set invalid state ON (StringType) on item WorkBenchOutlet1 of type SwitchItem, ignoring it
2018-05-29 16:41:20.119 [ERROR] [pse.smarthome.core.items.GenericItem] - Tried to set invalid state OFF (StringType) on item WorkBenchSafetyOutlet of type SwitchItem, ignoring it
2018-05-29 16:41:20.122 [ERROR] [pse.smarthome.core.items.GenericItem] - Tried to set invalid state -1 (StringType) on item MasterBedRoomLightLevel of type NumberItem, ignoring it
2018-05-29 16:41:20.125 [ERROR] [pse.smarthome.core.items.GenericItem] - Tried to set invalid state OFF (StringType) on item MasterBedroom_MotionSensorOverride of type SwitchItem, ignoring it
2018-05-29 16:41:20.132 [ERROR] [pse.smarthome.core.items.GenericItem] - Tried to set invalid state OFF (StringType) on item BedroomMotionSensor of type SwitchItem, ignoring it

seems like all my persistence recovery is messed up.

ok, odd but it worked. I tried to force a downgrade back to 2.2. That REALLY broke stuff. I ran the apt-get upgrade again and it started up…

So I am happy to say, i am officially up and running with 2.3.

my HUE and zwave is running on standard and not legacy. So I just have to migrate the rest off the legacy plugins. I have started getting in the ui and will be looking at the JSONDB and start working on my fault tolerance setup again.

Thanks for all the help!!!

1 Like