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

device support: iCasa switches #1124

Open
ebaauw opened this issue Jan 12, 2019 · 27 comments

Comments

@ebaauw
Copy link
Contributor

@ebaauw ebaauw commented Jan 12, 2019

wifimedia.eu kindly provided me with iCasa switches to integrate in deCONZ and homebridge-hue.

The battery-powered Pulse 2, Pulse 4S, and Pulse 8S keypads seem like regular switches. They pair to deCONZ on first attempt. They all look the same from a Zigbee perspective, except for the Model Identifier:

  • Pulse 2: ICZB-KPD12;
  • Pulse 4S: ICZB-KPD14S;
  • Pulse 8S: ICZB-KPD18S.

screenshot 2019-01-12 at 20 22

deCONZ receives APS indications for the_OnOff_ cluster (0x0006) on pressing the On or Off button; for the Scenes cluster (0x0005) on pressing or holding (store scene?) a scene button; and for the Level control cluster (0x0008) on holding and on releasing the On of Off button(except for the 4S - the light blinks instead of burns while holding the button Edit because of the low battery). I haven't yet brought out the sniffer, but this seems pretty standard.

I can bind the Power configuration cluster to the RaspBee, but get unsupported cluster commands when trying to read or write the report configuration for Battery Voltage or Battery Percentage Remaining. We might need to poll the switches for the battery percentage. They seem to poll their parent after a button is pressed.

The battery percentages are 100 (3.2V), 35 (2.5V) and 98 (3.0V) - I think they report in 1%, like the IKEA Trådfri, instead of the standard 0.5%.

They appear to be OTA upgradable; the OTAU plugin shows them with Version 0x0000000A and Image 0x2FAA.

The Power Descriptor does not seem valid. I see ZDP answers to 0x8003, but the Node Info panel continues to show them as Mains powered. The Node Descriptor seems fine, though.
screenshot 2019-01-12 at 20 47

@manup

This comment has been minimized.

Copy link
Member

@manup manup commented Jan 12, 2019

Cool, the dimmer looks very interesting have it already on my wish list since a few days :)

deCONZ receives APS indications for the_OnOff_ cluster (0x0006) on pressing the On or Off button; for the Scenes cluster (0x0005) on pressing or holding (store scene?) a scene button; and for the Level control cluster (0x0008) on holding and on releasing the On of Off button(except for the 4S - the light blinks instead of burns while holding the button). I haven't yet brought out the sniffer, but this seems pretty standard.

Do they send the commands without a former binding? And how, unicast or group-cast?

@ebaauw

This comment has been minimized.

Copy link
Contributor Author

@ebaauw ebaauw commented Jan 12, 2019

Do they send the commands without a former binding? And how, unicast or group-cast?

Need to sniff. I thought the first one I tried didn't, but the other two did.

Jan 12 21:30:09 pi1 deCONZ[23850]: 21:30:07:510 APS-DATA.indication srcAddr: 0x000d6f0010658a6e, srcEp: 0x01 dstAddrMode: 1, profile: 0x0104, cluster: 0x0006, lqi: 255, rssi: -52

Address mode 1 is group cast, isn't it?

EDIT And the REST API plugin spontaneously assigned a random group to config.group after whitelisting the keypads.

@ebaauw

This comment has been minimized.

Copy link
Contributor Author

@ebaauw ebaauw commented Jan 12, 2019

Cool, the dimmer looks very interesting have it already on my wish list since a few days

Here it is:
screenshot 2019-01-12 at 21 27
screenshot 2019-01-12 at 21 27 1

As I was advised, no metering and no reporting for the connected push switch, but attribute reporting for OnOff and Current Level. No PowerOn OnOff, but working PowerOn Level. When set to 0, it doesn't light up on power cycle. It reports 255 as group capacity, even after I joined it to a group. The manual says it can be controlled by up to 30 Zigbee remotes or keypads, so I assume 30 groups. OTAU seems OK, Version 0x00000014 and Image 0x27ED.

There's two push buttons on the device: one for reset, one for setting the minimum level. I don't see the minimum level reported anywhere over Zigbee. The dimmer seems small enough to hide behind a pulse switch. At 220V it's rated for 200W for LED lamps, drivers or electronic halogen trafos; and for 400W for incandescent lights. It supports resistive and capacitive loads - no mention of inductive (so no go for my ceiling fans).

