iobroker-community-adapters / ioBroker.sma-em

ioBroker Adapter for SMA Energy Meter & Sunny Home Manager 2
MIT License
25 stars 16 forks source link

New Version for Testing available #98

Closed TGuybrush closed 3 years ago

TGuybrush commented 3 years ago

I've revised the core of the adapter to solve the problem of invalid status data #34 . In addition I've added the frequency value. Please test the new version and provide feedback on it. The new version can found in my repository https://github.com/TGuybrush/ioBroker.sma-em.git

After some testing the version will be hopefully merged in the official repository.

rolsch commented 3 years ago

How can i install the fixed version?

Over the iobroker webui and then adapters - custom url?

I have installed and use this url: https://github.com/TGuybrush/ioBroker.sma-em.git

But now i don't see the sma-em in the iobroker - instances?

Regrads to monkey island :-)

TGuybrush commented 3 years ago

Hi,

I think that show that the installation works fine (exit code 0). However you have to create an instance of the adapter before usage. The update just overwrites the normal sma-em adapter. Go to the adapter page and create an instance of it. If you had already an instance it wil be updated an restarted automatically. You can easily check if the new adapter is active by checking the availability of the frequency object which was newly introduced in this version.

Best regards

rolsch commented 3 years ago

Hi TGuybrush.

"The update just overwrites the normal sma-em adapter." -> this was the solution :-)

After some hours, i think the modifyed code works well. I see the frequency object. All value are correct...

image

maxpd1 commented 3 years ago

Installed it due to connection lost problem in previous version. But Version number is still 0.5.7? Is it possible to reach out for the forecast values you see in SunnyPortal App?

pdbjjens commented 3 years ago

@TGuybrush I installed the new version from https://github.com/TGuybrush/ioBroker.sma-em.git It seemed to work as expected regarding the states and values of my SHM: Screenshot 2021-01-08 103928 However, it did not correctly detect my SMA Energy Meter which I have in my system. The Master Version did this: Screenshot 2021-01-08 105425 It seems that the new implementation is not able to handle more than one SEM or SHM. In one instantiation it found the SEM but intermittently displayed the values of the SEM alternating it with the values of the SHM. In another instantiation it found the SHM but did not find the SEM nor diplayed the values of the SEM alternatingly. Having two instances of the SMA-EM Adapter did not work either. The second instance would not go online due to an UDP connection error. Please fix this issue before merging this PR into the Master. I would also like to ask you to truncate the display of the values to a fixed sensible number of decimals. Values like 826.8856999999999 kWh do not make much sense in the display. Also it makes reading fast-changing values difficult as the number of displayed decimals changes rapidly. I am certainly willing to test your new version in my environment.

TGuybrush commented 3 years ago

Thx for the feedbacks. The version number will be increased in the next revision. The adapter binds to one multicast IPv4 address. IPv4 Multicast is designed as a one point to multipoint connection. That means in fact it is not usual that two devices send data over the same multicast address in the same network. However the multicast address of the SMA adapter cannot be changed easily, therefor I will try to fix that problem in the next version for testing.

pdbjjens commented 3 years ago

@TGuybrush Understood. It would be good enough if your adapter would behave in the same way as the current version does: Build a tree for each SMA Device from which it receives multicasts.

TGuybrush commented 3 years ago

I've pushed an updated version to my account. Please feel free to test it again to give feedback on the changes and bug fixes.

pdbjjens commented 3 years ago

@TGuybrush Great, I have immediately tried it out. Thumbs up for your new version 0.6.0. It now detected my SHM and SEM correctly and showed&updated the values as expected. (see screenshot). SM-EM0-6-0Screenshot 2021-01-11 111747

There was some strange behavior on first start up (see screenshot). Of course I removed the old instance before. When I deleted the misbehaving new instance and instantiated a new one, it started just fine. So I believe that the initial problem might be due to the fact that I installed the version 0.6.0 over the existing 0.5.7.

SMA-EM-log-Screenshot 2021-01-11 111130

However, I would like to ask you for some cosmetic changes:

  1. please show the units of all the power-values as W (not as Watt) analoguous to the energy values (kWh)
  2. please show the reactive power value units as VAr (not as var)
  3. please truncate the energy values (kWh) to 3 digits and the power values (W) to 1 digit after the decimal point.
  4. please truncate the reactive power values (VAr) and the apparent power values (VA) to 1 digit after the decimal point. Truncating the respective counter values to 3 digits after the dp should be sufficient.
  5. truncating cosphi and Hz values to 3 digits after the decimal point should be sufficient
  6. please abbreviate the text in the Name column of the Objects admin screen e.g. "SMA Energy Meter with serial number: 3009872298" to e.g. "SMA Energy Meter S/N: 3009872298" because the interesting part (the S/N) becomes easily hidden if the Name column is tight on smaller screens. Is there a way to discern a SHM from a SEM somehow? Then it would be nice if you would reflect that in the Name column of the respective device.

