ngardiner / TWCManager

Control power delivered by a Tesla Wall Charger using two wires screwed into its RS-485 terminals.
The Unlicense
127 stars 55 forks source link

Tracking Green Energy #184

Open addy199 opened 3 years ago

addy199 commented 3 years ago

Hi ngardiner, I am new for python programming. I am using a 3-phase power for my TWC with a 16A breaker. I want get the green energy data from my SMA inverter. But I do not see any configurations for config.json for SMA inverters. What is the best way to get this working?

Thanks in advance.

hopfi2k commented 3 years ago

May I step in...could you kindly let me know the model of your SMA inverter? Is there a Sunny Home Manager in the play? There currently is no support for SMA inverters, but if your's is a recent model that supports the ModBus protocol, I could write a module to support it - if you are willing to help testing it ;-)

addy199 commented 3 years ago

Sure definitely. Model-SMA25000TL Yes, it has a sunny portal which logs the generation and consumption data.

hopfi2k commented 3 years ago

Thanks very much - cooking something, although it will take some days, due to time constraints (Christmas preparations)...

addy199 commented 3 years ago

No Problem @hopfi2k.

Saftwerk commented 3 years ago

Hope anyone can help me on "Tracking Green Energy".

With this command, I can read the unused green energy power available, which would go to grid: http://192.168.178.20:8080/api/data.txt?uuid%5B%5D=00000006-0002-1570-ffff-0123456789ab The answer is text (without quotes): "4199.9 W" Before sending that command again I must wait 2 seconds or more.

How do I put this into the TWCManager config? Thank You!

Saftwerk commented 3 years ago

Please, could anybody help?

ngardiner commented 3 years ago

Hi @Saftwerk,

I have added support for this and am looking for your help to test it. Please make sure you've got the latest v1.2.2 sources:

git checkout main
git pull

And please configure the following in your /etc/twcmanager/config.json file under the sources section:

        "Volkszahler": {
          "enabled": true,
          "serverIP": "192.168.178.20",
          "serverPort": "8080",
          "uuid": "00000006-0002-1570-ffff-0123456789ab"
        }

And then hopefully you should see values. If not, could you please check for any errors on the console, for example;

23:30:04 Volkszahle 17 Error connecting to Volkszahler to fetch sensor values

And paste those errors here so I can see the output.

Saftwerk commented 3 years ago

Hi @ngardiner,

here the results from today's tryout . "v1.2.2"

  1. I do not see any errors.
  2. I do not see if Volkszahler is used and connected.
  3. I do not see see how much Green Energy is going to grid.

sudo systemctl stop twcmanager.service cd TWCManager python3 -m TWCManager image

Here is my config. config.json (Saftwerk).txt

I think the UUID is better to use for TWCManager to track energy: 00000004-0001-1670-ffff-0123456789ab as "Overall Total Grid Power" It gives positive numbers "2109.7 W" when I draw power from the grid. It gives negative numbers "-51 W" when I push power to the grid. (sun is almost down)

Question: Is the setting "subtractChargerLoad": true, correct for this case?