Skip to content

Instantly share code, notes, and snippets.

@phindmarsh
Created June 3, 2021 08:33
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phindmarsh/84085fd0f13a79969c51e71d53197d0b to your computer and use it in GitHub Desktop.
Save phindmarsh/84085fd0f13a79969c51e71d53197d0b to your computer and use it in GitHub Desktop.
PDL/Clipsal Wiser Dimmers in zigbee2mqtt

After a bunch of back and forth and many hours of trial and error, I've finally got a robust way to integrate the Clipsal/PDL Iconic dimmers integrated into Home Assistant via zigbee2mqtt.

I have submitted a PR that adds a zigbee-herdsman-converter that means the dimmers should be recognised automatically by zigbee2mqtt, allowing them to be controlled by Home Assistant like any other compatible device.

As it transpires, this was actually really easy once I worked out what to do, so this isn't even a hack.

Switching to zigbee mode

If you have the PDL354PBDMBTW or 41EPBDWCLM devices you can switch these over to zigbee mode by pressing the button 12 times (thanks to @ell249 for the tip).

After you press it 12 times it will take a few seconds then start flashing red. Then it takes another half minute or so to settle in and as long as your network permits joining it should show up as a device and join the network.

If you have problems, or you want to revert to BLE mode just do the standard factory reset by pressing the button 3 times quickly, then holding until the light flashes red slowly, then flashes red quickly. Make sure you hold on until it flashes quickly, otherwise it doesn't reset. This was the mistake I made and left me thinking I had bricked it.

Limitations

Once you switch to zigbee mode, you can't connect to it via the Wiser Room app to do firmware upgrades and such. It appears that the zigbee mode is supported by the Wiser by SE app, but it seems like you need a Wiser Hub to do this. So far, I haven't tried to make support for OTA via zigbee2mqtt.

There are some other settings that the zigbee certification document say are supported that I haven't gone through and made show up in zigbee2mqtt. I think it supports LevelCtrl and other things, but I couldn't get them to work easily and frankly I was more interested in the on/off and brightness control than anything else.

@beasthouse-au
Copy link

guessing that's not working for you?

I had some issues with the latest dev pull of z2m last night and had to roll back a version so will try adding again today and see if things improve

@mrgadget
Copy link

mrgadget commented Aug 3, 2023

I had some issues with the latest dev pull of z2m last night

I'm just intrigued as to why you're adding YAML for your devices - unless I'm missing something? I'm running a release build not a dev build, but I've never had to add YAML to add a zigbee2mqtt device to HA.

@DanielNagy
Copy link

I had some issues with the latest dev pull of z2m last night

I'm just intrigued as to why you're adding YAML for your devices - unless I'm missing something? I'm running a release build not a dev build, but I've never had to add YAML to add a zigbee2mqtt device to HA.

I'm with @mrgadget here.. I've got no YAML. zigbee2mqtt does everything correctly for me. I can control devices, as well as see their status.(Also not running a dev build).

I do know there was issues with earlier clipsal zigbee firmware where the state didnt reflect the mech pressing. Have you upgraded the devices to the latest firmwares? (using the mobile app in bluetooth mode)

@beasthouse-au
Copy link

All sorted now after rolling back to the last stable version of zigbee2MQTT. I had updated the mech's through the Wiser Rooms app prior to pairing with z2m.

When I first added the devices, there was no switch entity coming through. Now that it has rolled back they have appeared. Previously I had created switch entities via YAML for other zigbee devices, but glad these do not require that now :)

Thanks for your input guys.

@mrgadget
Copy link

mrgadget commented Aug 3, 2023

Never hurts to ask the hive-mind! One thing that may be of use (if you specifically want switch entities, and you're getting light entities from z2m auto discovery) - I manually updated the z2m config YAML file as below - now it shows up correctly as a switch entity in HA. There may be a better way to do this - but I couldn't find one.

  "0x943469fffe4d598c":
    friendly_name: house-hwc
    homeassistant:
      light:
        type: switch
        object_id: switch
      switch:
        name: house-hwc
        icon: mdi:water
        value_template: "{{ value_json.state }}"
  • updated as the old format no longer worked in 1.36.1.

@beasthouse-au
Copy link

Never hurts to ask the hive-mind!

Thanks :-)

