Supereg / homebridge-http-switch

Powerful http switch for Homebridge: https://github.com/homebridge/homebridge
ISC License
222 stars 37 forks source link

Authentication Problem #100

Closed brummbaer closed 1 year ago

brummbaer commented 3 years ago

Describe the bug It does not work via the plugin. Neither with "sendImmediately": false nor with "sendImmediately": true. Directly in the browser it works via URL and http://username:password@192.168.3.12:8082/restart

Expected behavior Restart homebridge with the restart button.

Output from log:

[11/22/2021, 12:54:11 PM] [Reboot] setStatus() doing http request...
[11/22/2021, 12:54:11 PM] [Reboot] Successfully set switch to OFF
[11/22/2021, 12:54:11 PM] [Reboot] Resetting switch to ON

Version homebridge: v1.3.5 homebridge-http-switch v0.5.35

Configuration

{
    "accessory": "HTTP-SWITCH",
    "name": "Reboot",
    "switchType": "stateless-reverse",
    "debug": true,
    "offUrl": {
        "url": "http://192.168.3.12:8082/restart",
        "method": "GET",
        "auth": {
            "sendImmediately": false,
            "username": "username",
            "password": "password"
        }
    }
}
benepixx commented 2 years ago

are you trying to reboot homebridge via http switch? If its the same homebridge instance and same hardware you may have more success setting the ip to 127.0.0.1.

as in

{
    "accessory": "HTTP-SWITCH",
    "name": "Reboot",
    "switchType": "stateless-reverse",
    "debug": true,
    "offUrl": {
        "url": "http://127.0.0.1:8082/restart",
        "method": "GET",
        "auth": {
            "sendImmediately": false,
            "username": "username",
            "password": "password"
        }
    }
}