The REST API plugin already seems to like it well enough. We might need to whitelist it to configure the attribute reporting. The settings were 1, 65535 (and 0 for the Current Level) - I don't suppose the plugin did set these values?

{
  "etag": "1c07beb922f18c4ca7cb719c4d51c5bc",
  "hascolor": false,
  "manufacturername": "icasa",
  "modelid": "ICZB-IW11D",
  "name": "Light 1",
  "state": {
    "alert": "none",
    "bri": 129,
    "on": true,
    "reachable": true
  },
  "swversion": "2.3.1_r20",
  "type": "Dimmable light",
  "uniqueid": "00:0d:6f:00:0f:94:86:ef-01"
}
@ebaauw

This comment has been minimized.

Copy link
Contributor Author

@ebaauw ebaauw commented Jan 12, 2019

After binding the OnOff and Level clusters to the RaspBee and configuring reporting (1, 300, 1), deCONZ seems to receive the reports. While transitioning from bri: 1 to bri: 254 over 600 seconds, it only sends a report per minute, though:

Jan 12 22:05:56 pi1 dc_eventlog[25650]: /lights/1/state: {"on":true}
Jan 12 22:05:57 pi1 dc_eventlog[25650]: /lights/1/state: {"bri":1}
Jan 12 22:07:57 pi1 dc_eventlog[25650]: /lights/1/state: {"bri":7}
Jan 12 22:08:56 pi1 dc_eventlog[25650]: /lights/1/state: {"bri":32}
Jan 12 22:09:56 pi1 dc_eventlog[25650]: /lights/1/state: {"bri":57}
Jan 12 22:10:56 pi1 dc_eventlog[25650]: /lights/1/state: {"bri":82}

I still need to wire a pulse switch to see how it reports external input.

Edit that seems to work. One input needs to be connected to neutral, the other to the pulse switch. The dimmer alternates between on and off on pulse, and between dim up and dim down on hold.

@manup

This comment has been minimized.

Copy link
Member

@manup manup commented Jan 12, 2019

Great this looks like a really nice device to fix the usual wall switch problem. Power measurement would be a nice feature but the Green Power Proxy support is also cool.

@ebaauw

This comment has been minimized.

Copy link
Contributor Author

@ebaauw ebaauw commented Jan 13, 2019

Do they send the commands without a former binding? And how, unicast or group-cast?

They send groupcasts. They pick a random group after reset, but after binding the OnOff, Level, and Scene clusters manually to another group, they use that group. The scene commands are hard-coded for group 0x0000 and scene 0x01, ..., 0x06. Very Hue: use the groupcast to recall the "global" scene only for the lights in the group.

I think I got them working in deCONZ, except for polling the battery percentage. It's only populated when manually reading the Power Configuration cluster from the deCONZ GUI. @manup please help me: where do I whitelist the sensor for polling?

@ebaauw

This comment has been minimized.

Copy link
Contributor Author

@ebaauw ebaauw commented Jan 13, 2019

Above mentioned PR adds support.

Pulse 8S, exposed as single /sensors resource:

{
  "config": {
    "battery": 91,
    "group": "31745",
    "on": true,
    "reachable": true
  },
  "ep": 1,
  "etag": "978bb3c741a540b38ec491228dfbe394",
  "manufacturername": "icasa",
  "mode": 1,
  "modelid": "ICZB-KPD18S",
  "name": "Pulse 8S",
  "state": {
    "buttonevent": 8002,
    "lastupdated": "2019-01-13T15:04:53"
  },
  "swversion": "2.2.3_r10",
  "type": "ZHASwitch",
  "uniqueid": "00:0d:6f:00:10:65:8a:63-01-1000"
}

With buttonevent values:

  • Off: 1001, 1002, 1003;
  • On: 2001, 2002, 2003;
  • S1: 3002;
  • S2: 4002;
  • S3: 5002;
  • S4: 6002;
  • S5: 7002;
  • S6: 8002.

Pulse 4S, exposed as single /sensors resource::

