Linking Xiaomi smart switch to Deconz

@Robban @donnib Great work on the Deconz component. I’m in the process of moving all my Xiaomi devices over to Deconz. It works great with the motion sensor and door/window sensor. However I’m not able to get the round wireless switches connected to Deconz. In the Phoscon App it is found as sensor but does not show up in the list. Do you by any chance have a solution?

I also made a issue on it on the Deconz Rest plugin Github.
I’m running deconz headless (2.04.99), so have only access to the wireless light webapp, and the Phoscon App.

Thanks in advance

If they’re switches they get exposed as events in HASS. If they report battery you should have a battery sensors that also keeps the name of the event that the switch will generate. Check the component documentation to get examples of automations using those events.

Which round switch do you have issues with?

Thanks for answering. They do not show up in HASS in the event list (also not a battery sensor). The motion and door/window sensor do.
The problem is that I cannot get Deconz to link with the switch in the first place. I don’t think it is a problem with the Deconz component you wrote, but with the Rest plugin of Deconz.

No most probably not. I’ve had some issues adding different devices to Deconz. My solution was to try and try again

Do you use the webapp wireless light or the Phoscon App for the linking? The Phoscon App does say it found a connection, but afterwards it is not listed in de sensor list.
I’ve been trying all day with no succes.

Haven’t tried the phoscon yet.

You can create a button in HASS that will open the network ;).

How would I do that? I’ve been looking in the REST API documentation, and found something about “permitjoin” parameter, but I do not know how to use this

Anything that can call a service like a switch that specifies those values. I don’t have a ready example, maybe I should add that to the documentation

something like a script:

deconz_gateway:
  alias: open network deconz
  sequence:
    - service: deconz.configure
      data:
	    permitjoin: 60

ok, made some progress.

Through Postman I collected my Api and opened the network and reset the button to join it like described in the REST API documentation of Deconz. Then did GET /api/apikey

and got the following:

    "5": {
        "config": {
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "ca1d961e4cc0d3166e6e327bb0787360",
        "manufacturername": "LUMI",
        "mode": 1,
        "modelid": "lumi.sensor_switch",
        "name": "lumi.sensor_switch",
        "state": {
            "buttonevent": 1002,
            "lastupdated": "2018-01-17T21:19:09"
        },
        "type": "ZHASwitch",
        "uniqueid": "00:15:8d:00:01:9c:a7:0a-01-0006"

The button is still not showing in de webapps. Also restarted HASS but there it is also not visible. Seems like a bug in the Rest API?

See if you can create a group and add the remote to it, I’ve read something about that requirement.

I can only add lights to a group, not sensors unfortunately

Then I don’t know :slightly_frowning_face:

You can enable debug for the deconz component to see if you get any data over the websocket

1 Like

Thanks for your help!

I can see that my switch is connected to Deconz, and the “lastupdated” parameter changes when I press the button. However it is not visible in the Webapp.

Maybe @donnib has got some advice, as I think I read that he also uses the xiaomi wireless smart home switches (don’t know for sure)

how do u guys proceed to add a device? theres no xiaomi on the list. i have the square buttons aqara. any help appreciated running latest deconz

I don’t know about the square button, but I added the motion and door sensor in via Phoscon app through sensor > add new sensor > other

Just do ‘open network’ and then follow your devices instructions for connecting

it just wont work :frowning: nothing is added

Is it that you don’t see it or you know it is not added?

Don’t see it … i have those square buttons. They might be added ad binary sensors?