One other thing that’s got me stumped is how to have one of these mech’a as a disconnected switch and follow the state of the light entity it controls in HA.

@mrgadget
Copy link

mrgadget commented Aug 3, 2023

I'm not 100% sure what you mean here - I see a couple of possibilities:

  • Linking. I do this in Node-Red - two mechs, if the status changes on one, it updates the other one. Your disconnected one would still need active and neutral of course. I'm sure this could be done using HA automations too - but I use what I know.
  • Decoupled mode. Basically, I wanted to be able to use the button on the mech in HA like a normal Zigbee button (single press, multi-press actions) and control the relay in the mech separately. I believe Shelley do this. I submitted this to Clipsal as a request and the below was their response.
At present the only/best option is to use the 2AX - PDL356PB2MBTZ-VW as this product does not require a load to be connected in order to function. The only issue here is that you only have the options of the ON or OFF to trigger other items. 

I will pass on the feedback regarding product suggestion, and it may be something that is looked at in the future.

If I've got the wrong end of the stick, feel free to elaborate :)

@phindmarsh
Copy link
Author

I could also be missing the point, but I just use 2 ‘dumb’ button mechs wired like a 3 way switch into the BLE dimmer, so I get a push button at the door (the BLE one) and a button on each side of the bed. Pushing any button controls the lights, and the state is reflected in zigbee2mqtt. Only the one main button by the door is zigbee/BLE, the other two are just regular push button switches.

@mrgadget
Copy link

mrgadget commented Aug 3, 2023

Ah multi-way, didn't think of that as an option - I use the Clipsal ControlLink Smart Push Button Remote for that - works a treat, and means you get a button/mech that still looks/works the same, with an led that follows state in the remote locations. These are not Zigbee, but connect back to a 10AX relay or 2AX dimmer (unfortunately not the 2AX relay though) much like @phindmarsh's. They are also supplied with wiring instructions to re-use existing 2-way wiring.

@beasthouse-au
Copy link

If I've got the wrong end of the stick, feel free to elaborate :)

No completely on track!

  • Decoupled mode.

Yeah this is what I was hoping to achieve. I was doing this previously with the Shelly i3, was not impressed with the delay though on some devices. What the i3 does is send a message to another Shelly to turn its relay off and on - that is what I am trying to do with the Wiser mechs.

I'm also finding that a couple of the mechs wired with just the Active and Neutral (piggy backed off one of the other mechs) is turning the switch with the load off and on as well. Essentially multi-way switching by mistake haha.

@mrgadget
Copy link

mrgadget commented Aug 3, 2023

Yeah it's a feature I really wish they'd look at supporting - but alas, it doesn't sound like it's coming any time soon. If you've got some spare TPS between them - have a look at that smart remote button I linked to - just looks like another mech. I've used it to retro all my 2-way switches. You only need 1 direct core between them for the control link, along with active and neutral.

When I want to do some cool stuff, I just run an ali Xaomi Mija button above the wall plate - that gets single, double, triple, quad and 'many' taps - so 5 different possible actions - into HA.

@beasthouse-au
Copy link

