Autor Thema: [geloest] hilfe bei userreading  (Gelesen 1667 mal)

Offline brain666

  • Jr. Member
  • **
  • Beiträge: 68
[geloest] hilfe bei userreading
« am: 10 Mai 2022, 10:20:29 »
Servus zusammen,

könnte mir evtl. jemand helfen bei dem userreading

Ich möchte wenn autakrechner > 0 ist dann rechnen eigenverbrauchtag / autakrechner

autak {if(ReadingsVal("Strom_Zaehler","autakrechner","") > 0) {sprintf("%0.1f ", ReadingsNum("Strom_Zaehler","eigenverbrauchtag",0)/ReadingsNum("Strom_Zaehler","autakrechner",0))}}

mein Anfang war so

autak {sprintf("%0.1f ", ReadingsNum("Strom_Zaehler","eigenverbrauchtag",0)/ReadingsNum("Strom_Zaehler","autakrechner",0))}
[Code]

da bekomme ich aber im log wenn der wert durch 0 geteilt wird folgenden fehler
[code]
2022.05.10 01:15:57 1: Error evaluating Strom_Zaehler userReading autak: Illegal division by zero at (eval 1632509) line 1.
« Letzte Änderung: 10 Mai 2022, 14:43:26 von brain666 »

Offline Beta-User

  • Moderator
  • Hero Member
  • ***
  • Beiträge: 18908
Antw:hilfe bei userreading
« Antwort #1 am: 10 Mai 2022, 10:38:52 »
Vorab:
- Auszüge ohne Kontext sind extrem schwierig für Helfer! https://forum.fhem.de/index.php/topic,71806.0.html gilt prinzipiell auch in diesem Forenbereich.
- userReadings ohne Trigger sind MIST!
- wenn userReadings Werte aus dem Stammdevice lesen, sollte man $name verwenden. Ist zwar mehr Rechenaufwand, aber dafür "rename-fest".

Von daher "ins Blaue":autak:eigenverbrauchtag:.* {if(ReadingsNum($name,'autakrechner',0) > 0) {sprintf("%0.1f ", (ReadingsNum($name,'eigenverbrauchtag',0)/ReadingsNum($name,'autakrechner',0)))}}
Anmerkungen:
- Wenn du rechnen willst, solltest du überall ausdrücklich nach der Nummer fragen (es sei denn, du bist sicher, dass da nur numerische Werte stehen)
- Wenn du ein Zwischenergebnis weiterverwenden willst, musst du entweder kenntlich machen, wo du ein solches benötigst (das macht hoffentlich die zusätzliche Klammer), oder eben vorher rechnen, das ganze in eine Variable packen und "hinten" dann die Variable hinschreiben. Falls das mit der Klammer nicht hinhaut, bitte vorab einen eigenen Versuch mit Variable unternehmen...
- ob der "trigger" tauglich ist, kann ich nicht beurteilen. Vom Namen her ist das auch ein userReading, das dann vorher stehen sollte und v.a. auch wieder sauber getriggert werden sollte (!).
Server: HP-T620@Debian 11, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

Offline brain666

  • Jr. Member
  • **
  • Beiträge: 68
Antw:hilfe bei userreading
« Antwort #2 am: 10 Mai 2022, 11:37:23 »
danke dir

ich werde mal testen und mein devices noch weiter anpassen.

Internals:
   .FhemMetaInternals 1
   CID        DVES_555CB9
   DEF        DVES_555CB9
   FUUID      62741621-f33f-078c-ea5b-754ebc3723a747a1
   FVERSION   10_MQTT2_DEVICE.pm:0.258890/2022-03-27
   IODev      m2s
   LASTInputDev m2s
   MSGCNT     190
   NAME       Strom_Zaehler
   NR         639
   STATE      | 1.8 kWh <span style='color:#FF0000'>0.52 €</span>
