-
Notifications
You must be signed in to change notification settings - Fork 33
feat: add Shelly push mode to fix Marstek Venus v153 communication issues #181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…sues Adds push mode functionality to work around communication interruptions introduced in Marstek Venus firmware v153. Instead of waiting for periodic JSON-RPC requests from the battery (which randomly stop after 10s-2min), the emulator can now proactively push power data to the battery. Related to issue tomquist#180 - intermittent communication failures on Venus v153. Features: - SHELLY_PUSH_MODE: enable proactive data transmission - SHELLY_PUSH_TARGET_IP/PORT: target battery address - SHELLY_PUSH_INTERVAL: configurable transmission rate - Maintains backward compatibility with request/response mode - Works with all Shelly device types (Pro3EM, EMG3, ProEM50) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
|
Yes, i have the same problem. At least it looks like this. Same Batterie. Same Firmware. |
Hi! I've been in contact with Marstek support regarding this exact issue with Venus firmware v153. Two official solutions available:
For your discovery issue after reboot:This is indeed related to the same v153 bug. The battery no longer properly handles network discovery and periodic requests. In the meantime:My PR #181 implements a "push" mode that completely bypasses the problem by proactively sending data to the battery. It works very well with v153. |
|
I have firmware V152 If yes, I have two batteries. |
|
Hei - When can we have this merged? This would be a very nice option for all those affected by the issue ... or How Can I do this on Home Assistant Addon locally? thanks! |
|
So, I put some time in getting this PR running locally to fix my issues between the Marstek Venus and the B2500 meter. @Sweti934 I never did something like this before... but it is possible with some basic coding knowledge and some AI tooling to help you filling in the gaps on errors. Some pointing in the right direction:
I had a hard time getting to my sensor data, since the default homeassistant connection to its own sensordata (supervisor:80) also didn't work with my manual setup weirdly enough, I needed to use HTTPS, which gives even more problems. In the end, I could get it working. I could validate it sending UDP packages when I would fill in my laptop IP in the customconfig.ini, and running So the PR works fine, although I must say it's just hard to debug this addon generally. It would be really helpful to have a little knowledge of what we expect from the Marstek (so we could debug/emulate stuff ourselves) and to have some more error handling (for example, when I didn't set some customconfig.ini since I thought it would be inherited from the addon configuration, it couldnt test the powermeter, but it didn't show me error messages about it). Anyhow. After all of this configuration.... my Marstek still couldn't connect to the emulated powermeter :( So I kept debugging, trying different firmwares as well (now on v154), and some more AI suggested debugging. In the end, the solution for me was changing some network settings. Looks like an Unifi software update made some changes to:
So, big facepalm after all :) it was way more easy to fix than running this PR locally for me. But, I hope I can help someone with this explainer. |
|
@richardwem so it works for you without the PR now? |
|
@Ativelos yes, it works for me. I'm also not 100% sure if v154 fixes the problem with querying the Shelly, since in the end, my problem seemed to be a networking problem, not a Marstek bug. My Marstek on v154 has (for now) at least no problem at all with finding the (emulated) Shelly.
Well; this PR doesn't have changes that would break the current implementation. So, if you can't make it work with this PR, I'm sure you also wouldn't make it work with the normal B2500-Meter. |
|
Thanks for your response. I'll probably just try it again and roll back to the local add on based on this PR that's currently running. |
Summary
Adds push mode functionality to work around communication interruptions introduced in Marstek Venus firmware v153.
Problem
After updating to Venus firmware v153, the battery randomly stops querying the Shelly Pro 3EM emulator after 10 seconds to 2 minutes, causing communication failures (see issue #180).
Solution
Instead of waiting for periodic JSON-RPC requests from the battery, the emulator can now proactively push power data to the battery at configurable intervals.
Changes
_push_data_loop()for periodic data transmissionSHELLY_PUSH_MODE: enable/disable push modeSHELLY_PUSH_TARGET_IP: target IP addressSHELLY_PUSH_TARGET_PORT: target portSHELLY_PUSH_INTERVAL: transmission interval in secondsConfiguration Example
Test Plan
Fixes #180