tommasomarchionni / homebridge-openhab2 Goto Github PK
View Code? Open in Web Editor NEWA openHAB2 plugin for homekit.
License: ISC License
A openHAB2 plugin for homekit.
License: ISC License
It would be awesome.
When we expose something like a leak sensor in HomeKit, there are multiple channels of interest:
Items can be associated with one channel, and items cannot reasonably be associated with channels of different types. Items can not be bound to thing statuses, such as zwave node online/offline.
As such, being item centric does not map well to Homekit services, which can aggregate multiple channels of information:
homebridge/node_modules/hap-nodejs/lib/gen/HomeKitTypes.js
3088 | Service.LeakSensor = function(displayName, subtype) {
3089 | Service.call(this, displayName, '00000083-0000-1000-8000-0026BB765291', subtype);
3090 |
3091 | // Required Characteristics
3092 | this.addCharacteristic(Characteristic.LeakDetected);
3093 |
3094 | // Optional Characteristics
3095 | this.addOptionalCharacteristic(Characteristic.StatusActive);
3096 | this.addOptionalCharacteristic(Characteristic.StatusFault);
3097 | this.addOptionalCharacteristic(Characteristic.StatusTampered);
3098 | this.addOptionalCharacteristic(Characteristic.StatusLowBattery);
3099 | this.addOptionalCharacteristic(Characteristic.Name);
3100 | };
Rollershutters are not being exposed to HomeKit. Other Lights and Switchables are working fine.
I have tried using the "WindowCovering" tag aswell as the "Blinds" Tag.
I have been extensively using HomeBridge with the OpehHAB2 addon. Love it!!!
My ONLY issue is that if the OpenHAB server is unavailable during the startup of this HomeBridge plugin, or if I loose connection to the OpenHAB server at any point in time, it seems that this HomeBridge plugin does not have a retry or reconnect feature.
It would be GREAT if this HomeBridge plugin would have the ability to reconnect to OpenHAB on connection loss and have a timer to continue retrying to connect until OpenHAB is back online.
If I am doing something wrong, please let me know. That seems to be my only issue.
Thank you for any and all help!
I observed that the event stream stopped responding after about 10 hours; push updates were lost. A week later (of no push updates for OpenHab2) I see this in the logs:
Oct 10 03:46:14 raspberrypi homebridge[5917]: [10/10/2018, 3:46:14 AM] [openHAB2] SSE - Error fetching updates: Event { type: 'error', message: undefined }
Oct 10 03:46:15 raspberrypi homebridge[5917]: [10/10/2018, 3:46:15 AM] [openHAB2] SSE - Error fetching updates: Event { type: 'error', status: 404, message: 'Not Found' }
I don't have any further detail to report at this time, sorry. It just looks like the recovery logic is not working.
mdns is a stong external dependancy because it needs a compile. But I have not seen a usage in the code.
Homebridge itself changed from mdns to bonjour-hap in May 2018.
Hi! I tried to hack on this but I am new to typescript. I ran npm install and then ran "tsc" but I got these error messages:
08:57 $ ./node_modules/typescript/bin/tsc
src/accessories/abstracts/abstractAccessory.ts(4,18): error TS2503: Cannot find namespace 'HAPNodeJS'.
src/accessories/abstracts/abstractAccessory.ts(4,18): error TS4000: Import declaration 'Service' is using private name 'HAPNodeJS'.
src/accessories/abstracts/abstractAccessory.ts(5,25): error TS2503: Cannot find namespace 'HAPNodeJS'.
src/accessories/abstracts/abstractAccessory.ts(5,25): error TS4000: Import declaration 'Characteristic' is using private name 'HAPNodeJS'.
src/models/homebridge/homebridgeInterface.ts(4,14): error TS2503: Cannot find namespace 'HAPNodeJS'.
src/models/homebridge/homebridgeInterface.ts(4,14): error TS4000: Import declaration 'hap' is using private name 'HAPNodeJS'.
src/models/homebridge/platformAccessoryInterface.ts(4,18): error TS2503: Cannot find namespace 'HAPNodeJS'.
src/models/homebridge/platformAccessoryInterface.ts(4,18): error TS4000: Import declaration 'Service' is using private name 'HAPNodeJS'.
src/models/homebridge/platformAccessoryInterface.ts(9,13): error TS2503: Cannot find namespace 'HAPNodeJS'.
src/models/homebridge/platformAccessoryInterface.ts(9,13): error TS4033: Property 'category' of exported interface has or is using private name 'HAPNodeJS'.
src/platform/openHAB2Platform.ts(13,18): error TS2503: Cannot find namespace 'HAPNodeJS'.
src/platform/openHAB2Platform.ts(13,18): error TS4000: Import declaration 'Service' is using private name 'HAPNodeJS'.
src/platform/openHAB2Platform.ts(14,25): error TS2503: Cannot find namespace 'HAPNodeJS'.
src/platform/openHAB2Platform.ts(14,25): error TS4000: Import declaration 'Characteristic' is using private name 'HAPNodeJS'.
src/platform/openHAB2Platform.ts(15,15): error TS2503: Cannot find namespace 'HAPNodeJS'.
src/platform/openHAB2Platform.ts(15,15): error TS4000: Import declaration 'uuid' is using private name 'HAPNodeJS'.
src/services/sse.ts(7,18): error TS2503: Cannot find namespace 'HAPNodeJS'.
src/services/sse.ts(7,18): error TS4000: Import declaration 'Service' is using private name 'HAPNodeJS'.
src/services/sse.ts(8,25): error TS2503: Cannot find namespace 'HAPNodeJS'.
src/services/sse.ts(8,25): error TS4000: Import declaration 'Characteristic' is using private name 'HAPNodeJS'.
not sure what I did wrong.
I'm excited to have a reason to hack on type script!
I have Fibaro Roller Shutters 2, perfectly integrated in open hab. openhab Control works.
Control via homebridge-openhab2 basically works, but there is a Problem regarding the correct states submitted to homebridge. If i am using the physicall switch in the wall connectet to the fibaro rollershutter to close the blinds, the resulting state "blinds closed" ist not submitted to homebridge. So homebridge still thinks that the blinds are open, which they are not. very unhandy and makes the rollershutter implementation in homekit quite useless. same happens, when i use the openhab app to close/open the blinds. the (correct) resulting state is not submitted to homebridge.
thx very much
Nip
Hi,
just stumbled upon homebridge-openhab2 and it works far more reliable for me then the openhab2 implementation atm. It looks like its missing a few features, like:
Are there plans to integrate this stuff? Maybe I could help to get some more features into the plugin.
BR
Patrick
The built-in homekit binding in openHAB doesn't implement sane maximums, i think the range is from 100C to -100C and it makes the sliders on iOS pretty useless, you have to set a temperature with Siri.
It would be nice if we could limit thermostat values in the sitemap by using the SetPoint type, it has configurable limits.
https://docs.openhab.org/configuration/sitemaps.html#element-type-setpoint
Are you planning to support the WindowCovering and DoorLock homekit types eventually? Right now I have to handle my window blinds with homebridge-mqtt and some logic in Node-RED, it works but it was very fiddly to set up.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.