| Gestern: 3.2 kWh <span style='color:#FF0000'>0.93 €</span>
<br>| Monat: 17.3 kWh <span style='color:#FF0000'>5.02 €</span>
| Jahr: 1756.3 kWh <span style='color:#FF0000'>509.33 €</span>
<br>| Eigenverbrauch Tag:<span style='color:#FF0000'>1.1 kWh</span>
| Verkauft an Eon heute:<span style='color:#00CC00'>5.3 kWh</span>
| Autak: <span style='color:#00CC00'>41.3 %</span>
|
   TYPE       MQTT2_DEVICE
   m2s_CONN   m2s_192.168.188.141_51641
   m2s_MSGCNT 190
   m2s_TIME   2022-05-10 11:32:03
   .DT:
     DEVICETOPIC Strom_Zaehler
   .attraggr:
   .attrminint:
   .userReadings:
     HASH(0x55b363cab408)
     HASH(0x55b3641c9150)
     HASH(0x55b363cf3450)
     HASH(0x55b365b0c8d8)
     HASH(0x55b364697c78)
     HASH(0x55b363c54418)
     HASH(0x55b365039768)
     HASH(0x55b3650353d8)
     HASH(0x55b3654741b0)
     HASH(0x55b363a69a78)
     HASH(0x55b3648b0168)
     HASH(0x55b363c5a040)
     HASH(0x55b3654b64d8)
     HASH(0x55b365007220)
   READINGS:
     2022-05-06 10:45:23   INFO1_Info1_FallbackTopic cmnd/DVES_555CB9_fb/
     2022-05-06 10:45:23   INFO1_Info1_GroupTopic cmnd/tasmotas/
     2022-05-06 10:45:23   INFO1_Info1_Module eHZ
     2022-05-06 10:45:23   INFO1_Info1_Version 9.4.0.1(tasmota)
     2022-05-06 10:45:23   INFO2_Info2_Hostname tasmota_555CB9-7353
     2022-05-06 10:45:23   INFO2_Info2_IPAddress 192.168.188.141
     2022-05-06 10:45:23   INFO2_Info2_WebServerMode Admin
     2022-05-06 10:45:23   INFO3_Info3_RestartReason External System
     2022-05-10 09:57:42   IODev           m2s
     2022-05-10 09:58:06   LWT             Online
     2022-05-05 22:29:12   RESULT_LogHost 
     2022-05-05 22:29:12   RESULT_LogPort  514
     2022-05-05 22:29:12   RESULT_MqttLog  0
     2022-05-05 22:29:12   RESULT_SerialLog_0_Active 0
     2022-05-05 22:29:12   RESULT_SysLog_0_Active 0
     2022-05-05 22:29:12   RESULT_TelePeriod 60
     2022-05-05 22:29:12   RESULT_WebLog   2
     2022-05-10 11:32:03   SENSOR_SOLAR_Total_exZ2 0.0000
     2022-05-10 11:32:03   SENSOR_SOLAR_Total_inZ2 0.0000
     2022-05-05 20:56:44   SENSOR_STROM_Meter_number
     2022-05-10 11:32:03   SENSOR_STROM_Total_exZ1 60161.8000
     2022-05-05 20:56:44   SENSOR_STROM_Total_in 0.000
     2022-05-10 11:32:03   SENSOR_STROM_Total_inZ1 30463.5000
     2022-05-05 20:56:44   SENSOR_STROM_Total_out 0.000
     2022-05-10 11:32:03   SENSOR_Time     2022-05-10T11:32:02
     2022-05-10 11:32:03   STATE_Heap      21
     2022-05-10 11:32:03   STATE_LoadAvg   19
     2022-05-10 11:32:03   STATE_MqttCount 74
     2022-05-10 11:32:03   STATE_Sleep     50
     2022-05-10 11:32:03   STATE_SleepMode Dynamic
     2022-05-10 11:32:03   STATE_Time      2022-05-10T11:32:02
     2022-05-10 11:32:03   STATE_Uptime    4T00:46:44
     2022-05-10 11:32:03   STATE_UptimeSec 348404
     2022-05-10 11:32:03   STATE_Wifi_AP   1
     2022-05-10 11:32:03   STATE_Wifi_BSSId CC:CE:1E:9F:53:21
     2022-05-10 11:32:03   STATE_Wifi_Channel 11
     2022-05-10 11:32:03   STATE_Wifi_Downtime 0T00:07:53
     2022-05-10 11:32:03   STATE_Wifi_LinkCount 65
     2022-05-10 11:32:03   STATE_Wifi_RSSI 58
     2022-05-10 11:32:03   STATE_Wifi_SSId EM WLAN
     2022-05-10 11:32:03   STATE_Wifi_Signal -71
     2022-05-10 11:32:03   Verbrauch       0
     2022-05-10 11:32:03   autak           41.3
     2022-05-10 11:32:03   autakrechner    0.03
     2022-05-06 10:45:32   config_btn_1    0
     2022-05-06 10:45:32   config_btn_2    0
     2022-05-06 10:45:32   config_btn_3    0
     2022-05-06 10:45:32   config_btn_4    0
     2022-05-06 10:45:32   config_btn_5    0
     2022-05-06 10:45:32   config_btn_6    0
     2022-05-06 10:45:32   config_btn_7    0
     2022-05-06 10:45:32   config_btn_8    0
     2022-05-06 10:45:32   config_dn       Zähler 1
     2022-05-06 10:45:32   config_fn_1     Zähler 1
     2022-05-06 10:45:32   config_ft       %prefix%/%topic%/
     2022-05-06 10:45:32   config_hn       tasmota_555CB9-7353
     2022-05-06 10:45:32   config_if       0
     2022-05-06 10:45:32   config_ip       192.168.188.141
     2022-05-06 10:45:32   config_lk       1
     2022-05-06 10:45:32   config_lt_st    0
     2022-05-06 10:45:32   config_mac      C45BBE555CB9
     2022-05-06 10:45:32   config_md       eHZ
     2022-05-06 10:45:32   config_ofln     Offline
     2022-05-06 10:45:32   config_onln     Online
     2022-05-06 10:45:32   config_rl_1     0
     2022-05-06 10:45:32   config_rl_2     0
     2022-05-06 10:45:32   config_rl_3     0
     2022-05-06 10:45:32   config_rl_4     0
     2022-05-06 10:45:32   config_rl_5     0
     2022-05-06 10:45:32   config_rl_6     0
     2022-05-06 10:45:32   config_rl_7     0
     2022-05-06 10:45:32   config_rl_8     0
     2022-05-06 10:45:32   config_sho_1    0
     2022-05-06 10:45:32   config_sho_2    0
     2022-05-06 10:45:32   config_sho_3    0
     2022-05-06 10:45:32   config_sho_4    0
     2022-05-06 10:45:32   config_so_11    0
     2022-05-06 10:45:32   config_so_114   0
     2022-05-06 10:45:32   config_so_117   0
     2022-05-06 10:45:32   config_so_13    0
     2022-05-06 10:45:32   config_so_17    0
     2022-05-06 10:45:32   config_so_20    0
     2022-05-06 10:45:32   config_so_30    0
     2022-05-06 10:45:32   config_so_4     0
     2022-05-06 10:45:32   config_so_68    0
     2022-05-06 10:45:32   config_so_73    0
     2022-05-06 10:45:32   config_so_82    0
     2022-05-06 10:45:32   config_state_1  OFF
     2022-05-06 10:45:32   config_state_2  ON
     2022-05-06 10:45:32   config_state_3  TOGGLE
     2022-05-06 10:45:32   config_state_4  HOLD
     2022-05-06 10:45:32   config_sw       9.4.0.1
     2022-05-06 10:45:32   config_swc_1    -1
     2022-05-06 10:45:32   config_swc_2    -1
     2022-05-06 10:45:32   config_swc_3    -1
     2022-05-06 10:45:32   config_swc_4    -1
     2022-05-06 10:45:32   config_swc_5    -1
     2022-05-06 10:45:32   config_swc_6    -1
     2022-05-06 10:45:32   config_swc_7    -1
     2022-05-06 10:45:32   config_swc_8    -1
     2022-05-06 10:45:32   config_t        tasmota_555CB9
     2022-05-06 10:45:32   config_tp_1     cmnd
     2022-05-06 10:45:32   config_tp_2     stat
     2022-05-06 10:45:32   config_tp_3     tele
     2022-05-06 10:45:32   config_ty       0
     2022-05-06 10:45:32   config_ver      1
     2022-05-10 11:32:03   eigen           30463.5
     2022-05-10 11:32:03   eigenverbrauch  16431.28
     2022-05-10 11:32:03   eigenverbrauchtag 1.14
     2022-05-10 11:32:03   eingespeist     5.30
     2022-05-10 11:32:03   kostenjahr      509.33
     2022-05-10 11:32:03   kostenmonat     5.02
     2022-05-10 11:32:03   kostentag       0.52
     2022-05-10 11:32:03   kostentaggestern 0.93
     2022-05-06 10:45:32   sensors_sn_SOLAR_Total_exZ2 0.0000
     2022-05-06 10:45:32   sensors_sn_SOLAR_Total_inZ2 0.0000
     2022-05-05 20:56:49   sensors_sn_STROM_Meter_number
     2022-05-06 10:45:32   sensors_sn_STROM_Total_exZ1 0.0000
     2022-05-05 20:56:49   sensors_sn_STROM_Total_in 0.000
     2022-05-06 10:45:32   sensors_sn_STROM_Total_inZ1 0.0000
     2022-05-05 20:56:49   sensors_sn_STROM_Total_out 0.000
     2022-05-06 10:45:32   sensors_sn_Time 2022-05-06T10:45:32
     2022-05-06 10:45:32   sensors_ver     1
     2022-05-10 11:32:03   solar           60161.8
     2022-05-10 11:32:03   statSENSOR_STROM_Total_exZ1 Hour: 1.6000 Day: 5.3000 Month: 105.6000 Year: 105.6000 (since: 2022-05-07 )
     2022-05-10 11:32:03   statSENSOR_STROM_Total_exZ1Day 5.3000
     2022-05-09 23:59:55   statSENSOR_STROM_Total_exZ1DayLast 41.7000
     2022-05-10 11:32:03   statSENSOR_STROM_Total_exZ1Hour 1.6000
     2022-05-10 10:59:55   statSENSOR_STROM_Total_exZ1HourLast 1.7000
     2022-05-10 10:59:55   statSENSOR_STROM_Total_exZ1Last Hour: 1.7000 Day: 41.7000 Month: - Year: -
     2022-05-10 11:32:03   statSENSOR_STROM_Total_exZ1Month 105.6000
     2022-05-10 11:32:03   statSENSOR_STROM_Total_exZ1Year 105.6000
     2022-05-10 11:32:03   statSENSOR_STROM_Total_inZ1 Hour: 0.0000 Day: 1.8000 Month: 17.3000 Year: 1756.3000 (since: 2022-05-06 )
     2022-05-10 11:32:03   statSENSOR_STROM_Total_inZ1Day 1.8000
     2022-05-09 23:59:55   statSENSOR_STROM_Total_inZ1DayLast 3.2000
     2022-05-10 11:32:03   statSENSOR_STROM_Total_inZ1Hour 0.0000
     2022-05-10 10:59:55   statSENSOR_STROM_Total_inZ1HourLast 0.0000
     2022-05-10 10:59:55   statSENSOR_STROM_Total_inZ1Last Hour: 0.0000 Day: 3.2000 Month: - Year: -
     2022-05-10 11:32:03   statSENSOR_STROM_Total_inZ1Month 17.3000
     2022-05-10 11:32:03   statSENSOR_STROM_Total_inZ1Year 1756.3000
     2022-05-10 11:32:03   state           1.8
     2022-05-10 11:32:03   state2          1.8
     2022-05-10 09:58:41   subscriptions   cmnd/DVES_555CB9_fb/# cmnd/tasmota_555CB9/# cmnd/tasmotas/#
   helper:
     _98_statistics Strom_Statistikex
