-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Z-Way server support #121
Z-Way server support #121
Conversation
…ems with authenticating.
This works (sometimes at least) but has lots of flaws, including ones that make the whole bridge unreachable.
Support for several device types. Gotta be careful to not throw the bridge out of compliance!
Committing before merging back to master, since the upstream branches have merged into master!
Also, I'm just seeing the "roadmap" and looking more into the HAP-nodeJS changes--I really like the new |
Glad you like! You can use it immediately as of master branch a couple hours ago. See http accessory for an example - basically you just return an array of Service objects from getServices, instead of JSON. For platforms it's the same - for Accessories returned by |
Mostly working, but door sensors need further work, battery service still isn't right, and I'm losing the bridge periodically...merging from master to see if I need some bugfixes.
@nfarina, I'm getting kicked off the bridge after a few hours (maybe)...All of the sudden all my devices are unreachable, but if I stop and restart the bridge, it works again--though the old unreachable devices are still there and I have a duplicate set of new working ones. Is getting an
And/or, have you seen this behavior? |
Yes it's still normal to receive socket disconnects as iOS devices travel in and out of the network. I've had my bridge up and running for a few days straight without any problems though; what hardware are you running the server on? |
A MacMini, on the same switch as the RPi running Z-Way that I'm trying to code against. It's probably something in my code, throwing an invalid value or something. Just having trouble finding it. |
Oh, not thinking...this (my dev copy) is running on a MacBook Pro on wireless, left on in another room. Particularly have you seen the behavior where the whole set of accessories gets duplicated, after which you have a set of unreachable accessories and a set of working ones? |
I did see it occasionally while reworking some of the HAP internals. But I haven't seen it for a while, particularly since I did a "Reset HomeKit Data" in Settings and started from scratch. I think I may have screwed up my HomeKit DB after so much testing. But I can't be sure. Are you running iOS 9 beta? |
can we get a timestamp on the log output lines, because I too struggle to correlate some logs with time... |
yes its normal to get ECONNRESET when your iphone goes out of wifi range. i.e. you leave home and come back. but it doesn't bring the server down, and it will auto reconnect when its back in range. |
I have not seen any whole sets of duplicate accessories in any of my testing. |
@SphtKr your log posted looks completely normal to me, and nothing out of the ordinary there. |
actually do you have two devices connecting? in all my testing I only have one iphone. and only occasionally do I connect on other iphones and ipads to check the user sharing mode. |
@SphtKr You can enable timestamp logging in the |
Haha, yes today during testing I see a duplicate set of accessories.. it is not a problem though, it is the way you added them, it is supposed to work this way. steps to create duplicate set:
easy to reset though
|
This is completely normal and IMO intended by design. If you use different usernames (MAC adress) you have different sets of devices. So you can add your development homebridge to a different room or home on the same account. |
Hmmm...well, I'm getting the duplicates without changing the username/MAC/thing. I could try clearing the persists, that might help. Doesn't help me figure out why they're going offline in the first place :-/ I'm already using Burp proxy to monitor calls between my Platform and the Z-Way server...is it possible to make the bridge use a forward-proxy? So I could see the traffic between Homebridge and my phone? @nfarina thanks, this was sufficient to get the timestamps to show up...in case anyone else comes looking:
So technically, I'm really doing this to get debug output and
|
Got rid of old code I clearly don’t need anymore. Switched `this.log`s to `debug`s. Fix for picking wrong vDev for thermostat current temp. Added configuration for `Name` characteristic…which I guess became required.
Sorry, seems I have misinterpreted your sentence with default mac address. |
Hi, Accessory.prototype = {
mylog: function mylog(msg) {
var now = new Date().toLocaleString();
var logmsg = now + " [" + this.name + "] " + msg;
console.log(logmsg);
}, Replace the function here: function Accessory(log, config) {
//this.log = log;
this.log = this.mylog; Example: FhemSwitch.js https://github.com/cflurin/homebridge-shims |
Switched Door sensors back to GarageDoorOpener services for now, and disabled battery service…lets see if we can get this stabilized.
@nfarina Question: If I hit I'm guessing we don't want |
Oh...I guess I definitely need to--I misread (more probably misremembered) the code in |
Basically, I needed to provide a default value instead of a `getDefaultValue` function. Keeping with this for a while before trying battery stats and door sensors again, but I think I figured out my compliance problems…don’t know how it ever successfully added before, actually. Also removed some more cruft from the earlier old-API version and started laying some groundwork for polling/updating from ZWay.
Yeah the |
Door/Window sensors are still implemented as garage door openers, because that seems to make the most sense at the moment.
Though there doesn’t seem to be much app support for it yet…and my math (% -> lux) is complete guesswork.
@SphtKr: Does the Z-Way server work with the USB Stick ZME_UZB1? |
@cflurin I think it's supposed to, yes--that's the same company: z-wave.me . I have the RaZberry hardware from the same company, but I think it works the same way. |
Thanks, on the z-wave-me site I learnt that you need a licensing code for the stick (approx. 60 $). For the same amount you can get the RaZberry (The hardware already contains a valid licensing key inside the transceiver chip). By the way did your see the announcement: The new RaZberry Controller Software Version 2.0 now supports Apple HomeKit. ? |
Heh...yes, see my first post/description of the pull request. The built in HomeKit support in v2.0-2.0.1 at least is not great, very limited. It has occurred to me that if this code gets good enough, they are within the license terms to just integrate it directly into their product ;-) |
And yes, I think much of the "cost" of the razberry is the license. They sell a "bundle" with the USB version, the only difference is that you can't buy the razberry without the bundled license. Still, it's cheaper than any other commercial z-wave controller out there--the smart-things hub is the only one that comes close. And then you can run other stuff on the Raspberry Pi... Like Homebridge. :-D |
I did read your first post but I didn't remember the details. Sorry! during the last weeks I've read a lot about Homekit, homebridge and more. Just now I'm using the ZME_UZB1 with my mac mini for almost half year. I installed homebridge today on a RPi B and I'm thinking about to use it with Z-Wave devices. |
Cleaned up some more old cruft, added config-sample.json entry, and now there’s a different default grouping of characteristics, which makes for more optional characteristics on fewer services. The older behavior (more services per accessory) can be switched on in config.json. The new default works better in Eve, other clients not so much.
Conflicts: config-sample.json
@nfarina I think this is ready to merge...any last minute feedback? It's not bulletproof, but seems stable and supports a pretty good number of devices. A few more I want to add...but waiting on Amazon :-D |
great! i just get my 4 thermostats (danfoss lc-13) and upgraded my pi with razberry today!.. the hardware installation took longer then the software part! everything is already working.. |
Platform to support Z-Way server (e.g. for RaZberry).
Very early! Use at your own risk! May have compliance problems that disable your entire bridge!
Putting this out there in case anyone else was planning on building the same platform.
Z-Way server has its own HomeKit support, but it's lacking--pretty much only supporting binary switches and dimmers.
This platform bridge is already much more robust, and the initial goal is to also properly support thermostats and temperature sensors at least.