[SOLVED] Phillips Hue Dimmer Switch with Raspbee/deconz

I’m using Raspberry Pi with OpenHAB, RaspBee (Pi + Zigbee from Dresden Elektronik), Phillips Hue Lights and Dimmer switches. Replaced the Phillips Hue Hub with the RaspBee. Lights are working. The Dimmer Switches (4 buttons) are working (switching/changing the light) as configured with the Phoscon WebPanel, but not available in OpenHab.
Why? I want to monitor the battery status of the switch and issue a reminder on my HabPanel. Before, using the Phillips hub, one of the switches was already “orange”. Also, I will want to use them to trigger other actions - did so before implementing a color loop.
I can access the switches with the Phoscon REST api:

output of /sensors:
{“1”:{“config”:{“configured”:true,“on”:true,“sunriseoffset”:30,“sunsetoffset”:-30},“etag”:“abfbfed956e614b4ad532d4969663e6e”,“manufacturername”:“Philips”,“modelid”:“PHDL00”,“name”:“Daylight”,“state”:{“dark”:false,“daylight”:true,“lastupdated”:“2019-10-20T11:11:25”,“status”:170,“sunrise”:“2019-10-20T07:55:38”,“sunset”:“2019-10-20T18:26:55”},“swversion”:“1.0”,“type”:“Daylight”,“uniqueid”:“00:21:2e:ff:ff:03:fe:98-01”},“2”:{“config”:{“battery”:100,“group”:“25235”,“on”:true,“reachable”:true},“ep”:2,“etag”:“a63bbf2402eed60693c669a37f3c7172”,“manufacturername”:“Philips”,“mode”:1,“modelid”:“RWL021”,“name”:“Schalter Bad”,“state”:{“buttonevent”:4002,“lastupdated”:“2019-10-19T21:16:17”},“swversion”:“6.1.1.28573”,“type”:“ZHASwitch”,“uniqueid”:“00:17:88:01:06:73:4d:69-02-fc00”},“3”:{“config”:{“battery”:100,“group”:“18130”,“on”:true,“reachable”:true},“ep”:2,“etag”:“2806c63edc8718393694f0391b950ed2”,“manufacturername”:“Philips”,“mode”:1,“modelid”:“RWL021”,“name”:“Schalter WoZi”,“state”:{“buttonevent”:4002,“lastupdated”:“2019-10-19T21:06:59”},“swversion”:“5.45.1.17846”,“type”:“ZHASwitch”,“uniqueid”:“00:17:88:01:06:e8:5e:af-02-fc00”}}

How to get them showing up in OpenHab?
Why do I get ‘“battery”:“100”’?

Did you install the DeCONZ binding?

I have deconz and hue binding. Already did a uninstall/reinstall. Lamps work fine straight away. Philligs Hue hub is removed and the hue app is uninstalled from the mobile.

Do you have successfully created the deconz bridge thing?

Yes, the bridge is in my things.
It says it is a “Philips Hue Bridge”.
Status: online. Properties are serial no and vendor: Philips.

I think that’s your bridge from the Hue Binding. You need a second one from the DeCONZ binding.

Both name and firmware version fit to the raspbee. The phillips device is unplugged.

What I’m doing now:
Removing the bridge sets the lamps to status “uninitialized - handler missing error”.
Removing the hue binding.
Restarting the openhab server.
Lamps are now “Unitialized” (without the “handler missing” part).
Searching for items with deconz binding finds nothing.
Installing hue binding.
Searching for items with hue binding finds nothing.
Of course - I have to set the Phoscon SW to “App Verbinden”.
Uninstall hue binding again.
Restart Openhab2.service.
Set the Phoscon SW to “App Verbinden”.
Searching for items with deconz binding finds nothing.
Installing hue binding.
Set the Phoscon SW to “App Verbinden”.
Searching for items with hue binding finds nothing.

So no bridge/hub at the moment.

Restart of the Raspbee from the Phoscon Panel did bring it back as Hue bridge.
Added as item, connecting from the Phoscon side, the lamps show up as items.
Back where I did start.

You need both bridges. One from the Hue binding that connects to the Raspbee and handles the lights (and plugs) and one from the deCONZ binding that connects to the Raspbee and handles the switches (and sensors).
So it wouldn’t have been necessary to remove the bridge from the hue binding.

To bring back the bridge you can try to stop openHab and clean the cache. Then you should be able to add the bridge from the hue binding again (and also the bridge from the deCONZ binding).

I have one (1) thing that is the hue bridge (which is the raspbee and not the phillips hue hub).
Should I have a second thing that is the deconz bridge and physically also the raspbee?

Yes.

Thank you!
Manually added deconz bridge, entering IP adress, connect from Phoscon. Status ONLINE!

But still not having the switches. They don’t come automatically. Doing it manually - whatever I try, the openhab log says:
Cannot create thing. No binding found that supports creating a thing of type ‘deconz:switch’.

What I do - Paper UI:
Inbox - deCONZ - add things manually - Switch/Button
Then select the bridge. Tried as sensor id (it’s from the RestAPI, number, ETag, unique ID):
2
a63bbf2402eed60693c669a37f3c71
00:17:88:01:06:73:4d:69-02-fc00

Strange.
Autodiscovery should work when everything is set up correctly.
The error indicates that the deCONZ binding isn’t installed. But it is, correct?

Yes deconz binding is installed, version 2.4.0.
Did an uninstall, reboot the pi, install the binding, reboot the pi.
Meanwhile, I managed to address the deconz bridge with a deconz.thing file. So:
Bridge deconz:deconz:homeserver [ host=“192.168.XXX”, apikey=“XXX” ] {
switch Schalter_Bad “Schalter_Bad” [ id=“2” ]
}
Shows me the deconz bridge.

Using this
http://gsf.diphda.uberspace.de/smarthome/2019/03/24/teil-4-openhab2-frust-mit-zigbee/
I updated the binding to 2.5.0 and the switches show up!

Ok, Syn/Christoph, thank you for your help. The switches are in OpenHab2.
Seems like deconz isn’t giving the values about battery - I get battery_level “-NaN%” and battery_low = false.
I’ll ask at github about that.

Again issues with deconz. Using aqara door/window sensors. Don’t automatically show up in openhab.
Manually add them in the thing-file using [ id=“2”].
Now they show up in paper ui things.