Attributes:
   group      stromem
   readingList DVES_555CB9:tele/tasmota_555CB9/LWT:.* LWT
DVES_555CB9:tele/tasmota_555CB9/INFO1:.* { json2nameValue($EVENT, 'INFO1_', $JSONMAP) }
DVES_555CB9:tele/tasmota_555CB9/INFO2:.* { json2nameValue($EVENT, 'INFO2_', $JSONMAP) }
DVES_555CB9:tele/tasmota_555CB9/INFO3:.* { json2nameValue($EVENT, 'INFO3_', $JSONMAP) }
DVES_555CB9:tele/tasmota_555CB9/STATE:.* { json2nameValue($EVENT, 'STATE_', $JSONMAP) }
DVES_555CB9:tele/tasmota_555CB9/SENSOR:.* { json2nameValue($EVENT, 'SENSOR_', $JSONMAP) }
DVES_555CB9:tasmota/discovery/C45BBE555CB9/config:.* { json2nameValue($EVENT, 'config_', $JSONMAP) }
DVES_555CB9:tasmota/discovery/C45BBE555CB9/sensors:.* { json2nameValue($EVENT, 'sensors_', $JSONMAP) }
DVES_555CB9:stat/tasmota_555CB9/RESULT:.* { json2nameValue($EVENT, 'RESULT_', $JSONMAP) }
   room       0.3_Solaranlagen,MQTT2_DEVICE
   stateFormat | [$name:statSENSOR_STROM_Total_inZ1Day:r1] kWh <span style='color:#FF0000'>[$name:kostentag:r2] €</span>
