Leistungsprognose für Wechselrichter

Begonnen von ch.eick, 18 Januar 2021, 08:35:46

Vorheriges Thema - Nächstes Thema

DS_Starter

Ich versuche heute Abend mal was...

LG
ESXi@NUC+Debian+MariaDB, PV: SMA, Victron MPII+Pylontech+CerboGX
Maintainer: SSCam, SSChatBot, SSCal, SSFile, DbLog/DbRep, Log2Syslog, SolarForecast,Watches, Dashboard, PylonLowVoltage
Kaffeekasse: https://www.paypal.me/HMaaz
Contrib: https://svn.fhem.de/trac/browser/trunk/fhem/contrib/DS_Starter

habl

Zitat von: Wzut am 26 Mai 2021, 18:58:39
verstehe ich zum Teil nicht, aber lass uns mal einen Anfang machen, der Rest kommt dann schon so nach und nach.
Im Anhang eine neue sub, ich habe sie bei mir via weblink angebunden, aber das willst du vermutlich eh anders lösen.
Da wir hier svgs ausgeben war ich mal so frei nicht alles von papa 1:1 zu kopieren, sondern auch noch eigene Vorstellungen umzusetzen :
a. das Sonnen Icon/Symbol habe ich jetzt doppelt drin, einmal eine Kopie des Icons day und eine von weather_sun.
müssen wir mal schauen welches das "schönere" ist, ich wäre für day

b. Das Icon für Grid/Netz habe ich neu gemacht, dieses Kabel mit den beiden Steckern hat mir nicht gefallen. Ist jetzt ähnlich wie im SMA Portal ein Gittemast.

c. mit dem Batterie Symbol bin ich z.Z.auch noch nicht zufrieden, die Ladebalken sind waagerecht, aber beim FHEM Icon leicht schräg.
Stichwort  Batterie : die ist jetzt immer grün, sobald dieser State Of Charge Wert zur Verfügung steht kann man da auch aktiv werden.

Hallo Wzut,
auch ich war neugierig und habe es schon mal ausprobiert ::) Respekt, das sieht schon mal sehr, sehr gut aus!
Wäre es im allgemeinen allerdings nicht schöner, die Energielieferanten links und rechts zu halten und oben die Sonne und unten das Haus? Somit hätte man auch die Pfade etwas symmetrischer.

Welche Sonne besser aussieht kann ich nur schlecht beurteilen, da sie beide übereinander liegen, würde aber auch eher day favorisieren.

VG
  habl

papa

Zitat von: Wzut am 26 Mai 2021, 18:58:39
Da wir hier svgs ausgeben war ich mal so frei nicht alles von papa 1:1 zu kopieren, sondern auch noch eigene Vorstellungen umzusetzen :
Leider kein Bild :-(
Verbesserungen/Verschönerungen nehme ich gern mit. Ich glaube im TabletUI kann ich auch einfach HMTL mit dem Label-Widget anzeigen. Könnte dann auf meinen Hack gern verzichten.
Bei mir sieht es übrigens aktuell wie im Bild unten aus. Am Anfang waren die Balken auch mal noch animiert - aber das macht mein Tablet nicht mit. Das scheint auf Dauer zu viel CPU-Last zu erzeugen.
BananaPi + CUL868 + CUL433 + HM-UART + 1Wire

DS_Starter

Hallo Wzut, @all,

habe deine Grafik integriert und liegt im  contrib. Mit dem Attr flowGraphicSize kann man die Größe festlegen.
Fehlt noch ein Attr um die verschiedenen Grafiken zur Ansicht auswählen zu können. Mache ich noch.

Die day-Sonne finde ich auch besser.

Zitat
Stichwort  Batterie : die ist jetzt immer grün, sobald dieser State Of Charge Wert zur Verfügung steht kann man da auch aktiv werden.
Den Batterieteil sollte es nur geben wenn es das Reading currentBatteryDev gibt. Ich habe zB. keine Batterie, da wundert man sich dann.  ;)
Wo bekommt man "State Of Charge" her ? Bieten die Batteriedevs ein solches Reading ?

Ansonsten wie immer super Arbeit, feine Sache.  8)

Animierte Balken wären natürlich noch was ...  :)

LG,
Heiko
ESXi@NUC+Debian+MariaDB, PV: SMA, Victron MPII+Pylontech+CerboGX
Maintainer: SSCam, SSChatBot, SSCal, SSFile, DbLog/DbRep, Log2Syslog, SolarForecast,Watches, Dashboard, PylonLowVoltage
Kaffeekasse: https://www.paypal.me/HMaaz
Contrib: https://svn.fhem.de/trac/browser/trunk/fhem/contrib/DS_Starter

dk3572

Zitat von: DS_Starter am 21 Mai 2021, 09:42:36
Hmm, versuche es doch mal so:


etotal_fc:modulstate.* {
                         if (ReadingsVal($name, "etotal", 8000) < 7000) {
                           ReadingsVal($name, "etotal", 0);
                         }
                       },
total_pac_fc:modulstate.* {
                         if (ReadingsVal($name, "total_pac", 8) <7) {
                           ReadingsVal($name, "total_pac", 0);
                         }
                       }


