-
Notifications
You must be signed in to change notification settings - Fork 1
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
Support Clipsal Control Link and Wiser Room #1
Comments
And Google Assistant https://developers.google.com/assistant/sdk/overview BLE info https://www.jaredwolff.com/blog/get-started-with-bluetooth-low-energy/ |
Just need another plugin: https://github.com/anthonywebb/homebridge-cbus |
Mmmm cbus != BLE with new stuff though. Maybe they do talk. NZ Site and brand Maybe the Saturn brand is the one to go with that does do cbus On further investigation, cbus requires you to wire everything back to controllers (rewire the house). But I can see exactly how if that was done in the first place you'd be stoked with that integration! |
I’m planning to install Clipsal Iconic BLE switches into my new apartment. I’m already using homebridge quite a bit, so I’ll probably write a homebridge plug-in. I’m writing this partly to advertise my interest and intent, but also to know if someone beats me to it. :-) |
It looks like there’s already a plug-in for wiser, but nothing to directly control the ble switches yet: |
Hey @sj26 - did you have any luck with this? About to buy a whole heap of switches in the next few days, wondering if I should invest in the BLE options |
I haven't managed to grab any BLE switches myself yet, sorry. :-( |
It sounds like installing the Iconic stuff is a good, future-proof plan, though. The mechanisms can be swapped out for BLE options later. And there are rumours that Clipsal may end up offering direct HomeKit and other integrations themselves. |
Don't be sorry! Let us know if you have any luck once you get your hands on one. I'll grab just one for now so I can start playing, and I'll do the same! |
Trying to decide to get PDL/Schneider iconic range for my new home or not. Unless there are any updates since Aug 2019 I think I may just opt to place SONOFF MINIS behind my switches and either control those through my own code or a Home Assistant setup. All advice/critique is welcome. Only 1-2 weeks away from getting the gib on the walls... ;) |
Hey mate! I'm using the PDL BLE dimmers now. They're OK, do as they say but
I've struggled to figure out the correct codes to send commands via a
Bluetooth transmitter. Also, I've struggled to find an LED bulb that dims
nicely. They all flicker, some worse than others, and completely randomly.
I don't have this problem with incandescent bulbs. When I spoke to
electricians they just say that's to expect with the push button dimmers vs
LED bulbs. YMMV
…On Fri, 13 Mar 2020, 20:44 Rob de Voer, ***@***.***> wrote:
Trying to decide to get PDL/Schneider iconic range for my new home or not.
Unless there are any updates since Aug 2019 I think I may just opt to place
SONOFF MINIS behind my switches and either control those through my own
code or a Home Assistant setup. All advice/critique is welcome. Only 1-2
weeks away from getting the gib on the walls... ;)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHJ6XOSJI4YXE2ZFSGIQIZTRHHP2JANCNFSM4ENL5OGA>
.
|
At the moment I am only concerned about remote on/off as we have two lighting sets in each room. Mood lighting (pendants, tiny LED lights, and LED strips) or full light (LED lights in a grid from the ceiling). Dimming may happen in the future although our current system hardly ever asks for dimming as mood lighting is nice and low already. Sounds from your experience I may be better off with the cheap Sonoff mini option. Am surprised about your experiences with LED dimming since I have done that without any issues before with regular dimmable LED lights. Big thanks for sharing your experiences! |
How has everyone gone with this? I'll be moving in to a house in 2 and a bit weeks with clipsal iconic and the BLE switches |
I picked up some of the dimmers (under the PDL brand in New Zealand, but they are the Clipsal equivalent and work with the Wiser Room app) and have been poking at the BLE side of things for a few weeks. I’ve managed to work out the GATT profile allows you to remotely turn it off/on, set the level, and toggle the current state. This works with a generic BLE app off the App Store, but I haven’t yet got it working with with a Raspberry Pi. The services and characteristics have descriptors so it’s pretty easy to find the correct characteristics, but writing the value from python is where I’m stuck. The basic problem seems to be that the underlying Bluetooth library on the Pi disconnects automatically after a few seconds of connecting, sometimes more like 30s, and attempting to write to the characteristics with similar values used in the generic BLE app does nothing. I’ve also tried sniffing the BLE traffic with the iOS sysdiagnose logging and pulling the actual data that the Wiser app uses, but that’s also been difficult because I’m not really familiar with that level of reverse engineering. My plan was to first work out how to control them using the CLI on a Pi, then port those commands to python, then wrap that into a home assistant integration. So far I’m still stuck on the “control them with the CLI” part... I don’t have another device with a Bluetooth stack other than a Pi and a MacBook, and many of the python BLE libs don’t support macOS so my next thing was to try something in Nodejs or something to rule out a bug somewhere in python land. I’m pretty sure the issue is lower down than that, but I’m not that familiar with bluez or the lower level Bluetooth stuff yet. |
Ooh, nice one @phindmarsh, that's what I was hoping to do. Any chance you could share the gatt profile descriptions in copy pasteable form? |
Oh I've found the equivalent devices and profiles via the same GATTBrowser app. Any chance you could share which services/properties you've been poking, and how? |
It’s the section at the bottom that has the control parameters I’ve found so far: 720A9081 is the on/off, you can write 0x00 for off and 0x01 for on. 720A9082 is set level, which takes a value from 0x0000 for lowest and something like 0x1027 for the highest. Note the value has the bytes flipped, so 0x1010 is like half the level. So something like this: Low = 0000 = 0x0000 720A9083 is the toggle, so you can toggle it on/off relative to the current state, and also read the state of the physical button (depressed, undepressed). I haven’t done much with this one though. The other ones you can read the firmware version, name, etc, but I also haven’t played with those much. Also make sure you upgrade the firmware via the wiser app first, otherwise it tells you the encryption is insufficient. The other thing I did was decompile the Android app and tried to read the code but it’s a kotlin app so the decompiled source is not that readable (to me at least!). The only interesting thing is the Android app seems to use services with a slightly different uuid, one that starts with 720A8081 instead of 720A9081 for example. I haven’t yet poked around the edges of this yet though. I wonder if the app is using services that aren’t advertised like the other ones are. |
Here’s a screen recording for turning the dimmer on/off |
So I can also control my device by reading and writing those properties, which is great! But I can't do it from any device other than my iPhone. My iPhone has the Wiser app installed, and has been paired to the switches. I think that's the missing piece — pairing. I need to read some more to figure it out. Maybe I'll try decompiling the android app like you did. |
Ha yeah that’s basically where I am. I wondered if pairing has something to do with it, but I haven’t yet had the time to unpack that hypothesis yet. Reading some attributes like firmware seems |
The linux bluetooth tooling is pretty good. I have a usb bluetooth adapter attached to my machine running homebridge. After doing a scan to find the dimmer devices:
I can see the characteristics for one of my wiser dimmers:
I believe this is the on/off characteristic:
Reading via gatttool doesn't show a change after toggling power state, though, so I'm wondering if this value means "unauthorized" or something |
apktool and ClassyShark are letting me poke around in the android app. There's an interesting "communicationlib" which has lots of BLE implementation. Skimming, I'm confident that the device is paired or bonded to the phone before interaction. It seems to use standard android bond creation gear: https://developer.android.com/reference/android/bluetooth/BluetoothDevice#createBond() |
Useful reference on bonding/pairing in BLE: https://www.kynetics.com/docs/2018/BLE_Pairing_and_bonding/ |
Yeh I’ve got about as far as reading the characteristics and the handles using a combination of lescan, gattctl, gatttool, and all the different python BLE libraries. The trick I couldn’t get was being able to write to the chosen characteristic, or find the simple 0x00 or 0x01 values I expected on the on/off characteristic. Perhaps you are right about the unauthorised response, didn’t think about that. I had tried to MITM or sniff the app traffic to see if there was some kind of handshake or key exchange happening, but then I figured that if I could do it with the generic GATT app it probably wasn’t using proprietary communication. If you connect with gatttool does it automatically disconnect after a few seconds? I often got segfaults when using the gatttool CLI. |
I also noticed if you unpair/remove one of the dimmers from the Bluetooth settings on the iPhone the GATTBrowser app asks if you want to pair again before you can write data, which would lend more evidence to the fact you have to pair or bond with it first |
My reading of the android code makes me think it's not doing anything special (authentication etc) beyond doing simple bonding (pairing) of the ble device once the switch is in "pairing" mode (three presses, flashing). But when I try pairing (which I confirmed tries to create a ble bond in the bluez code) it doesn't work, and I get this output:
I think my little adapter is Bluetooth 4.0, maybe it needs 4.2. Will keep digging |
I was thinking about this earlier, and wondered what protection it had (if any) from a random device trying to control it without doing the triple tap thing first. Presumably without some kind of bonding process it would be a Bad Idea and allow anyone to control your lights. So based on what you’ve seen it would look like you need to bond with it through the triple tap process before it’ll allow you to control it? |
Yeah, I'm pretty sure the triple tap puts it into some sort of "expect bonding" mode. But I can't figure out how to successfully bond. I don't understanding bonding well enough, I think. I figured out my UDM has a bluetooth radio in it, and is the ideal controller for me. I also noticed that it's got more modern bluetooth - 4.2:
I can scan the device and whatnot from this controller, but still pairing fails (during triple tap mode):
with the following daemon output:
I'm very suspicious of this "not powered" status, it makes me think I need to do something to this controller before it'll work. |
It took some finessing to get the bluetooth stack up and running correctly, but then a pairing request worked:
|
My lights just turned on and off, controlled from my wifi router 🎉 |
Yeah I reckon it's Bluetooth 4.2. It introduced a new key exchange mode for BLE devices that I think this is using. Fortunately bluez takes care of most of it. I'll be ordering some new usb bluetooth adapters 😅 |
Nice, I've got some Pi 3s which only have 4.1, and trying a pair doesn't seem to work:
Looks like I need to buy some more adapters too, or just a new Pi 4 |
Check your software, too — you might just need a new kernel or bluetooth stack. |
Been following this intently :-)
What did you try differently? I've just tried from a Pi4 with the standard bluez stack and I'm getting the same error:
Made trusted to test ^
Know what I might be missing? |
Note this after the 3x Tap to begin pairing mode (red flashing).
|
My new Pi4 just arrived, and I managed to get it to turn the lights on and off just now after a bit of trial and error, here's what I did. This is on a vanilla install of RaspberryOS, no additional packages installed. I had also upgraded the firmware from the initial version using the Wiser Room app (currently v2.2.0). Pi 4 info:
First, I removed any previous devices I had from past attempts:
Then, inspired by these instructions, I did these commands:
At this point I triple pressed the dimmer button to get it to flash green and red, then
Pairing successful! Switching to the gatt menu now, and reading the attribute for the current on/off status:
The light was currently switched on, so read the state should give me a
Which it did, so writing a
Which it did!
With this I'll now focus on getting it working from Python, so I can wrap that in a home assistant plugin. @sj26 have you started work in that area yet? |
Thanks so much for all the information, but still no good for me. So weird, I'm doing exactly the same on my Pi, the controller looks identical, deleted the device (which I was running 2.2.0, but now 2.2.8) but still getting I wonder if my BLE switch module is a slightly different model (in New Zealand). |
I’m in NZ too, got the dimmers from JA Russell, they are the PDL branded ones. I have had some problems reconnecting to them after pairing, so it’s not 100% reliable. I’m away for the long weekend, so will be back to it next week |
Yeah I got mine from JA Russell too. Very odd! Is your intermittent message the same |
Full log:
|
I found I couldn't reconnect after completing those steps. After some digging it appears there might be a firmware issue on the RPi. Rolling it back has mean I can connect again. I've also mucked about setting levels, here's the examples that worked: # select the level attribute
[CH-DIMMER_C3E0:/service0029/char002a]# select-attribute 720a9082-9c7d-11e5-a7e3-0002a5d5c51b
# write the level to be "off"
[CH-DIMMER_C3E0:/service0029/char002e]# write "0x00 0x00"
Attempting to write /org/bluez/hci0/dev_XX_XX_XX_XX_C3_E0/service0029/char002e
# write the level to be max (where the "integer value" is 2710)
[CH-DIMMER_C3E0:/service0029/char002e]# write "0x10 0x27"
Attempting to write /org/bluez/hci0/dev_XX_XX_XX_XX_C3_E0/service0029/char002e
#write the level to be half(ish) ("integer level" of 1000)
[CH-DIMMER_C3E0:/service0029/char002e]# write "0x00 0x10"
Attempting to write /org/bluez/hci0/dev_XX_XX_XX_XX_C3_E0/service0029/char002e Still to start with the python side of things, been a busy couple of weeks. |
@phindmarsh Yes I'm in! Thanks a lot, the version was the trick. I had tried a couple of versions but the one you linked worked a treat. |
A really quick play with BluePy this evening and the connection looks good:
|
Here's my progress so far, a class that can turn on/off a dimmer, and set the level. Assumes the dimmer is already paired with the bluetooth controller device (using Next step for me is to bridge this into MQTT, because my home assistant instance runs on a VM that doesn't have a bluetooth stack. https://gist.github.com/phindmarsh/a89cd407a57926e9f604e23cc9f9f5ce |
Following with interest guys - I reckon i've tried BLE connections with Iconic switches since they were released. My experience has been similar - works every time from my iPhone with BLE/GATT apps but really hit and miss from anything else. Interestingly I have some switches in my house that pair no problem and can reconnect anytime, and others that just refuse to even pair. Definitely keen on MQTT - keen to integrate with my Home Assistant! |
Using @phindmarsh 's good work, I've got mine working at least in a test scenario with MQTT, here's the quickly thrown together code which I intend to clean up at some point: It utilises the MQTT-Light HomeAssistant Integration with the config YAML as follows:
|
Any update on this fellas? Considering buying these Clipsal smart modules but the only thing I'm not keen on is the lack of Home Assistant integration |
I put this together a while ago, works well for me so I haven’t tried any further: |
I’ve been following this for quite a while too, and have just installed switches but not integrated them yet. A quick note to keep in mind is that Clipsal have finally made some movement on a hub with smart home integration. If you have a look at the new wiser app it shows options for both direct connection and hub connection, there are also references online to firmware upgrades for the switches which will support this. I’m not holding my breath but it could have impacts on the current solutions. |
Hey folks, an update on this for anyone interested: I've just submitted a PR to add support for the PDL354PBDMBTZ (and similar) devices to zigbee2mqtt. This means they are controllable within home assistant without needing the Wiser Bridge or fudging support via BLE. If you already have the PDL354PBDMBTW (i.e. the ones with BLE out of the box) you can convert these to zigbee mode by pressing the button 12 times and waiting a bit for them to switch modes. I recommend you use the Wiser Room app first to make sure they run the latest firmware. If you want to switch them back you can just factory reset them by pressing the button three times then holding until the red light flashes quickly. This is essentially what I've done with the 4 dimmers I already own, and its working great. No need to use the BLE mode and if you already run a zigbee2mqtt once this is merged it should "just work". More details in this gist. |
Was looking at connecting a few of the Iconic wiser power points to Zigbee and stumbled across this project. Awesome work here gents! Wasn't able to get the power point to go into Zigbee mode and contacted Clipsal for some help. They told me that new firmware will be released in the coming weeks/month for the power points as the Zigbee firmware is still being tested. |
This is great! Has anybody managed to connect them to a Philips Hue Bridge — does that work? |
Not sure about the Hue Bridge, but I’ve heard that the Samsung SmartHub bridge seems to work. |
I can confirm that ZHA with the Sonoff Zigbee Hub works a treat too. Thanks for the tip @phindmarsh !! |
Any tips on getting this to work? I’ve just changed one of my switches over to Zigbee and by ConBee II isn’t seeing anything. Did you need to keep the module close to your Zigbee hub? Mine is only about 4 metres away. |
For me I have a Electrollama zzh! stick and it was up in the ceiling when I paired it, one was easily over 8m away. I did find that I needed to reboot things occasionally early on when I was testing things, but not sure if that was needed. Do you see any logs about ZHA interviewing the dimmer? |
@mathew-ryan I should preface that my Sonoff ZBBrige is flashed with Tasmota, but I literally just did the 12 button presses and it showed in he ZHA scan after 20 seconds or so. |
Quick update on the Clipsal Iconic power points for those interested - Clipsal have release the new firmware and they can now be configured to work in Zigbee mode. Update the power points firmware via the Wiser phone app, then tap the button 12 on the power point times to switch modes. Added mine to Home Assistant ZHA this morning and they are working perfectly (Using Texas Instruments CC2531 USB). |
Hey there. I've got the dimmer mech connected using Zigbee to a Hue bridge (2/square w/ v1.47.x on it). The outcome is not ideal so far. Dimming works as expected, both via Hue/Hue HomeKit and Hue Homebridge plugin. Turning on works via both mechanisms as well. No ability to turn off the switch, via any means except by pressing it. Turning on/off and dimming worked flawlessly using BLE and the wiser apps. I've tried channels 15, 20 and 25, so unlikely a channel issue. The switch is <2m from my bridge. Suspect it's an inconsistency in the way off is handled (either for dimmable or all switches) with either PDL/Clipsal or Hue or both being non-standard. Haven't bothered trying to dig any further yet, probably won't. Some other notes. The update process was a pita. The app (iOS PDL Wiser Room) failed to read settings. The app is gone from the play store, so I had to side load it onto an old Android to update. Post-upgrade the new Wiser app works well. I've got another six switches (both 2A and 10A) that I'm going to hook up shortly. Will see if they suffer the same issue and if so will install a conbee. (Sean H has this working). |
Update on my last comment: hue bridge was unable to add the 2AX switches so I bought a RaspBee II. Works as expected. Really happy with the setup eh. Confirmed working with the dimming switch, the 2AX switch and the 10AX switch from PDL/Clipsal/Schneider. |
Clipsal has released their very low cost "Iconic" range of light switches that will replace the old school ones you see in every house.
They have "mechs" that are programmable by BLE and work together in a room.
https://www.clipsal.com/iconic#new-technology
We must be able to intercept or control them by BLE with the homebridge for epic dimmer and power and lighting control in AU, NZ!
https://www.youtube.com/watch?v=TMt_zeA56LI
http://www.clipsal.com/Trade/Products/ProductDetail?CatNo=41EPBM
The text was updated successfully, but these errors were encountered: