See my first comment below... mqtt doesn't work for this, but dbus does
tl;dr: How can I emulate a et340 meter on the MQTT bus? What do I need to publish to make Venus believe there is a meter there?
I already have an SMA system installed which includes a SMA Home Manager (SMA's version of the ET340: a meter at the grid connection point). I want to extend my system with a Multiplus-ii and add some storage.
Let's get this out of the way: I know the SMA meter is not officially supported.
SMA's meter outputs the values it sees at the grid connection point once per second, and it does this via multicast. I have written a little python script which subscribes to the multicast, and provides the output like this:
A: buy: 0.0 A: sell: 821.2 -------------- L1 buy: 0.0 L1 sell: 381.6 L2 buy: 0.0 L2 sell: 81.6 L3 buy: 0.0 L3 sell: 358.0
The above table is my current buy and sell across all phases ("A"), where I am currently selling 821.2W and buying 0. The values are broken into each phase (so L1 is selling 381, L2 81, and L3 358). There is much more available in the data from the meter, I am only focusing on what is necessary to emulate the 340.
The script is available here: https://gist.github.com/mitchese/afd823c3c5036c5b0e5394625f1a81e4
As I understand the ET340, it connects to the Venus via rs485, and then a cgwacs process is responsible for taking data from RS485 and putting it on dbus. I've also read that MQTT can be used for writing things into Venus as well. My idea is to write a simple python script which connects to the SMA broadcasts, massages the data to whatever venus would expect, and publishes this via MQTT. This should be darn close to what cgwacs is doing.
I have done some publishing to the topics (*** removed my device id) with some bogus-but-sane values to see if I can get my Venus GX to think I have a meter.
W/**********/grid/33/Ac/Energy/Forward {"value": 5000.0} W/**********/grid/33/Ac/Energy/Reverse {"value": 5000.0} W/**********/grid/33/Ac/Power W/**********/grid/33/Ac/L1/Current '{"value": 123.0}' W/**********/grid/33/Ac/L1/Energy/Forward '{"value": 30.0}' W/**********/grid/33/Ac/L1/Energy/Reverse '{"value": 500.0}' W/**********/grid/33/Ac/L1/Power '{"value": 300.0}' W/**********/grid/33/Ac/L1/Voltage '{"value": 230.0}' ...
but this is just a bit of publishing in the dark. I don't actually have a device id, 33 was just a guess. Anyone have some tips on how I can use MQTT?
I also tried a publish to W/***/system/0/Ac/Grid/DeviceType {"value": 340} to see if that would trigger an adoption of the 340 meter.
Currently I have an ET340 for testing and a Venus GX - there is nothing hooked up yet and I'll be ordering the multiplus as soon as I can get this setup.