sstadlberger / home

Custom Interface / API for the Busch Jäger free@home system.
Mozilla Public License 2.0
42 stars 16 forks source link

broadcast received updates to connected websocket clients #15

Closed henry-spanka closed 6 years ago

henry-spanka commented 6 years ago

Closes #14

The received JSON is in the following format:

{
    "result": {
        "ABB700****": {
            "serialNumber": "ABB700****",
            "deviceId": "1002",
            "typeName": "Sensoreinheit 2-fach",
            "channels": {
                "ch0003": {
                    "datapoints": {
                        "odp0000": "1"
                    }
                }
            }
        },
        "ABB700****": {
            "serialNumber": "ABB700****",
            "deviceId": "1021",
            "typeName": "Dimmaktor 4-fach",
            "channels": {
                "ch0003": {
                    "datapoints": {
                        "idp0000": "1"
                    }
                }
            }
        }
    },
    "type": "update"
}

I have added a type to the json object to differentiate between a full update info command and an update from an action.

henry-spanka commented 6 years ago

The cool thing is we also get temperature changes through this which could integrate nicely with HomeKit ;)

{
    "result": {
        "ABB700****": {
            "serialNumber": "ABB700****",
            "deviceId": "1004",
            "typeName": "Raumtemperaturregler",
            "channels": {
                "ch0000": {
                    "datapoints": {
                        "odp0010": "19.91"
                    }
                }
            }
        }
    },
    "type": "update"
}
henry-spanka commented 6 years ago

I have now implemented this into my project and it's working great. State changes are picked up instantly by HomeKit.

If you have an iPhone and want to try it, check: https://github.com/henry-spanka/homebridge-buschjaeger

sstadlberger commented 6 years ago

Hi Henry,

thanks for your contribution. I will integrate is as soon as possible (hopefully next week), I just need to make a change so the full feed is optional. I have a visualization frontend running that would be overloaded with the full feed. I think that the best solution would be that clients that need the full feed just send a subscribe/full to the web socket to get all information.

The visualization frontend will also be released as soon as I have replaced the included Busch Jaeger / Gira graphics with open licensed ones.

Thanks, Stefan

henry-spanka commented 6 years ago

Thanks. That would be great, I'm totally fine with that. A UI would be great too, to manage my accessories from the outside with a PC.

henry-spanka commented 6 years ago

@sstadlberger do you have any ETA when you will be able to merge the PR and release the UI frontend?

sstadlberger commented 6 years ago

merge: probably over the Easter weekend UI frontend: this will take a while because a lot of graphics need to be redesigned

henry-spanka commented 6 years ago

Great, thank you for the information. Isn't it possible to release the UI without icons and allow users to use their own icons including the Gira graphics (without download link)? I believe that would be perfectly legal.

sstadlberger commented 6 years ago

Worked mostly with the frontend. I just had to change a line that checks if the message had only one key as the result update now has two.

sstadlberger commented 6 years ago

I'll also think about how this can be moved into the data module. The idea behind the data module is that every change passes trough that module so that centralized triggers can be implemented and a master status/event is preserved there.