kdietrich / homebridge-devolo

WARNING: this repo is not maintained anymore. Homebridge plugin for Devolo Home Control
16 stars 4 forks source link

Wish: Support Qubino and Bush& Jäger Device #24

Closed ramsnerm closed 6 years ago

ramsnerm commented 7 years ago

I have seen you integrate now the quoin shutter device. So maybe next you could consider to add the standard qubino flush 1/1D relay. Thanks

KiboOst commented 7 years ago

I have just ordered a Qubino 1 relay ZMNHAD1 Once received and installed, I will generate a debug report with the API ;-)

kdietrich commented 7 years ago

@KiboOst Great news, thank you! 👍

KiboOst commented 7 years ago

@ramsnerm You can test by replacing the files in the zip. This actually works (running here) giving first Q1 contact in HomeKit for Qubino 2 relay. It should works with qubino 1 relay

@kdietrich I have name de device HBGenericSwitchDevice as this could work for 1relay, 1Drelay, 2relay and maybe fibaro relays, dunno. Do whatever you think is best ;-)

maslisteneremitter error is also fixed homebridge-devolo.zip

More info when 1relay get home ;-)

ramsnerm commented 7 years ago

So I think you are looking for some device debug reports:

Qubino Flush 1D relay

<pre>Device:<br>{
    "result": {
        "items": [
            {
                "UID": "hdm:ZWave:EADFD80F\/9",
                "objectClass": [
                    "com.devolo.fi.widget.DeviceWidget",
                    "com.devolo.fi.widget.BaseWidget",
                    "com.devolo.fi.widget.Widget",
                    "com.devolo.fi.async.base.AsyncFunctionalItem",
                    "com.prosyst.mbs.services.fim.FunctionalItem"
                ],
                "attributes": [],
                "properties": {
                    "isOwn": true,
                    "operationStatus": null,
                    "wrongDevicePaired": false,
                    "deviceModelUID": "devolo.model.Unknown:Device",
                    "settingUIDs": [
                        "gds.hdm:ZWave:EADFD80F\/9"
                    ],
                    "isSecurelyIncluded": false,
                    "statisticsUID": "st.hdm:ZWave:EADFD80F\/9",
                    "icon": "icon_3",
                    "description": null,
                    "prodID": "0x0053",
                    "prodTypeID": "0x0002",
                    "secureInclusionCode": 0,
                    "itemName": "Hausglocke",
                    "pendingOperations": null,
                    "zone": "Werkstatt\/Garage",
                    "elementUIDs": [
                        "devolo.BinarySwitch:hdm:ZWave:EADFD80F\/9"
                    ],
                    "manID": "0x0159",
                    "zoneId": "hz_2",
                    "batteryLow": false,
                    "status": 2,
                    "batteryLevel": -1
                },
                "tags": []
            }
        ]
    },
    "id": 5,
    "jsonrpc": "2.0"
}</pre><br><pre>elementUIDs:<br>{
    "result": {
        "items": [
            {
                "UID": "devolo.BinarySwitch:hdm:ZWave:EADFD80F\/9",
                "objectClass": [
                    "com.devolo.fi.control.BinarySwitchFI",
                    "com.devolo.fi.widget.WidgetElement",
                    "com.devolo.fi.async.base.AsyncFunctionalItem",
                    "com.prosyst.mbs.services.fim.FunctionalItem"
                ],
                "attributes": [],
                "properties": {
                    "guiEnabled": true,
                    "itemId": null,
                    "operationStatus": null,
                    "pendingOperations": null,
                    "switchType": "normal",
                    "targetState": 0,
                    "state": 0,
                    "type": 1,
                    "widgetUID": "hdm:ZWave:EADFD80F\/9"
                },
                "tags": []
            }
        ]
    },
    "id": 6,
    "jsonrpc": "2.0"
}</pre><br><pre>settingUIDs:<br>{
    "result": {
        "items": [
            {
                "UID": "gds.hdm:ZWave:EADFD80F\/9",
                "objectClass": [
                    "com.devolo.fi.setting.GeneralDeviceSettings",
                    "com.devolo.fi.setting.DeviceSetting",
                    "com.prosyst.mbs.services.fim.FunctionalItem"
                ],
                "attributes": [],
                "properties": {
                    "settings": {
                        "eventsEnabled": true,
                        "name": "Hausglocke",
                        "icon": "icon_3",
                        "zoneID": "hz_2"
                    },
                    "itemId": null
                },
                "tags": []
            }
        ]
    },
    "id": 7,
    "jsonrpc": "2.0"
}</pre><br>Hausglocke: States:<br>null

and here is it for the Busch & Jäger DS2000