{
  "config": {
    "battery": 100,
    "group": "19457",
    "on": true,
    "reachable": true
  },
  "ep": 1,
  "etag": "3c0db7d640581ffbb559349e6cd70fc4",
  "manufacturername": "icasa",
  "mode": 1,
  "modelid": "ICZB-KPD14S",
  "name": "Pulse 4S",
  "state": {
    "buttonevent": 4002,
    "lastupdated": "2019-01-13T15:04:44"
  },
  "swversion": "2.2.3_r10",
  "type": "ZHASwitch",
  "uniqueid": "00:0d:6f:00:10:65:89:e0-01-1000"
}

With buttonevent values:

  • Off: 1001, 1002, 1003;
  • On: 2001, 2002, 2003;
  • S1: 3002;
  • S2: 4002.

Pulse 2, exposed as single /sensors resource:

{
  "config": {
    "battery": 100,
    "group": "8192",
    "on": true,
    "reachable": true
  },
  "ep": 1,
  "etag": "8f82350154add05632898ab9ac91c184",
  "manufacturername": "icasa",
  "mode": 1,
  "modelid": "ICZB-KPD12",
  "name": "Pulse 2",
  "state": {
    "buttonevent": 2002,
    "lastupdated": "2019-01-13T14:52:09"
  },
  "swversion": "2.2.3_r10",
  "type": "ZHASwitch",
  "uniqueid": "00:0d:6f:00:10:65:8a:6e-01-1000"
}

With buttonevent values:

  • Off: 1001, 1002, 1003;
  • On: 2001, 2002, 2003.

Dimmer, exposed as a single /lights resource:

{
  "etag": "b74453474c0f0889a65fd97763ce4cdc",
  "hascolor": false,
  "manufacturername": "icasa",
  "modelid": "ICZB-IW11D",
  "name": "Dimmer",
  "state": {
    "alert": "none",
    "bri": 3,
    "on": false,
    "reachable": true
  },
  "swversion": "2.3.1_r20",
  "type": "Dimmable light",
  "uniqueid": "00:0d:6f:00:0f:94:86:ef-01"
}
@manup

This comment has been minimized.

Copy link
Member

@manup manup commented Jan 13, 2019

They send groupcasts. They pick a random group after reset, but after binding the OnOff, Level, and Scene clusters manually to another group, they use that group. The scene commands are hard-coded for group 0x0000 and scene 0x01, ..., 0x06. Very Hue: use the groupcast to recall the "global" scene only for the lights in the group.

Guess this is good, just like Ikea remote works with the random group. Setup is easier with this, no binding is required.

I think I got them working in deCONZ, except for polling the battery percentage. It's only populated when manually reading the Power Configuration cluster from the deCONZ GUI. @manup please help me: where do I whitelist the sensor for polling?

I think this needs more logic. Usually polling sleeping devices is tricky and needs to planned carefully on a per device basis. For Xiaomi it is done right after the special reports since this is the only time they do mac data polling.

@ebaauw

This comment has been minimized.

Copy link
Contributor Author

@ebaauw ebaauw commented Jan 21, 2019

I think I managed to read the battery on receiving a message from the keypad, see above commit. It almost seems too easy. The keypads seem to check for firmware updates every ~10 minutes, which triggers the read, see log below.

I currently wait 300s before next reading the battery. My test network doesn't care, but I'm not sure if this is a wise choice for real. It might be prudent to wait longer. The Hue dimmer switch is configured to report battery every 5m; but the Hue motion sensor only every 2h. In order not to cause any additional traffic to the latter, we would have to wait for over 2h, which seems a bit long. Maybe whitelisting for which devices to read the battery is a better option? @manup, please advise.

