Reading zeitgesteuert in ein anderes Reading kopieren

Begonnen von kptkip, 21 März 2019, 20:12:27

Vorheriges Thema - Nächstes Thema

kptkip

Habe folgendes vor und nach viel Suchen (womöglich nicht nach den passenden Suchparametern) leider noch nichts gefunden.

Ich möchte zeitgesteuert (in meinem Beispiel 23:00 Uhr) den aktuellen Wert eines Readings in ein anderes Reading zu kopieren. Sozusagen um einen Tagesmaxwert zu generieren.

Geschrieben werden soll der Wert von:
Daily_yield => LastDailyYield

Hier die Raw Definition:
defmod Plenticore ModbusAttr 71 60 192.168.33.34:1502 TCP
attr Plenticore userattr dev-type-Fl_R2-format dev-type-Fl_R2-len dev-type-Fl_R2-revRegs dev-type-Fl_R2-unpack obj-h100-poll obj-h100-reading obj-h100-type obj-h320-expr obj-h320-poll obj-h320-reading obj-h320-type obj-h322-expr obj-h322-poll obj-h322-reading obj-h322-type obj-h324-expr obj-h324-poll obj-h324-reading obj-h324-type obj-h326-expr obj-h326-poll obj-h326-reading obj-h326-type
attr Plenticore dev-type-Fl_R2-format %.2f
attr Plenticore dev-type-Fl_R2-len 2
attr Plenticore dev-type-Fl_R2-revRegs 1
attr Plenticore dev-type-Fl_R2-unpack f>
attr Plenticore icon max_heizungsthermostat
attr Plenticore obj-h100-poll 1
attr Plenticore obj-h100-reading Total_DC_Power
attr Plenticore obj-h100-type Fl_R2
attr Plenticore obj-h320-expr $val/1000
attr Plenticore obj-h320-poll 1
attr Plenticore obj-h320-reading Total_yield
attr Plenticore obj-h320-type Fl_R2
attr Plenticore obj-h322-expr $val/1000
attr Plenticore obj-h322-poll 1
attr Plenticore obj-h322-reading Daily_yield
attr Plenticore obj-h322-type Fl_R2
attr Plenticore obj-h324-expr $val/1000
attr Plenticore obj-h324-poll 1
attr Plenticore obj-h324-reading Yearly_yield
attr Plenticore obj-h324-type Fl_R2
attr Plenticore obj-h326-expr $val/1000
attr Plenticore obj-h326-poll 1
attr Plenticore obj-h326-reading Monthly_yield
attr Plenticore obj-h326-type Fl_R2
attr Plenticore room 06_Solaranlage

setstate Plenticore opened
setstate Plenticore 2019-03-21 20:03:05 Daily_yield 49.22
setstate Plenticore 2019-03-20 20:24:00 LastDailyYield 0.0
setstate Plenticore 2019-03-21 20:03:04 Monthly_yield 528.05
setstate Plenticore 2019-03-21 20:03:04 Total_DC_Power 0.00
setstate Plenticore 2019-02-16 23:17:00 Total_DC_Power_round 0.00
setstate Plenticore 2019-03-21 20:03:04 Total_yield 1904.49
setstate Plenticore 2019-03-21 20:03:05 Yearly_yield 1359.60
setstate Plenticore 2019-03-17 22:00:44 state opened



Probiert habe ich es damit:
defmod LastDailyYield at *23:05:00 { fhem ("setreading Plenticore LastDailyYield "+{return ReadingsVal("Plenticore","Daily_yield",0)})}
attr LastDailyYield room 06_Solaranlage

setstate LastDailyYield Next: 23:05:00
setstate LastDailyYield 2019-03-20 23:05:00 state Next: 23:05:00


Das schreibt mir allerdings den Text
+{return ReadingsVal("Plenticore","Daily_yield",0
in das neue Reading.

Hat mir jemand einen Tipp?

Danke
Alex
FHEM Revision: 22312 auf RasPI3B+,1xNeumannCUL,HMLAN,1xRasPi3B+,2xRasPI ZERO W
CUL_HM:HM-Sec-SCo, HM-CC-RT-DN
Fritz: Fritz!Box 6590C,DECT301,DECT200
Shelly:Shelly1,Shelly2, ShellyBulb Xiaomi: Schalter, Fensterkontakte HUE: ConbeeII
Tasmota:SonoffBridge, Stecker

amenomade

defmod LastDailyYield at *23:05:00 setreading Plenticore LastDailyYield [Plenticore:Daily_yield]
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

kptkip

SUPI!

Vielen Dank für die rapide Hilfe!

Nur der Vollständigkeit halber:
Gäbe es auch noch eine - vielleicht schlankere - Lösung im Gerät selber über ein zeitgesteuertes UserReading?
Geht das überhaupt und wäre das schlauer?

Gruß
Alex
FHEM Revision: 22312 auf RasPI3B+,1xNeumannCUL,HMLAN,1xRasPi3B+,2xRasPI ZERO W
CUL_HM:HM-Sec-SCo, HM-CC-RT-DN
Fritz: Fritz!Box 6590C,DECT301,DECT200
Shelly:Shelly1,Shelly2, ShellyBulb Xiaomi: Schalter, Fensterkontakte HUE: ConbeeII
Tasmota:SonoffBridge, Stecker