<pre>Device:<br>{
    "result": {
        "items": [
            {
                "UID": "hdm:ZWave:EADFD80F\/33",
                "objectClass": [
                    "com.devolo.fi.widget.DeviceWidget",
                    "com.devolo.fi.widget.BaseWidget",
                    "com.devolo.fi.widget.Widget",
                    "com.devolo.fi.async.base.AsyncFunctionalItem",
                    "com.prosyst.mbs.services.fim.FunctionalItem"
                ],
                "attributes": [],
                "properties": {
                    "isOwn": true,
                    "operationStatus": null,
                    "wrongDevicePaired": false,
                    "deviceModelUID": "devolo.model.Unknown:Device",
                    "settingUIDs": [
                        "gds.hdm:ZWave:EADFD80F\/33"
                    ],
                    "isSecurelyIncluded": false,
                    "statisticsUID": "st.hdm:ZWave:EADFD80F\/33",
                    "icon": "icon_12",
                    "description": null,
                    "prodID": "0x0001",
                    "prodTypeID": "0x1000",
                    "secureInclusionCode": 0,
                    "itemName": "Deckenlampe",
                    "pendingOperations": null,
                    "zone": "Mehrzweckraum",
                    "elementUIDs": [
                        "devolo.BinarySwitch:hdm:ZWave:EADFD80F\/33"
                    ],
                    "manID": "0x0115",
                    "zoneId": "hz_5",
                    "batteryLow": false,
                    "status": 2,
                    "batteryLevel": -1
                },
                "tags": []
            }
        ]
    },
    "id": 5,
    "jsonrpc": "2.0"
}</pre><br><pre>elementUIDs:<br>{
    "result": {
        "items": [
            {
                "UID": "devolo.BinarySwitch:hdm:ZWave:EADFD80F\/33",
                "objectClass": [
                    "com.devolo.fi.control.BinarySwitchFI",
                    "com.devolo.fi.widget.WidgetElement",
                    "com.devolo.fi.async.base.AsyncFunctionalItem",
                    "com.prosyst.mbs.services.fim.FunctionalItem"
                ],
                "attributes": [],
                "properties": {
                    "guiEnabled": true,
                    "itemId": null,
                    "operationStatus": {
                        "requestID": "9",
                        "name": "turnOn",
                        "functionalItemUID": "devolo.BinarySwitch:hdm:ZWave:EADFD80F\/33",
                        "status": 2,
                        "timestamp": 1506869328707
                    },
                    "pendingOperations": null,
                    "switchType": "normal",
                    "targetState": 1,
                    "state": 1,
                    "type": 1,
                    "widgetUID": "hdm:ZWave:EADFD80F\/33"
                },
                "tags": []
            }
        ]
    },
    "id": 6,
    "jsonrpc": "2.0"
}</pre><br><pre>settingUIDs:<br>{
    "result": {
        "items": [
            {
                "UID": "gds.hdm:ZWave:EADFD80F\/33",
                "objectClass": [
                    "com.devolo.fi.setting.GeneralDeviceSettings",
                    "com.devolo.fi.setting.DeviceSetting",
                    "com.prosyst.mbs.services.fim.FunctionalItem"
                ],
                "attributes": [],
                "properties": {
                    "settings": {
                        "eventsEnabled": true,
                        "name": "Deckenlampe",
                        "icon": "icon_12",
                        "zoneID": "hz_5"
                    },
                    "itemId": null
                },
                "tags": []
            }
        ]
    },
    "id": 7,
    "jsonrpc": "2.0"
}</pre><br>Deckenlampe: States:<br>null
ramsnerm commented 7 years ago

@kdietrich: I tested your fork and yes I can confirm contact 1 of the Qubino Flush 2 relay is shown. Also I get no longer the message: Open an issue on github and ask for adding it, but ...

unfortunately the other two relays Qubino Flush 1D relay and the Busch & Jäger Switch are not showing up in HomeKit.

KiboOst commented 7 years ago

Yes, this is normal as these report unknown, and I check for devices having more than one switch. Will see if Kevin provide support, or I can modify something so it get all unknown device that have a switch inside.

KiboOst commented 7 years ago

In Devolo.js line 178 change if (el.indexOf('devolo.BinarySwitch:hdm:ZWave') > -1 && el.endsWith('#1')) { to if (el.indexOf('devolo.BinarySwitch:hdm:ZWave') > -1 ) {

it should create one switch for every unknown device that have a switch inside

ramsnerm commented 7 years ago

@KiboOst: Thanks for the tip. I had to change the line a bit to be able to see the 2 relay and the 1 relay in HomeKit. Without that I only saw the 1 relay and the Busch & Jäger switch:

if ((el.indexOf('devolo.BinarySwitch:hdm:ZWave') > -1 && el.endsWith('#1')) || (el.indexOf('devolo.BinarySwitch:hdm:ZWave') > -1 )) {

One Remark: This hack does not reflect if an Qubino device is not reachable/connected (so it just sets the state without indicated that it is offline)

KiboOst commented 7 years ago

Nice ;-)

I didn't forked the repo just for this, hope @kdietrich will have a look. This approach allow supporting nearly every switch, but is a bit trivial ;-) Anyway it is a filter after all known devices so it won't interfere with known/supported one.

As Qubino shutter are recognized as official Devolo shutter, I guess it should be the same for 1 Relay recognized as Relay. Will let you know once I got it.

KiboOst commented 7 years ago

@kdietrich Qubino 1relay is arrived !! Like I though: "deviceModelUID": "devolo.model.Relay" Good news is that switching wall switch get the device updated in DHC, and consumption report also! Is noted offline anyway, like qubino shutters. This will be fixed in future Devolo updates and don't prevent them to work perfectly !!

Qubino1Relay_ZMNHAD1.zip

KiboOst commented 7 years ago

And works perfectly in homebridge-devolo

else if (item.properties.deviceModelUID.indexOf('Relay') > -1) { device = new DevoloDevice_1.GenericSwitchDevice(); }

YIIHAAAAA !!!

ramsnerm commented 7 years ago

Can confirm!

kdietrich commented 7 years ago

Hey guys, a quick update on this: @KiboOst is going to send me his Flush 2 Relay for integration. I will wait for it to arrive because I want to integrate Flush 1-, Flush 2-, Flush whatever-Relay into ONE generic device. There needs some API refactoring to be done but I think this is cleverest way to go.

nicoh88 commented 6 years ago

For Busch-Jaeger this Issue. For Qubino Flush 1 and Flush 2 this Issue.