Unfortunately there’s no wiring between the two locations :( it’s that I’d like to control a switch on the other side of the room and it’s impossible to run cables there.

@lucasteligioridis
Copy link

Hi everyone, sorry if this isn't the most appropriate location to put this, but figured I'd ask it for other people using these wiser Clipsal Switches in z2m!

Have you noticed if you rapidly change brightness or on/off you'll see queueing and then flapping of the reporting? Me and a friend of mine have both seen this on our z2m / clipsal switches! I narrowed it down to the reporting in z2m and if you delete all the reporting configuration the issue doesn't occur! I'm not familiar enough with how this stuff works in depth in z2m but I did notice in the logs when I was changing states on my switches, it was sending 2 identical MQTT messages for states. So this is why you start getting that flapping because after a little bit the duplicate messages start over lapping with each other.

I'm going to do more testing tonight with some local code to see if this issue is something in the convertor, I have 100% confirmed this issue does not occur using the Wiser Hub and is only present in the z2m adoption.

@alexeiw123
Copy link

Hi @DanielNagy and @rmcleay - having read through this gist, the z2mqtt issues you've both contributed to and the 'fearthecow' write up, i will consider you both the hive mind on all things clipsal wiser.

I have dived head first into an iconic/wiser range fit out in my house, having bought enough mechs to do half the house, I'm now too far to turn back!

I was running Z2MQTT until recently and took it for granted that the LED indicator behaviour 'just worked'. I switched over to ZHA because of ongoing issues I never really resolved that had me needing to re-pair some other zigbee devices and restart add-ons to get things working again. I do like that ZHA is seemingly more integrated in to the HA experience however the clipsal devices, while supported, don't offer the full feature set.

I've got a few questions that I'd appreciate your insights on:

  1. Has there been any progression on zigbee firmware updates without the hub? I've updated via bluetooth but I'm still experiencing the two-press requirement often. I contacted SE support and they told me that firmware updates are only achievable in the mode that they're operating in.
  2. Would either of you be interested in applying your learning to a ZHA quirk to support those extra features? I've created an issue here but I simply don't have the knowledge or skills to build this myself. You will see I've been able to access those features using service calls.
  3. I am considering buying a wiser fan controller but can't see any confirmed support in either ZHA or Z2MQTT. Have you any experience with these?
  4. If OTA is solvable in Z2MQTT, would it be possible to host the OTA files somwhere to ease the process through Z2MQTT?
    4.1 Is OTA also possible through ZHA?

Thanks in advance!

@kiwipaulrob
Copy link

kiwipaulrob commented Jan 11, 2024

The comprehensive advice on this website worked for me. I couldn't get my dimmers to pair and thought my controller was to blame, but no, all it took was some twiddling with the button.

Note that the red LED blinks fast to indicate the dimmer is reset - give it some time.

Mine paired without the need to reconfigure anything.

(https://fearthecow.net/projects/clipsal-wiser-updating-without-hub-zigbee-home-bridge-home-assistant/)

Option 1) Updating via Bluetooth

Download the Wiser Rooms app

  1. Press 3 times, then press (a fourth time) and hold until the light blinks red very quickly. It will blink red slowly first. Keep holding. This switches from Zigbee to Bluetooth mode. It’s not described in the documentation but does work.

  2. Wait for the switch to reset into Bluetooth mode.

  3. Press 3 times and wait for it to flash white for pairing.

  4. Add the switch and pair it with the Wiser Rooms app on your phone.

  5. Select the switch, and choose Settings -> Advanced -> Firmware -> Update.

  6. Wait the 3min to update the software.

  7. Factory reset the switch by pressing 3 times, then press (a fourth time) and hold until the light blinks red slowly. Wait for the reset.

  8. Press 12 times to switch back to Zigbee mode. Wait.

  9. Press 3 times to repair with Zigbee2MQTT.

  10. Find the switch in Zigbee2MQTT and select reconfigure. This seems to intermittently be required and sometimes fail unless you restart Zigbee2MQTT. I’m not sure what’s going on here.

@alexeiw123
Copy link

is there any way to configure the dimmer behaviour with these when they turn on/off?

  • it likes to return to the previous brightness state but with a slow transition
  • on/off actions have a fade in/out where obviously the swithces do not

I'd like to be able set the on behaviour and also that transition time to be actually zero.

The transitions mess with automations that I use to control the brightness in home assistant

@mrgadget
Copy link

mrgadget commented Apr 4, 2024

const extend = require('zigbee-herdsman-converters/lib/extend');

As of the latest Z2M update (1.36.1) I've had to comment the above line in the js files to get Z2M to start - just in case anyone else has this issue. Isn't referenced in the files, and doesn't seem to impact operation.

@alexeiw123
Copy link

const extend = require('zigbee-herdsman-converters/lib/extend');

As of the latest Z2M update (1.36.1) I've had to comment the above line in the js files to get Z2M to start - just in case anyone else has this issue. Isn't referenced in the files, and doesn't seem to impact operation.

That's because the latest version dropped legacy extend methods. FYI there's been considerable work on the support for these devices on repo, you might want to disable your external convertor and have a look at the repo version (with OTA support).

@mrgadget
Copy link

mrgadget commented Apr 4, 2024

disable your external convertor and have a look at the repo version (with OTA support).

Interestingly I tried doing exactly that first - and none of my Clipsal devices worked. Didn't try re-pairing though.

On the OTA front, my devices all had their first OTA firmware via Z2M a month or so back - so it must be somehow merging the external and repo ones?

@alexeiw123
Copy link

disable your external convertor and have a look at the repo version (with OTA support).

Interestingly I tried doing exactly that first - and none of my Clipsal devices worked. Didn't try re-pairing though.

On the OTA front, my devices all had their first OTA firmware via Z2M a month or so back - so it must be somehow merging the external and repo ones?

Which wiser devices are you using? They should be picked up just fine unless it's something super obscure.

The ota links were added to the ota repo about a month ago, I guess if the local converter has OTA enabled it will still be linked correctly.

@mrgadget
Copy link

mrgadget commented Apr 4, 2024

Which wiser devices are you using?

Thanks - nothing obscure. 2AX relays, 10AX relays, 2AX dimmers. Will investigate further (and report) when I have some time to put into it - for now it was just the path of least resistance to get it working again so the hot water would heat tonight :)

