staromeste / homebridge-http-advanced-accessory

Supports all devices on HomeBridge Platform / Bridges devices to http
Apache License 2.0
65 stars 22 forks source link

Track Status (History) #23

Open Stefan-83 opened 4 years ago

Stefan-83 commented 4 years ago

Hi, my homebrigde gets the status of my rainsensor by using the HTTP-Output, when using a http-request. The status is "sn2" (0 or 1) It works great with that configuration:

        {
            "accessory": "HttpAdvancedAccessory",
            "service": "ContactSensor",
            "name": "Rain Sensor",
            "polling": "true",
            "forceRefreshDelay": 5,
            "debug": true,
            "optionCharacteristic": [],
            "urls": {
                "getContactSensorState": {
                    "url": "http://192.168.178.98/jc?pw=passwort",
                    "mappers": [
                        {
                            "type": "jpath",
                            "parameters": {
                                "jpath": "$.sn2",
                                "index": "0"
                            }
                        },
                        {
                            "type": "static",
                            "parameters": {
                                "mapping": {
                                    "ALARM": "1",
                                    "NORMAL": "0"
                                }
                            }
                        }
                    ]
                }
            }
        }

Now I want to track the history of the status for the hole day/week/month.

Is it possible after the status was queried, a script writes the current status into a database? (I currently have openhab2 and iobroker running)

Any ideas? Thanks :)

staromeste commented 4 years ago

Hi Stefan,

this is possible of course but also out of scope.

On Sun, 10 May 2020 at 11:58, Stefan-83 notifications@github.com wrote:

Hi, my homebrigde gets the status of my rainsensor by using the HTTP-Output, when using a http-request. The status is "sn2" (0 or 1) It works great with that configuration:

    {
        "accessory": "HttpAdvancedAccessory",
        "service": "ContactSensor",
        "name": "Rain Sensor",
        "polling": "true",
        "forceRefreshDelay": 5,
        "debug": true,
        "optionCharacteristic": [],
        "urls": {
            "getContactSensorState": {
                "url": "http://192.168.178.98/jc?pw=passwort",
                "mappers": [
                    {
                        "type": "jpath",
                        "parameters": {
                            "jpath": "$.sn2",
                            "index": "0"
                        }
                    },
                    {
                        "type": "static",
                        "parameters": {
                            "mapping": {
                                "ALARM": "1",
                                "NORMAL": "0"
                            }
                        }
                    }
                ]
            }
        }
    }

Now I want to track the history of the status for the hole day/week/month.

Is it possible after the status was queried, a script writes the current status into a database? (I currently have openhab2 and iobroker running)

Any ideas? Thanks :)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/staromeste/homebridge-http-advanced-accessory/issues/23, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBP2MMJYP6GK7CLSN6RLADRQZ3ENANCNFSM4M5FQRRQ .