Homebridge gives HTTP Status code 401 when starting

Post Reply
djpj12345
Posts: 4
Joined: Friday 19 January 2018 23:42
Target OS: Raspberry Pi
Domoticz version:
Contact:

Homebridge gives HTTP Status code 401 when starting

Post by djpj12345 » Friday 19 January 2018 23:56

Hello,

I just installed Homebridge using this page:
https://www.domoticz.com/wiki/Homekit_Siri

I followed it to the letter, but when I start homebridge and check the log, I see al lot of these messages:

0|homebrid | <html><head><title>Unauthorized</title></head><body><h1>401 Unauthorized</h1></body></html>
0|homebrid | [1/19/2018, 10:44:32 PM] [Domoticz] There was a problem connecting to Domoticz. (HTTP Status code 401)

It looks like a very clear message (authorization issue), but I'm not able to solve it. I tried:

- add my Domoticz userid/pass to the config.json file
- allow local networks without userid/password (via settings, in Domoticz)
- start homebridge as root, via sudo
- Try the SSL port instead of the default port 8080
- Change the 127.0.0.1 loopback address to the real ip address of the Pi

But nothing helps. I have googled, of course, but didn't find any solution that works for me.

Anyone who can help me?

My current config.json file:

{
"bridge": {
"name": "Homebridge van Piet",
"username": "CC:22:3D:E3:CE:30",
"port": 51826,
"pin": "031-45-154"
},
"description": "Configuration file for Domoticz platform.",
"platforms": [
{
"platform": "eDomoticz",
"name": "Domoticz",
"username": "pieter",
"password": "xxxxx",
"server": "127.0.0.1",
"port": "8080",
"ssl": 0,
"roomid": 3
}
],
"accessories": [
]
}

Thanks in advance,
Pieter

djpj12345
Posts: 4
Joined: Friday 19 January 2018 23:42
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Homebridge gives HTTP Status code 401 when starting

Post by djpj12345 » Saturday 20 January 2018 13:45

Ok, I found the solution myself. If someone else encounters the same issue: you have to provide userid/password in de config.json file, even when you exclude local addresses from the need of authentication.

To provide userid and password in de config.json, change the server rule to:

"server": "username:[email protected]",

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest