sstadlberger / home

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

Motion Detector #21

Open loserat opened 5 years ago

loserat commented 5 years ago

Can you tell me how I can read a motion detector?

},
   "ABB123456789":{  
      "serialNumber":"ABB123456789",
      "deviceId":"1008",
      "typeName":"Bewegungsmelder",
      "channels":{  
         "ch0000":{  
            "datapoints":{  
               "idp0000":"0"
henry-spanka commented 5 years ago

You should be able to read whether the idp0000 datapoint is 0 or 1. I don't have a motion sensor but I think it switches to 1 for a short time (as long as it detects motion). You should be able to catch every single event (very short motions) with web sockets.

sstadlberger commented 5 years ago

When you connect via Websocket you get the following data when the motion sensor is triggered:

{
    "result": {
        "ABB123456789": {
            "serialNumber": "ABB123456789",
            "deviceId": "2040",
            "typeName": "Bewegungsmelder/Schaltaktor 1-fach",
            "channels": {
                "ch0000": {
                    "datapoints": {
                        "idp0000": "1"
                    }
                }
            }
        },
    },
    "type": "update"
}

And the following update if no more motion is detected after the configured timeframe ("Autonomous Switch Off Time Duration" / "Nachlaufzeit")

{
    "result": {
        "ABB123456789": {
            "serialNumber": "ABB123456789",
            "deviceId": "2040",
            "typeName": "Bewegungsmelder/Schaltaktor 1-fach",
            "channels": {
                "ch0000": {
                    "datapoints": {
                        "idp0000": "0"
                    }
                }
            }
        }
    },
    "type": "update"
}