Open uuf6429 opened 1 month ago
Off-topic sidenote, using a URL with a fragment/hash for the integration documentation field (I used https://www.home-assistant.io/integrations/shelly#shelly-device-configuration-generation-1 originally) seems to confuse/break @homeassistant, my bad.
So I'm pinging the codeowners manually: @balloob @bieniu @thecode @chemelli74 @bdraco
Hi @uuf6429, do you mind describing your network structure ? For example, does HA have more than 1 network interface ?
One thing I noticed in your log is:
2024-10-23 08:38:58.278 DEBUG (MainThread) [aioshelly.block_device.coap] CoapMessage: ip=127.0.0.1, type=CoapType.PERIODIC(30), options={11: b's', 3332: b'SHDW-2#18E2F0#2', 3412: b'\x96\x00', 3420: b'\x01\x00'}, payload={'G': [[0, 9103, 0], [0, 3108, 1], [0, 3119, 0], [0, 3109, -1], [0, 6110, -1], [0, 3106, 31], [0, 3110, 'dark'], [0, 3101, 26.4], [0, 3102, 79.52], [0, 3115, 0], [0, 3111, 100], [0, 9102, ['button']]]}
I bet you have a reverse proxy somewhere in the game.
Hi! I'm not overly familiar with how everything works when it comes to docker on windows - it is possible there is some reverse proxying somewhere... perhaps that's how "Host Networking" in "Docker Desktop" on Windows works.
I managed to add the debug log (that you saw) rather late in the troubleshooting, but seeing as there is some logging in HA triggered by the shelly sensor, I'm wondering what else HA would need and/or why it would need to connect back to the device. I don't know much about CoIoT to answer that.
The problem
I was trying to set up a shelly sensor and followed the linked documentation to the letter. I tried other approaches (e.g. mqtt, different settings, hosts, ports and so on).
In the end I turned off the HA container and "replaced" it with a UDP listener container:
This actually worked:
So this test means:
I checked that port 5683 is allocated for both containers (the host is Windows, by the way) with
powershell Get-NetUDPEndpoint
and the listing was identical for both containers.Next I opened a terminal in the HA container and ran
netstat -ulp
, which also looks fine:It's interesting to note that if I run "Reconfigure" in the HA interface (while the device is "actively configurable"), sensor values are picked up correctly. I am guessing this is because of some sort of API polling, completely unrelated to CoIoT.
At the moment, my very rough guess is that something is wrong with parsing the data, although I do not see any logs to (dis)prove that.
Sidenote: I also dug into the ha-core source, but couldn't find obvious references to the shelly integration with port 5683, then I found this repository - is that the actual implementation for handling CoIoT? Should this issue be (re/cross)posted there?
What version of Home Assistant Core has the issue?
core-2024.10.2
What was the last working version of Home Assistant Core?
core-2024.10.2
What type of installation are you running?
Home Assistant Container
Integration causing the issue
shelly
Link to integration documentation on our website
https://www.home-assistant.io/integrations/shelly
Diagnostics information
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information
Example UDP traffic