Closed Ergerbolt closed 3 years ago
Hi, i found another log - maybe this helps.. it seems to be a problem with the http and https connection... maybe?!
2021-01-07 00:39:12,529 - urllib3.connection - ERROR - Certificate did not match expected hostname: 127.0.0.1. Certificate: {'subject': ((('commonName', '....duckdns.org'),),), 'issuer': ((('countryName', 'US'),), (('organizationName', "Let's Encrypt"),), (('commonName', 'R3'),)), 'version': 3, 'serialNumber': '04A474DFF45A9FBF698A87CC53B6D543A621', 'notBefore': 'Jan 4 17:07:06 2021 GMT', 'notAfter': 'Apr 4 17:07:06 2021 GMT', 'subjectAltName': (('DNS', '.....duckdns.org'),), 'OCSP': ('http://r3.o.lencr.org',), 'caIssuers': ('http://r3.i.lencr.org/',)}
Hey @Ergerbolt,
thank you for the report. We are investigating this https issue at the moment.
Hi - from the log it looks like you are running Home Assistant as https on port 8123?
If so the websocket connection is only supported under HTTP. You'd need to raise with the Home Assistant developers to get the Web Socket supporting ssl.
Hi, thanks for your answer.
I just tried some requests with postman via http - its not working. Its only working via https through the internet - even when i curl from localhost.
Home Assistant by default should serve http on port 8123. So this suggests you have some setup that has changed this?
Can it be that home assistant now does support web socket via ssl? i can only connect to was and not ws when I test: I have enabled ssl in the http home assistant component.
diyhue wsdump.py wss://<hostname>:8123/api/websocket
Press Ctrl+C to quit
< {"type": "auth_required", "ha_version": "2021.5.1"}
> #
diyhue wsdump.py ws://<hostname>:8123/api/websocket
Connection is already closed.
diyhue
i've tested by changing the following line:
homeassistant_url = f'ws://{homeassistant_ip}:{homeAssistant_port}/api/websocket'
to
homeassistant_url = f'wss://{homeassistant_ip}:{homeAssistant_port}/api/websocket'
and it works , a valid cert is needed though.
Hello, I'm experiencing the same issue. Has this been resolved please? I'm running diyhue 1.4.1 on HA 2021.06.6
Hi. Basically when you put home assistant into secure mode instead of using a wss socket it uses ws over Https which I've not managed to get working. The easiest work around ismise something like nginx for the SSL layer and not home assistants built in version
And this is the proposed solution for the end user? Can someone please explain how the end user would be able to implement this solution? And while on the subject, why is the current application still needing this hack to get it to work? Is the app an abandoned project considering this issue has been reported for well over a year now?
The issue is with how Home Assistant handles web sockets when in secure mode. If you submit a fix upstream to them I'm happy to see if it is easy to get working. Or use NGINX like I do.
The issue is with how Home Assistant handles web sockets when in secure mode. If you submit a fix upstream to them I'm happy to see if it is easy to get working. Or use NGINX like I do.
I appreciate your assistance. But quite honestly, this hack should be absolutely unacceptable. Installing work arounds like NGINX is not an easy fix for end users. Why the AI isn't put into the app or the core of HA to handle this properly is crazy. It'll be easier for me to throw my wife's crappy iphone into the sea and buy her a different device than to spend more time trying to fix this.
Again, it worked flawlessly for nearly 2 years. And this bug has been around for some time now. Yet it remains. Go figure!
im running version
diyHue-beta Current version: 1.1.8
in Hass.io from https://github.com/MaxBec/hassio-diyHue
Im running HA in Version 2020.12.7
It seems that diyhue cant connect to the HA API.
my config.json:
"emulator": { "alarm": { "email": "", "lasttriggered": 100000, "on": false }, "esphome": { "enabled": false }, "homeassistant": { "enabled": true, "homeAssistantIncludeByDefault": true, "homeAssistantIp": "192.168.178.106", "homeAssistantPort": 8123, "homeAssistantToken": "....." }, "hyperion": { "enabled": false }, "lights": {}, "mqtt": { "discoveryPrefix": "homeassistant", "enabled": false, "mqttPassword": "", "mqttPort": 1883, "mqttServer": "mqtt", "mqttUser": "" }, "network_scan": { "enabled": true }, "sensors": {}, "shelly": { "enabled": false }, "tasmota": { "enabled": false }, "wled": { "enabled": false }, "yeelight": { "enabled": false } },
The logs tell me: