staromeste / homebridge-http-advanced-accessory

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

Device turning on, but HomeKit shows On then Off. #38

Closed ravedoglv closed 2 years ago

ravedoglv commented 3 years ago

So I have this WebRelay that I’ve managed to get working sort of in this plugin.

on: http://192.168.1.156/state.xml?relay1State=1 Off: http://192.168.1.156/state.xml?relay1State=0

to get its state: http://192.168.1.156/state.xml

Here’s the code:

{
    "accessory": "HttpAdvancedAccessory",
    "service": "Outlet",
    "name": "Pool Heater",
    "forceRefreshDelay": 5,
    "debug": false,
    "urls": {
        "getOn": {
            "url": "http://192.168.1.156/state.xml",
            "mappers": [{
                "type": "xpath",
                "parameters": {
                    "jpath": "//relay7/text()",
                    "index": "0"
                }
            }]
        },
        "setOn": {
            "url": "http://192.168.1.156/state.xml?relay7state=1"
        },
        "setOff": {
            "url": "http://192.168.1.156/state.xml?relay7state=0"
        }
    }
}

So it appears in HomeKit as a outlet. When I turn the outlet on, it does turn the relay on but then HomeKit turns the outlet off immediately in HomeKit. However, the relay itself remains on and has to be turned off locally.

any idea?

ravedoglv commented 2 years ago

Moved to superReg http-switch to solve this.