Jan 21 22:26:31 pi1 deCONZ[19357]: 22:26:30:579 APS-DATA.indication srcAddr: 0x000d6f0010658a63, srcEp: 0x01 dstAddrMode: 2, profile: 0x0104, cluster: 0x0019, lqi: 255, rssi: -56
Jan 21 22:26:31 pi1 deCONZ[19357]: 22:26:30:579 #011asdu: 013701012412aa2f0a000000010e
Jan 21 22:26:31 pi1 deCONZ[19357]: 22:26:30:579 APS-DATA.request id: 237, addrmode: 0x03, addr: 0x000d6f0010658a63, profile: 0x0104, cluster: 0x0019, ep: 0x01 -> 0x01 queue: 0 len: 4 tx.options 0x04
Jan 21 22:26:31 pi1 deCONZ[19357]: 22:26:30:745 read attributes of 0x000D6F0010658A63 cluster: 0x0001: [ 22:26:30:745 0x0021 22:26:30:745 ]
Jan 21 22:26:31 pi1 deCONZ[19357]: 22:26:30:745 add task 14732 type 19 to 0x000D6F0010658A63 cluster 0x0001 req.id 238
Jan 21 22:26:31 pi1 deCONZ[19357]: 22:26:30:745 APS-DATA.request id: 238, addrmode: 0x03, addr: 0x000d6f0010658a63, profile: 0x0104, cluster: 0x0001, ep: 0x01 -> 0x01 queue: 1 len: 5 tx.options 0x00
Jan 21 22:26:31 pi1 deCONZ[19357]: 22:26:30:792 Erase task req-id: 238, type: 19 zcl seqno: 62 send time 0, profileId: 0x0104, clusterId: 0x0001
Jan 21 22:26:31 pi1 deCONZ[19357]: 22:26:30:792 APS-DATA.confirm id: 238, status: 0x00 SUCCESS 
Jan 21 22:26:31 pi1 deCONZ[19357]: 22:26:30:792 APS-DATA.confirm request id: 238 -> erase from queue
Jan 21 22:26:31 pi1 deCONZ[19357]: 22:26:30:871 aps request id: 238 finished, erase from queue
Jan 21 22:26:31 pi1 deCONZ[19357]: 22:26:31:618 APS-DATA.indication srcAddr: 0x000d6f0010658a63, srcEp: 0x01 dstAddrMode: 2, profile: 0x0104, cluster: 0x0001, lqi: 255, rssi: -58
Jan 21 22:26:31 pi1 deCONZ[19357]: 22:26:31:618 #011asdu: 083e012100002053
Jan 21 22:26:31 pi1 deCONZ[19357]: 22:26:31:619 Node data 0x000d6f0010658a63 profileId: 0x0104, clusterId: 0x0001
Jan 21 22:26:31 pi1 deCONZ[19357]: 22:26:31:619 update ZCL value 0x0001/0x0021 for 0x000D6F0010658A63 after 589 s
Jan 21 22:26:31 pi1 homebridge[2491]: #033[36m[Hue]#033[39m #033[90mPulse 8S: config changed event: {"battery":83}#033[39m
Jan 21 22:26:31 pi1 homebridge[2491]: #033[36m[Hue]#033[39m #033[90mPulse 8S: sensor battery changed from 82 to 83#033[39m
Jan 21 22:26:31 pi1 homebridge[2491]: #033[36m[Hue]#033[39m Pulse 8S: set homekit battery level from 82% to 83%
Jan 21 22:26:31 pi1 dc_eventlog[1935]: /sensors/4/config: {"battery":83}
Jan 21 22:26:35 pi1 deCONZ[19357]: 22:26:31:621 Websocket 127.0.0.1:45558 send message: {"config":{"battery":83},"e":"changed","id":"4","r":"sensors","t":"event","uniqueid":"00:0d:6f:00:10:65:8a:63-01-1000"} (ret = 119)
Jan 21 22:26:35 pi1 deCONZ[19357]: 22:26:31:625 Websocket 127.0.0.1:45928 send message: {"config":{"battery":83},"e":"changed","id":"4","r":"sensors","t":"event","uniqueid":"00:0d:6f:00:10:65:8a:63-01-1000"} (ret = 119)
@ebaauw

This comment has been minimized.

Copy link
Contributor Author

@ebaauw ebaauw commented Jan 22, 2019

For those looking to buy an icasa Pulse keypad or the icasa Dimmer: Wifimedia give a 10% discount if you enter discount code homebridgehue. They ship to the EU.

@Klagio

This comment has been minimized.

Copy link

@Klagio Klagio commented Jan 31, 2019

