Open jamoir opened 4 years ago
So, I had this exact problem, and was able to track it down. I don't know why it worked before for me as well.
For some reason, Zway appends the probe
value to the deviceType
; so switchBinary
becomes switchBinary.switch
, and so it doesn't find switchBinary
in its big switch (no pun intended) statement that creates the details for the services. I noted it does the exact same thing for switchMultiLevel
, but that works because it then maps switchMultilevel.multilevel
back to switchMultiLevel
, so I just added the switchBinary
case to the same map, and it works fine.
I barely understand what I'm doing here, don't know if this is a correct fix for anyone else, and don't know how to deal with npm etc, so I'll leave it to someone else to decide if this is the right answer and submit a pull request (assuming anyone would respond to a PR).
specifically, add a line 89: "switchBinary.switch": "switchBinary",
Here's a patch file with the same idea: switchBinary.patch.txt
And here's my patched index.js, which on my Raspberry system goes in /usr/local/lib/node_modules/homebridge-zway
Homebridge-zway-index.js.zip
Again, your mileage may vary...
So, I had this exact problem, and was able to track it down. I don't know why it worked before for me as well.
For some reason, Zway appends the
probe
value to thedeviceType
; soswitchBinary
becomesswitchBinary.switch
, and so it doesn't findswitchBinary
in its big switch (no pun intended) statement that creates the details for the services. I noted it does the exact same thing forswitchMultiLevel
, but that works because it then mapsswitchMultilevel.multilevel
back toswitchMultiLevel
, so I just added theswitchBinary
case to the same map, and it works fine.I barely understand what I'm doing here, don't know if this is a correct fix for anyone else, and don't know how to deal with npm etc, so I'll leave it to someone else to decide if this is the right answer and submit a pull request (assuming anyone would respond to a PR).
specifically, add a line 89:
"switchBinary.switch": "switchBinary",
Here's a patch file with the same idea: switchBinary.patch.txt
And here's my patched index.js, which on my Raspberry system goes in
/usr/local/lib/node_modules/homebridge-zway
Homebridge-zway-index.js.zipAgain, your mileage may vary...
Great advice !!! Thank you!
So, I had this exact problem, and was able to track it down. I don't know why it worked before for me as well.
For some reason, Zway appends the
probe
value to thedeviceType
; soswitchBinary
becomesswitchBinary.switch
, and so it doesn't findswitchBinary
in its big switch (no pun intended) statement that creates the details for the services. I noted it does the exact same thing forswitchMultiLevel
, but that works because it then mapsswitchMultilevel.multilevel
back toswitchMultiLevel
, so I just added theswitchBinary
case to the same map, and it works fine.I barely understand what I'm doing here, don't know if this is a correct fix for anyone else, and don't know how to deal with npm etc, so I'll leave it to someone else to decide if this is the right answer and submit a pull request (assuming anyone would respond to a PR).
specifically, add a line 89:
"switchBinary.switch": "switchBinary",
Here's a patch file with the same idea: switchBinary.patch.txt
And here's my patched index.js, which on my Raspberry system goes in
/usr/local/lib/node_modules/homebridge-zway
Homebridge-zway-index.js.zipAgain, your mileage may vary...
This works for my issue, too. Thanks.
I can't believe it took me a year to find this. So incredibly frustrating.... That said... riddle me this. I have a dozen BinarySwitches. All Jasco, some with the same software/firmware versions others a level up or down... I can discern no pattern as to why some show(ed) in Homekit correctly and others showed as Not supported. Regardless making the change above resoled the issue for my remaining switches.
I just had to replace two Jasco switches that died, and replaced them with brand new Leviton Z-Wave switches (both model DZ15S). And, of course, after replacing them, the dreaded "Not Supported" started showing up again. I had added the previous fix to index.js (thanks, @KanG00!) but no dice. So I added some logging and figured out that these new Leviton switches were scanning as "switchBinary.power_switch_binary". That's just terrific. So, I added:
"switchBinary.power_switch_binary": "switchBinary",
in the same place as the other "switchBinary.switch" addition, and it started working.
If I had more time, I'd figure out a way to make this not so brittle.
I just had to replace two Jasco switches that died, and replaced them with brand new Leviton Z-Wave switches (both model DZ15S). And, of course, after replacing them, the dreaded "Not Supported" started showing up again. I had added the previous fix to index.js (thanks, @KanG00!) but no dice. So I added some logging and figured out that these new Leviton switches were scanning as "switchBinary.power_switch_binary". That's just terrific. So, I added:
"switchBinary.power_switch_binary": "switchBinary",
in the same place as the other "switchBinary.switch" addition, and it started working.
If I had more time, I'd figure out a way to make this not so brittle.
If you have this problem and don't want to change any code, use homebridge-zway-kevindayton specifically 0.6.0-alpha1 and tag your device with "Homebridge.Override.probeType:switch", this however makes custom tags not work.
If you want to run my code on HOOBS, install homebridge-zway-kevindayton then open your terminal and enter:
cd ~/.hoobs
npm install git+https://github.com/dkattan/homebridge-zway-kevindayton.git
I just had to fix this after upgrading my Z-Way server from some ancient version to v3.2.2, and the fix that @mackworth posted did not work for my Jasco switches did not work, but the switch for the Leviton switches did work for my Jasco switches.
I'm running homebridge-zway-kevindayton 0.6.0-alpha1 which was released specifically to address this issue, but it no longer does due because the Z-Way API changed how it is returning device data.
Here's what I know, the Z-Way v3.2.2 API returns the following JSON for Jasco switches:
{
"creationTime": 1643564474,
"creatorId": 1,
"customIcons": {},
"deviceType": 'switchBinary',
"firmware": '5.22',
"h": -1928968201,
"hasHistory": false,
"id": 'ZWayVDev_zway_105-0-37',
"location": 0,
"locationName": 'globalRoom',
"manufacturer": 'Jasco Products',
"metrics": {
"icon": 'switch',
"isFailed": false,
"title": 'Living Room Overhead Light',
"level": 'off'
},
"nodeId": 105,
"order": { rooms": 0, elements": 0, dashboard": 0
},
"permanently_hidden": false,
"probeType": 'power_switch_binary',
"product": '',
"tags": [],
"technology": 'Z-Wave',
"visibility": true,
"updateTime": 1643630461
}
In short, it appears that initially Z-Way did not return probeType for these switches. Then at some point in time it started returning it with the value "switch", which is why @mackworth 's fix worked, and why @kevindayton 's fix worked. (They are both doing the same thing in 2 different ways)
Then at some subsequent point later Z-Way began returning probeType: "power_switch_binary", and that is the state of affairs today in v3.2.2
If you peruse the release history, there is multiple mentions of probeType https://z-wave.me/z-way/version-history/
Based on the date this issue was opened, I think the breaking changes occurred either in 18.07.2019 v3.0.0 or 03.04.2020 v3.0.5
Anyway, I incorporated changes for GE Gan Controllers as well as a fix for this issue in my branch, which I'll submit a PR for to homebridge-zway-kevindayton since this project appears to be abandoned.
Hi,
Please tell me this project isn't dead. I use this every day and really love the work!
I've just had to rebuild the computer that runs zwave.me, home bridge and zway. I installed the latest version (3) and I'm getting some issues.
I added one device to test, a simple socket switch. Added fine on zway. Then installed the plugin on homebridge. Also when well. But on "home" the device is showing up 'Not supported' I think its not detected it currently. But it use to work fine before the rebuild.
Any help would be amazing.
Thanks, Jamie