@alexeiw123
Copy link

Ha, yes priorities.
I find I can switch between local convertor and repo with nothing more than commenting out the config lines and restarting Z2M.

@mrgadget
Copy link

mrgadget commented Apr 4, 2024

Turns out it wasn't that they weren't working - it was the fact that the relay devices are now presented to HomeAssistant as a switch entity - so I just need to run through my Z2M config file and map them back to light.

@alexeiw123
Copy link

Turns out it wasn't that they weren't working - it was the fact that the relay devices are now presented to HomeAssistant as a switch entity - so I just need to run through my Z2M config file and map them back to light.

Ah yes - I also did that for quite a few of my 2AX

@DanielNagy
Copy link

Yep. Went through all that pain. My local converters broke and used the repo version, and all my lights switched to switches. Had a good discussion on discord about this. @alexeiw123 share the discord link.

Ps, 2ax should be lights, not switches. Prove me wrong @alexeiw123 😂

@mrgadget
Copy link

mrgadget commented Apr 4, 2024

Was a pretty quick resolution in the end thankfully. I use 2AX relays for heated towel rails and bathroom fans - so neither is a 100% hit-rate for me, but I'd tend to agree that they'd be more frequently used as lights than relays/switches. But please don't change it now 😂

@alexeiw123
Copy link

share the discord link.
https://discord.com/invite/UAhfKWVd

This is where we've been putting some effort in to getting all the features working in Z2M.

Prove me wrong

This will be my hill to die on!

so neither is a 100% hit-rate for me

I'm in that boat too. About half half lights and other things.

@DanielNagy
Copy link

I have more lights than non lights connected to mine. LOL.

@rmcleay
Copy link

rmcleay commented Apr 4, 2024

Ps, 2ax should be lights, not switches. Prove me wrong @alexeiw123 😂

While I certainly missed that breaking change in the changelog, moderately strong disagree - mine are mostly on towel rails, fans, and heaters! Every good light deserves a dimmer ;)

That said, I still had to remap quite a few which was sad.

@DanielNagy
Copy link

Every good light deserves a dimmer ;)

Cmon, I’m not that rich. 😂

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