Shelly Pro 3EM: extended documentation with a few hints for Docker and UniFi#172
Shelly Pro 3EM: extended documentation with a few hints for Docker and UniFi#172MarkusHarmsen wants to merge 1 commit into
Conversation
|
Hi Markus, thanks for your input. I think you are right and I should add a separate section which outlines the necessary steps for the different storages. But your comments from above are not 100% correct. I don't have a Marstek storage to test all thinks but from the discussions in the Photovoltaikforum I got the following information: Initially the Marstek Storage sends out a UDP Broadcast to the local network. Therefore the storage just sets the last octet of its ip address to 255 and assumes that this is the broadcast address. This behavior is only correct for a /24 network type and will not work for all other networks. The first Shelly that answers that broadcast request is "detected" by the Marstek. Afterward, it is a direct communication between the Marstek's and the Shellie's IP address, no UDP broadcast is used anymore. That has the consequence that the Marstek Storage and the Shelly have to be in the same broadcast section of the network for the detection. A lot of switches and even some routers do not forward UDP broadcast request which prevents the detection of the Shelly. But when the initial detection is done, you can move the Shelly/Marstek in different sections of the network, only IP routing between the two is necessary. For a normal docker installation it is necessary, that the network is in host mode. Otherwise the UDP broadcast traffic is not forwarded into the container. I just tested that in my network with a standard Raspberry Pi and the docker daemon installed with "apt-get install". In bridge mode only my working uni-meter from address 192.168.178.99 answers the UDP broadcast request, there is no answer from the container running in bridge mode on 192.168.178.197: When I switch to host networking, I also get an anwer from the docker container on *.197: So you either switched to bridge networking mode after the the Marstek had already detected the Shelly and that then worked, or your docker daemon has a specical bridge networking mode, which also forwards UDP broadcast into the container. For a standard docker installation on a Raspberry Pi the host networking mode is necessary for bot the Marstek and the Hoymiles storage (in the detection phase). |
|
Hi sdeigm, uhhh - interesting insights. Let me verify the current behavior with my Venus E, I definitely don't want to merge wrong assumptions. My current setup is
But that just means that its NOW bridged. I had it briefly on Will verify with a sniffer in the evening and come back here. Greetings Markus |
|
Ok, thanks for verifying again. I used the following docker-compose.yaml file for a the non-working "bridge" case: When switching to "host", the UDP broadcast package is answered. But your bridge is a "named" bridge which you created with certain parameters I assume. Maybe that's the difference. My "default" bridge has a complete different network address and is a /16 network. The broadcast address here would be 172.17.255.255 total different from my home network where it is 192.168.178.255 which would be used by the Marstek storage: |
|
Ok, did a super brief check on my Docker Host (the Rasperry PI) It seems you are right, the Venus E is indeed making direct requests and NOT broadcasting anymore! When I now place the Venus E back into my IoT network, it looses the connection. Question for me is now: is it because UPD is not properly routed or does the VENUS not continue with its current behavior if the WIFI / Network changes. Edit: Routing is working using UDP and all my networks Will try to find out what exactly the Venus is doing and why it looses connection after switching networks. |
|
Ok, I made an experiment. As soon as I change the WIFI of my Venus E (Firmware 1.52), it starts to broadcast on UDP port 1010. If it gets a response from any device, it will directly communicate. Example (using the communication is up and running. When I now keep listening and reconfigure the Venus E to switch WIFI (which is mapped to the the Venus starts broadcasting, which is not answered by the docker container, no matter if I configure When I now reconfigure the Venus E to switch WIFI again to the original one: it does first send a broadcast which is now again answered by the container, actually no matter if I configure This is by the way how I configured the container in docker compose: uni-meter:
image: sdeigm/uni-meter:latest
container_name: uni-meter
restart: unless-stopped
depends_on:
mqtt:
condition: service_started
ports:
- 1010:1010/udp
volumes:
- "./uni_meter/uni-meter.conf:/etc/uni-meter.conf"
- "./uni_meter/logback.xml:/opt/uni-meter/config/logback.xml"where I do not use |
f67f6f0 to
dcc6846
Compare
…d multiple networks
dcc6846 to
c92843e
Compare
|
Made an attempt to correct the documentation according to the latest discussion (and actually removed the host/bridged recommendation). |
|
In the docker-compose.yaml, it is defined: Is this note not automatically fulfilled by
|


Hey @sdeigm,
many thanks for your awesome project!
I had a small issue with my Docker and UniFi based home network, where a Marstek Venus was not able to "detect" the virtual Shelly Pro 3EM.
As it might be useful for others in a similar situation, I extended the existing documentation.
If I placed it wrong, please let me know and I will update this PR.
Greetings!