Roeland54 / SMA-Energy-Meter-emulator

Emulate the existence of one or more SMA Energy Meters on the local network. This makes it possible to use the data from other meter types and integrate them in your SMA inverter.
Apache License 2.0
6 stars 1 forks source link

STP SE only getting dummy values #20

Closed cyrill-wyss closed 14 hours ago

cyrill-wyss commented 5 days ago

Hi Roeland

I just switched from the test version (next) to the current main one and noticed that no power values are registered in the STP 10.0 SE anymore. The meter is recognized but all values are zero. I think the issue is in adding all values as dummy and the appending the real total values in the end. The real value must be added before the dummy values or if appended, replacing the previously added dummy totals at the correct packet position. Thanks in advance for looking into it and best regards

Cyrill

Roeland54 commented 4 days ago

Mmm I did some changes to prevent having to add all dummy values in the mqtt.py and also in homewizard.py. It does work for my inverter. So I can not really test for your usecase.

maybe we could try to remove these lines that add the the dummy values for power. self.addMeasurementValue(emeterPacket.SMA_POSITIVE_ACTIVE_POWER, 0) self.addCounterValue(emeterPacket.SMA_POSITIVE_ACTIVE_ENERGY, 0) self.addMeasurementValue(emeterPacket.SMA_NEGATIVE_ACTIVE_POWER, 0) self.addCounterValue(emeterPacket.SMA_NEGATIVE_ACTIVE_ENERGY, 0) My illness is preventing me more and more to come up with good solutions and Il probably will have to archive all my repositories soon because of this. It would be nice to have a working version for tripower before that.

cyrill-wyss commented 4 days ago

I'm very sorry to hear about your illness. I'll for sure fork this repo once the tripower works and then figure out how to properly build a plugin instance. It would be a shame if this project is lost.

Your solution seems to work, just tested it with my static emulator by adding the four values to the end. If you could change this and build a next version I'll be happy to test it out.

Roeland54 commented 3 days ago

I have created a new test version on the "next" branch. Can you try if that one works?

cyrill-wyss commented 3 days ago

3 out of 4 values are now working. But SMA_NEGATIVE_ACTIVE_POWER is still 0. But Im pretty sure this is because of SMA_VOLTAGE_L1 = 0x00020400 having the wrong id, matching the active negative powers id... SMA_VOLTAGE_L1 should be 0x00320400, i must have typed that wrong in my pull request already.

Roeland54 commented 3 days ago

Changed the id of SMA_VOLTAGE_L1 and updated the version on next to 0.1.4-rc2. Could you try again?

cyrill-wyss commented 3 days ago

Now it's working, thank you.

Roeland54 commented 17 hours ago

Released 0.1.4 on the main branch. Could you verify that one?

cyrill-wyss commented 14 hours ago

0.1.4 works as expected, thank you.