| Gestern: [$name:statSENSOR_STROM_Total_inZ1DayLast:r1] kWh <span style='color:#FF0000'>[$name:kostentaggestern:r2] €</span>
<br>| Monat: [$name:statSENSOR_STROM_Total_inZ1Month:r1] kWh <span style='color:#FF0000'>[$name:kostenmonat:r2] €</span>
| Jahr: [$name:statSENSOR_STROM_Total_inZ1Year:r1] kWh <span style='color:#FF0000'>[$name:kostenjahr:r2] €</span>
<br>| Eigenverbrauch Tag:<span style='color:#FF0000'>[$name:eigenverbrauchtag:r1] kWh</span>
| Verkauft an Eon heute:<span style='color:#00CC00'>[$name:eingespeist:r1] kWh</span>
| Autak: <span style='color:#00CC00'>[$name:autak:r1] %</span>
|
   userReadings state {ReadingsVal($name,"state2","")}, Verbrauch difference {1000*ReadingsVal($name,"state2",0);;},
state2 {sprintf("%0.1f ", ReadingsNum($name,"statSENSOR_STROM_Total_inZ1Day",0))},
eigen {sprintf("%0.1f ", ReadingsNum($name,"SENSOR_STROM_Total_inZ1",0))},
solar {sprintf("%0.1f ", ReadingsNum($name,"SENSOR_STROM_Total_exZ1",0))},
kostentag {sprintf("%0.2f ", ReadingsNum($name,"statSENSOR_STROM_Total_inZ1Day",0)*ReadingsNum("einstellung_Strompreis_je_KWH","state",0)/100)},
kostenmonat {sprintf("%0.2f ", ReadingsNum($name,"statSENSOR_STROM_Total_inZ1Month",0)*ReadingsNum("einstellung_Strompreis_je_KWH","state",0)/100)},
kostenjahr {sprintf("%0.2f ", ReadingsNum($name,"statSENSOR_STROM_Total_inZ1Year",0)*ReadingsNum("einstellung_Strompreis_je_KWH","state",0)/100)},
kostentaggestern {sprintf("%0.2f ", ReadingsNum($name,"statSENSOR_STROM_Total_inZ1DayLast",0)*ReadingsNum("einstellung_Strompreis_je_KWH","state",0)/100)},
eigenverbrauch {sprintf("%0.2f ", ReadingsNum("MQTT2_m2s","total",0)-ReadingsNum($name,"SENSOR_STROM_Total_exZ1",0))},
eigenverbrauchtag {sprintf("%0.2f ", ReadingsNum("MQTT2_m2s","statTotalDay",0)-ReadingsNum($name,"statSENSOR_STROM_Total_exZ1Day",0))},
eingespeist {sprintf("%0.2f ", ReadingsNum("MQTT2_m2s","statTotalDay",0)-ReadingsNum("Strom_Zaehler","eigenverbrauchtag",0))},
autakrechner {sprintf("%0.2f ", ReadingsNum($name,"statSENSOR_STROM_Total_inZ1Day",0)/100+ReadingsNum($name,"eigenverbrauchtag",0)/100)},
autak:eigenverbrauchtag:.* {if(ReadingsNum($name,'autakrechner',0) > 0) {sprintf("%0.1f ", (ReadingsNum($name,'eigenverbrauchtag',0)/ReadingsNum($name,'autakrechner',0)))}}

