[gelöst] HourCounter mit selbsdefiniertem Zeitraum

Begonnen von matze1999, 20 Mai 2024, 16:28:24

Vorheriges Thema - Nächstes Thema

matze1999

Hallo,

ich habe ein HourCounter Device, für das ich gern den Zeitraum 5 Tage von aktuellen Tag zurück, zur Datenerhebung nutzen möchte.

Lt. FHEMWiki:

Aggregation über bestimmte oder ganz freie Zeiträume
Ich möchte meine Bewässerung u.a. davon abhängig machen, ob es in den letzten X Tagen eine Menge Y geregnet hat.

Hier mal das Device:

define CN.Regenmenge HourCounter MQTT2_zigbee_Regenmesser:open MQTT2_zigbee_Regenmesser:closed
attr CN.Regenmenge devStateStyle style="text-align:left;;font-weight:bold;;"
attr CN.Regenmenge group Bewässerung
attr CN.Regenmenge icon weather_rain_meter
attr CN.Regenmenge room Bewässerung,Garten,Schalter
attr CN.Regenmenge sortby 4
attr CN.Regenmenge stateFormat letzte Stunde regenstunde l/m² | \
heute regentag l/m² | \
lfd. Woche regenwoche l/m² |\
lfd. Monat regenmonat l/m²
attr CN.Regenmenge userReadings regenstunde:appCountsPerHourTemp.* {round( ReadingsNum($name,'appCountsPerHourTemp',0)*0.30303, 0 ) },\
regentag:countsPerDay.* {round( ReadingsNum($name,'countsPerDay',0) * 0.30303, 0 ) },\
regenwoche:appCountsPerWeekTemp.* {round( ReadingsNum($name,'appCountsPerWeekTemp',0)*0.30303, 0 ) },\
regenmonat:appCountsPerMonthTemp.* {round( ReadingsNum($name,'appCountsPerMonthTemp',0)*0.30303, 0 ) }
#   DEF        MQTT2_zigbee_Regenmesser:open MQTT2_zigbee_Regenmesser:closed
#   FUUID      62ab57f2-f33f-214e-0042-119484fada12476c
#   NAME       CN.Regenmenge
#   NR         322
#   NTFY_ORDER 50-CN.Regenmenge
#   STATE      letzte Stunde 0 l/m² |
#heute 0 l/m² |
#lfd. Woche 0 l/m² |
#lfd. Monat 16 l/m²
#   TYPE       HourCounter
#   VERSION    1.0.1.2 - 24.12.2014
#   eventCount 1659
#   READINGS:
#     2024-05-20 00:00:00   appCountsPerDay 0
#     2024-05-20 16:00:00   appCountsPerHour 0
#     2024-05-20 16:00:00   appCountsPerHourTemp 0
#     2024-05-01 00:00:00   appCountsPerMonth 81
#     2024-05-18 15:14:09   appCountsPerMonthTemp 53
#     2024-05-19 00:00:00   appCountsPerWeek 16
#     2024-05-19 00:00:00   appCountsPerWeekTemp 0
#     2024-01-01 00:00:02   appCountsPerYear 0
#     2024-05-18 15:14:09   appCountsPerYearTemp 134
#     2024-05-20 00:00:00   appOpHoursPerDay 24
#     2024-05-20 16:25:02   appOpHoursPerDayTemp 16.4172222222222
#     2024-05-01 00:00:00   appOpHoursPerMonth 716.948333333333
#     2024-05-20 00:00:00   appOpHoursPerMonthTemp 452.3625
#     2024-05-19 00:00:00   appOpHoursPerWeek 167.995833333333
#     2024-05-20 00:00:00   appOpHoursPerWeekTemp 24
#     2024-01-01 00:00:02   appOpHoursPerYear 0
#     2024-05-20 00:00:00   appOpHoursPerYearTemp 1201.74444444444
#     2024-05-20 00:00:00   appUtilization  100
#     2024-05-20 16:25:02   appUtilizationTemp 100
#     2024-05-20 16:25:02   appUtilizationTempOld 100
#     2024-05-20 16:25:02   countsOverall   158
#     2024-05-20 16:25:02   countsPerDay    0
#     2024-05-20 16:25:02   pauseTimeEdge   1
#     2024-05-20 16:25:02   pauseTimeIncrement 1
#     2024-05-20 16:25:02   pauseTimeOverall 11385324
#     2024-05-20 16:25:02   pauseTimePerDay 0
#     2024-05-20 16:25:02   pulseTimeEdge   2238
#     2024-05-20 16:25:02   pulseTimeIncrement 177053
#     2024-05-20 16:25:02   pulseTimeOverall 4385382
#     2024-05-20 16:25:02   pulseTimePerDay 59102
#     2024-05-18 15:14:09   regenmonat      16
#     2024-05-20 16:00:00   regenstunde     0
#     2024-05-20 16:25:02   regentag        0
#     2024-05-19 00:00:00   regenwoche      0
#     2024-05-20 16:25:02   state           0
#     2024-05-18 15:14:09   tickChanged     315
#     2024-05-20 00:00:00   tickDay         9
#     2024-05-20 16:00:00   tickHour        260
#     2024-05-11 15:11:05   tickMonth       0
#     2024-05-20 16:25:02   tickUpdated     749
#     2024-05-19 00:00:00   tickWeek        2
#     2024-05-11 15:11:05   tickYear        0
#     2024-05-20 16:25:02   value           1
#   helper:
#     OFF_Regexp MQTT2_zigbee_Regenmesser:closed
#     ON_Regexp  MQTT2_zigbee_Regenmesser:open
#     calledByEvent
#     changedTimestamp 2024-05-20 16:25:02
#     forceClear
#     forceDayChange
#     forceHourChange
#     forceMonthChange
#     forceWeekChange
#     forceYearChange
#     isFirstRun
#     sdRoundHourLast 1716213600
#     value      1
#     cmdQueue:
#
setstate CN.Regenmenge letzte Stunde 0 l/m² | \
heute 0 l/m² | \
lfd. Woche 0 l/m² |\
lfd. Monat 16 l/m²
setstate CN.Regenmenge 2024-05-20 00:00:00 appCountsPerDay 0
setstate CN.Regenmenge 2024-05-20 16:00:00 appCountsPerHour 0
setstate CN.Regenmenge 2024-05-20 16:00:00 appCountsPerHourTemp 0
setstate CN.Regenmenge 2024-05-01 00:00:00 appCountsPerMonth 81
setstate CN.Regenmenge 2024-05-18 15:14:09 appCountsPerMonthTemp 53
setstate CN.Regenmenge 2024-05-19 00:00:00 appCountsPerWeek 16
setstate CN.Regenmenge 2024-05-19 00:00:00 appCountsPerWeekTemp 0
setstate CN.Regenmenge 2024-01-01 00:00:02 appCountsPerYear 0
setstate CN.Regenmenge 2024-05-18 15:14:09 appCountsPerYearTemp 134
setstate CN.Regenmenge 2024-05-20 00:00:00 appOpHoursPerDay 24
setstate CN.Regenmenge 2024-05-20 16:25:02 appOpHoursPerDayTemp 16.4172222222222
setstate CN.Regenmenge 2024-05-01 00:00:00 appOpHoursPerMonth 716.948333333333
setstate CN.Regenmenge 2024-05-20 00:00:00 appOpHoursPerMonthTemp 452.3625
setstate CN.Regenmenge 2024-05-19 00:00:00 appOpHoursPerWeek 167.995833333333
setstate CN.Regenmenge 2024-05-20 00:00:00 appOpHoursPerWeekTemp 24
setstate CN.Regenmenge 2024-01-01 00:00:02 appOpHoursPerYear 0
setstate CN.Regenmenge 2024-05-20 00:00:00 appOpHoursPerYearTemp 1201.74444444444
setstate CN.Regenmenge 2024-05-20 00:00:00 appUtilization 100
setstate CN.Regenmenge 2024-05-20 16:25:02 appUtilizationTemp 100
setstate CN.Regenmenge 2024-05-20 16:25:02 appUtilizationTempOld 100
setstate CN.Regenmenge 2024-05-20 16:25:02 countsOverall 158
setstate CN.Regenmenge 2024-05-20 16:25:02 countsPerDay 0
setstate CN.Regenmenge 2024-05-20 16:25:02 pauseTimeEdge 1
setstate CN.Regenmenge 2024-05-20 16:25:02 pauseTimeIncrement 1
setstate CN.Regenmenge 2024-05-20 16:25:02 pauseTimeOverall 11385324
setstate CN.Regenmenge 2024-05-20 16:25:02 pauseTimePerDay 0
setstate CN.Regenmenge 2024-05-20 16:25:02 pulseTimeEdge 2238
setstate CN.Regenmenge 2024-05-20 16:25:02 pulseTimeIncrement 177053
setstate CN.Regenmenge 2024-05-20 16:25:02 pulseTimeOverall 4385382
setstate CN.Regenmenge 2024-05-20 16:25:02 pulseTimePerDay 59102
setstate CN.Regenmenge 2024-05-18 15:14:09 regenmonat 16
setstate CN.Regenmenge 2024-05-20 16:00:00 regenstunde 0
setstate CN.Regenmenge 2024-05-20 16:25:02 regentag 0
setstate CN.Regenmenge 2024-05-19 00:00:00 regenwoche 0
setstate CN.Regenmenge 2024-05-20 16:25:02 state 0
setstate CN.Regenmenge 2024-05-18 15:14:09 tickChanged 315
setstate CN.Regenmenge 2024-05-20 00:00:00 tickDay 9
setstate CN.Regenmenge 2024-05-20 16:00:00 tickHour 260
setstate CN.Regenmenge 2024-05-11 15:11:05 tickMonth 0
setstate CN.Regenmenge 2024-05-20 16:25:02 tickUpdated 749
setstate CN.Regenmenge 2024-05-19 00:00:00 tickWeek 2
setstate CN.Regenmenge 2024-05-11 15:11:05 tickYear 0
setstate CN.Regenmenge 2024-05-20 16:25:02 value 1


matze1999

matze1999

Hallo,

habs jetzt anders gelöst, siehe HIER.

matze1999