In Home Assistant will it work as receiving events (each press will be an event)?

@Klagio

This comment has been minimized.

Copy link

@Klagio Klagio commented Jan 31, 2019

For those looking to buy an icasa Pulse keypad or the icasa Dimmer: Wifimedia give a 10% discount if you enter discount code homebridgehue. They ship to the EU.

20 Euro shipping cot ... crazy, 70 Euro for a switch ... I pass

@ebaauw

This comment has been minimized.

Copy link
Contributor Author

@ebaauw ebaauw commented Jan 31, 2019

In Home Assistant will it work as receiving events (each press will be an event)?

I don't know Home Assistant, but should be. See my earlier posts on the buttonevent values.

@ebaauw ebaauw closed this Feb 8, 2019
manup added a commit that referenced this issue May 19, 2019
It appears these keypads report battery percentage periodically after all, slightly under every four hours. see #1509 (comment) and #1124.
@ebaauw

This comment has been minimized.

Copy link
Contributor Author

@ebaauw ebaauw commented May 24, 2019

They now ship the iCasa dimmer with new ZigBee 3.0 firmware:
Screenshot 2019-05-24 at 12 10

They also upgraded the ZGP function from proxy to combo. Unfortunately, the firmware is not available for download.

They also introduced an in-wall switch (relay):
Screenshot 2019-05-24 at 12 13

I looks, feels, and behaves very much like the dimmer. Notably, it also supports attribute reporting, especially useful when the relay is operated thru a connected push button. Obviously, the Level Control cluster is for responding to wireless switches that send with (On/Off) commands; the Current Level reflects the level requested by the most recent command, but the relay on turns on or off.

bol.com now carry them as well. I'm not sure if they'll deliver these outside the Netherlands and Belgium.

@ebaauw

This comment has been minimized.

Copy link
Contributor Author

@ebaauw ebaauw commented May 24, 2019

Above commits add support for the in-wall switch. Had to do some fiddling to suppress state.bri, as they use VENDOR_PHILIPS as manufacturer code.

{
  "etag": "d9311f4799782dce6400dce88b742d16",
  "hascolor": false,
  "manufacturername": "icasa",
  "modelid": "ICZB-IW11SW",
  "name": "Light 5",
  "state": {
    "alert": "none",
    "on": true,
    "reachable": true
  },
  "swversion": "2.4.1_r33",
  "type": "On/Off light",
  "uniqueid": "00:0d:6f:00:0f:d8:56:6c-01"
}
@ebaauw

This comment has been minimized.

Copy link
Contributor Author

@ebaauw ebaauw commented May 24, 2019

This is interesting: the Hue bridge recognises the switch as certified and exposes it natively to HomeKit. Presumably because of the Manufacturer Code?

{
  "capabilities": {
    "certified": true,
    "control": {},
    "streaming": {
      "proxy": false,
      "renderer": false
    }
  },
  "config": {
    "archetype": "classicbulb",
    "direction": "omnidirectional",
    "function": "functional",
    "startup": {
      "configured": true,
      "mode": "safety"
    }
  },
  "manufacturername": "icasa",
  "modelid": "ICZB-IW11SW",
  "name": "Hue light 1",
  "productname": "Hue light",
  "state": {
    "alert": "select",
    "mode": "homeautomation",
    "on": false,
    "reachable": false
  },
  "swupdate": {
    "lastinstall": "2019-05-24T11:32:23",
    "state": "noupdates"
  },
  "swversion": "2.4.1_r33",
  "type": "On/Off light",
  "uniqueid": "00:0d:6f:00:0f:d8:56:6c-01"
}
@manup

This comment has been minimized.

Copy link
Member

@manup manup commented May 24, 2019

This is interesting: the Hue bridge recognises the switch as certified and exposes it natively to HomeKit. Presumably because of the Manufacturer Code?

Hehe interesting, perhaps a nice little hack,seems like it was done on purpose :) I wonder how long it will last.

@ebaauw

This comment has been minimized.

Copy link
Contributor Author

@ebaauw ebaauw commented May 24, 2019

More fun: the switch supports PowerOn On/Off and PowerOn Level. The dimmer (both old ZLL and new ZigBee 3.0 firmware) supports only PowerOn Level, but it won't turn on with PowerOn Level set to 0.