I would also like to ask, if it is normal that in extended mode the values are updated rapidly for a few (10) seconds and then they remain stable for about 50s

I will continue to let the adapter run in my environment and report any strange behavior here.

TGuybrush commented 3 years ago

Thx for the feedback. I've pushed a new version targeting the following issues. 1) Error message 2) All units are named according to the SI system (DIN 1302). 3) The description string of the top-level hierarchy indicates if the device is a Home Manger or an Energy Meter

Number truncation: For me it does not make any sense to truncate the numbers in the database since that is an option of the GUI application.

The object browser has sometimes a latency for displaying the values. Therefore the update time and the display time can be very different. I see no issue there.

pdbjjens commented 3 years ago

@TGuybrush Wow, that was quick. Thank you for implementing these improvements. I installed 0.6.1 and now it is running in my production environment. Up to now I saw no further problems. From my point of view 0.6.1 could be merged to master.

pdbjjens commented 3 years ago

@TGuybrush This morning the values of the SHM would not update. (screenshot)

SMA-EM0-6-1Screenshot 2021-01-12 112508 Not even a restart of the adapter nor of the iobroker would help. The SHM is active, though.

pdbjjens commented 3 years ago

@TGuybrush It seems that the reason for this effect was the browser and or Windows 10. After rebooting the Notebook and restarting Chrome it now seems to update correctly. Sorry if this caused you any extra effort.

Mirage1981 commented 3 years ago

@TGuybrush I just installed your new version (even the normal version 0.5.7 still working for me ... only the details of L1/2/3 not after the update of SMA) thanks for taking this up again :-)

the installation is running well:

1 2

but the instance can not start: I'm running a docker installation on a synology

3
Mirage1981 commented 3 years ago

@TGuybrush

sorry my bad ... I updated the node version to 12.20.1 ... now everything is running well :-)

thanks for your work on the update of the adapter

TGuybrush commented 3 years ago

Thx folks for testing. I suggest to accept the pull request to update the version in the official repository.

DutchmanNL commented 3 years ago

please retest with new version

pdbjjens commented 3 years ago

@TGuybrush I saw that the version 0.6.1 does not show the frequency value for SEM, but for SHM it does. This problem was already mentioned in issue #13 Since I have just recently aquired the SEM, I suppose that it is a current model. It is true (like TJJochen claims in #13) that the current model of the SMA EnergyMeter Type 20 apparently supports mains frequency. On the internal web interface, the frequency is always displayed under instantaneous values. However I do not know if it also multicasts it on the LAN interface like the SHM. TGuybrush do you know that? and if so is it possible to fix this behavior?

TGuybrush commented 3 years ago

Unfortunately I have no further documentation of the SEM. However the adapter creates a log entry if it detects an unknown data point in the received UDP package. Please check the log if you see a message from the SEM.

pdbjjens commented 3 years ago

@TGuybrush I started the instance several times with different log levels, but did not see anything suspicious. Maybe you do: SMA-EM0-6-1-LOG-Screenshot 2021-01-20 090626 It seems that the frequency datapoint is created for the SEM just like for the SHM, but it receives no values (value field is empty): SMA-EM-Frequency-Screenshot 2021-01-19 104309 Do you have an idea why?

TGuybrush commented 3 years ago

I don't see any useful message either. That means the frequency value is not included in the UDP message in case of SEM. Therefore I see no possible to get the frequency value for the SEM.

pdbjjens commented 3 years ago

@TGuybrush Yes, I agree. It seems that the SEM, despite the fact that it has firmware 2.0 (in my case 2.0.18.R - do you know if this is the latest version?) and thus should adhere to the EMETER 20 protocol, it seems that it does not multicast the frequency in the same way as the SHM does. Do you have a way to trace the raw datagrams? I mean like http://www.eb-systeme.de/?page_id=3005 Then maybe it might be possible to finally decide that the frequency is not included in the SEM datagrams.

pdbjjens commented 3 years ago

@TGuybrush We have a new issue #117 pending for version 0.6.1. Since we do not have appropriate hardware to debug this special case I would like to ask you whether you would look into issue #117