Denn etotal sind bei SMAInverter kWh (nicht Wh). Gleiches gilt für total_pac mit kW.

Hallo Heiko,

heute mal wieder zur exakt gleichen Zeit einen Ausreißer drin gehabt  >:(

Today_Hour06_PVreal    7615212 Wh    2021-05-27 05:59:49

So sieht mein userReading im Wechselrichter aus:

etotal_fc:modulstate.* {
                         if (ReadingsVal($name, "etotal", 8000) < 8000) {
                           ReadingsVal($name, "etotal", 0);
                         }
                         else {return 0}
                       },
total_pac_fc:modulstate.* {
                         if (ReadingsVal($name, "total_pac", 8) <7) {
                           ReadingsVal($name, "total_pac", 0);
                         }
                         else {return 0}
                       }


Woher bezieht SolarForecast den Wert?
So ein hoher Wert kann doch mit dem userReading gar nicht übergeben werden?

FUUID      5fd65ec0-f33f-cd72-ba56-13a41f24f97a012f
   FVERSION   76_SolarForecast.pm:v0.47.0-s21735/2020-04-20 TESTING
   MODE       Automatic - next polltime: 08:00:28
   NAME       SolarForecast
   NOTIFYDEV  DWD,DWD_PV,SMA_Wechselrichter,SMA_Zaehler,SMA_Wechselrichter_Bat
   NR         446
   NTFY_ORDER 50-SolarForecast
   STATE      updated
   TYPE       SolarForecast
   HELPER:
     FW         WEB
     INITCONTOTAL 2053893.1
     INITFEEDTOTAL 5212131.9
     PACKAGE    FHEM::SolarForecast
     SPGDETAIL  SolarForecast
     SPGDEV     SolarForecast
     SPGROOM    Photovoltaik
     VERSION    0.47.0
     VERSION_API unused
     VERSION_ErrCodes unused
     VERSION_SMUtils 1.22.0
   READINGS:
     2021-05-28 23:59:59   AllPVforecastsToEvent 0 Wh
     2021-05-27 07:59:18   Current_AutarkyRate 98 %
     2021-05-27 07:59:18   Current_Consumption 466 W
     2021-05-27 07:59:18   Current_GridConsumption 11 W
     2021-05-27 07:59:18   Current_GridFeedIn 0 W
     2021-05-27 07:59:18   Current_PV      698 W
     2021-05-27 07:59:18   Current_PowerBatIn 243 W
     2021-05-27 07:59:18   Current_PowerBatOut 0 W
     2021-05-27 07:59:18   Current_SelfConsumption 698 W
     2021-05-27 07:59:18   Current_SelfConsumptionRate 100 %
     2021-05-27 07:00:00   LastHourGridconsumptionReal 502 Wh
     2021-05-27 07:00:00   LastHourPVforecast 187 Wh
     2021-05-27 07:00:00   LastHourPVreal  52 Wh
     2021-05-27 07:59:18   NextHours_Sum01_PVforecast 676 Wh
     2021-05-27 07:59:18   NextHours_Sum02_PVforecast 1562 Wh
     2021-05-27 07:59:18   NextHours_Sum03_PVforecast 2824 Wh
     2021-05-27 07:59:18   NextHours_Sum04_ConsumptionForecast 2296 Wh
     2021-05-27 07:59:18   NextHours_Sum04_PVforecast 4541 Wh
     2021-05-27 07:59:18   RestOfDayConsumptionForecast 5058 Wh
     2021-05-27 07:59:18   RestOfDayPVforecast 15588 Wh
     2021-05-27 00:59:59   Today_Hour01_BatIn 0 Wh
     2021-05-27 00:59:59   Today_Hour01_BatOut 0 Wh
     2021-05-27 00:59:59   Today_Hour01_GridConsumption 0 Wh
     2021-05-27 00:59:59   Today_Hour01_GridFeedIn 0 Wh
     2021-05-27 00:59:59   Today_Hour01_PVreal 0 Wh
     2021-05-27 01:59:29   Today_Hour02_BatIn 0 Wh
     2021-05-27 01:59:29   Today_Hour02_BatOut 274 Wh
     2021-05-27 01:59:29   Today_Hour02_GridConsumption 2 Wh
     2021-05-27 01:59:29   Today_Hour02_GridFeedIn 2 Wh
     2021-05-27 01:59:29   Today_Hour02_PVreal 0 Wh
     2021-05-27 02:58:59   Today_Hour03_BatIn 0 Wh
     2021-05-27 02:58:59   Today_Hour03_BatOut 317 Wh
     2021-05-27 02:58:59   Today_Hour03_GridConsumption 2 Wh
     2021-05-27 02:58:59   Today_Hour03_GridFeedIn 2 Wh
     2021-05-27 02:58:59   Today_Hour03_PVreal 0 Wh
     2021-05-27 03:59:39   Today_Hour04_BatIn 0 Wh
     2021-05-27 03:59:39   Today_Hour04_BatOut 291 Wh
     2021-05-27 03:59:39   Today_Hour04_GridConsumption 2 Wh
     2021-05-27 03:59:39   Today_Hour04_GridFeedIn 2 Wh
     2021-05-27 03:59:39   Today_Hour04_PVreal 0 Wh
     2021-05-27 04:59:09   Today_Hour05_BatIn 0 Wh
     2021-05-27 04:59:09   Today_Hour05_BatOut 283 Wh
     2021-05-27 04:59:09   Today_Hour05_GridConsumption 2 Wh
     2021-05-27 04:59:09   Today_Hour05_GridFeedIn 2 Wh
     2021-05-27 04:59:09   Today_Hour05_PVreal 0 Wh
     2021-05-27 05:59:49   Today_Hour06_BatIn 0 Wh
     2021-05-27 05:59:49   Today_Hour06_BatOut 226 Wh
     2021-05-27 05:59:49   Today_Hour06_GridConsumption 1 Wh
     2021-05-27 05:59:49   Today_Hour06_GridFeedIn 1 Wh
     2021-05-27 05:59:49   Today_Hour06_PVforecast 6 Wh
     2021-05-27 05:59:49   Today_Hour06_PVreal 7615212 Wh
     2021-05-27 06:59:20   Today_Hour07_BatIn 0 Wh
     2021-05-27 06:59:20   Today_Hour07_BatOut 793 Wh
     2021-05-27 06:59:20   Today_Hour07_GridConsumption 502 Wh
     2021-05-27 06:59:20   Today_Hour07_GridFeedIn 14 Wh
     2021-05-27 06:59:20   Today_Hour07_PVforecast 187 Wh
     2021-05-27 06:59:20   Today_Hour07_PVreal 52 Wh
     2021-05-27 07:59:18   Today_Hour08_BatIn 100 Wh
     2021-05-27 07:59:18   Today_Hour08_BatOut 0 Wh
     2021-05-27 07:59:18   Today_Hour08_GridConsumption 313 Wh
     2021-05-27 07:59:18   Today_Hour08_GridFeedIn 2 Wh
     2021-05-27 07:59:18   Today_Hour08_PVforecast 432 Wh
     2021-05-27 07:59:18   Today_Hour08_PVreal 446 Wh
     2021-05-27 07:59:18   Today_Hour09_PVforecast 676 Wh
     2021-05-27 07:59:18   Today_Hour10_PVforecast 886 Wh
     2021-05-27 07:59:18   Today_Hour11_PVforecast 1262 Wh
     2021-05-27 07:59:18   Today_Hour12_PVforecast 1717 Wh
     2021-05-27 07:59:18   Today_Hour13_PVforecast 2015 Wh
     2021-05-27 07:59:18   Today_Hour14_PVforecast 1747 Wh
     2021-05-27 07:59:18   Today_Hour15_PVforecast 2020 Wh
     2021-05-27 07:59:18   Today_Hour16_PVforecast 1610 Wh
     2021-05-27 07:59:18   Today_Hour17_PVforecast 1656 Wh
     2021-05-27 07:59:18   Today_Hour18_PVforecast 1127 Wh
     2021-05-27 07:59:18   Today_Hour19_PVforecast 547 Wh
     2021-05-27 07:59:18   Today_Hour20_PVforecast 257 Wh
     2021-05-27 07:59:18   Today_Hour21_PVforecast 66 Wh
     2021-05-27 07:59:18   Today_Hour22_PVforecast 2 Wh
     2021-05-27 07:59:18   Today_PVforecast 16213 Wh
     2021-05-27 07:59:18   Today_SunRise   05:22
     2021-05-27 07:59:18   Today_SunSet    21:23
     2021-05-27 07:59:18   Tomorrow_ConsumptionForecast 9561 Wh
     2021-05-27 07:59:18   Tomorrow_PVforecast 35430 Wh
     2021-05-27 07:59:18   Tomorrow_SunRise 05:21
     2021-05-27 07:59:18   Tomorrow_SunSet 21:24
     2021-05-27 07:59:18   consumer01      name='Waschmaschine' state='on' planningstate='planned'
     2021-05-27 07:59:18   consumer01_planned_start 2021-05-27 07:00:00
     2021-05-27 07:59:18   consumer01_planned_stop 2021-05-27 11:00:00
     2021-05-27 07:59:18   consumer02      name='Trockner' state='on' planningstate='planned'
     2021-05-27 07:59:18   consumer02_planned_start 2021-05-27 09:00:00
     2021-05-27 07:59:18   consumer02_planned_stop 2021-05-27 15:00:00
     2021-05-16 20:22:48   currentBatteryDev SMA_Wechselrichter_Bat pin=power_in:W pout=power_out:W intotal=bat_loadtoday:kWh outtotal=etoday:kWh
     2021-04-19 11:41:42   currentForecastDev DWD
     2021-04-28 06:45:38   currentInverterDev SMA_Wechselrichter pv=total_pac_fc:kW etotal=etotal_fc:kWh
     2021-04-06 19:24:25   currentMeterDev SMA_Zaehler gcon=gcon:W contotal=contotal:kWh gfeedin=gfeedin:W feedtotal=feedtotal:kWh
     2021-04-17 12:33:40   currentRadiationDev DWD_PV
     2021-04-10 08:24:00   energyH4Trigger 1on=2000 1off=1700 2on=4000 2off=3700 3on=6000 3off=5700
     2021-05-27 05:09:39   energyH4Trigger_1 on
     2021-05-27 07:37:50   energyH4Trigger_2 on
     2021-05-25 14:44:01   energyH4Trigger_3 off
     2021-01-27 19:08:53   inverterStrings Süddach
     2020-12-13 19:39:52   moduleArea      32
     2021-01-27 19:07:57   moduleDirection Süddach=S
     2021-01-27 19:10:15   modulePeakString Süddach=6.175
     2021-01-27 19:11:29   moduleTiltAngle Süddach=45
     2021-05-27 07:59:18   nextPolltime    08:00:28
     2021-04-04 12:41:37   powerTrigger    1on=1000 1off=500 2on=3000 2off=2500 3on=5500 3off=5000
     2021-05-27 00:00:28   powerTrigger_1  off
     2021-05-27 00:00:28   powerTrigger_2  off
     2021-05-27 00:00:28   powerTrigger_3  off
     2021-05-27 06:00:59   pvCorrectionFactor_06 0.94 (automatic - old factor: 0.44, cloudiness range: 6, found history days in range: 5)
     2021-05-27 06:00:59   pvCorrectionFactor_06_autocalc done
     2021-05-27 07:00:30   pvCorrectionFactor_07 0.58 (automatic - old factor: 1.08, cloudiness range: 7, found history days in range: 10)
     2021-05-27 07:00:30   pvCorrectionFactor_07_autocalc done
     2021-05-26 08:00:12   pvCorrectionFactor_08 1.26 (automatic - old factor: 0.97, cloudiness range: 9, found history days in range: 2)
     2021-05-26 09:00:52   pvCorrectionFactor_09 0.77 (automatic - old factor: 0.91, cloudiness range: 9, found history days in range: 2)
     2021-05-26 10:00:23   pvCorrectionFactor_10 0.99 (automatic - old factor: 1.28, cloudiness range: 9, found history days in range: 2)
     2021-05-26 11:01:03   pvCorrectionFactor_11 0.91 (automatic - old factor: 1.31, cloudiness range: 9, found history days in range: 3)
     2021-05-26 12:00:33   pvCorrectionFactor_12 1.09 (automatic - old factor: 1.06, cloudiness range: 9, found history days in range: 2)
     2021-05-26 13:00:56   pvCorrectionFactor_13 1.20 (automatic - old factor: 0.93, cloudiness range: 9, found history days in range: 2)
     2021-05-26 14:00:26   pvCorrectionFactor_14 1.05 (automatic - old factor: 0.72, cloudiness range: 9, found history days in range: 2)
     2021-05-26 15:01:07   pvCorrectionFactor_15 1.22 (automatic - old factor: 0.72, cloudiness range: 9, found history days in range: 2)
     2021-05-26 16:00:37   pvCorrectionFactor_16 1.11 (automatic - old factor: 0.71, cloudiness range: 9, found history days in range: 3)
     2021-05-26 17:00:07   pvCorrectionFactor_17 1.22 (automatic - old factor: 0.72, cloudiness range: 9, found history days in range: 2)
     2021-05-26 18:01:05   pvCorrectionFactor_18 1.14 (automatic - old factor: 0.96, cloudiness range: 8, found history days in range: 7)
     2021-05-26 19:00:38   pvCorrectionFactor_19 0.72 (automatic - old factor: 0.66, cloudiness range: 8, found history days in range: 6)
     2021-05-26 20:00:08   pvCorrectionFactor_20 0.89 (automatic - old factor: 0.69, cloudiness range: 7, found history days in range: 5)
     2021-05-26 21:00:48   pvCorrectionFactor_21 0.77 (automatic - old factor: 1.03, cloudiness range: 7, found history days in range: 4)
     2021-05-26 22:00:18   pvCorrectionFactor_22 0.18 (automatic - old factor: 0.50, cloudiness range: 7, found history days in range: 4)
     2021-05-27 07:59:18   pvCorrectionFactor_Auto on
     2021-05-27 07:59:18   state           updated
Attributes:
   DbLogExclude .*
   Wh/kWh     Wh
   alias      Solar Vorhersage
   autoRefresh 120
   beam1Color 0033FF
   beam1Content pvForecast
   beam2Color 149600
   beam2Content pvReal
   consumer01 TP_Waschmaschine icon=scene_dishwasher@orange type=dishwasher mode=can power=2500 etotal=total:kWh
   consumer02 TP_Trockner icon=scene_dishwasher@orange type=dryer mode=can power=2500 etotal=total:kWh
   flowGraphicSize 200
   forcePageRefresh 1
   historyHour -12
   layoutType double
   numHistDays 30
   room       Photovoltaik
   sameWeekdaysForConsfc 1
   showDiff   no
   showNight  0


   DEF        0000 192.168.178.67
   FUUID      5eb01b4c-f33f-cd72-5e39-40639d5f6f9b3c00
   FVERSION   76_SMAInverter.pm:v2.14.1-s23909/2021-03-07
   HOST       192.168.178.67
   INTERVAL   manual
   LASTUPDATE 27.05.2021 / 08:03:32
   MODEL      STP6.0-3AV-40 (Sunny Tripower 6.0)
   NAME       SMA_Wechselrichter
   NR         363
   PASS       xxxx
   STATE      PV-aktuell: <font color="White"><b>0.717 W</b></font><br>PV-heute: <font color="White">0.551 Wh</font><br>
   TYPE       SMAInverter
   HELPER:
     AVERAGEBUF 717,714,708,705,702,701,700,701,699,699,698,695,690,678,677,670,668
     DEFAULT_TARGET_SERIAL 4294967295
     DEFAULT_TARGET_SUSYID 65535
     FAULTEDCYCLES 0
     INTERVAL   60
     MAXBYTES   300
     MYSERIALNUMBER 123321123
     MYSUSYID   233
     PACKAGE    main
     PKT_ID     32769
     VERSION    2.14.1
   Helper:
     DBLOG:
       etoday:
         logdb:
           TIME       1622095412.77847
           VALUE      0.551
       etotal:
         logdb:
           TIME       1622095412.77847
           VALUE      7615.763
       total_pac:
         logdb:
           TIME       1622095412.77847
           VALUE      0.717
   READINGS:
     2021-05-27 08:03:32   avg_power_lastminutes_05 707
     2021-05-27 08:03:32   avg_power_lastminutes_10 704
     2021-05-27 08:03:32   avg_power_lastminutes_15 697
     2021-05-27 08:03:32   background_processing_time 0.6194
     2021-05-27 08:03:32   device_class    Solar-Wechselrichter
     2021-05-27 08:03:32   device_name     SN: 3007788841
     2021-05-27 08:03:32   device_status   Ok
     2021-05-27 08:03:32   device_type     STP6.0-3AV-40 (Sunny Tripower 6.0)
     2021-05-27 08:03:32   etoday          0.551
     2021-05-27 08:03:32   etotal          7615.763
     2021-05-27 08:03:32   etotal_fc       7615.763
     2021-05-27 08:03:32   feed-in_time    4526.89
     2021-05-27 08:03:32   grid_freq       50.03
     2021-05-27 08:03:32   gridrelay_status geschlossen
     2021-05-27 08:03:32   inverter_processing_time 0.6018
     2021-05-27 08:03:32   modulstate      normal
     2021-05-27 08:03:32   operation_time  4735.3
     2021-05-27 08:03:32   opertime_start  27.05.2021 03:44:16
     2021-05-27 08:03:32   opertime_stop   27.05.2021 23:00:29
     2021-05-27 08:03:32   pac_max_phase_1 6000
     2021-05-27 08:03:32   pac_max_phase_2 0
     2021-05-27 08:03:32   pac_max_phase_3 0
     2021-05-27 08:03:32   phase_1_iac     39.640
     2021-05-27 08:03:32   phase_1_pac     0.240
     2021-05-27 08:03:32   phase_1_uac     228.95
     2021-05-27 08:03:32   phase_2_iac     40.007
     2021-05-27 08:03:32   phase_2_pac     0.240
     2021-05-27 08:03:32   phase_2_uac     229.36
     2021-05-27 08:03:32   phase_3_iac     39.398
     2021-05-27 08:03:32   phase_3_pac     0.237
     2021-05-27 08:03:32   phase_3_uac     229.06
     2021-05-27 08:03:32   serial_number   3007788841
     2021-05-27 08:03:32   state           0.717
     2021-05-27 08:03:32   string_1_idc    1.142
     2021-05-27 08:03:32   string_1_pdc    0.392
     2021-05-27 08:03:32   string_1_udc    344.93
     2021-05-27 08:03:32   string_2_idc    1.193
     2021-05-27 08:03:32   string_2_pdc    0.356
     2021-05-27 08:03:32   string_2_udc    299.94
     2021-05-27 08:03:32   susyid          378 - SN: 3007788841
     2021-05-27 08:03:32   total_pac       0.717
     2021-05-27 08:03:32   total_pac_fc    0.717
Attributes:
   DbLogExclude .*
   DbLogInclude total_pac,etoday,etotal
   SBFSpotComp 1
   alias      SMA Wechselrichter
   detail-level 2
   event-on-change-reading total_pac,etoday,etotal,state
   event-on-update-reading state,modulstate
   icon       measure_power
   interval   60
   mode       manual
   offset     3600
   room       Photovoltaik
   showproctime 1
   stateFormat PV-aktuell: <font color="White"><b>[$name:total_pac] W</b></font><br>PV-heute: <font color="White">[$name:etoday] Wh</font><br>
   suppressSleep 0
   target-serial 3007788841
   target-susyid 378
   timeout    90
   userReadings etotal_fc:modulstate.* {
                         if (ReadingsVal($name, "etotal", 8000) < 8000) {
                           ReadingsVal($name, "etotal", 0);
                         }
                         else {return 0}
                       },
total_pac_fc:modulstate.* {
                         if (ReadingsVal($name, "total_pac", 8) <7) {
                           ReadingsVal($name, "total_pac", 0);
                         }
                         else {return 0}
                       }
   verbose    2


VG Dieter

papa

Zitat von: DS_Starter am 26 Mai 2021, 22:59:41
Wo bekommt man "State Of Charge" her ? Bieten die Batteriedevs ein solches Reading ?
Ja, das sollte da her kommen
BananaPi + CUL868 + CUL433 + HM-UART + 1Wire

DS_Starter

Hallo Dieter,

ich vermute wie folgt.
Ich hatte dir ja den Vorschlag gemacht, die if-Bedingung so zu schreiben:


if (ReadingsVal($name, "etotal", 8000) < 7000)


Du hast etwas abgewandelt in:

if (ReadingsVal($name, "etotal", 8000) < 8000)

Wenn jetzt dein WR den fehlerhaften Wert  7615.212  (= 7615212 Wh) bringt, geht das problemlos durch weil du auf < 8000 testest. Das Reading etotal in SMAInverter sind ja kWh.

Grüße,
Heiko
ESXi@NUC+Debian+MariaDB, PV: SMA, Victron MPII+Pylontech+CerboGX
Maintainer: SSCam, SSChatBot, SSCal, SSFile, DbLog/DbRep, Log2Syslog, SolarForecast,Watches, Dashboard, PylonLowVoltage
Kaffeekasse: https://www.paypal.me/HMaaz
Contrib: https://svn.fhem.de/trac/browser/trunk/fhem/contrib/DS_Starter

DS_Starter

Hallo Batterie-User,

könnt ihr mir bitte mal ein Beispiel geben, wie ein Reading aussieht welches den Status der Batterieladung (""State Of Charge") liefert ?
ESXi@NUC+Debian+MariaDB, PV: SMA, Victron MPII+Pylontech+CerboGX
Maintainer: SSCam, SSChatBot, SSCal, SSFile, DbLog/DbRep, Log2Syslog, SolarForecast,Watches, Dashboard, PylonLowVoltage
Kaffeekasse: https://www.paypal.me/HMaaz
Contrib: https://svn.fhem.de/trac/browser/trunk/fhem/contrib/DS_Starter

habl

Zitat von: DS_Starter am 27 Mai 2021, 17:54:48
Hallo Batterie-User,

könnt ihr mir bitte mal ein Beispiel geben, wie ein Reading aussieht welches den Status der Batterieladung (""State Of Charge") liefert ?

das ist doch das mindeste was ich tun kann :-)

Internals:
   .FhemMetaInternals 1
   CFGFN     
   DEF        PASSWORT IP-ADRESSE
   FUUID      60afcdfb-f33f-b755-ec0b-beb907f835da7afe
   FVERSION   76_SMAInverter.pm:v2.14.1-s23909/2021-03-07
   HOST       1IP-ADRESSE
   INTERVAL   60
   LASTUPDATE 27.05.2021 / 18:54:52
   NAME       SmaBtWr
   NR         45048
   PASS       PASSWORT
   STATE      -10
   TYPE       SMAInverter
   .attraggr:
   .attrminint:
   HELPER:
     DEFAULT_TARGET_SERIAL SERIENNUMMER
     DEFAULT_TARGET_SUSYID 65535
     FAULTEDCYCLES 1
     INTERVAL   60
     MAXBYTES   300
     MYSERIALNUMBER SERIENNUMMER
     MYSUSYID   233
     PACKAGE    main
     PKT_ID     32769
     VERSION    2.14.1
   READINGS:
     2021-05-27 18:54:52   BAT_CYCLES      18
     2021-05-27 18:54:52   BAT_IDC         5.361
     2021-05-27 18:54:52   BAT_LOADTODAY   0
     2021-05-27 18:54:52   BAT_LOADTOTAL   181698
     2021-05-27 18:54:52   BAT_TEMP        568
     2021-05-27 18:54:52   BAT_UDC         2.5
     2021-05-27 18:54:52   ChargeStatus    98
     2021-05-27 18:54:52   INV_CLASS       Batterie-Wechselrichter
     2021-05-27 18:54:52   INV_PACMAX1     0
     2021-05-27 18:54:52   INV_PACMAX2     0
     2021-05-27 18:54:52   INV_PACMAX3     0
     2021-05-27 18:54:52   INV_STATUS      Ok
     2021-05-27 18:54:52   INV_TYPE        9475
     2021-05-27 18:54:52   POWER_IN        10
     2021-05-27 18:54:52   POWER_OUT       0
     2021-05-27 18:54:52   SPOT_ETODAY     0
     2021-05-27 18:54:52   SPOT_ETOTAL     136725
     2021-05-27 18:54:52   SPOT_FREQ       50
     2021-05-27 18:54:52   SPOT_IAC1       1.014
     2021-05-27 18:54:52   SPOT_IAC2       0
     2021-05-27 18:54:52   SPOT_IAC3       0
     2021-05-27 18:54:52   SPOT_PAC1       -9
     2021-05-27 18:54:52   SPOT_PAC2       0
     2021-05-27 18:54:52   SPOT_PAC3       0
     2021-05-27 18:54:52   SPOT_PACTOT     -10
     2021-05-27 18:54:52   SPOT_UAC1       225.44
     2021-05-27 18:54:52   SPOT_UAC2       0
     2021-05-27 18:54:52   SPOT_UAC3       0
     2021-05-27 18:54:52   SUSyID          370
     2021-05-27 18:54:52   Serialnumber    3010759352
     2021-05-27 18:54:52   modulstate      normal
     2021-05-27 18:54:52   opertime_start  27.05.2021 04:27:48
     2021-05-27 18:54:52   opertime_stop   27.05.2021 22:27:29
     2021-05-27 18:54:52   state           -10
Attributes:
   detail-level 2
   target-serial 3010759352
   target-susyid 370


VG
  habl

DS_Starter

ESXi@NUC+Debian+MariaDB, PV: SMA, Victron MPII+Pylontech+CerboGX
Maintainer: SSCam, SSChatBot, SSCal, SSFile, DbLog/DbRep, Log2Syslog, SolarForecast,Watches, Dashboard, PylonLowVoltage
Kaffeekasse: https://www.paypal.me/HMaaz
Contrib: https://svn.fhem.de/trac/browser/trunk/fhem/contrib/DS_Starter

dk3572

Zitat von: DS_Starter am 27 Mai 2021, 17:44:25
Hallo Dieter,

ich vermute wie folgt.
Ich hatte dir ja den Vorschlag gemacht, die if-Bedingung so zu schreiben:


if (ReadingsVal($name, "etotal", 8000) < 7000)


Du hast etwas abgewandelt in:

if (ReadingsVal($name, "etotal", 8000) < 8000)

Wenn jetzt dein WR den fehlerhaften Wert  7615.212  (= 7615212 Wh) bringt, geht das problemlos durch weil du auf < 8000 testest. Das Reading etotal in SMAInverter sind ja kWh.

Grüße,
Heiko

Hallo Heiko,

mit <7000 wäre zu jetzigem Zeitpunkt das Reading etotal_fc = 0, weil ja etotal >7000 ist.  ???

etotal     7633.369     2021-05-27 20:00:04

DS_Starter

Ah ja stimmt. Das ist blöd.
Dann müsste man vllt. die if-Bedingung abändern und prüfen ob die aktuelle Uhrzeit größer ist als 06:00 um den Bereich darunter auszublenden.
Schön ist das nicht wirklich. Möglicherweise macht es bei dir Sinn, die WR Abfrage mit Modbus zu erledigen ?
Zumindest vllt. mal testen ob damit das Problem erledigt wäre.

LG
ESXi@NUC+Debian+MariaDB, PV: SMA, Victron MPII+Pylontech+CerboGX
Maintainer: SSCam, SSChatBot, SSCal, SSFile, DbLog/DbRep, Log2Syslog, SolarForecast,Watches, Dashboard, PylonLowVoltage
Kaffeekasse: https://www.paypal.me/HMaaz
Contrib: https://svn.fhem.de/trac/browser/trunk/fhem/contrib/DS_Starter

DS_Starter

Was mir auch noch einfällt ist die Nutzung von OldReadingsNum (http://fhem.de/commandref_DE.html#perl).

Du nimmst immer die Differenz zwischen ReadingsNum (... etotal ...) und  OldReadingsNum (... etotal ...) und wenn die Diff nicht größer ist als zB. einen Tageswert Erzeugung ist der Wert von etotal gültig und damit setzt du dann dein UserReading.

Du musst dazu das Attr oldreadings entsprechend setzen.

Könnte klappen.
ESXi@NUC+Debian+MariaDB, PV: SMA, Victron MPII+Pylontech+CerboGX
Maintainer: SSCam, SSChatBot, SSCal, SSFile, DbLog/DbRep, Log2Syslog, SolarForecast,Watches, Dashboard, PylonLowVoltage
Kaffeekasse: https://www.paypal.me/HMaaz
Contrib: https://svn.fhem.de/trac/browser/trunk/fhem/contrib/DS_Starter

habl

zumindest lassen sich per Modbus einfach die  falschen Werte ignorieren, die m.E. immer wieder auftauchen wenn ein Update von SMA eingespielt wird (da bin ich noch am testen ob dem wirklich so ist)

dev-h-defIgnoreExpr (( $val==536870911 ) || ( $val ==2147483648 ))

wenn Du umbauen willst, hier mal die Def von meiner Tripower:
defmod PVA_PV ModbusAttr 3  2 IP-ADRESSE:502  TCP
attr PVA_PV dev-h-defIgnoreExpr (( $val==536870911 ) || ( $val ==2147483648 ))
attr PVA_PV dev-h-defLen 2
attr PVA_PV dev-h-defPoll 1
attr PVA_PV dev-h-defUnpack N
attr PVA_PV devStateIcon ok:on fault:message_attention warnings:message_attention
attr PVA_PV enableControlSet 1
attr PVA_PV event-on-change-reading Wirkleistung,Tagesertrag,SoftVersion,SoftVersionKomm
attr PVA_PV obj-h30059-polldelay 3600
attr PVA_PV obj-h30059-reading SoftVersion
attr PVA_PV obj-h30201-map 35:fault,303:off,307:ok,455:warnings
attr PVA_PV obj-h30201-polldelay 300
attr PVA_PV obj-h30201-reading state
attr PVA_PV obj-h30217-map 51:geschlossen,311:offen,16777213:unbekannt
attr PVA_PV obj-h30217-polldelay 300
attr PVA_PV obj-h30217-reading Netzrelais
attr PVA_PV obj-h30219-map 557:Übertemperatur,884:nicht aktiv,1705:Frequenzabweichung,3520:Spannungsabweichung,3554:Blindleistungspriorität,3556:Hohe DC-Spannung,4560:Externer Vorgabe,4561:Externe Vorgabe 2,16777213:Unbekannt
attr PVA_PV obj-h30219-polldelay 300
attr PVA_PV obj-h30219-reading PReduzierung
attr PVA_PV obj-h30529-reading Gesamtertrag
attr PVA_PV obj-h30535-reading Tagesertrag
attr PVA_PV obj-h30559-polldelay 300
attr PVA_PV obj-h30559-reading Benutzerereignisse
attr PVA_PV obj-h30581-reading NetzBezugZaehler
attr PVA_PV obj-h30583-reading NetzEinspZaehler
attr PVA_PV obj-h30599-polldelay 300
attr PVA_PV obj-h30599-reading Netzzuschaltungen
attr PVA_PV obj-h30775-reading Wirkleistung
attr PVA_PV obj-h30865-reading NetzBezug
attr PVA_PV obj-h30867-reading NetzEinspeisung
attr PVA_PV obj-h30881-map 1779:Getrennt,1780:Stromnetz,1781:Inselnetz,16777213:Unbekannt
attr PVA_PV obj-h30881-polldelay 300
attr PVA_PV obj-h30881-reading Anbindung
attr PVA_PV obj-h30953-expr ($val  & 0xFFF) / 10
attr PVA_PV obj-h30953-polldelay 300
attr PVA_PV obj-h30953-reading Temperatur
attr PVA_PV obj-h31247-expr ($val / 1000)
attr PVA_PV obj-h31247-polldelay 300
attr PVA_PV obj-h31247-reading FehlerStrom
attr PVA_PV obj-h33001-map 1393:Warte auf PV-Spannung,1394: Warte auf gültiges AC-Netz,2531: Energiesparmodus,16777213: Unbekannt
attr PVA_PV obj-h33001-polldelay 300
attr PVA_PV obj-h33001-reading StandbyStatus
attr PVA_PV obj-h40009-map 381:Stopp,1467:Start,295:MPP,381:Stopp,443:Konstantspannung,1855:Stand-Alone Operation,3128:Fernsteuerung durch Service
attr PVA_PV obj-h40009-polldelay 3600
attr PVA_PV obj-h40009-reading AllgemeineBetriebsart
attr PVA_PV obj-h40029-map 295:MPP,303:Aus,381:Stopp,569:Eingeschaltet,1295:Standby,1392:Fehler,1393:Warten auf DC-Startbedingungen,1467:Start,1469:Herunterfahren,1480:Warten auf EVU,1795:Verriegelt,2119:Abregelung,16777213:Unbekannt
attr PVA_PV obj-h40029-polldelay 150
attr PVA_PV obj-h40029-reading Betriebszustand
attr PVA_PV obj-h40789-polldelay 3600
attr PVA_PV obj-h40789-reading SoftVersionKomm
attr PVA_PV room PVA
attr PVA_PV stateFormat {sprintf("%.2f kWh Tagesertrag <a href=\"http://IP-ADRESSE/#/smartView\" target=\"_blank\" rel=\"noopener noreferrer\">WebSite</a>", ReadingsVal($name,"Tagesertrag",0)/1000)}
attr PVA_PV userReadings website {"<a href=\"http://IP-ADRESSE/#/smartView\" target=\"_blank\" rel=\"noopener noreferrer\">WebSite</a>"}


VG
  habl


dk3572

Zitat von: DS_Starter am 27 Mai 2021, 20:35:23
Was mir auch noch einfällt ist die Nutzung von OldReadingsNum (http://fhem.de/commandref_DE.html#perl).

Du nimmst immer die Differenz zwischen ReadingsNum (... etotal ...) und  OldReadingsNum (... etotal ...) und wenn die Diff nicht größer ist als zB. einen Tageswert Erzeugung ist der Wert von etotal gültig und damit setzt du dann dein UserReading.

Du musst dazu das Attr oldreadings entsprechend setzen.

Könnte klappen.

ehrlich gesagt verstehe ich grad nicht was etotal im WR eigentlich ist.
Das soll doch die gesamte Energie des Tages sein.
Die ist bei mir aber von Tagesbeginn an bei knapp über 7000.
Kann das stimmen?

Wie soll dein Vorschlag aussehen? So in etwa?

etotal_fc:modulstate.* {
                         if (ReadingsNum($name, "etotal") - (OldReadingsNum($name, "etotal")< 7000) {
                           ReadingsVal($name, "etotal", 0);
                         }
                         else {return 0}

Ich blicke leider nicht mehr durch  ??? :-[