@ebaauw

This comment has been minimized.

Copy link
Contributor Author

@ebaauw ebaauw commented May 24, 2019

Hehe interesting, perhaps a nice little hack

I take it you’re already cooking up a custom firmware for the FLS-PP to check this?

@ebaauw

This comment has been minimized.

Copy link
Contributor Author

@ebaauw ebaauw commented May 24, 2019

I also works for the dimmer (at least for the ZigBee 3.0 firmware - haven't tested the ZLL firmware). The Hue app claims power-on behaviour is not supported, though (presumably because of the missing PowerOn On/Off).

@ebaauw

This comment has been minimized.

Copy link
Contributor Author

@ebaauw ebaauw commented May 24, 2019

And here's the 12V LED dimmer:
Screenshot 2019-05-24 at 19 37

Same firmware version and functionality as the in-wall switch, except, of course, this one does dim the output. Is already handled by the previous commits.

{
  "etag": "db972e9151c3094839fbebd079b20b57",
  "hascolor": false,
  "manufacturername": "icasa",
  "modelid": "ICZB-DC11",
  "name": "Light 7",
  "state": {
    "alert": "none",
    "bri": 1,
    "on": true,
    "reachable": true
  },
  "swversion": "2.4.1_r33",
  "type": "Dimmable light",
  "uniqueid": "00:0d:6f:00:10:68:1b:d9-01"
}
manup added a commit that referenced this issue Jun 10, 2019
manup added a commit that referenced this issue Jun 10, 2019
Fix `type` for iCasa in-wall switch, see #1124.
@JBS5

This comment has been minimized.

Copy link

@JBS5 JBS5 commented Aug 21, 2019

I guess it is not possible to use direct bindings with the Pulse 8S like possible with the Hue Dimmer Switch and Tradfri grey/Black dimmer to keep it possible to switch a light even when deCONZ is offline?

@ebaauw

This comment has been minimized.

Copy link
Contributor Author

@ebaauw ebaauw commented Aug 21, 2019

Yes it is. You need to create a group with an ID matching the switch’s config.group. I don’t think you can specify the group ID when creating a group through the REST API, though so either:

  • Create a group, shutdown deCONZ and patch the group ID in the database; or
  • Create a group and bind the switch to this group in the Bind dropbox panel in the deCONZ GUI; or
  • Add the group ID from the switch’s config.group to a light using the Cluster Info panel in the deCONZ GUI for the light’s group cluster.

Once the group has been created, you can add (more) lights to it using the API.

@JBS5

This comment has been minimized.

Copy link

@JBS5 JBS5 commented Aug 21, 2019

@ebaauw Thanks, Does this mean this kind of binding is possible with all kind of switches paired in deCONZ, for example the the Xiaomi Aqara double wirelss switch (WXKG02LM)?

@ebaauw

This comment has been minimized.

Copy link
Contributor Author

@ebaauw ebaauw commented Aug 21, 2019

No, only with switches that send commands to lights or groups. Xiaomi switches only send reports to the coordinator.

You want to look for switches that:

  • Support touch linking;
  • Show config.group in the REST API (although some switches will send broadcasts after reset, and will need to be bound to a group manually befor showing config.group);
  • Show client (grey) On/Off, Level, and/or Scenes clusters in the deCONZ GUI (although with Xiaomi there doesn’t seem to be any relationship between the clusters they advertise vs the clusters they actually support).
@rendgeor

This comment has been minimized.

Copy link

@rendgeor rendgeor commented Sep 2, 2019

Hello,
I bought the switch ćause thought they are fully supported by deconz.
Adding the switch results in no new switch object in phoscon.

Anyhow, I thing it was added by isn't shown.

Is that the icasa switch and if so, why isn it shown in phoscon after parting?
image

Btw:
Do pairing with:

  1. phoscon: search for switches
  2. icasa switch: on + off, then on...blinks
@rendgeor

This comment has been minimized.

Copy link

@rendgeor rendgeor commented Sep 4, 2019

@manup
Switch is seen in webapp. Why isn it available in phoscon?

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.