Closed TimE90 closed 6 years ago
In order to add support to a new device you must implement additional code into the plugin.
What additional code has to be implemented to the plugin? Would love to open the garage door with Siri:)
Not a lot, but without a real device to test it's difficult to code.
Could you give it a go?
Are you able to support me? Do you have the device?
I have the device Yes, but dont know a lot about coding. As long as you will guide me in helping you it will be ok😊
Let start this way:
{ "id": 294, "name": "294", "roomID": 0, "type": "com.fibaro.zwaveDevice", "baseType": "com.fibaro.device", "enabled": true, "visible": false, "isPlugin": false, "parentId": 1, "remoteGatewayId": 0, "interfaces": [ "polling", "zwave", "zwaveAssociation", "zwaveConfiguration", "zwaveSecurity", "zwaveSlaveRouting" ], "properties": { "associations": "[{\"endPointId\":0,\"groups\":[{\"groupInfo\":{\"commands\":[{\"command\":\"Basic Report\",\"commandClass\":\"Command Class Basic\"},{\"command\":\"Hail\",\"commandClass\":\"Command Class Hail\"},{\"command\":\"Configuration Report\",\"commandClass\":\"Command Class Configuration\"},{\"command\":\"Notification Report\",\"commandClass\":\"Command Class Notification\"},{\"command\":\"Barrier Operator Report\",\"commandClass\":\"Command Class Barrier Operator\"}],\"name\":\"Lifeline\",\"profile\":\"General: Not Applicable\"},\"id\":1,\"singleChannel\":{\"max\":5,\"set\":[1],\"view\":[1]}},{\"groupInfo\":{\"commands\":[{\"command\":\"Switch Binary Set\",\"commandClass\":\"Command Class Switch Binary\"},{\"command\":\"Basic Set\",\"commandClass\":\"Command Class Basic\"}],\"name\":\"transmit\",\"profile\":\"General: Not Applicable\"},\"id\":2,\"singleChannel\":{\"max\":5,\"set\":[],\"view\":[]}}]},{\"endPointId\":0,\"groups\":[{\"groupInfo\":{\"commands\":[{\"command\":\"Basic Report\",\"commandClass\":\"Command Class Basic\"},{\"command\":\"Hail\",\"commandClass\":\"Command Class Hail\"},{\"command\":\"Configuration Report\",\"commandClass\":\"Command Class Configuration\"},{\"command\":\"Notification Report\",\"commandClass\":\"Command Class Notification\"},{\"command\":\"Barrier Operator Report\",\"commandClass\":\"Command Class Barrier Operator\"}],\"name\":\"Lifeline\",\"profile\":\"General: Not Applicable\"},\"id\":1,\"singleChannel\":{\"max\":5,\"set\":[1],\"view\":[1]}},{\"groupInfo\":{\"commands\":[{\"command\":\"Switch Binary Set\",\"commandClass\":\"Command Class Switch Binary\"},{\"command\":\"Basic Set\",\"commandClass\":\"Command Class Basic\"}],\"name\":\"transmit\",\"profile\":\"General: Not Applicable\"},\"id\":2,\"singleChannel\":{\"max\":5,\"set\":[],\"view\":[]}}]}]", "configured": false, "dead": "false", "deviceControlType": "0", "deviceIcon": "28", "deviceSpecificData": "h'0a000100010106030400000009090200000000", "deviceSpecificIdType": "Serial Number", "deviceState": "NotConfigured", "emailNotificationID": "0", "emailNotificationType": "0", "endPointId": "0", "liliOffCommand": "", "liliOnCommand": "", "log": "Not configured", "logTemp": "TxtBlue", "manufacturer": "", "markAsDead": "true", "model": "", "nodeId": "66", "parameters": [ { "id": 41, "lastReportedValue": 15, "lastSetValue": 15, "size": 1, "value": 15 }, { "id": 36, "lastReportedValue": 1, "lastSetValue": 1, "size": 1, "value": 1 } ], "parametersTemplate": "0", "pollingInterval": "0", "pollingTimeSec": 0, "productInfo": "0,134,0,3,0,62,1,11", "pushNotificationID": "0", "pushNotificationType": "0", "remoteGatewayId": "0", "saveLogs": "true", "securitySchemes": "[]", "serialNumber": "h'0a000100010106030400000009090200000000", "smsNotificationID": "0", "smsNotificationType": "0", "useTemplate": "false", "userDescription": "", "zwaveCompany": "AEON Labs", "zwaveInfo": "3,3,99", "zwaveSoftwareVersion": "{}", "zwaveVersion": "1.11" }, "actions": { "getParameter": 1, "poll": 0, "reconfigure": 0, "setParameter": 2 }, "created": 1516900653, "modified": 1516900653, "sortOrder": 151 }
{ "id": 295, "name": "Garasjeport", "roomID": 17, "type": "com.fibaro.barrier", "baseType": "com.fibaro.actor", "enabled": true, "visible": true, "isPlugin": false, "parentId": 294, "remoteGatewayId": 0, "interfaces": [ "fibaroFirmwareUpdate", "zwave", "zwaveAlarm", "zwaveSubsystem" ], "properties": { "parameters": [ { "id": 41, "lastReportedValue": 15, "lastSetValue": 15, "size": 1, "value": 15 }, { "id": 36, "lastReportedValue": 1, "lastSetValue": 1, "size": 1, "value": 1 } ], "pollingTimeSec": 0, "zwaveCompany": "AEON Labs", "zwaveInfo": "3,3,99", "zwaveVersion": "1.11", "alarmLevel": "0", "alarmType": "0", "configured": false, "dead": "false", "deviceControlType": "0", "deviceIcon": "104", "emailNotificationID": "0", "emailNotificationType": "0", "endPointId": "0", "firmwareUpdate": "{\"info\":\"\",\"progress\":0,\"status\":\"UpToDate\",\"updateVersion\":\"1.11\"}", "liliOffCommand": "", "liliOnCommand": "", "log": "Not configured", "logTemp": "TxtBlue", "manufacturer": "", "markAsDead": "true", "model": "", "nodeId": "66", "parametersTemplate": "0", "productInfo": "0,134,0,3,0,62,1,11", "pushNotificationID": "0", "pushNotificationType": "0", "remoteGatewayId": "0", "saveLogs": "true", "serialNumber": "h'0a000100010106030400000009090200000000", "smsNotificationID": "0", "smsNotificationType": "0", "state": "Closed", "subsystems": "[{\"name\":\"Visual Notification\",\"state\":\"On\",\"type\":2},{\"name\":\"Unknown\",\"state\":\"unknown\",\"type\":3}]", "updateVersion": "", "useTemplate": "false", "userDescription": "" }, "actions": { "abortUpdate": 1, "close": 0, "open": 0, "reconfigure": 0, "retryUpdate": 1, "setAllSubsystems": 1, "startUpdate": 1, "updateFirmware": 1 }, "created": 1516900653, "modified": 1516900653, "sortOrder": 152 }
sorry, it was the hidden ID of the device you got first..
Thankyou @Andreasjohansen. Can you also send me a screenshot of the UI of Fibaro Home Center corresponding to the device?
Like that? Or am I just stupid..?
Perfect. I will try a first draft tomorrow.
Awesome:)
@Andreasjohansen, I just committed on Github a first draft of the plugin with a support for GDC status (not yet the actions). Are you able to test it with your device?
Later today when i come home from work :)
Ok, just added also the actions part. Give me a feedback later.
@TimE90 are you also able to test it?
Yes, will try it now… Thanks in advance!
pi@raspberrypi:/usr/lib/node_modules/homebridge-fibaro-hc2 $ npm ls
homebridge-fibaro-hc2@2.0.7 /usr/lib/node_modules/homebridge-fibaro-hc2
But new gdc code is not visible in src/ files… updated via "npm update…"?
@TimE90, you need to manually upgrade the plugin. Replace the following files from GitHub to your installation: dist/shadows.js, dist/getFunctions.js and dist/setFunctions.js and restart homebridge.
Backup the previous ones in case of malfunctioning.
Yap, it just works. But (in my case) with a little exception. HomeKit says it's OPEN while garage door is CLOSED.
` getCurrentDoorState(callback, characteristic, service, IDs, properties) {
I think this.hapCharacteristic.TargetHeatingCoolingState.CLOSED and this.hapCharacteristic.TargetHeatingCoolingState.OPEN are the wrong return values. Even if I change the function to always return CLOSED/OPEN HomeKit always shows "OPEN".
What do you think?
After changing getCurrentDoorState to:
getCurrentDoorState(callback, characteristic, service, IDs, properties) { this.returnValue(properties.state == "Closed" ? 1 : 0, callback, characteristic); }
it just works!
And for setting change to:
setTargetDoorState(value, callback, context, characteristic, service, IDs) { var action = value == 1 ? "close" : "open"; this.command(action, 0, service, IDs); }
@TimE90 you are right. In the get function I used the wrong constant because of a copy paste and in the set function I didn't know the kind of values return by homekit. I just committed the changes. Can you retest ?
Yap, the new constants are working! Thanks for implementation (Y)
Let's wait for @Andreasjohansen test and then I will publish on pm the new version. How do you command the GDC via Siri?
In German: "Hey Siri, öffne/schließe das Garagentor" In English: "Hey Siri, open/close the garage door"
ok, can you also ask for the status?
"Ist das Garagentor offen" / "Ist das Garagentor geschlossen"… it works fine!
BTW: We use RGBW stripes in Fibaro… I think HomeKit now supports RGBW type? Could you add the W color?
My homebridge crashes when I add those 3 files. what have i done wrong?
Now it kind of works, but it just says closing in HomeKit, never closed. But when the door is open it says open..
@TimE90, what about you? Does it say closed or closing?
@Andreasjohansen , @TimE90 I just modified the dist/setFunctions.js file. Can you retest in order to verify that the closed status is reflected in the Home app?
Correct status for me :)
@TimE90, with or without the change I made this morning?
It works for me now. Thank you so much!
Hey,
thanks for this great homebridge plugin 👍
Could you please add support for Aeon Garage Door Controller. It's type of com.fibaro.barrier.
Open, Close, Status. So we can use: "Hey Siri, is the garage door open?" or "Hey Siri, please open the garage door".
Thanks in advance!
Best Regards Tim