Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zemismart 4 buttons ZigBee Scene Switch #3611

Closed
tr1plus opened this issue Nov 8, 2020 · 192 comments
Closed

Zemismart 4 buttons ZigBee Scene Switch #3611

tr1plus opened this issue Nov 8, 2020 · 192 comments

Comments

@tr1plus
Copy link

tr1plus commented Nov 8, 2020

Hi all - I just got this button and would like to connect it to my Deconz set-up. Let me know if any info is missing. This is my first device request 👍
Thanks!

Device

  • Product name: Zemismart 4 buttons ZigBee Scene Switch
  • Manufacturer: _TZ3000_vp6clf9d
  • Model identifier: TS0044
  • Device type : Please remove all unrelated device types.
    • Switch
    • Other: (I assume Scene Switch is just a normal switch)

https://www.aliexpress.com/item/4001365407192.html?spm=a2g0o.store_home.hotSpots_6000239680572.0
https://www.zemismart.com/products/zemismart-4-gang-tuya-zigbee-wireless-switch

Screenshots

  • Endpoints and clusters of the node
    image
  • Node Info panel
    image
  • Basic Cluster attributes in the Cluster Info panel.
    image

image

image

@Smanar
Copy link
Collaborator

Smanar commented Nov 9, 2020

Hello, I m trying to include your device, have you something to compile the code to test ?

Take a look here https://github.com/dresden-elektronik/deconz-rest-plugin#install-deconz-development-package-optional-linux-only

So it will be for you

sudo apt install deconz-dev
git clone --branch tuya https://github.com/Smanar/deconz-rest-plugin.git
cd deconz-rest-plugin
qmake && make -j2
sudo cp ../libde_rest_plugin.so /usr/share/deCONZ/plugins

But :

  • better to have the last deconz version available (you will have the next stable in 3/4 days) or can try with the beta
  • you can make a backup of the file "libde_rest_plugin.so" (in another folder), so easy to make rollback if you have problem with my code.

@tr1plus
Copy link
Author

tr1plus commented Nov 9, 2020

Hey

I haven't done this as I'm using the deconz add-on in homeassistant.

I do have a vmware esxi server so I can spin up a temporary VM. Could you just confirm if this makes no changes to the conbee II stick. With that I mean - when I link the stick back to my homeassistant VM it should all still work as before on that vm, right?

Also if I understand your comment I should wait for the week-end to spin up this VM to test? Or will your changes already be included in the new stable?

Just a quick question also - do I first need to install the deconz application as per here https://phoscon.de/en/conbee2/install and then execute your commands? Or are your commands sufficient?

Thanks for the support!

@Smanar
Copy link
Collaborator

Smanar commented Nov 9, 2020

No, don't worry, settings are stored on the device, but you don't change them and other informations (devices) are stored in a DB stored locally.
But it can be harder to install deconz (and the dev environnement) on virtual machine, so not sure it will work.
You can too use the phoscon feature to make a backup, and make a copy of the lib file, to rollbacl fastly.

No the change will be not in the next Stable in 3/4 days, but in the beta the 15 th, so if I m wrong the correction will be in the next one, 1 month after.

And Yes you need to install first deconz, as you need a recent version, you can wait for the next stable, else better to use beta version.

@tr1plus
Copy link
Author

tr1plus commented Nov 11, 2020

Hey

I tried in a VM since I couldn't find another solution quickly 👍
I think I did it with the stable release however - hope that is no big issue.

In the deconz applicationI do see it being a "switch" (see first screenshot), however in the phoscon front-end it's still just 4 lights and nothing is added in my switches. I did add it by selecting 'other' switch.

image
image

Not sure if this is of any help to you?

Thanks!

@Smanar
Copy link
Collaborator

Smanar commented Nov 11, 2020

Same problem than here > #3524

Wireless device are working like wired one ...

I have updated the code, can you make another try pls ?

cd deconz-rest-plugin
git pull
qmake && make -j2
sudo cp ../libde_rest_plugin.so /usr/share/deCONZ/plugins

@tr1plus
Copy link
Author

tr1plus commented Nov 11, 2020

For me it shows up in the deconz client but not at all on the phoscon web app (not even a light like before)

image

@Smanar
Copy link
Collaborator

Smanar commented Nov 11, 2020

Nothing in "sensor" part ?
Can you take a look direclty in the api (the device can be invisible in phosocn), using third app or http://IP:PORT/api/API_KEY/sensors

@tr1plus
Copy link
Author

tr1plus commented Nov 11, 2020

Hey

For whatever reason I see it as a "light" now (but only 1 instead of 4). When I remove this light the switch node in deconz client is also gone.

Last modified date of the libde_rest_plugin.so is 2 hours ago so that should be the latest one you shared.

image

image

Item 22 and 23 in the json below look to be relevant. Not sure if this is of any help

Output of the rest api before deleting and adding the node. (after doing the same below)