Internals:
   .FhemMetaInternals 1
   CID        m2s
   DEF        m2s
   FUUID      62066115-f33f-078c-db6a-8d54d7fb199964d7
   FVERSION   10_MQTT2_DEVICE.pm:0.258890/2022-03-27
   IODev      m2s
   LASTInputDev m2s
   MSGCNT     46
   NAME       MQTT2_m2s
   NR         430
   STATE      ???
   TYPE       MQTT2_DEVICE
   m2s_CONN   m2s_127.0.0.1_54830
   m2s_MSGCNT 46
   m2s_TIME   2022-05-10 11:35:10
   .DT:
     DEVICETOPIC MQTT2_m2s
   .attraggr:
   .attrminint:
   .userReadings:
     HASH(0x55b363c61d70)
     HASH(0x55b363c97ca0)
     HASH(0x55b3640cb028)
     HASH(0x55b365b1fd00)
   READINGS:
     2022-05-10 09:57:42   IODev           m2s
     2022-04-20 09:11:23   Klaus_AGE       34
     2022-05-10 11:35:10   Klaus_EToday    6.433
     2022-05-10 11:35:10   Klaus_ETotal    48744.794
     2022-05-10 11:35:10   Klaus_IDC1      4.798
     2022-05-10 11:35:10   Klaus_IDC2      3.708
     2022-05-10 11:35:10   Klaus_InvGridRelay Geschlossen
     2022-05-10 11:35:10   Klaus_InvName   SN: 2130012027
     2022-05-10 11:35:10   Klaus_InvSerial 2130012027
     2022-05-10 11:35:10   Klaus_InvStatus Ok
     2022-05-10 11:35:10   Klaus_InvTemperature 53.890
     2022-05-10 11:35:10   Klaus_InvTime   10/05/2022 11:35:03
     2022-04-20 09:11:23   Klaus_NAME      ATOM
     2022-05-10 11:35:10   Klaus_PACTot    2489.000
     2022-03-29 13:49:37   Klaus_PACTot2   2503
     2022-05-10 11:35:10   Klaus_PDC1      1310.000
     2022-05-10 11:35:10   Klaus_PDC2      1304.000
     2022-05-10 11:35:10   Klaus_SunRise   10/05/2022 06:02:00
     2022-05-10 11:35:10   Klaus_SunSet    10/05/2022 21:16:00
     2022-05-10 11:35:10   Klaus_Timestamp 10/05/2022 11:35:10
     2022-05-10 11:35:10   Klaus_UDC1      273.080
     2022-05-10 11:35:10   Klaus_UDC2      351.270
     2022-04-20 09:17:11   Klaus_dd/MM/yyyy 09/02/2022
     2022-04-20 09:17:11   Klaus_kWh       1.867
     2022-05-10 11:31:18   Marco1_EToday   3.250
     2022-05-10 11:31:18   Marco1_ETotal   38579.992
     2022-05-10 11:31:18   Marco1_IDC1     2.774
     2022-05-10 11:31:18   Marco1_IDC2     2.782
     2022-05-10 11:31:18   Marco1_InvGridRelay ?
     2022-05-10 11:31:18   Marco1_InvName  SN: 2130011857
     2022-05-10 11:31:18   Marco1_InvSerial 2130011857
     2022-05-10 11:31:18   Marco1_InvStatus Ok
     2022-05-10 11:31:18   Marco1_InvTemperature 34.950
     2022-05-10 11:31:18   Marco1_InvTime  10/05/2022 11:31:00
     2022-05-10 11:31:18   Marco1_PACTot   1899.000
     2022-05-10 11:31:18   Marco1_PDC1     1010.000
     2022-05-10 11:31:18   Marco1_PDC2     1014.000
     2022-05-10 11:31:18   Marco1_SunRise  10/05/2022 06:02:00
     2022-05-10 11:31:18   Marco1_SunSet   10/05/2022 21:16:00
     2022-05-10 11:31:18   Marco1_Timestamp 10/05/2022 11:31:18
     2022-05-10 11:31:18   Marco1_UDC1     366.910
     2022-05-10 11:31:18   Marco1_UDC2     366.910
     2022-05-10 11:27:59   Marco2_EToday   3.183
     2022-05-10 11:27:59   Marco2_ETotal   38013.087
     2022-05-10 11:27:59   Marco2_IDC1     2.644
     2022-05-10 11:27:59   Marco2_IDC2     2.591
     2022-05-10 11:27:59   Marco2_InvGridRelay Geschlossen
     2022-05-10 11:27:59   Marco2_InvName  SN: 2130007075
     2022-05-10 11:27:59   Marco2_InvSerial 2130007075
     2022-05-10 11:27:59   Marco2_InvStatus Ok
     2022-05-10 11:27:59   Marco2_InvTemperature 33.910
     2022-05-10 11:27:59   Marco2_InvTime  10/05/2022 11:27:41
     2022-05-10 11:27:59   Marco2_PACTot   1810.000
     2022-05-10 11:27:59   Marco2_PDC1     961.000
     2022-05-10 11:27:59   Marco2_PDC2     943.000
     2022-05-10 11:27:59   Marco2_SunRise  10/05/2022 06:02:00
     2022-05-10 11:27:59   Marco2_SunSet   10/05/2022 21:16:00
     2022-05-10 11:27:59   Marco2_Timestamp 10/05/2022 11:27:59
     2022-05-10 11:27:59   Marco2_UDC1     367.120
     2022-05-10 11:27:59   Marco2_UDC2     367.120
     2022-05-10 11:35:10   SummPower       3709
     2022-02-16 09:05:47   SummPower1      0.022
     2022-05-10 11:35:10   SummPower100    3.7
     2022-03-29 13:58:31   Summtoday       9.706
     2022-04-20 12:21:01   ioana           13/02/2022;47274.644;15.296
     2022-05-09 20:08:20   json2nameValueErrorText json2nameValue: no closing } found
     2022-05-09 20:08:20   json2nameValueInput {"Timestamp": "09/05/2022 20:08:20","SunRise": "09/05/2022 06:03:00","SunSet": "09/05/2022 21:14:00","InvSerial": 2130007075,"InvName": ","InvTime": "09/05/2022 20:07:40","InvStatus": "?","InvTemperature": 36.890,"InvGridRelay": "?","EToday": 24.050,"ETotal": 38009.879,"PACTot": 111.000,"UDC1": 353.760,"UDC2": 374.730,"IDC1": 0.224,"IDC2": 0.250,"PDC1": 79.000,"PDC2": 94.000}
     2022-05-10 11:35:10   klauswatt       2489
     2022-02-16 09:09:05   powersume       0.022
     2022-02-20 10:20:16   statKlaus_EToday Hour: 0.113 Day: -11.764 Month: -1.467 Year: -1.467 (since: 2022-02-17 )
     2022-02-21 10:25:07   statKlaus_ETodayDay Min: 0.000 Avg: 1.309 Max: 1.670
     2022-02-20 23:59:55   statKlaus_ETodayDayLast Min: 0.000 Avg: 10.028 Max: 15.795
     2022-02-21 10:25:07   statKlaus_ETodayHour Min: 0.579 Avg: 1.010 Max: 1.225
     2022-02-21 09:59:55   statKlaus_ETodayHourLast Min: 0.088 Avg: 0.361 Max: 0.579
     2022-02-20 09:59:55   statKlaus_ETodayLast Hour: 0.097 Day: 10.680 Month: - Year: -
     2022-02-21 10:25:07   statKlaus_ETodayMonth Min: 0.000 Avg: 9.122 Max: 15.795 (since: 2022-02-15_09:57:51 )
     2022-02-21 10:25:07   statKlaus_ETodayYear Min: 0.000 Avg: 9.122 Max: 15.795 (since: 2022-02-15_09:57:51 )
     2022-05-10 11:35:10   statKlaus_ETotal Hour: 1.739 Day: 6.435 Month: 224.751 Year: 2590.481 (since: 2022-02-24 )
     2022-05-10 11:35:10   statKlaus_ETotalDay 6.435
     2022-05-09 23:59:55   statKlaus_ETotalDayLast 30.349
     2022-05-10 11:35:10   statKlaus_ETotalHour 1.739
     2022-05-10 10:59:55   statKlaus_ETotalHourLast 1.838
     2022-05-10 10:59:55   statKlaus_ETotalLast Hour: 1.838 Day: 30.349 Month: 523.138 Year: -
     2022-05-10 11:35:10   statKlaus_ETotalMonth 224.751
     2022-04-30 23:59:56   statKlaus_ETotalMonth1 523.138
     2022-04-30 23:59:56   statKlaus_ETotalMonth12 2365.730 (3 Month)
     2022-04-30 23:59:56   statKlaus_ETotalMonthLast 523.138
     2022-05-10 11:35:10   statKlaus_ETotalYear 2590.481
     2022-02-20 10:20:16   statMarco1_EToday Hour: 0.076 Day: -10.558 Month: -1.038 Year: -1.038 (since: 2022-02-17 )
     2022-02-21 10:25:07   statMarco1_ETodayDay Min: 0.000 Avg: 0.873 Max: 1.127
     2022-02-20 23:59:55   statMarco1_ETodayDayLast Min: 0.000 Avg: 8.668 Max: 13.882
     2022-02-21 10:25:07   statMarco1_ETodayHour Min: 0.306 Avg: 0.483 Max: 0.628
     2022-02-21 09:59:55   statMarco1_ETodayHourLast Min: 0.061 Avg: 0.218 Max: 0.306
     2022-02-20 09:59:55   statMarco1_ETodayLast Hour: 0.059 Day: 9.810 Month: - Year: -
     2022-02-21 10:25:07   statMarco1_ETodayMonth Min: 0.000 Avg: 7.776 Max: 13.882 (since: 2022-02-15_09:57:51 )
     2022-02-21 10:25:07   statMarco1_ETodayYear Min: 0.000 Avg: 7.776 Max: 13.882 (since: 2022-02-15_09:57:51 )
     2022-02-20 10:20:16   statMarco2_EToday Hour: 0.078 Day: -10.073 Month: -1.045 Year: -1.045 (since: 2022-02-17 )
     2022-02-21 10:25:07   statMarco2_ETodayDay Min: 0.000 Avg: 0.888 Max: 1.147
     2022-02-20 23:59:55   statMarco2_ETodayDayLast Min: 0.000 Avg: 8.264 Max: 13.371
     2022-02-21 10:25:07   statMarco2_ETodayHour Min: 0.305 Avg: 0.485 Max: 0.634
     2022-02-21 09:59:55   statMarco2_ETodayHourLast Min: 0.058 Avg: 0.216 Max: 0.305
     2022-02-20 09:59:55   statMarco2_ETodayLast Hour: 0.062 Day: 9.303 Month: - Year: -
     2022-02-21 10:25:07   statMarco2_ETodayMonth Min: 0.000 Avg: 7.446 Max: 13.371 (since: 2022-02-15_09:57:51 )
     2022-02-21 10:25:07   statMarco2_ETodayYear Min: 0.000 Avg: 7.446 Max: 13.371 (since: 2022-02-15_09:57:51 )
     2022-05-10 11:35:10   statTotal       Hour: 2.040 Day: 6.440 Month: 347.840 Year: 4160.372 (since: 2022-02-24 )
     2022-05-10 11:35:10   statTotalDay    6.440
     2022-05-09 23:59:55   statTotalDayLast 48.170
     2022-05-10 11:35:10   statTotalHour   2.040
     2022-05-10 10:59:55   statTotalHourLast 1.500
     2022-05-10 10:59:55   statTotalLast   Hour: 1.500 Day: 48.170 Month: 824.660 Year: -
     2022-05-10 11:35:10   statTotalMonth  347.840
     2022-04-30 23:59:56   statTotalMonth1 824.660
     2022-04-30 23:59:56   statTotalMonth12 3812.513 (3 Month)
     2022-04-30 23:59:56   statTotalMonthLast 824.660
     2022-05-10 11:35:10   statTotalYear   4160.372
     2022-04-20 12:20:00   test            13/02/2022;47274.644;15.296
     2022-05-10 11:35:10   total           76593.08
     2022-03-29 14:02:01   totaltest       5045.00
   helper:
     _98_statistics PV_Statistik
Attributes:
   alias      Solaranlagen_Readings
   autocreate 1
   readingList m2s:sbfspot_klaus:.* { json2nameValue($EVENT, 'Klaus_', $JSONMAP) }
m2s:sbfspot_2130011857:.* { json2nameValue($EVENT, 'Marco1_', $JSONMAP) }
m2s:sbfspot_2130007075:.* { json2nameValue($EVENT, 'Marco2_', $JSONMAP) }
   room       0.3_Solaranlagen
   userReadings klauswatt {sprintf("%0.0F ", ReadingsNum($name,"Klaus_PACTot",0)/1)},
total {sprintf("%0.2f ", ReadingsNum($name,"Marco1_ETotal",0)+ReadingsNum($name,"Marco2_ETotal",0))},
SummPower {sprintf("%0.0F ", ReadingsNum($name,"Marco1_PACTot",0)+ReadingsNum($name,"Marco2_PACTot",0))},
SummPower100 {sprintf("%0.1F ", ReadingsNum($name,"Marco1_PACTot",0)/1000+ReadingsNum($name,"Marco2_PACTot",0)/1000)}

Offline Beta-User

  • Moderator
  • Hero Member
  • ***
  • Beiträge: 18908
Antw:hilfe bei userreading
« Antwort #3 am: 10 Mai 2022, 11:45:28 »
[OT]
Diese MQTT2_DEVICE-Instanzen sehen "gruselig" aus. Bevor du an den userReadings schraubst, kannst du auch erst mal einen Blick in https://wiki.fhem.de/wiki/MQTT2_DEVICE_-_Schritt_f%C3%BCr_Schritt werfen.

Zumindest diesen "discovery"-Unfug sollte man "beerdingen", aber das ist nicht alles...
Server: HP-T620@Debian 11, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

Offline brain666

  • Jr. Member
  • **
  • Beiträge: 68
Antw:hilfe bei userreading
« Antwort #4 am: 10 Mai 2022, 12:39:03 »
Danke ist mir klar das die devices nicht Perfekt sind aber es funktioniert bisher so wie ich es will.
Ich habe mit absicht bisher nichts gefilterd weil ich mir erstmal selber alles anschauen möchte was alles übermittelt wird.

Offline Beta-User

  • Moderator
  • Hero Member
  • ***
  • Beiträge: 18908
Antw:hilfe bei userreading
« Antwort #5 am: 10 Mai 2022, 12:54:54 »
Ich habe mit absicht bisher nichts gefilterd weil ich mir erstmal selber alles anschauen möchte was alles übermittelt wird.
Diese Vorgehensweise ist auch prinzipiell völlig ok, mache ich meistens auch so - schaue aber dann tendenziell (aus Gewohnheit per mosquitto_sub) "von außen" an, was da so alles kommt. Die große Ausnahme dabei sind aber diese "autodiscovery"-Geschichten von Tasmota bzw. für HomeAssistant, das braucht unter FHEM keiner, und von daher kann ich nur empfehlen, diesen Balast an der Quelle loszuwerden, also entweder direkt zu deaktivieren (wo möglich), in jedem Fall aber "ignoreRegexp" so am IO einzustellen, dass es nicht in den Devices landet.

Diese Readings sind jedenfalls nach meinen bisherigen Erfahrungen in FHEM effektiv zu nichts zu gebrauchen, und wenn, ist es einfacher, den kompletten JSON-Blob zu verstehen...

aber es funktioniert bisher so wie ich es will.
Das ist auch erst mal das Wichtigste!
Server: HP-T620@Debian 11, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

Offline brain666

  • Jr. Member
  • **
  • Beiträge: 68
Antw:hilfe bei userreading
« Antwort #6 am: 10 Mai 2022, 13:06:34 »
Besten Dank für die Lernstunde  :D