larsbeck / HomematicIp

This package allows to query the HomematicIp REST and WebSocket endpoint.
MIT License
7 stars 2 forks source link

[Unsupported HomematicIp Object] KEY_REMOTE_CONTROL_ALARM #15

Closed DevEddy closed 5 years ago

DevEddy commented 5 years ago

Hi Lars,

one more ;)

{
    "id": "3014F711A0000995698F72AB",
    "homeId": "21edcd0f-2b62-4b28-b0fb-e8476834d493",
    "label": "Fernbedienung",
    "lastStatusUpdate": 0,
    "type": "KEY_REMOTE_CONTROL_ALARM",
    "functionalChannels": {
        "0": {
            "label": "",
            "deviceId": "3014F711A0000995698F72AB",
            "index": 0,
            "groupIndex": 0,
            "functionalChannelType": "DEVICE_BASE",
            "groups": [
                "072abd4a-aa66-44b9-9743-b2c9bd13ff80"
            ],
            "unreach": null,
            "lowBat": null,
            "routerModuleEnabled": false,
            "routerModuleSupported": false,
            "rssiDeviceValue": null,
            "rssiPeerValue": null,
            "configPending": false,
            "dutyCycle": null
        },
        "1": {
            "label": "",
            "deviceId": "3014F711A0000995698F72AB",
            "index": 1,
            "groupIndex": 1,
            "functionalChannelType": "SINGLE_KEY_CHANNEL",
            "groups": [
                "a72a33cb-b048-4e5f-88d0-743afd5f7d07",
                "98383206-9f19-4b94-9d0c-46f9ca49d95f"
            ]
        },
        "2": {
            "label": "",
            "deviceId": "3014F711A0000995698F72AB",
            "index": 2,
            "groupIndex": 1,
            "functionalChannelType": "SINGLE_KEY_CHANNEL",
            "groups": [
                "a72a33cb-b048-4e5f-88d0-743afd5f7d07",
                "98383206-9f19-4b94-9d0c-46f9ca49d95f"
            ]
        },
        "3": {
            "label": "",
            "deviceId": "3014F711A0000995698F72AB",
            "index": 3,
            "groupIndex": 1,
            "functionalChannelType": "SINGLE_KEY_CHANNEL",
            "groups": [
                "a72a33cb-b048-4e5f-88d0-743afd5f7d07",
                "98383206-9f19-4b94-9d0c-46f9ca49d95f"
            ]
        },
        "4": {
            "label": "",
            "deviceId": "3014F711A0000995698F72AB",
            "index": 4,
            "groupIndex": 1,
            "functionalChannelType": "SINGLE_KEY_CHANNEL",
            "groups": [
                "a72a33cb-b048-4e5f-88d0-743afd5f7d07",
                "a2ba0300-d3aa-470b-9106-7667de3ef124",
                "98383206-9f19-4b94-9d0c-46f9ca49d95f"
            ]
        }
    },
    "oem": "eQ-3",
    "manufacturerCode": 1,
    "firmwareVersion": "1.10.0",
    "updateState": "UP_TO_DATE",
    "firmwareVersionInteger": 68096,
    "liveUpdateState": "LIVE_UPDATE_NOT_SUPPORTED",
    "availableFirmwareVersion": "1.10.0",
    "serializedGlobalTradeItemNumber": "3014F711A0000995698F72AB",
    "modelType": "HmIP-KRCA",
    "modelId": 293,
    "permanentlyReachable": false
}

-- Eddy

larsbeck commented 5 years ago

Hi Eddy,

support for KEY_REMOTE_CONTROL_ALARM is added in the latest commit.

Lars

DevEddy commented 5 years ago

Hi Lars,

thanks, finally all my devices are supported :-D

-- Eddy

larsbeck commented 5 years ago

Hi Eddy,

that is cool! Now, I could think about adding some functionality to flip switches and the like. I'll look into that when I have the time. I don't personally have any, but that would be an interesting feature for you I think. Feel free to open up a feature request if you are interested.

Lars

DevEddy commented 5 years ago

Hi Lars,

do you mean to set a value via API?

-- Eddy

larsbeck commented 5 years ago

Hi Eddy,

yes, setting values on your devices which eventually have an effect on their behavior. Could be flipping the light switch, could be setting a target temperature on your heating control. I would have to see what the API can do, but that is the idea.

DevEddy commented 5 years ago

Hi Lars,

that would be cool. I am about to integrate this in an app. So I would love this functionality. Also teaching in devices would be nice.

Are you able to reverse ingeneer those things?

-- Eddy

larsbeck commented 5 years ago

Hi Eddy,

what do you mean by "teaching in" devices? The protocol can be reverse engineered, yes. So far I have only read the code of the python project, but one could also read the messages the original app sends and receives, which is probably what the other guys did. You would simply put a proxy in the middle of the communication and read what goes over the wire.

DevEddy commented 5 years ago

Hi Lars,

cool to hear. Yeah, it's probably SSL, is it so simple? Before you can use th devices you need to teach them in by scanning the qr code or entering the last 4 digits of the included sgtin. Would be cool if we could replicate it.

-- Eddy

larsbeck commented 5 years ago

Hi Eddy,

well, you would need to get the device running the app to trust your proxy's certificate, but that is not really a hurdle. Also an app can explicitly require a certain certificate on the other end, but that functionality was only introduced in Android 7 if I remember correctly and maybe that isn't even used by the app.

Now I see what you mean. Yes, that should be doable. I never thought of that, since for me, I only wanted an Api to monitor and potentially modify the state of my devices, since the original app is so limited. I didn't mind to set it up in the original app. But then again, it would be nice to have everything in one place and support all scenarios.

DevEddy commented 5 years ago

Hi Lars,

wow, would be cool :) I will try to build a environment to sniff the communication. Maybe you have some tips of how and what tools to use?

Would love to help and make it happen.

-- Eddy

larsbeck commented 5 years ago

Hi Eddy,

sure. I suggest you get an emulator with an Android 6 image and a play store installed, such as Genymotion. Install the HomematicIp App on the image. Then follow these instructions: https://www.telerik.com/blogs/how-to-capture-android-traffic-with-fiddler You can also try your phone directly instead of the Android 6 image, but you might not be able to decrypt the https traffic there due to pinned certificates (if the HomematicIP app has any).

Lars