{
    "1": {
        "config": {
            "configured": true,
            "on": true,
            "sunriseoffset": 30,
            "sunsetoffset": -30
        },
        "etag": "4d5a471fe5fcc594892f432311156efb",
        "manufacturername": "Philips",
        "modelid": "PHDL00",
        "name": "Daylight",
        "state": {
            "dark": true,
            "daylight": false,
            "lastupdated": "2020-11-11T19:58:11.725",
            "status": 230,
            "sunrise": "2020-11-11T06:53:26",
            "sunset": "2020-11-11T16:03:33"
        },
        "swversion": "1.0",
        "type": "Daylight",
        "uniqueid": "00:21:2e:ff:ff:05:03:a2-01"
    },
    "10": {
        "config": {
            "battery": 100,
            "offset": 0,
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "1f4f1d8b4664cfd2cdce09ccb1c8a773",
        "lastseen": "2020-11-11T20:01Z",
        "manufacturername": "LUMI",
        "modelid": "lumi.weather",
        "name": "Bedroom Sensor",
        "state": {
            "lastupdated": "2020-11-11T20:01:54.172",
            "temperature": 1972
        },
        "swversion": "20161129",
        "type": "ZHATemperature",
        "uniqueid": "00:15:8d:00:04:4a:47:c4-01-0402"
    },
    "11": {
        "config": {
            "battery": 100,
            "offset": 0,
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "1f4f1d8b4664cfd2cdce09ccb1c8a773",
        "lastseen": "2020-11-11T20:01Z",
        "manufacturername": "LUMI",
        "modelid": "lumi.weather",
        "name": "Bedroom Sensor",
        "state": {
            "humidity": 5986,
            "lastupdated": "2020-11-11T20:01:54.179"
        },
        "swversion": "20161129",
        "type": "ZHAHumidity",
        "uniqueid": "00:15:8d:00:04:4a:47:c4-01-0405"
    },
    "12": {
        "config": {
            "battery": 100,
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "1f4f1d8b4664cfd2cdce09ccb1c8a773",
        "lastseen": "2020-11-11T20:01Z",
        "manufacturername": "LUMI",
        "modelid": "lumi.weather",
        "name": "Bedroom Sensor",
        "state": {
            "lastupdated": "2020-11-11T20:01:54.185",
            "pressure": 1006
        },
        "swversion": "20161129",
        "type": "ZHAPressure",
        "uniqueid": "00:15:8d:00:04:4a:47:c4-01-0403"
    },
    "13": {
        "config": {
            "alert": "none",
            "battery": 47,
            "group": "7",
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "cbe52ddf367e862b865054c0315d2989",
        "lastseen": "2020-11-11T20:12Z",
        "manufacturername": "IKEA of Sweden",
        "mode": 3,
        "modelid": "TRADFRI remote control",
        "name": "Bedroom Remote",
        "state": {
            "buttonevent": 3003,
            "lastupdated": "2020-11-10T22:49:39.062"
        },
        "swversion": "2.3.014",
        "type": "ZHASwitch",
        "uniqueid": "00:0b:57:ff:fe:eb:5c:71-01-1000"
    },
    "14": {
        "config": {
            "alert": "none",
            "battery": 74,
            "group": "10",
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "bac3c0d03f0f16741ca7a439198d3b48",
        "lastseen": "2020-11-11T20:08Z",
        "manufacturername": "IKEA of Sweden",
        "mode": 1,
        "modelid": "TRADFRI on/off switch",
        "name": "Bedroom Remote Mini",
        "state": {
            "buttonevent": 1002,
            "lastupdated": "2020-08-27T20:49:20.387"
        },
        "type": "ZHASwitch",
        "uniqueid": "00:0d:6f:ff:fe:a9:4d:e5-01-1000"
    },
    "15": {
        "config": {
            "alert": "none",
            "battery": 87,
            "duration": 60,
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "4d5a471fe5fcc594892f432311156efb",
        "lastseen": "2020-11-11T19:58Z",
        "manufacturername": "IKEA of Sweden",
        "modelid": "TRADFRI motion sensor",
        "name": "Livingroom Motion sensor",
        "state": {
            "lastupdated": "2020-11-11T12:51:04.890",
            "presence": false
        },
        "swversion": "2.0.022",
        "type": "ZHAPresence",
        "uniqueid": "58:8e:81:ff:fe:1e:9a:d5-01-0006"
    },
    "16": {
        "config": {
            "battery": 95,
            "on": true,
            "reachable": true,
            "temperature": 2800
        },
        "ep": 1,
        "etag": "9d5d83c496eabc64cafd96cfcb23a5eb",
        "lastseen": "2020-11-11T20:11Z",
        "manufacturername": "LUMI",
        "modelid": "lumi.sensor_magnet.aq2",
        "name": "Window / Door Sensor",
        "state": {
            "lastupdated": "2020-11-11T20:11:22.222",
            "open": false
        },
        "swversion": "20161128",
        "type": "ZHAOpenClose",
        "uniqueid": "00:15:8d:00:04:5c:f2:40-01-0006"
    },
    "17": {
        "config": {
            "battery": 100,
            "on": true,
            "reachable": true,
            "temperature": 2200,
            "tholddark": 12000,
            "tholdoffset": 7000
        },
        "ep": 1,
        "etag": "daef424e87d72ab2cc8c2768a7d0373f",
        "lastseen": "2020-11-11T20:14Z",
        "manufacturername": "LUMI",
        "modelid": "lumi.sensor_motion.aq2",
        "name": "Bedroom Motion Sensor",
        "state": {
            "dark": true,
            "daylight": false,
            "lastupdated": "2020-11-11T20:14:33.515",
            "lightlevel": 9031,
            "lux": 8
        },
        "swversion": "20170627",
        "type": "ZHALightLevel",
        "uniqueid": "00:15:8d:00:04:49:a0:d5-01-0400"
    },
    "18": {
        "config": {
            "battery": 100,
            "duration": 90,
            "on": true,
            "reachable": true,
            "temperature": 2200
        },
        "ep": 1,
        "etag": "daef424e87d72ab2cc8c2768a7d0373f",
        "lastseen": "2020-11-11T20:14Z",
        "manufacturername": "LUMI",
        "modelid": "lumi.sensor_motion.aq2",
        "name": "Bedroom Motion Sensor",
        "state": {
            "lastupdated": "2020-11-11T20:14:33.515",
            "presence": false
        },
        "swversion": "20170627",
        "type": "ZHAPresence",
        "uniqueid": "00:15:8d:00:04:49:a0:d5-01-0406"
    },
    "19": {
        "config": {
            "alert": "none",
            "battery": 74,
            "group": "12",
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "4d5a471fe5fcc594892f432311156efb",
        "lastseen": "2020-11-11T20:14Z",
        "manufacturername": "IKEA of Sweden",
        "mode": 3,
        "modelid": "TRADFRI remote control",
        "name": "Office Remote",
        "state": {
            "buttonevent": 1002,
            "lastupdated": "2020-11-10T20:04:53.857"
        },
        "swversion": "2.3.014",
        "type": "ZHASwitch",
        "uniqueid": "00:0b:57:ff:fe:d2:cc:9a-01-1000"
    },
    "20": {
        "config": {
            "battery": 100,
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "4df8007b139bda299cd05bbf7175eaec",
        "lastseen": "2020-11-11T20:15Z",
        "manufacturername": "_TZ3000_vp6clf9d",
        "mode": 1,
        "modelid": "TS0044",
        "name": "TS0044 20",
        "state": {
            "buttonevent": 1004,
            "lastupdated": "2020-11-11T20:15:28.540"
        },
        "type": "ZHASwitch",
        "uniqueid": "5c:02:72:ff:fe:a4:ab:ad-01-0006"
    },
    "21": {
        "config": {
            "battery": 100,
            "on": true,
            "reachable": true
        },
        "ep": 2,
        "etag": "a8da0fff26c2e610fbaabd319fd02b5d",
        "lastseen": "2020-11-11T20:15Z",
        "manufacturername": "_TZ3000_vp6clf9d",
        "mode": 1,
        "modelid": "TS0044",
        "name": "TS0044 21",
        "state": {
            "buttonevent": 2002,
            "lastupdated": "2020-11-11T20:15:30.564"
        },
        "type": "ZHASwitch",
        "uniqueid": "5c:02:72:ff:fe:a4:ab:ad-02-0006"
    },
    "22": {
        "config": {
            "battery": 100,
            "on": true,
            "reachable": true
        },
        "ep": 3,
        "etag": "4df8007b139bda299cd05bbf7175eaec",
        "lastseen": "2020-11-11T20:15Z",
        "manufacturername": "_TZ3000_vp6clf9d",
        "mode": 1,
        "modelid": "TS0044",
        "name": "TS0044 22",
        "state": {
            "buttonevent": 3002,
            "lastupdated": "2020-11-11T20:15:26.272"
        },
        "type": "ZHASwitch",
        "uniqueid": "5c:02:72:ff:fe:a4:ab:ad-03-0006"
    },
    "23": {
        "config": {
            "battery": 100,
            "on": true,
            "reachable": true
        },
        "ep": 4,
        "etag": "4df8007b139bda299cd05bbf7175eaec",
        "lastseen": "2020-11-11T20:15Z",
        "manufacturername": "_TZ3000_vp6clf9d",
        "mode": 1,
        "modelid": "TS0044",
        "name": "TS0044 23",
        "state": {
            "buttonevent": null,
            "lastupdated": "none"
        },
        "type": "ZHASwitch",
        "uniqueid": "5c:02:72:ff:fe:a4:ab:ad-04-0006"
    },
    "3": {
        "config": {
            "battery": 98,
            "on": true,
            "pending": [],
            "reachable": true,
            "temperature": 2100
        },
        "ep": 1,
        "etag": "871da55a4e6dd38d7777c69b62ba71ad",
        "lastseen": "2020-11-11T19:58Z",
        "manufacturername": "LUMI",
        "modelid": "lumi.sensor_wleak.aq1",
        "name": "Water Sensor",
        "state": {
            "lastupdated": "2020-11-11T19:58:13.463",
            "lowbattery": false,
            "tampered": false,
            "water": false
        },
        "swversion": "20170721",
        "type": "ZHAWater",
        "uniqueid": "00:15:8d:00:04:05:66:22-01-0500"
    },
    "6": {
        "config": {
            "alert": "none",
            "battery": 60,
            "group": "9",
            "on": true,
            "reachable": false
        },
        "ep": 1,
        "etag": "4d5a471fe5fcc594892f432311156efb",
        "lastseen": null,
        "manufacturername": "IKEA of Sweden",
        "mode": 3,
        "modelid": "TRADFRI remote control",
        "name": "Living room Remote",
        "state": {
            "buttonevent": 1002,
            "lastupdated": "2020-11-06T07:32:36.135"
        },
        "swversion": "2.3.014",
        "type": "ZHASwitch",
        "uniqueid": "00:0b:57:ff:fe:27:4b:72-01-1000"
    },
    "7": {
        "config": {
            "battery": 100,
            "offset": 0,
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "03f775b0779f2f00b6a27edf51a8c818",
        "lastseen": "2020-11-11T20:11Z",
        "manufacturername": "LUMI",
        "modelid": "lumi.weather",
        "name": "Living room Sensor",
        "state": {
            "lastupdated": "2020-11-11T20:11:31.414",
            "temperature": 2198
        },
        "swversion": "20161129",
        "type": "ZHATemperature",
        "uniqueid": "00:15:8d:00:04:4a:46:b4-01-0402"
    },
    "8": {
        "config": {
            "battery": 100,
            "offset": 0,
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "03f775b0779f2f00b6a27edf51a8c818",
        "lastseen": "2020-11-11T20:11Z",
        "manufacturername": "LUMI",
        "modelid": "lumi.weather",
        "name": "Living room Sensor",
        "state": {
            "humidity": 5176,
            "lastupdated": "2020-11-11T20:11:31.414"
        },
        "swversion": "20161129",
        "type": "ZHAHumidity",
        "uniqueid": "00:15:8d:00:04:4a:46:b4-01-0405"
    },
    "9": {
        "config": {
            "battery": 100,
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "03f775b0779f2f00b6a27edf51a8c818",
        "lastseen": "2020-11-11T20:11Z",
        "manufacturername": "LUMI",
        "modelid": "lumi.weather",
        "name": "Living room Sensor",
        "state": {
            "lastupdated": "2020-11-11T20:11:31.414",
            "pressure": 1007
        },
        "swversion": "20161129",
        "type": "ZHAPressure",
        "uniqueid": "00:15:8d:00:04:4a:46:b4-01-0403"
    }
}

Output of sensors api after re-adding the device via phoscon UI

{
    "1": {
        "config": {
            "configured": true,
            "on": true,
            "sunriseoffset": 30,
            "sunsetoffset": -30
        },
        "etag": "4d5a471fe5fcc594892f432311156efb",
        "manufacturername": "Philips",
        "modelid": "PHDL00",
        "name": "Daylight",
        "state": {
            "dark": true,
            "daylight": false,
            "lastupdated": "2020-11-11T19:58:11.725",
            "status": 230,
            "sunrise": "2020-11-11T06:53:26",
            "sunset": "2020-11-11T16:03:33"
        },
        "swversion": "1.0",
        "type": "Daylight",
        "uniqueid": "00:21:2e:ff:ff:05:03:a2-01"
    },
    "10": {
        "config": {
            "battery": 100,
            "offset": 0,
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "64e212b7889b28b611f7c6dbf73b1fe0",
        "lastseen": "2020-11-11T20:21Z",
        "manufacturername": "LUMI",
        "modelid": "lumi.weather",
        "name": "Bedroom Sensor",
        "state": {
            "lastupdated": "2020-11-11T20:21:28.520",
            "temperature": 1964
        },
        "swversion": "20161129",
        "type": "ZHATemperature",
        "uniqueid": "00:15:8d:00:04:4a:47:c4-01-0402"
    },
    "11": {
        "config": {
            "battery": 100,
            "offset": 0,
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "64e212b7889b28b611f7c6dbf73b1fe0",
        "lastseen": "2020-11-11T20:21Z",
        "manufacturername": "LUMI",
        "modelid": "lumi.weather",
        "name": "Bedroom Sensor",
        "state": {
            "humidity": 5987,
            "lastupdated": "2020-11-11T20:21:28.528"
        },
        "swversion": "20161129",
        "type": "ZHAHumidity",
        "uniqueid": "00:15:8d:00:04:4a:47:c4-01-0405"
    },
    "12": {
        "config": {
            "battery": 100,
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "64e212b7889b28b611f7c6dbf73b1fe0",
        "lastseen": "2020-11-11T20:21Z",
        "manufacturername": "LUMI",
        "modelid": "lumi.weather",
        "name": "Bedroom Sensor",
        "state": {
            "lastupdated": "2020-11-11T20:21:28.534",
            "pressure": 1006
        },
        "swversion": "20161129",
        "type": "ZHAPressure",
        "uniqueid": "00:15:8d:00:04:4a:47:c4-01-0403"
    },
    "13": {
        "config": {
            "alert": "none",
            "battery": 47,
            "group": "7",
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "cbe52ddf367e862b865054c0315d2989",
        "lastseen": "2020-11-11T20:12Z",
        "manufacturername": "IKEA of Sweden",
        "mode": 3,
        "modelid": "TRADFRI remote control",
        "name": "Bedroom Remote",
        "state": {
            "buttonevent": 3003,
            "lastupdated": "2020-11-10T22:49:39.062"
        },
        "swversion": "2.3.014",
        "type": "ZHASwitch",
        "uniqueid": "00:0b:57:ff:fe:eb:5c:71-01-1000"
    },
    "14": {
        "config": {
            "alert": "none",
            "battery": 74,
            "group": "10",
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "bac3c0d03f0f16741ca7a439198d3b48",
        "lastseen": "2020-11-11T20:08Z",
        "manufacturername": "IKEA of Sweden",
        "mode": 1,
        "modelid": "TRADFRI on/off switch",
        "name": "Bedroom Remote Mini",
        "state": {
            "buttonevent": 1002,
            "lastupdated": "2020-08-27T20:49:20.387"
        },
        "type": "ZHASwitch",
        "uniqueid": "00:0d:6f:ff:fe:a9:4d:e5-01-1000"
    },
    "15": {
        "config": {
            "alert": "none",
            "battery": 87,
            "duration": 60,
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "4d5a471fe5fcc594892f432311156efb",
        "lastseen": "2020-11-11T19:58Z",
        "manufacturername": "IKEA of Sweden",
        "modelid": "TRADFRI motion sensor",
        "name": "Livingroom Motion sensor",
        "state": {
            "lastupdated": "2020-11-11T12:51:04.890",
            "presence": false
        },
        "swversion": "2.0.022",
        "type": "ZHAPresence",
        "uniqueid": "58:8e:81:ff:fe:1e:9a:d5-01-0006"
    },
    "16": {
        "config": {
            "battery": 95,
            "on": true,
            "reachable": true,
            "temperature": 2800
        },
        "ep": 1,
        "etag": "9d5d83c496eabc64cafd96cfcb23a5eb",
        "lastseen": "2020-11-11T20:11Z",
        "manufacturername": "LUMI",
        "modelid": "lumi.sensor_magnet.aq2",
        "name": "Window / Door Sensor",
        "state": {
            "lastupdated": "2020-11-11T20:11:22.222",
            "open": false
        },
        "swversion": "20161128",
        "type": "ZHAOpenClose",
        "uniqueid": "00:15:8d:00:04:5c:f2:40-01-0006"
    },
    "17": {
        "config": {
            "battery": 100,
            "on": true,
            "reachable": true,
            "temperature": 2200,
            "tholddark": 12000,
            "tholdoffset": 7000
        },
        "ep": 1,
        "etag": "daef424e87d72ab2cc8c2768a7d0373f",
        "lastseen": "2020-11-11T20:14Z",
        "manufacturername": "LUMI",
        "modelid": "lumi.sensor_motion.aq2",
        "name": "Bedroom Motion Sensor",
        "state": {
            "dark": true,
            "daylight": false,
            "lastupdated": "2020-11-11T20:14:33.515",
            "lightlevel": 9031,
            "lux": 8
        },
        "swversion": "20170627",
        "type": "ZHALightLevel",
        "uniqueid": "00:15:8d:00:04:49:a0:d5-01-0400"
    },
    "18": {
        "config": {
            "battery": 100,
            "duration": 90,
            "on": true,
            "reachable": true,
            "temperature": 2200
        },
        "ep": 1,
        "etag": "daef424e87d72ab2cc8c2768a7d0373f",
        "lastseen": "2020-11-11T20:14Z",
        "manufacturername": "LUMI",
        "modelid": "lumi.sensor_motion.aq2",
        "name": "Bedroom Motion Sensor",
        "state": {
            "lastupdated": "2020-11-11T20:14:33.515",
            "presence": false
        },
        "swversion": "20170627",
        "type": "ZHAPresence",
        "uniqueid": "00:15:8d:00:04:49:a0:d5-01-0406"
    },
    "19": {
        "config": {
            "alert": "none",
            "battery": 74,
            "group": "12",
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "4d5a471fe5fcc594892f432311156efb",
        "lastseen": "2020-11-11T20:19Z",
        "manufacturername": "IKEA of Sweden",
        "mode": 3,
        "modelid": "TRADFRI remote control",
        "name": "Office Remote",
        "state": {
            "buttonevent": 1002,
            "lastupdated": "2020-11-10T20:04:53.857"
        },
        "swversion": "2.3.014",
        "type": "ZHASwitch",
        "uniqueid": "00:0b:57:ff:fe:d2:cc:9a-01-1000"
    },
    "20": {
        "config": {
            "battery": 100,
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "1a5758fdd2079425a4e73126dd8410eb",
        "lastseen": "2020-11-11T20:23Z",
        "manufacturername": "_TZ3000_vp6clf9d",
        "mode": 1,
        "modelid": "TS0044",
        "name": "TS0044 20",
        "state": {
            "buttonevent": 1004,
            "lastupdated": "2020-11-11T20:15:28.540"
        },
        "type": "ZHASwitch",
        "uniqueid": "5c:02:72:ff:fe:a4:ab:ad-01-0006"
    },
    "21": {
        "config": {
            "battery": 100,
            "on": true,
            "reachable": true
        },
        "ep": 2,
        "etag": "1a5758fdd2079425a4e73126dd8410eb",
        "lastseen": "2020-11-11T20:23Z",
        "manufacturername": "_TZ3000_vp6clf9d",
        "mode": 1,
        "modelid": "TS0044",
        "name": "TS0044 21",
        "state": {
            "buttonevent": 2002,
            "lastupdated": "2020-11-11T20:15:30.564"
        },
        "type": "ZHASwitch",
        "uniqueid": "5c:02:72:ff:fe:a4:ab:ad-02-0006"
    },
    "22": {
        "config": {
            "battery": 100,
            "on": true,
            "reachable": true
        },
        "ep": 3,
        "etag": "1a5758fdd2079425a4e73126dd8410eb",
        "lastseen": "2020-11-11T20:23Z",
        "manufacturername": "_TZ3000_vp6clf9d",
        "mode": 1,
        "modelid": "TS0044",
        "name": "TS0044 22",
        "state": {
            "buttonevent": 3002,
            "lastupdated": "2020-11-11T20:15:26.272"
        },
        "type": "ZHASwitch",
        "uniqueid": "5c:02:72:ff:fe:a4:ab:ad-03-0006"
    },
    "23": {
        "config": {
            "battery": 100,
            "on": true,
            "reachable": true
        },
        "ep": 4,
        "etag": "1a5758fdd2079425a4e73126dd8410eb",
        "lastseen": "2020-11-11T20:23Z",
        "manufacturername": "_TZ3000_vp6clf9d",
        "mode": 1,
        "modelid": "TS0044",
        "name": "TS0044 23",
        "state": {
            "buttonevent": null,
            "lastupdated": "none"
        },
        "type": "ZHASwitch",
        "uniqueid": "5c:02:72:ff:fe:a4:ab:ad-04-0006"
    },
    "3": {
        "config": {
            "battery": 98,
            "on": true,
            "pending": [],
            "reachable": true,
            "temperature": 2100
        },
        "ep": 1,
        "etag": "871da55a4e6dd38d7777c69b62ba71ad",
        "lastseen": "2020-11-11T19:58Z",
        "manufacturername": "LUMI",
        "modelid": "lumi.sensor_wleak.aq1",
        "name": "Water Sensor",
        "state": {
            "lastupdated": "2020-11-11T19:58:13.463",
            "lowbattery": false,
            "tampered": false,
            "water": false
        },
        "swversion": "20170721",
        "type": "ZHAWater",
        "uniqueid": "00:15:8d:00:04:05:66:22-01-0500"
    },
    "6": {
        "config": {
            "alert": "none",
            "battery": 60,
            "group": "9",
            "on": true,
            "reachable": false
        },
        "ep": 1,
        "etag": "4d5a471fe5fcc594892f432311156efb",
        "lastseen": null,
        "manufacturername": "IKEA of Sweden",
        "mode": 3,
        "modelid": "TRADFRI remote control",
        "name": "Living room Remote",
        "state": {
            "buttonevent": 1002,
            "lastupdated": "2020-11-06T07:32:36.135"
        },
        "swversion": "2.3.014",
        "type": "ZHASwitch",
        "uniqueid": "00:0b:57:ff:fe:27:4b:72-01-1000"
    },
    "7": {
        "config": {
            "battery": 100,
            "offset": 0,
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "1739a60e8a9c96684491b9cf90bd62d4",
        "lastseen": "2020-11-11T20:22Z",
        "manufacturername": "LUMI",
        "modelid": "lumi.weather",
        "name": "Living room Sensor",
        "state": {
            "lastupdated": "2020-11-11T20:22:05.288",
            "temperature": 2199
        },
        "swversion": "20161129",
        "type": "ZHATemperature",
        "uniqueid": "00:15:8d:00:04:4a:46:b4-01-0402"
    },
    "8": {
        "config": {
            "battery": 100,
            "offset": 0,
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "1739a60e8a9c96684491b9cf90bd62d4",
        "lastseen": "2020-11-11T20:22Z",
        "manufacturername": "LUMI",
        "modelid": "lumi.weather",
        "name": "Living room Sensor",
        "state": {
            "humidity": 5157,
            "lastupdated": "2020-11-11T20:22:05.293"
        },
        "swversion": "20161129",
        "type": "ZHAHumidity",
        "uniqueid": "00:15:8d:00:04:4a:46:b4-01-0405"
    },
    "9": {
        "config": {
            "battery": 100,
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "1739a60e8a9c96684491b9cf90bd62d4",
        "lastseen": "2020-11-11T20:22Z",
        "manufacturername": "LUMI",
        "modelid": "lumi.weather",
        "name": "Living room Sensor",
        "state": {
            "lastupdated": "2020-11-11T20:22:05.306",
            "pressure": 1006
        },
        "swversion": "20161129",
        "type": "ZHAPressure",
        "uniqueid": "00:15:8d:00:04:4a:46:b4-01-0403"
    }
}

@Smanar
Copy link
Collaborator

Smanar commented Nov 11, 2020

Ok so :

  • I haven't find yet why you still have 1 light device ... do you have the "light" device json (just replace "sensors" by "lights" in the url) ?
  • The devices for switches are ID = 20 / 21 / 22/ 23 (look at their uniqueid, there is one by endpoint)
  • The pressed button appear in "buttonevent".
  • It seem from the code you will have 1 entry bu endpoint, I can group them if you prefer ?

@tr1plus
Copy link
Author

tr1plus commented Nov 11, 2020

Hey, no light is appearing in phoscon client anymore - not sure why it's gone now (I keep switching between the VM and my main install, so maybe the stick is just seeing things). I do still see 4 lights with name TS0044 in the lights api call - not sure what they are about. It's possible they are also "old", I'm not fully sure how to verify that as I can't see them in deconz or phoscon (unless it's the 4 little lights on the remote itself for indicating button press, but I doubt it).

I'm not sure what you mean with 1 entry by endpoint. I'm not too familiar with the inner workings of deconz/phoscon.

Let's take the ikea remotes as an example. I want to be able to have the device being known as 1 device in phoscon with 4 buttons, and if possible having each button have multiple functions (long press, single press, double press) as far as possible of course :) I hope that answers yours question?

Additional question - is there any reason why it's not showing up in phoscon? Will it work once this device gets included in the stable release or...?

Thanks! :)

{
    "1": {
        "colorcapabilities": 16,
        "ctmax": 454,
        "ctmin": 250,
        "etag": "14b12afaa4275cda5fb7e10ae75231f6",
        "hascolor": true,
        "lastannounced": null,
        "lastseen": "2020-11-11T21:20Z",
        "manufacturername": "IKEA of Sweden",
        "modelid": "TRADFRI bulb E14 WS opal 400lm",
        "name": "Office Light",
        "state": {
            "alert": "none",
            "bri": 248,
            "colormode": "ct",
            "ct": 250,
            "on": false,
            "reachable": true
        },
        "swversion": "1.2.221",
        "type": "Color temperature light",
        "uniqueid": "00:0b:57:ff:fe:2f:f0:63-01"
    },
    "11": {
        "etag": "314ddc1881c39cc7afecb4ff90c0f9c2",
        "hascolor": false,
        "lastannounced": "2020-11-11T21:17:53Z",
        "lastseen": "2020-11-11T21:17Z",
        "manufacturername":"�����U",
        "modelid": null,
        "name": "On/Off light 11",
        "state": {
            "alert": "none",
            "on": false,
            "reachable": true
        },
        "swversion": null,
        "type": "On/Off light",
        "uniqueid": "5c:02:72:ff:fe:a4:ab:ad-02"
    },
    "12": {
        "etag": "314ddc1881c39cc7afecb4ff90c0f9c2",
        "hascolor": false,
        "lastannounced": "2020-11-11T21:17:53Z",
        "lastseen": "2020-11-11T21:17Z",
        "manufacturername":"�����U",
        "modelid": null,
        "name": "On/Off light 12",
        "state": {
            "alert": "none",
            "on": false,
            "reachable": true
        },
        "swversion": null,
        "type": "On/Off light",
        "uniqueid": "5c:02:72:ff:fe:a4:ab:ad-03"
    },
    "13": {
        "etag": "314ddc1881c39cc7afecb4ff90c0f9c2",
        "hascolor": false,
        "lastannounced": "2020-11-11T21:17:53Z",
        "lastseen": "2020-11-11T21:17Z",
        "manufacturername":"�����U",
        "modelid": null,
        "name": "On/Off light 13",
        "state": {
            "alert": "none",
            "on": false,
            "reachable": true
        },
        "swversion": null,
        "type": "On/Off light",
        "uniqueid": "5c:02:72:ff:fe:a4:ab:ad-04"
    },
    "14": {
        "etag": "0f747ecaedac514b8aeca9290bc7da3e",
        "hascolor": false,
        "lastannounced": "2020-11-11T21:17:53Z",
        "lastseen": "2020-11-11T21:19Z",
        "manufacturername":"�0��%V",
        "modelid": "TS0044",
        "name": "On/Off light 14",
        "state": {
            "alert": "none",
            "on": false,
            "reachable": true
        },
        "swversion": null,
        "type": "On/Off light",
        "uniqueid": "5c:02:72:ff:fe:a4:ab:ad-01"
    },
    "2": {
        "colorcapabilities": 16,
        "ctmax": 454,
        "ctmin": 250,
        "etag": "014ad284c3c1f3d347ee190273592d38",
        "hascolor": true,
        "lastannounced": "2020-10-13T20:33:27Z",
        "lastseen": "2020-11-11T21:20Z",
        "manufacturername": "IKEA of Sweden",
        "modelid": "TRADFRI bulb E27 WS opal 980lm",
        "name": "Living room Light Sofa",
        "state": {
            "alert": "none",
            "bri": 103,
            "colormode": "ct",
            "ct": 373,
            "on": true,
            "reachable": true
        },
        "swversion": "1.2.217",
        "type": "Color temperature light",
        "uniqueid": "00:0b:57:ff:fe:da:d7:94-01"
    },
    "3": {
        "colorcapabilities": 16,
        "ctmax": 454,
        "ctmin": 250,
        "etag": "a74073aeb8cda3039d5da1656b947e18",
        "hascolor": true,
        "lastannounced": "2020-09-02T20:46:46Z",
        "lastseen": "2020-11-11T21:20Z",
        "manufacturername": "IKEA of Sweden",
        "modelid": "TRADFRI bulb E14 WS opal 400lm",
        "name": "Living room Light Cupboard",
        "state": {
            "alert": "none",
            "bri": 103,
            "colormode": "ct",
            "ct": 373,
            "on": true,
            "reachable": true
        },
        "swversion": "1.2.221",
        "type": "Color temperature light",
        "uniqueid": "00:0b:57:ff:fe:34:a4:30-01"
    },
    "4": {
        "colorcapabilities": 8,
        "etag": "d41754976fbb10f181b1982cb82abed6",
        "hascolor": true,
        "lastannounced": "2020-09-24T20:09:26Z",
        "lastseen": "2020-11-11T21:20Z",
        "manufacturername": "IKEA of Sweden",
        "modelid": "TRADFRI bulb E27 CWS opal 600lm",
        "name": "Bedroom Light",
        "state": {
            "alert": "none",
            "bri": 102,
            "colormode": "xy",
            "effect": "none",
            "hue": 0,
            "on": false,
            "reachable": true,
            "sat": 254,
            "xy": [
                0.136,
                0.04
            ]
        },
        "swversion": "1.3.009",
        "type": "Color light",
        "uniqueid": "90:fd:9f:ff:fe:3e:47:d1-01"
    },
    "5": {
        "etag": "f79ded54c708b64383ad380cf32ebf76",
        "hascolor": false,
        "lastannounced": null,
        "lastseen": "2020-11-11T21:20Z",
        "manufacturername": "IKEA of Sweden",
        "modelid": "TRADFRI control outlet",
        "name": "Shrimproom Fans",
        "state": {
            "alert": "none",
            "on": false,
            "reachable": true
        },
        "swversion": "2.0.022",
        "type": "On/Off plug-in unit",
        "uniqueid": "00:0d:6f:ff:fe:bb:2a:f8-01"
    },
    "6": {
        "etag": "05ff025bf9cf8524127430437a5ee7b0",
        "hascolor": false,
        "lastannounced": "2020-08-07T19:07:13Z",
        "lastseen": "2020-11-11T21:20Z",
        "manufacturername": "IKEA of Sweden",
        "modelid": "TRADFRI control outlet",
        "name": "Bedroom Plug",
        "state": {
            "alert": "none",
            "on": false,
            "reachable": true
        },
        "swversion": "2.0.022",
        "type": "On/Off plug-in unit",
        "uniqueid": "90:fd:9f:ff:fe:1e:dd:32-01"
    },
    "7": {
        "etag": "fe29f40980715ffaebfe24547c99078b",
        "hascolor": false,
        "lastannounced": null,
        "lastseen": "2020-11-11T21:19Z",
        "manufacturername": "dresden elektronik",
        "modelid": "ConBee II",
        "name": "Configuration tool 7",
        "state": {
            "reachable": true
        },
        "swversion": "0x26580700",
        "type": "Configuration tool",
        "uniqueid": "00:21:2e:ff:ff:05:03:a2-01"
    },
    "8": {
        "colorcapabilities": 31,
        "ctmax": 495,
        "ctmin": 155,
        "etag": "e7ce1903eade6834146a1383a14c8c05",
        "hascolor": true,
        "lastannounced": "2020-09-27T07:09:48Z",
        "lastseen": "2020-11-11T21:20Z",
        "manufacturername": "GLEDOPTO",
        "modelid": "GL-C-008",
        "name": "Office Desk RGB LED strip",
        "state": {
            "alert": "none",
            "bri": 254,
            "colormode": "xy",
            "ct": 250,
            "effect": "none",
            "hue": 40448,
            "on": true,
            "reachable": true,
            "sat": 242,
            "xy": [
                0.142,
                0.1279
            ]
        },
        "swversion": "2.0.2",
        "type": "Extended color light",
        "uniqueid": "00:12:4b:00:21:13:10:3a-0b"
    },
    "9": {
        "colorcapabilities": 31,
        "ctmax": 234,
        "ctmin": 210,
        "etag": "846961ae53fe29733e134058b38e32fe",
        "hascolor": true,
        "lastannounced": "2020-11-10T19:52:42Z",
        "lastseen": "2020-11-10T20:32Z",
        "manufacturername": "FeeBit  RGBW",
        "modelid": "FB56-ZCW20FB1.2",
        "name": "Office LED strip",
        "state": {
            "alert": "none",
            "bri": 250,
            "colormode": "xy",
            "ct": 222,
            "effect": "none",
            "hue": 32256,
            "on": true,
            "reachable": false,
            "sat": 253,
            "xy": [
                0.151,
                0.343
            ]
        },
        "swversion": "1.0.0",
        "type": "Extended color light",
        "uniqueid": "00:12:4b:00:19:c1:19:a6-0b"
    }
}

Sensors

{
    "1": {
        "config": {
            "configured": true,
            "on": true,
            "sunriseoffset": 30,
            "sunsetoffset": -30
        },
        "etag": "05e75bac6c1d23600229ba6731092789",
        "manufacturername": "Philips",
        "modelid": "PHDL00",
        "name": "Daylight",
        "state": {
            "dark": true,
            "daylight": false,
            "lastupdated": "2020-11-11T21:15:16.856",
            "status": 230,
            "sunrise": "2020-11-11T06:53:26",
            "sunset": "2020-11-11T16:03:33"
        },
        "swversion": "1.0",
        "type": "Daylight",
        "uniqueid": "00:21:2e:ff:ff:05:03:a2-01"
    },
    "10": {
        "config": {
            "battery": 100,
            "offset": 0,
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "05e75bac6c1d23600229ba6731092789",
        "lastseen": "2020-11-11T21:15Z",
        "manufacturername": "LUMI",
        "modelid": "lumi.weather",
        "name": "Bedroom Sensor",
        "state": {
            "lastupdated": "2020-11-11T20:21:28.520",
            "temperature": 1964
        },
        "swversion": "20161129",
        "type": "ZHATemperature",
        "uniqueid": "00:15:8d:00:04:4a:47:c4-01-0402"
    },
    "11": {
        "config": {
            "battery": 100,
            "offset": 0,
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "05e75bac6c1d23600229ba6731092789",
        "lastseen": "2020-11-11T21:15Z",
        "manufacturername": "LUMI",
        "modelid": "lumi.weather",
        "name": "Bedroom Sensor",
        "state": {
            "humidity": 5987,
            "lastupdated": "2020-11-11T20:21:28.528"
        },
        "swversion": "20161129",
        "type": "ZHAHumidity",
        "uniqueid": "00:15:8d:00:04:4a:47:c4-01-0405"
    },
    "12": {
        "config": {
            "battery": 100,
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "05e75bac6c1d23600229ba6731092789",
        "lastseen": "2020-11-11T21:15Z",
        "manufacturername": "LUMI",
        "modelid": "lumi.weather",
        "name": "Bedroom Sensor",
        "state": {
            "lastupdated": "2020-11-11T20:21:28.534",
            "pressure": 1006
        },
        "swversion": "20161129",
        "type": "ZHAPressure",
        "uniqueid": "00:15:8d:00:04:4a:47:c4-01-0403"
    },
    "13": {
        "config": {
            "alert": "none",
            "battery": 47,
            "group": "7",
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "05e75bac6c1d23600229ba6731092789",
        "lastseen": "2020-11-11T21:15Z",
        "manufacturername": "IKEA of Sweden",
        "mode": 3,
        "modelid": "TRADFRI remote control",
        "name": "Bedroom Remote",
        "state": {
            "buttonevent": 3003,
            "lastupdated": "2020-11-10T22:49:39.062"
        },
        "swversion": "2.3.014",
        "type": "ZHASwitch",
        "uniqueid": "00:0b:57:ff:fe:eb:5c:71-01-1000"
    },
    "14": {
        "config": {
            "alert": "none",
            "battery": 74,
            "group": "10",
            "on": true,
            "reachable": false
        },
        "ep": 1,
        "etag": "05e75bac6c1d23600229ba6731092789",
        "lastseen": null,
        "manufacturername": "IKEA of Sweden",
        "mode": 1,
        "modelid": "TRADFRI on/off switch",
        "name": "Bedroom Remote Mini",
        "state": {
            "buttonevent": 1002,
            "lastupdated": "2020-08-27T20:49:20.387"
        },
        "type": "ZHASwitch",
        "uniqueid": "00:0d:6f:ff:fe:a9:4d:e5-01-1000"
    },
    "15": {
        "config": {
            "alert": "none",
            "battery": 87,
            "duration": 60,
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "05e75bac6c1d23600229ba6731092789",
        "lastseen": "2020-11-11T21:15Z",
        "manufacturername": "IKEA of Sweden",
        "modelid": "TRADFRI motion sensor",
        "name": "Livingroom Motion sensor",
        "state": {
            "lastupdated": "2020-11-11T12:51:04.890",
            "presence": false
        },
        "swversion": "2.0.022",
        "type": "ZHAPresence",
        "uniqueid": "58:8e:81:ff:fe:1e:9a:d5-01-0006"
    },
    "16": {
        "config": {
            "battery": 95,
            "on": true,
            "reachable": true,
            "temperature": 2800
        },
        "ep": 1,
        "etag": "05e75bac6c1d23600229ba6731092789",
        "lastseen": "2020-11-11T21:15Z",
        "manufacturername": "LUMI",
        "modelid": "lumi.sensor_magnet.aq2",
        "name": "Window / Door Sensor",
        "state": {
            "lastupdated": "2020-11-11T20:11:22.222",
            "open": false
        },
        "swversion": "20161128",
        "type": "ZHAOpenClose",
        "uniqueid": "00:15:8d:00:04:5c:f2:40-01-0006"
    },
    "17": {
        "config": {
            "battery": 100,
            "on": true,
            "reachable": true,
            "temperature": 2200,
            "tholddark": 12000,
            "tholdoffset": 7000
        },
        "ep": 1,
        "etag": "05e75bac6c1d23600229ba6731092789",
        "lastseen": "2020-11-11T21:15Z",
        "manufacturername": "LUMI",
        "modelid": "lumi.sensor_motion.aq2",
        "name": "Bedroom Motion Sensor",
        "state": {
            "dark": true,
            "daylight": false,
            "lastupdated": "2020-11-11T20:14:33.515",
            "lightlevel": 9031,
            "lux": 8
        },
        "swversion": "20170627",
        "type": "ZHALightLevel",
        "uniqueid": "00:15:8d:00:04:49:a0:d5-01-0400"
    },
    "18": {
        "config": {
            "battery": 100,
            "duration": 90,
            "on": true,
            "reachable": true,
            "temperature": 2200
        },
        "ep": 1,
        "etag": "05e75bac6c1d23600229ba6731092789",
        "lastseen": "2020-11-11T21:15Z",
        "manufacturername": "LUMI",
        "modelid": "lumi.sensor_motion.aq2",
        "name": "Bedroom Motion Sensor",
        "state": {
            "lastupdated": "2020-11-11T20:14:33.515",
            "presence": false
        },
        "swversion": "20170627",
        "type": "ZHAPresence",
        "uniqueid": "00:15:8d:00:04:49:a0:d5-01-0406"
    },
    "19": {
        "config": {
            "alert": "none",
            "battery": 74,
            "group": "12",
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "3bd21c9d8d969adcc67f5d9cb9404bcb",
        "lastseen": "2020-11-11T21:15Z",
        "manufacturername": "IKEA of Sweden",
        "mode": 3,
        "modelid": "TRADFRI remote control",
        "name": "Office Remote",
        "state": {
            "buttonevent": 1002,
            "lastupdated": "2020-11-10T20:04:53.857"
        },
        "swversion": "2.3.014",
        "type": "ZHASwitch",
        "uniqueid": "00:0b:57:ff:fe:d2:cc:9a-01-1000"
    },
    "20": {
        "config": {
            "battery": 100,
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "05e75bac6c1d23600229ba6731092789",
        "lastseen": "2020-11-11T21:15Z",
        "manufacturername": "_TZ3000_vp6clf9d",
        "mode": 1,
        "modelid": "TS0044",
        "name": "TS0044 20",
        "state": {
            "buttonevent": 1002,
            "lastupdated": "2020-11-11T20:26:45.959"
        },
        "type": "ZHASwitch",
        "uniqueid": "5c:02:72:ff:fe:a4:ab:ad-01-0006"
    },
    "21": {
        "config": {
            "battery": 100,
            "on": true,
            "reachable": true
        },
        "ep": 2,
        "etag": "05e75bac6c1d23600229ba6731092789",
        "lastseen": "2020-11-11T21:15Z",
        "manufacturername": "_TZ3000_vp6clf9d",
        "mode": 1,
        "modelid": "TS0044",
        "name": "TS0044 21",
        "state": {
            "buttonevent": 2002,
            "lastupdated": "2020-11-11T20:26:43.813"
        },
        "type": "ZHASwitch",
        "uniqueid": "5c:02:72:ff:fe:a4:ab:ad-02-0006"
    },
    "22": {
        "config": {
            "battery": 100,
            "on": true,
            "reachable": true
        },
        "ep": 3,
        "etag": "05e75bac6c1d23600229ba6731092789",
        "lastseen": "2020-11-11T21:15Z",
        "manufacturername": "_TZ3000_vp6clf9d",
        "mode": 1,
        "modelid": "TS0044",
        "name": "TS0044 22",
        "state": {
            "buttonevent": 3002,
            "lastupdated": "2020-11-11T20:26:52.025"
        },
        "type": "ZHASwitch",
        "uniqueid": "5c:02:72:ff:fe:a4:ab:ad-03-0006"
    },
    "23": {
        "config": {
            "battery": 100,
            "on": true,
            "reachable": false
        },
        "ep": 4,
        "etag": "05e75bac6c1d23600229ba6731092789",
        "lastseen": null,
        "manufacturername": "_TZ3000_vp6clf9d",
        "mode": 1,
        "modelid": "TS0044",
        "name": "TS0044 23",
        "state": {
            "buttonevent": null,
            "lastupdated": "none"
        },
        "type": "ZHASwitch",
        "uniqueid": "5c:02:72:ff:fe:a4:ab:ad-04-0006"
    },
    "3": {
        "config": {
            "battery": 98,
            "on": true,
            "pending": [],
            "reachable": true,
            "temperature": 2100
        },
        "ep": 1,
        "etag": "05e75bac6c1d23600229ba6731092789",
        "lastseen": "2020-11-11T21:15Z",
        "manufacturername": "LUMI",
        "modelid": "lumi.sensor_wleak.aq1",
        "name": "Water Sensor",
        "state": {
            "lastupdated": "2020-11-11T19:58:13.463",
            "lowbattery": false,
            "tampered": false,
            "water": false
        },
        "swversion": "20170721",
        "type": "ZHAWater",
        "uniqueid": "00:15:8d:00:04:05:66:22-01-0500"
    },
    "6": {
        "config": {
            "alert": "none",
            "battery": 60,
            "group": "9",
            "on": true,
            "reachable": false
        },
        "ep": 1,
        "etag": "05e75bac6c1d23600229ba6731092789",
        "lastseen": null,
        "manufacturername": "IKEA of Sweden",
        "mode": 3,
        "modelid": "TRADFRI remote control",
        "name": "Living room Remote",
        "state": {
            "buttonevent": 1002,
            "lastupdated": "2020-11-06T07:32:36.135"
        },
        "swversion": "2.3.014",
        "type": "ZHASwitch",
        "uniqueid": "00:0b:57:ff:fe:27:4b:72-01-1000"
    },
    "7": {
        "config": {
            "battery": 100,
            "offset": 0,
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "05e75bac6c1d23600229ba6731092789",
        "lastseen": "2020-11-11T21:15Z",
        "manufacturername": "LUMI",
        "modelid": "lumi.weather",
        "name": "Living room Sensor",
        "state": {
            "lastupdated": "2020-11-11T20:22:05.288",
            "temperature": 2199
        },
        "swversion": "20161129",
        "type": "ZHATemperature",
        "uniqueid": "00:15:8d:00:04:4a:46:b4-01-0402"
    },
    "8": {
        "config": {
            "battery": 100,
            "offset": 0,
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "05e75bac6c1d23600229ba6731092789",
        "lastseen": "2020-11-11T21:15Z",
        "manufacturername": "LUMI",
        "modelid": "lumi.weather",
        "name": "Living room Sensor",
        "state": {
            "humidity": 5157,
            "lastupdated": "2020-11-11T20:22:05.293"
        },
        "swversion": "20161129",
        "type": "ZHAHumidity",
        "uniqueid": "00:15:8d:00:04:4a:46:b4-01-0405"
    },
    "9": {
        "config": {
            "battery": 100,
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "05e75bac6c1d23600229ba6731092789",
        "lastseen": "2020-11-11T21:15Z",
        "manufacturername": "LUMI",
        "modelid": "lumi.weather",
        "name": "Living room Sensor",
        "state": {
            "lastupdated": "2020-11-11T20:22:05.306",
            "pressure": 1006
        },
        "swversion": "20161129",
        "type": "ZHAPressure",
        "uniqueid": "00:15:8d:00:04:4a:46:b4-01-0403"
    }
}

Thanks!

@Smanar
Copy link
Collaborator

Smanar commented Nov 12, 2020

Ok, so I think it s because you have let the permit join.
Look at "light" device 11/ 12 / 13 / 14

   "lastannounced": "2020-11-11T21:17:53Z",
     "lastseen": "2020-11-11T21:19Z",

And incomplete data (strange deconz haven't tried to complete them .... )

But the sensor was created before

    "lastseen": "2020-11-11T21:15Z"

So I have updated the code to prevent that (at least to try), I m retreiving the value from sensor, so if sensor is created, light will be blocked.

Let's take the ikea remotes as an example. I want to be able to have the device being known as 1 device in phoscon with 4 buttons, and if possible having each button have multiple functions (long press, single press, double press) as far as possible of course :) I hope that answers yours question?

Short/ long / double are already supported
Have modified to code to trying to make only 1 device instead of 4.

Additional question - is there any reason why it's not showing up in phoscon? Will it work once this device gets included in the stable release or...?

Nope, Phoscon is a different project, it s the phoscon dev that decide wich one switch will be visible or not.

BTW, I will start to update the code tonight, so it can move a lot in the next hours.

@tr1plus
Copy link
Author

tr1plus commented Nov 13, 2020

Sorry for the delay. I just updated the code based on your branch. This are the outputs of /lights and /sensors (I first deleted everything trough the api that was created earlier).

It seems a light is still created. Below also the deconz screenshot. Is there anyway I can verify via deconz if my button presses are registering? (Sorry I'm used to using phoscon)

Also- can we ask phoscon team to add the device or how is this usually done?

image

{
    "1": {
        "colorcapabilities": 16,
        "ctmax": 454,
        "ctmin": 250,
        "etag": "735bf25a976ca8dbc83196798d92d003",
        "hascolor": true,
        "lastannounced": null,
        "lastseen": "2020-11-13T19:57Z",
        "manufacturername": "IKEA of Sweden",
        "modelid": "TRADFRI bulb E14 WS opal 400lm",
        "name": "Office Light",
        "state": {
            "alert": "none",
            "bri": 248,
            "colormode": "ct",
            "ct": 250,
            "on": true,
            "reachable": true
        },
        "swversion": "1.2.221",
        "type": "Color temperature light",
        "uniqueid": "00:0b:57:ff:fe:2f:f0:63-01"
    },
    "11": {
        "etag": "735bf25a976ca8dbc83196798d92d003",
        "hascolor": false,
        "lastannounced": null,
        "lastseen": "2020-11-13T19:51Z",
        "manufacturername": "_TZ3000_vp6clf9d",
        "modelid": "TS0044",
        "name": "On/Off light 11",
        "state": {
            "alert": "none",
            "on": false,
            "reachable": true
        },
        "swversion": null,
        "type": "On/Off light",
        "uniqueid": "5c:02:72:ff:fe:a4:ab:ad-01"
    },
    "2": {
        "colorcapabilities": 16,
        "ctmax": 454,
        "ctmin": 250,
        "etag": "92e545f8d087240f3ba3f37100a8d750",
        "hascolor": true,
        "lastannounced": "2020-10-13T20:33:27Z",
        "lastseen": "2020-11-13T19:57Z",
        "manufacturername": "IKEA of Sweden",
        "modelid": "TRADFRI bulb E27 WS opal 980lm",
        "name": "Living room Light Sofa",
        "state": {
            "alert": "none",
            "bri": 103,
            "colormode": "ct",
            "ct": 373,
            "on": true,
            "reachable": true
        },
        "swversion": "1.2.217",
        "type": "Color temperature light",
        "uniqueid": "00:0b:57:ff:fe:da:d7:94-01"
    },
    "3": {
        "colorcapabilities": 16,
        "ctmax": 454,
        "ctmin": 250,
        "etag": "735bf25a976ca8dbc83196798d92d003",
        "hascolor": true,
        "lastannounced": "2020-09-02T20:46:46Z",
        "lastseen": "2020-11-13T19:53Z",
        "manufacturername": "IKEA of Sweden",
        "modelid": "TRADFRI bulb E14 WS opal 400lm",
        "name": "Living room Light Cupboard",
        "state": {
            "alert": "none",
            "bri": 103,
            "colormode": "ct",
            "ct": 373,
            "on": true,
            "reachable": true
        },
        "swversion": "1.2.221",
        "type": "Color temperature light",
        "uniqueid": "00:0b:57:ff:fe:34:a4:30-01"
    },
    "4": {
        "colorcapabilities": 8,
        "etag": "735bf25a976ca8dbc83196798d92d003",
        "hascolor": true,
        "lastannounced": "2020-09-24T20:09:26Z",
        "lastseen": "2020-11-13T19:53Z",
        "manufacturername": "IKEA of Sweden",
        "modelid": "TRADFRI bulb E27 CWS opal 600lm",
        "name": "Bedroom Light",
        "state": {
            "alert": "none",
            "bri": 102,
            "colormode": "xy",
            "effect": "none",
            "hue": 0,
            "on": false,
            "reachable": true,
            "sat": 254,
            "xy": [
                0.136,
                0.04
            ]
        },
        "swversion": "1.3.009",
        "type": "Color light",
        "uniqueid": "90:fd:9f:ff:fe:3e:47:d1-01"
    },
    "5": {
        "etag": "735bf25a976ca8dbc83196798d92d003",
        "hascolor": false,
        "lastannounced": null,
        "lastseen": "2020-11-13T19:54Z",
        "manufacturername": "IKEA of Sweden",
        "modelid": "TRADFRI control outlet",
        "name": "Shrimproom Fans",
        "state": {
            "alert": "none",
            "on": false,
            "reachable": true
        },
        "swversion": "2.0.022",
        "type": "On/Off plug-in unit",
        "uniqueid": "00:0d:6f:ff:fe:bb:2a:f8-01"
    },
    "6": {
        "etag": "735bf25a976ca8dbc83196798d92d003",
        "hascolor": false,
        "lastannounced": "2020-08-07T19:07:13Z",
        "lastseen": "2020-11-13T19:54Z",
        "manufacturername": "IKEA of Sweden",
        "modelid": "TRADFRI control outlet",
        "name": "Bedroom Plug",
        "state": {
            "alert": "none",
            "on": false,
            "reachable": true
        },
        "swversion": "2.0.022",
        "type": "On/Off plug-in unit",
        "uniqueid": "90:fd:9f:ff:fe:1e:dd:32-01"
    },
    "7": {
        "etag": "92e545f8d087240f3ba3f37100a8d750",
        "hascolor": false,
        "lastannounced": null,
        "lastseen": "2020-11-13T19:57Z",
        "manufacturername": "dresden elektronik",
        "modelid": "ConBee II",
        "name": "Configuration tool 7",
        "state": {
            "reachable": true
        },
        "swversion": "0x26580700",
        "type": "Configuration tool",
        "uniqueid": "00:21:2e:ff:ff:05:03:a2-01"
    },
    "8": {
        "colorcapabilities": 31,
        "ctmax": 495,
        "ctmin": 155,
        "etag": "735bf25a976ca8dbc83196798d92d003",
        "hascolor": true,
        "lastannounced": "2020-09-27T07:09:48Z",
        "lastseen": "2020-11-13T19:54Z",
        "manufacturername": "GLEDOPTO",
        "modelid": "GL-C-008",
        "name": "Office Desk RGB LED strip",
        "state": {
            "alert": "none",
            "bri": 254,
            "colormode": "xy",
            "ct": 250,
            "effect": "none",
            "hue": 17920,
            "on": true,
            "reachable": true,
            "sat": 225,
            "xy": [
                0.188,
                0.643
            ]
        },
        "swversion": "2.0.2",
        "type": "Extended color light",
        "uniqueid": "00:12:4b:00:21:13:10:3a-0b"
    }
}
{
    "1": {
        "config": {
            "configured": true,
            "on": true,
            "sunriseoffset": 30,
            "sunsetoffset": -30
        },
        "etag": "d0803524322851a2de96681b8dde3e1c",
        "manufacturername": "Philips",
        "modelid": "PHDL00",
        "name": "Daylight",
        "state": {
            "dark": true,
            "daylight": false,
            "lastupdated": "2020-11-13T19:57:43.098",
            "status": 230,
            "sunrise": "2020-11-13T06:56:50",
            "sunset": "2020-11-13T16:00:44"
        },
        "swversion": "1.0",
        "type": "Daylight",
        "uniqueid": "00:21:2e:ff:ff:05:03:a2-01"
    },
    "10": {
        "config": {
            "battery": 100,
            "offset": 0,
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "d0803524322851a2de96681b8dde3e1c",
        "lastseen": "2020-11-13T19:57Z",
        "manufacturername": "LUMI",
        "modelid": "lumi.weather",
        "name": "Bedroom Sensor",
        "state": {
            "lastupdated": "2020-11-13T19:41:42.293",
            "temperature": 1830
        },
        "swversion": "20161129",
        "type": "ZHATemperature",
        "uniqueid": "00:15:8d:00:04:4a:47:c4-01-0402"
    },
    "11": {
        "config": {
            "battery": 100,
            "offset": 0,
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "d0803524322851a2de96681b8dde3e1c",
        "lastseen": "2020-11-13T19:57Z",
        "manufacturername": "LUMI",
        "modelid": "lumi.weather",
        "name": "Bedroom Sensor",
        "state": {
            "humidity": 6299,
            "lastupdated": "2020-11-13T19:41:42.301"
        },
        "swversion": "20161129",
        "type": "ZHAHumidity",
        "uniqueid": "00:15:8d:00:04:4a:47:c4-01-0405"
    },
    "12": {
        "config": {
            "battery": 100,
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "d0803524322851a2de96681b8dde3e1c",
        "lastseen": "2020-11-13T19:57Z",
        "manufacturername": "LUMI",
        "modelid": "lumi.weather",
        "name": "Bedroom Sensor",
        "state": {
            "lastupdated": "2020-11-13T19:41:42.306",
            "pressure": 1004
        },
        "swversion": "20161129",
        "type": "ZHAPressure",
        "uniqueid": "00:15:8d:00:04:4a:47:c4-01-0403"
    },
    "13": {
        "config": {
            "alert": "none",
            "battery": 47,
            "group": "7",
            "on": true,
            "reachable": false
        },
        "ep": 1,
        "etag": "d0803524322851a2de96681b8dde3e1c",
        "lastseen": null,
        "manufacturername": "IKEA of Sweden",
        "mode": 3,
        "modelid": "TRADFRI remote control",
        "name": "Bedroom Remote",
        "state": {
            "buttonevent": 3003,
            "lastupdated": "2020-11-10T22:49:39.062"
        },
        "swversion": "2.3.014",
        "type": "ZHASwitch",
        "uniqueid": "00:0b:57:ff:fe:eb:5c:71-01-1000"
    },
    "14": {
        "config": {
            "alert": "none",
            "battery": 74,
            "group": "10",
            "on": true,
            "reachable": false
        },
        "ep": 1,
        "etag": "d0803524322851a2de96681b8dde3e1c",
        "lastseen": null,
        "manufacturername": "IKEA of Sweden",
        "mode": 1,
        "modelid": "TRADFRI on/off switch",
        "name": "Bedroom Remote Mini",
        "state": {
            "buttonevent": 1002,
            "lastupdated": "2020-08-27T20:49:20.387"
        },
        "type": "ZHASwitch",
        "uniqueid": "00:0d:6f:ff:fe:a9:4d:e5-01-1000"
    },
    "15": {
        "config": {
            "alert": "none",
            "battery": 87,
            "duration": 60,
            "on": true,
            "reachable": false
        },
        "ep": 1,
        "etag": "d0803524322851a2de96681b8dde3e1c",
        "lastseen": null,
        "manufacturername": "IKEA of Sweden",
        "modelid": "TRADFRI motion sensor",
        "name": "Livingroom Motion sensor",
        "state": {
            "lastupdated": "2020-11-11T21:22:20.865",
            "presence": false
        },
        "swversion": "2.0.022",
        "type": "ZHAPresence",
        "uniqueid": "58:8e:81:ff:fe:1e:9a:d5-01-0006"
    },
    "16": {
        "config": {
            "battery": 95,
            "on": true,
            "reachable": true,
            "temperature": 2600
        },
        "ep": 1,
        "etag": "d0803524322851a2de96681b8dde3e1c",
        "lastseen": "2020-11-13T19:57Z",
        "manufacturername": "LUMI",
        "modelid": "lumi.sensor_magnet.aq2",
        "name": "Window / Door Sensor",
        "state": {
            "lastupdated": "2020-11-13T19:22:57.314",
            "open": false
        },
        "swversion": "20161128",
        "type": "ZHAOpenClose",
        "uniqueid": "00:15:8d:00:04:5c:f2:40-01-0006"
    },
    "17": {
        "config": {
            "battery": 100,
            "on": true,
            "reachable": true,
            "temperature": 2100,
            "tholddark": 12000,
            "tholdoffset": 7000
        },
        "ep": 1,
        "etag": "d0803524322851a2de96681b8dde3e1c",
        "lastseen": "2020-11-13T19:57Z",
        "manufacturername": "LUMI",
        "modelid": "lumi.sensor_motion.aq2",
        "name": "Bedroom Motion Sensor",
        "state": {
            "dark": true,
            "daylight": false,
            "lastupdated": "2020-11-13T19:50:29.910",
            "lightlevel": 9031,
            "lux": 8
        },
        "swversion": "20170627",
        "type": "ZHALightLevel",
        "uniqueid": "00:15:8d:00:04:49:a0:d5-01-0400"
    },
    "18": {
        "config": {
            "battery": 100,
            "duration": 90,
            "on": true,
            "reachable": true,
            "temperature": 2100
        },
        "ep": 1,
        "etag": "d0803524322851a2de96681b8dde3e1c",
        "lastseen": "2020-11-13T19:57Z",
        "manufacturername": "LUMI",
        "modelid": "lumi.sensor_motion.aq2",
        "name": "Bedroom Motion Sensor",
        "state": {
            "lastupdated": "2020-11-13T19:50:29.910",
            "presence": false
        },
        "swversion": "20170627",
        "type": "ZHAPresence",
        "uniqueid": "00:15:8d:00:04:49:a0:d5-01-0406"
    },
    "19": {
        "config": {
            "alert": "none",
            "battery": 60,
            "group": "12",
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "d0803524322851a2de96681b8dde3e1c",
        "lastseen": "2020-11-13T19:57Z",
        "manufacturername": "IKEA of Sweden",
        "mode": 3,
        "modelid": "TRADFRI remote control",
        "name": "Office Remote",
        "state": {
            "buttonevent": 1002,
            "lastupdated": "2020-11-13T19:42:46.056"
        },
        "swversion": "2.3.014",
        "type": "ZHASwitch",
        "uniqueid": "00:0b:57:ff:fe:d2:cc:9a-01-1000"
    },
    "20": {
        "config": {
            "battery": 100,
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "d0803524322851a2de96681b8dde3e1c",
        "lastseen": "2020-11-13T19:57Z",
        "manufacturername": "_TZ3000_vp6clf9d",
        "mode": 1,
        "modelid": "TS0044",
        "name": "Switch 20",
        "state": {
            "buttonevent": 1002,
            "lastupdated": "2020-11-13T19:51:20.148"
        },
        "type": "ZHASwitch",
        "uniqueid": "5c:02:72:ff:fe:a4:ab:ad-01-0006"
    },
    "3": {
        "config": {
            "battery": 98,
            "on": true,
            "pending": [],
            "reachable": true,
            "temperature": 1900
        },
        "ep": 1,
        "etag": "d0803524322851a2de96681b8dde3e1c",
        "lastseen": "2020-11-13T19:57Z",
        "manufacturername": "LUMI",
        "modelid": "lumi.sensor_wleak.aq1",
        "name": "Water Sensor",
        "state": {
            "lastupdated": "2020-11-13T19:40:43.848",
            "lowbattery": false,
            "tampered": false,
            "water": false
        },
        "swversion": "20170721",
        "type": "ZHAWater",
        "uniqueid": "00:15:8d:00:04:05:66:22-01-0500"
    },
    "6": {
        "config": {
            "alert": "none",
            "battery": 16,
            "group": "9",
            "on": true,
            "reachable": false
        },
        "ep": 1,
        "etag": "d0803524322851a2de96681b8dde3e1c",
        "lastseen": null,
        "manufacturername": "IKEA of Sweden",
        "mode": 3,
        "modelid": "TRADFRI remote control",
        "name": "Living room Remote",
        "state": {
            "buttonevent": 1002,
            "lastupdated": "2020-11-06T07:32:36.135"
        },
        "swversion": "2.3.014",
        "type": "ZHASwitch",
        "uniqueid": "00:0b:57:ff:fe:27:4b:72-01-1000"
    },
    "7": {
        "config": {
            "battery": 100,
            "offset": 0,
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "d0803524322851a2de96681b8dde3e1c",
        "lastseen": "2020-11-13T19:57Z",
        "manufacturername": "LUMI",
        "modelid": "lumi.weather",
        "name": "Living room Sensor",
        "state": {
            "lastupdated": "2020-11-13T19:51:36.859",
            "temperature": 2254
        },
        "swversion": "20161129",
        "type": "ZHATemperature",
        "uniqueid": "00:15:8d:00:04:4a:46:b4-01-0402"
    },
    "8": {
        "config": {
            "battery": 100,
            "offset": 0,
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "d0803524322851a2de96681b8dde3e1c",
        "lastseen": "2020-11-13T19:57Z",
        "manufacturername": "LUMI",
        "modelid": "lumi.weather",
        "name": "Living room Sensor",
        "state": {
            "humidity": 5102,
            "lastupdated": "2020-11-13T19:51:36.866"
        },
        "swversion": "20161129",
        "type": "ZHAHumidity",
        "uniqueid": "00:15:8d:00:04:4a:46:b4-01-0405"
    },
    "9": {
        "config": {
            "battery": 100,
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "d0803524322851a2de96681b8dde3e1c",
        "lastseen": "2020-11-13T19:57Z",
        "manufacturername": "LUMI",
        "modelid": "lumi.weather",
        "name": "Living room Sensor",
        "state": {
            "lastupdated": "2020-11-13T19:51:36.877",
            "pressure": 1004
        },
        "swversion": "20161129",
        "type": "ZHAPressure",
        "uniqueid": "00:15:8d:00:04:4a:46:b4-01-0403"
    }
}

@Smanar
Copy link
Collaborator

Smanar commented Nov 13, 2020

It seems a light is still created. Below also the deconz screenshot. Is there anyway I can verify via deconz if my button presses are registering? (Sorry I'm used to using phoscon)

Sure, look at field "buttonevent" in sensor 20. The first number is the button number and the second number is the action

Also- can we ask phoscon team to add the device or how is this usually done?

Yep, It's possible too, there is a github for that too https://github.com/dresden-elektronik/phoscon-app-beta/issues
But he have lot of work ATM, and the device is not yet in deconz itslef ^^, so I think it s better to wait some time.

You have deleted API entries for your tests, but you have keep the deconz entry or not for your tests ? Because it s a long story but I m trying to get information from deconz database to reconize the device.
And I think if you delete the "light" entry it will delete too the "sensor" entry ?

@tr1plus
Copy link
Author

tr1plus commented Nov 13, 2020

Hey. I deleted it via api and from the deconz screen itself before testing your latest code.

I tried validating button presses (I did it via API since I can't find the "buttonevent" in the deconz gui :( )
It mostly stays at 1002 - doesn't matter what buttons I press. In very rare cases it goes to 1004. So I don't think button handeling is working correctly (or the API Doesn't update frequently enough, not sure how that works)

When I (just now) deleted the light entry via api, the senor entry stayed behind.

Then I removed sensor via api and removed the node from deconz.

Then re-paired the switch (limiting to relevant entries for visibility)

{
    "config": {
        "battery": 100,
        "on": true,
        "reachable": true
    },
    "ep": 1,
    "etag": "0f8e78898daf838b12e3c65e45cd073a",
    "lastseen": "2020-11-13T22:28Z",
    "manufacturername": "_TZ3000_vp6clf9d",
    "mode": 1,
    "modelid": "TS0044",
    "name": "Switch 21",
    "state": {
        "buttonevent": 1004,
        "lastupdated": "2020-11-13T22:28:04.699"
    },
    "type": "ZHASwitch",
    "uniqueid": "5c:02:72:ff:fe:a4:ab:ad-01-0006"
}
    "10": {
        "etag": "b5fa90c83ec3b58356ddc2828e1953b0",
        "hascolor": false,
        "lastannounced": null,
        "lastseen": "2020-11-13T22:27Z",
        "manufacturername": "_TZ3000_vp6clf9d",
        "modelid": "TS0044",
        "name": "On/Off light 10",
        "state": {
            "alert": "none",
            "on": false,
            "reachable": true
        },
        "swversion": null,
        "type": "On/Off light",
        "uniqueid": "5c:02:72:ff:fe:a4:ab:ad-01"
    },
    "12": {
        "etag": "2351533a7c1e55da7165e434e67e3066",
        "hascolor": false,
        "lastannounced": null,
        "lastseen": "2020-11-13T22:27Z",
        "manufacturername":"��}��V",
        "modelid": null,
        "name": "On/Off light 12",
        "state": {
            "alert": "none",
            "on": false,
            "reachable": true
        },
        "swversion": null,
        "type": "On/Off light",
        "uniqueid": "5c:02:72:ff:fe:a4:ab:ad-02"
    },
    "13": {
        "etag": "6aa57b31ff6af75a05ed59d186567e83",
        "hascolor": false,
        "lastannounced": null,
        "lastseen": "2020-11-13T22:27Z",
        "manufacturername":"��}��V",
        "modelid": null,
        "name": "On/Off light 13",
        "state": {
            "alert": "none",
            "on": false,
            "reachable": true
        },
        "swversion": null,
        "type": "On/Off light",
        "uniqueid": "5c:02:72:ff:fe:a4:ab:ad-03"
    },
    "14": {
        "etag": "6aa57b31ff6af75a05ed59d186567e83",
        "hascolor": false,
        "lastannounced": null,
        "lastseen": "2020-11-13T22:27Z",
        "manufacturername":"��}��V",
        "modelid": null,
        "name": "On/Off light 14",
        "state": {
            "alert": "none",
            "on": false,
            "reachable": true
        },
        "swversion": null,
        "type": "On/Off light",
        "uniqueid": "5c:02:72:ff:fe:a4:ab:ad-04"
    },

@Smanar
Copy link
Collaborator

Smanar commented Nov 14, 2020

When I (just now) deleted the light entry via api, the senor entry stayed behind.

Good news for later.
In fact, the deconz code need to be modified, ATM to reconize tuya device I m using the deconz database, so for the code works the device need to be in it. So you make a first inclusion, you will have bad entries, but the next one will work. But if you delete the deconz entry, you restart from scratch.

So the better way is to delete the "light" entry in the API, but never the device in deconz, to prevent "bad devices" creation. One time the device is in the deconz base, the api can prevent bad device creation.

For your button event return, I think you have only return for the first button, so I have updated the code again, if it still not working I will probably need special log when you press it.

The field need to be X00Y

  • X = button Number
  • Y = event

Events are

  • 2 = short released
  • 3 = long released
  • 4 = double press

@Smanar
Copy link
Collaborator

Smanar commented Nov 14, 2020

I m sorry but I need to finalize the code sunday if I want it be in next beta.
There is no one that can try the code ?
On "tuya" branch or "tuya_pr" (based on last code possible)

I just need to know if the "switches group" is working (mean all buttons are working in the same entry), else I will make a roolback to have 1 sensor device by endpoint.

@tr1plus
Copy link
Author

tr1plus commented Nov 14, 2020

Hey - I can only test in about 12 hours from now - was out for almost the whole day. I may try a bit earlier. Keep you posted

Do whatever needs to be done if it's too late - I can test after and see what is possible.

@tr1plus
Copy link
Author

tr1plus commented Nov 15, 2020

FYI - I'll start testing now by pulling the tuya branch.

Keep you posted.

@tr1plus
Copy link
Author

tr1plus commented Nov 15, 2020

Hey

I didn't delete anything this time around, just updated the code with your git pull & compile.

According to the "buttonevent" in the api the 3 press types (short, long, double) work for buttons 1 - 3. This device has 4 buttons so I'm not sure if you considered that or of the last button is just wonky 👍

Apart from that the lights are still visible in the api of deconz. Let me know if I need more testing on that.

I will be available from time to time in the coming hours. I will keep an eye on this github/mail.

@Smanar
Copy link
Collaborator

Smanar commented Nov 15, 2020

Thx, will take a look for button 4.
But you have 3 "sensor" entry, ot only one that show the 3 buttons ?

@tr1plus
Copy link
Author

tr1plus commented Nov 15, 2020

Hey

In Deconz I see this (so 4 buttons I would assume)
image

In API /sensors I only see the 1 entry

    "21": {
        "config": {
            "battery": 100,
            "on": true,
            "reachable": true
        },
        "ep": 1,
        "etag": "d06d1cd496471b839c8da74764582732",
        "lastseen": "2020-11-15T09:11Z",
        "manufacturername": "_TZ3000_vp6clf9d",
        "mode": 1,
        "modelid": "TS0044",
        "name": "Switch 21",
        "state": {
            "buttonevent": 1004,
            "lastupdated": "2020-11-15T09:11:12.646"
        },
        "type": "ZHASwitch",
        "uniqueid": "5c:02:72:ff:fe:a4:ab:ad-01-0006"
    },

In /lights I see the 4 lights

   "10": {
        "etag": "41ed218799c314771724001ea70cf91f",
        "hascolor": false,
        "lastannounced": null,
        "lastseen": "2020-11-15T09:10Z",
        "manufacturername": "_TZ3000_vp6clf9d",
        "modelid": "TS0044",
        "name": "On/Off light 10",
        "state": {
            "alert": "none",
            "on": false,
            "reachable": true
        },
        "swversion": null,
        "type": "On/Off light",
        "uniqueid": "5c:02:72:ff:fe:a4:ab:ad-01"
    },
    "12": {
        "etag": "41ed218799c314771724001ea70cf91f",
        "hascolor": false,
        "lastannounced": null,
        "lastseen": "2020-11-15T09:10Z",
        "manufacturername":"��}��V",
        "modelid": null,
        "name": "On/Off light 12",
        "state": {
            "alert": "none",
            "on": false,
            "reachable": true
        },
        "swversion": null,
        "type": "On/Off light",
        "uniqueid": "5c:02:72:ff:fe:a4:ab:ad-02"
    },
    "13": {
        "etag": "41ed218799c314771724001ea70cf91f",
        "hascolor": false,
        "lastannounced": null,
        "lastseen": "2020-11-15T09:10Z",
        "manufacturername":"��}��V",
        "modelid": null,
        "name": "On/Off light 13",
        "state": {
            "alert": "none",
            "on": false,
            "reachable": true
        },
        "swversion": null,
        "type": "On/Off light",
        "uniqueid": "5c:02:72:ff:fe:a4:ab:ad-03"
    },
    "14": {
        "etag": "41ed218799c314771724001ea70cf91f",
        "hascolor": false,
        "lastannounced": null,
        "lastseen": "2020-11-15T09:10Z",
        "manufacturername":"��}��V",
        "modelid": null,
        "name": "On/Off light 14",
        "state": {
            "alert": "none",
            "on": false,
            "reachable": true
        },
        "swversion": null,
        "type": "On/Off light",
        "uniqueid": "5c:02:72:ff:fe:a4:ab:ad-04"
    },

hope this clarifies. I only get response in the "buttonevent" field in the /sensors/5c:02:72:ff:fe:a4:ab:ad-01-0006 on button 1-2-3. 4 does't change anything for 'buttonevent' field.

@Smanar
Copy link
Collaborator

Smanar commented Nov 15, 2020

Nice thx ^^. So you have all value, 3001 2002 and ect, in the sensor 21 (not only 100X) ?
Unfornately, for the moment you need to delete yourself the "light" devices the first time, but one time they are stored, it will be ok.

If you want to try the 4 th button, edit the json file > Smanar@dbcf97a

This file is in a special folder, on rapsbian it's
.local/share/dresden-elektronik/deCONZ/devices/
or
/usr/share/deCONZ/plugins/devices

But don't worry if the 3 are working the 4 th will work too. Thx A lot, I will make the last PR now.

@tr1plus
Copy link
Author

tr1plus commented Nov 15, 2020

Just to confirm - I should delete the 4 lights via api, an leave the rest (sensor & deconz gui node), correct?

Yes, some examples, all from the same sensor:

"buttonevent": 2003,
"buttonevent": 3002,
"buttonevent": 3003,
"buttonevent": 2002,
"buttonevent": 2004,

Finishing something up - will take a look at the file

Thanks for the help already :) Will this potentailly be in the next stable somewhere mid December?

@Smanar
Copy link
Collaborator

Smanar commented Nov 15, 2020

Yep, you have said it don't delete the sensor entry, so yes you can.
The code look first in deconz database then in sensor database before creating a new "light" device, so they will not re appear after the deletion.

You will have them in the beta tommorow I think, so ofc in the future official.

@tr1plus
Copy link
Author

tr1plus commented Nov 15, 2020

I just re-confirmed. I deleted the 4 light entries and the sensor entry is still there and responding to button presses (via the buttonevent field).

Thanks for the help. If I find some time later today I'll check the JSON file you mentioned for button 4.

@tr1plus
Copy link
Author

tr1plus commented Nov 15, 2020

Hey

1 remark:

You are putting all this in "Tuya3gang". My button is a 4 gang - not sure if this will be clear in the future why a 3 gang has 4 buttons ;)

Below JSON is tested and works with my 4Gang button

        "Tuya3gangMap": {
            "modelids": [""],
            "map": [
                [1, "0x01", "ONOFF", "0xfd", "0", "S_BUTTON_1", "S_BUTTON_ACTION_SHORT_RELEASED", "B1 short"],
                [1, "0x01", "ONOFF", "0xfd", "1", "S_BUTTON_1", "S_BUTTON_ACTION_DOUBLE_PRESS", "B1 double"],
                [1, "0x01", "ONOFF", "0xfd", "2", "S_BUTTON_1", "S_BUTTON_ACTION_LONG_RELEASED", "B1 long"],
                [1, "0x02", "ONOFF", "0xfd", "0", "S_BUTTON_2", "S_BUTTON_ACTION_SHORT_RELEASED", "B2 short"],
                [1, "0x02", "ONOFF", "0xfd", "1", "S_BUTTON_2", "S_BUTTON_ACTION_DOUBLE_PRESS", "B2 double"],
                [1, "0x02", "ONOFF", "0xfd", "2", "S_BUTTON_2", "S_BUTTON_ACTION_LONG_RELEASED", "B2 long"],
                [1, "0x03", "ONOFF", "0xfd", "0", "S_BUTTON_3", "S_BUTTON_ACTION_SHORT_RELEASED", "B3 short"],
                [1, "0x03", "ONOFF", "0xfd", "1", "S_BUTTON_3", "S_BUTTON_ACTION_DOUBLE_PRESS", "B3 double"],
                [1, "0x03", "ONOFF", "0xfd", "2", "S_BUTTON_3", "S_BUTTON_ACTION_LONG_RELEASED", "B3 long"],
                [1, "0x04", "ONOFF", "0xfd", "0", "S_BUTTON_4", "S_BUTTON_ACTION_SHORT_RELEASED", "B4 short"],
                [1, "0x04", "ONOFF", "0xfd", "1", "S_BUTTON_4", "S_BUTTON_ACTION_DOUBLE_PRESS", "B4 double"],
                [1, "0x04", "ONOFF", "0xfd", "2", "S_BUTTON_4", "S_BUTTON_ACTION_LONG_RELEASED", "B4 long"]
            ]
        },

@tr1plus
Copy link
Author

tr1plus commented Nov 15, 2020

Another remark.

I don't see the switch in the deconz UI anymore. This happened after I restarted deconz to validate the json change.
Is it possible that it is no longer there because the lights (the once I removed) were not available on start up?

IT's still availalbe in the API

image

{
    "config": {
        "battery": 100,
        "on": true,
        "reachable": true
    },
    "ep": 1,
    "etag": "af43562570713f63e786d0f257b72228",
    "lastseen": "2020-11-15T13:04Z",
    "manufacturername": "_TZ3000_vp6clf9d",
    "mode": 1,
    "modelid": "TS0044",
    "name": "Switch 21",
    "state": {
        "buttonevent": 4002,
        "lastupdated": "2020-11-15T13:04:00.296"
    },
    "type": "ZHASwitch",
    "uniqueid": "5c:02:72:ff:fe:a4:ab:ad-01-0006"
}

@Smanar
Copy link
Collaborator

Smanar commented Nov 15, 2020

Yep, it s a generic code for tuya, it work for 1 gang and 2 gand and 3 and 4. I will change the name in the future version.

I don't see the switch in the deconz UI anymore

Ha ? not good. But if it still working, it is obligatorily in deconz, a device can be in deconz and not in the api, but not the reverse.

You have deleted them using the api ? or phoscon ?

@tr1plus
Copy link
Author

tr1plus commented Nov 15, 2020

I had previously deleted the 4 lights via API.

Then I restarted the whole machine after making changes to the json file to ensure it had the latest version.

After that I could still see the switch in the api and it was responding to button presses, but as you can see It is not visible in deconz ui (switch 21)

@github-actions github-actions bot added the stale label May 28, 2021
@tr1plus
Copy link
Author

tr1plus commented May 28, 2021

To my understanding the double event bug for Tuya is still not resolved - hoping to keep this open.

@Smanar
Copy link
Collaborator

Smanar commented May 28, 2021

Yes it is #4716
You still have the issue ?

@tr1plus
Copy link
Author

tr1plus commented May 28, 2021

Should this be resolved in the "live" version already, or only in the beta versions still? I haven't paired this device in my "live" environment still. Not sure if the "4 lights are added" issue was already resolved.

@Smanar
Copy link
Collaborator

Smanar commented May 28, 2021

Merged the 8 april, I think yes it s in the "live" now.
For the "4 lights are added", try to delete it and make a second inclusion.
At first inclusion you will have this issue, but the device will be memorised to be correclty reconized at the second inclusion.

@tr1plus
Copy link
Author

tr1plus commented May 28, 2021

Switch gets added without issue (even only had to add it once, but it may be because it was still in its database).
I am indeed getting 2 events triggered per button press.

Event 1 fired 11:05 PM:
{
    "event_type": "deconz_event",
    "data": {
        "id": "ts0044_20",
        "unique_id": "5c:02:72:ff:fe:a4:ab:ad",
        "event": 3002,
        "device_id": "0a38d95c43598a7b538cde4feece612e"
    },
    "origin": "LOCAL",
    "time_fired": "2021-05-28T21:05:48.278182+00:00",
    "context": {
        "id": "885fd39fbc90a94d3f1113c35fdd0195",
        "parent_id": null,
        "user_id": null
    }
}
Event 0 fired 11:05 PM:
{
    "event_type": "deconz_event",
    "data": {
        "id": "ts0044_20",
        "unique_id": "5c:02:72:ff:fe:a4:ab:ad",
        "event": 3002,
        "device_id": "0a38d95c43598a7b538cde4feece612e"
    },
    "origin": "LOCAL",
    "time_fired": "2021-05-28T21:05:47.267291+00:00",
    "context": {
        "id": "27ae1ba3c449a492144f87d31f747163",
        "parent_id": null,
        "user_id": null
    }
}

NOTE: this is the home assistant output, but listening for any event in deconz :)

@Smanar
Copy link
Collaborator

Smanar commented May 28, 2021

What is your deconz version ?
Can you show logs with "info" when pressing the button ?

@github-actions github-actions bot removed the stale label May 29, 2021
@tr1plus
Copy link
Author

tr1plus commented May 29, 2021

image
This is what the "info" & "info2" checkbox shows when pressing one of the 4 buttons.

Version:
image

As of now everything is happening via HASSOS - if needed I can spin up another VM again, but I think this should be sufficient information?

@vanarebane
Copy link

I can confirm that the 3 button and 4 button variants work well with new firmware. Both are supported and don't have double event problem

Platform: Homeassistant
Version: 2.11.05 / 5/9/2021
Firmware: 26660700

@Smanar
Copy link
Collaborator

Smanar commented May 30, 2021

You have an older version @tr1plus
Was added in this version https://github.com/dresden-elektronik/deconz-rest-plugin/releases/tag/v2.11.0-beta

@tr1plus
Copy link
Author

tr1plus commented May 30, 2021

Good catch - I confirm my specific switch is also working, all types of button presses work for the 4 buttons, and only seem to generate 1 event!

Thanks a lot for working on this and even fixing part of the base code to support this!
Great work!

@github-actions
Copy link
Contributor

As there has not been any response in 21 days, this issue has been automatically marked as stale. At OP: Please either close this issue or keep it active It will be closed in 7 days if no further activity occurs.

@github-actions github-actions bot added the stale label Jun 21, 2021
@github-actions
Copy link
Contributor

As there has not been any response in 28 days, this issue will be closed. @ OP: If this issue is solved post what fixed it for you. If it is not solved, request to get this opened again.

@VoyteckPL
Copy link

Hi all. Sorry for reopening this. I have deconz and ts0044 and delay problem like in this link on zigbee2mqtt Koenkk/zigbee2mqtt#8149 (comment)

Maybe there is a fix already?

@Smanar
Copy link
Collaborator

Smanar commented Aug 2, 2021

Ha good question.
Never see this issue yet, but there is some PR about the defaut response (and one today).
Wich one deconz version are you using ?

Some else have this issue ? and wich one deconz version ?

@VoyteckPL
Copy link

26680700

2.11.05 / 9.05.2021

@VoyteckPL
Copy link

No one has this problem?

@manuelgorman
Copy link

Yes, I'm seeing the same issue with the 4 button version.

@Smanar
Copy link
Collaborator

Smanar commented Aug 3, 2021

I m sorry, but I prefer wait for the next version to be sure.
Look here for "Default Response" https://github.com/dresden-elektronik/deconz-rest-plugin/releases there is at least 3 PR just in the version 2.12

@VoyteckPL
Copy link

VoyteckPL commented Aug 3, 2021

Not sure what you mean? Total noob here. What should I do?

@Smanar
Copy link
Collaborator

Smanar commented Aug 3, 2021

np, just try the beta 2.12 or wait for a 2.12 stable.

@VoyteckPL
Copy link

Thanks. Im so confused. Can I update it on hassos?

@Smanar
Copy link
Collaborator

Smanar commented Aug 3, 2021

I don't think, on this kind of OS you are HAssos dependent, but I think the 2.12 stable will be soon, long time we haven't a new version.

@sebres
Copy link
Contributor

sebres commented Aug 3, 2021

if you use HA, you can switch to the ZHA (which does not have this issue at all) - just use the integration Zigbee Home Automation instead of deCONZ. And you would need to (re)connect your devices using ZHA integration from HA settings.

@VoyteckPL
Copy link

I'll wait. When is this update expected.

@Smanar
Copy link
Collaborator

Smanar commented Aug 4, 2021

The last stable is 2 months old, so the next one is realy close.
From the discord, It still need some days, to correct some part of ZGP proxy code.

@VoyteckPL
Copy link

Looks like delay is sorted. It works fine. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests