Autor Thema: Counter incremental  (Gelesen 482 mal)

Offline kroonen

  • Full Member
  • ***
  • Beiträge: 131
    • http://www.kroonen.eu/mobile
Counter incremental
« am: 07 Oktober 2017, 11:46:18 »
Hi,

I made a pulse counter on my water, and connect it on an esp8266 and send it through mqtt to them

I get every minute a value how much water is used that minute. Now i want ofcourse use them also to know what i used this hour and today..

Is this possible with the statistics module??? I see delta readings but not really incremental readings
Any idea how I can get this?? Here is my logging



2017-10-07_11:10:49 Watermeter Water: 0.0
2017-10-07_11:11:49 Watermeter transmission-state: incoming publish received
2017-10-07_11:11:49 Watermeter Water: 1.5
2017-10-07_11:12:49 Watermeter transmission-state: incoming publish received
2017-10-07_11:12:49 Watermeter Water: 0.0
2017-10-07_11:13:49 Watermeter transmission-state: incoming publish received
2017-10-07_11:13:49 Watermeter Water: 0.5
2017-10-07_11:14:49 Watermeter transmission-state: incoming publish received
2017-10-07_11:14:49 Watermeter Water: 1.5
2017-10-07_11:15:50 Watermeter transmission-state: incoming publish received
2017-10-07_11:15:50 Watermeter Water: 1.0
2017-10-07_11:16:50 Watermeter transmission-state: incoming publish received
2017-10-07_11:16:50 Watermeter Water: 0.0
2017-10-07_11:17:50 Watermeter transmission-state: incoming publish received
2017-10-07_11:17:50 Watermeter Water: 0.0
2017-10-07_11:18:50 Watermeter transmission-state: incoming publish received
2017-10-07_11:18:50 Watermeter Water: 0.0
2017-10-07_11:19:50 Watermeter transmission-state: incoming publish received
2017-10-07_11:19:50 Watermeter Water: 0.0
2017-10-07_11:20:50 Watermeter transmission-state: incoming publish received
2017-10-07_11:20:50 Watermeter Water: 0.0

Offline amenomade

  • Hero Member
  • *****
  • Beiträge: 2195
Antw:Counter incremental
« Antwort #1 am: 07 Oktober 2017, 21:11:20 »
You could define a userReadings which calculates the overall cumulative water usage, and then use the statistics module on it.
FHEM 5.8 Pi 3, EchoDot, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, und HM Komponenten

F:"Schatz? Mach aus bitte"
M: "Alexa? Licht aus"-"Ich bin mir leider nicht sicher"  M:"Alexa? aus Licht"-"Das weiss ich leider nicht" M:"Alexa? Schalte...
F: "Drück mal auf den blöden Knopf!

Offline kroonen

  • Full Member
  • ***
  • Beiträge: 131
    • http://www.kroonen.eu/mobile
Antw:Counter incremental
« Antwort #2 am: 07 Oktober 2017, 21:40:33 »
Ok , and how this the user reading calculates the values??, i See differential, but not a real incremental??

attr Watermeter userReadings Water integral???


regards Richard

Offline amenomade

  • Hero Member
  • *****
  • Beiträge: 2195
Antw:Counter incremental
« Antwort #3 am: 07 Oktober 2017, 22:05:41 »
Simple calculation :
attr Watermeter userReadings TotalWater:Water.* {ReadingsVal("Watermeter","TotalWater",0) + ReadingsVal("Watermeter","Water",0)}
FHEM 5.8 Pi 3, EchoDot, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, und HM Komponenten

F:"Schatz? Mach aus bitte"
M: "Alexa? Licht aus"-"Ich bin mir leider nicht sicher"  M:"Alexa? aus Licht"-"Das weiss ich leider nicht" M:"Alexa? Schalte...
F: "Drück mal auf den blöden Knopf!