[ { "id": "cb0670fbfefba3c9", "type": "tab", "label": "Watermeter", "disabled": false, "info": "", "env": [] }, { "id": "791ef127862f16c7", "type": "mqtt in", "z": "cb0670fbfefba3c9", "name": "", "topic": "wmbusmeters/57740424", "qos": "2", "datatype": "auto", "broker": "0b2c896eedbacc8f", "nl": false, "rap": true, "rh": 0, "inputs": 0, "x": 130, "y": 40, "wires": [ [ "614f99e8e9ed69a0" ] ] }, { "id": "777bf8ae176a6e5a", "type": "change", "z": "cb0670fbfefba3c9", "name": "extract total", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "payload.total_m3", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 510, "y": 40, "wires": [ [ "736be9bdeb7dd957", "24da087c9fe43d14" ] ] }, { "id": "5f53b645945b0417", "type": "change", "z": "cb0670fbfefba3c9", "name": "extract total last year", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "payload.last_month_total_m3", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 540, "y": 160, "wires": [ [ "884f8d4930406846", "70edffe44ea0eacb" ] ] }, { "id": "082c280aa16da4c5", "type": "change", "z": "cb0670fbfefba3c9", "name": "extract last year reset date", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "payload.last_month_measure_date", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 560, "y": 300, "wires": [ [ "e981bf6575e54373" ] ] }, { "id": "736be9bdeb7dd957", "type": "mqtt out", "z": "cb0670fbfefba3c9", "name": "", "topic": "wmbusmeters/57740424/total", "qos": "", "retain": "", "respTopic": "", "contentType": "", "userProps": "", "correl": "", "expiry": "", "broker": "0b2c896eedbacc8f", "x": 1030, "y": 40, "wires": [] }, { "id": "884f8d4930406846", "type": "mqtt out", "z": "cb0670fbfefba3c9", "name": "", "topic": "wmbusmeters/57740424/total_last_year", "qos": "", "retain": "", "respTopic": "", "contentType": "", "userProps": "", "correl": "", "expiry": "", "broker": "0b2c896eedbacc8f", "x": 1060, "y": 160, "wires": [] }, { "id": "48e30f10aea7a001", "type": "mqtt out", "z": "cb0670fbfefba3c9", "name": "", "topic": "wmbusmeters/57740424/reset_date_last_year", "qos": "", "retain": "", "respTopic": "", "contentType": "", "userProps": "", "correl": "", "expiry": "", "broker": "0b2c896eedbacc8f", "x": 1080, "y": 300, "wires": [] }, { "id": "614f99e8e9ed69a0", "type": "json", "z": "cb0670fbfefba3c9", "name": "", "property": "payload", "action": "", "pretty": false, "x": 310, "y": 160, "wires": [ [ "777bf8ae176a6e5a", "5f53b645945b0417", "082c280aa16da4c5" ] ] }, { "id": "e981bf6575e54373", "type": "throttle", "z": "cb0670fbfefba3c9", "name": "Throttle 1h", "throttleType": "time", "timeLimit": "1", "timeLimitType": "hours", "countLimit": 0, "blockSize": 0, "locked": false, "x": 790, "y": 300, "wires": [ [ "48e30f10aea7a001", "cba0bd88a2cf229f" ] ] }, { "id": "d120716ae221118e", "type": "influxdb out", "z": "cb0670fbfefba3c9", "influxdb": "93bf5275153947d9", "name": "", "measurement": "watermeter", "precision": "", "retentionPolicy": "", "database": "database", "precisionV18FluxV20": "ms", "retentionPolicyV18Flux": "", "org": "greinerlive", "bucket": "smarthome", "x": 1020, "y": 100, "wires": [] }, { "id": "c0fb12d0661a6b5f", "type": "influxdb out", "z": "cb0670fbfefba3c9", "influxdb": "93bf5275153947d9", "name": "", "measurement": "watermeter", "precision": "", "retentionPolicy": "", "database": "database", "precisionV18FluxV20": "ms", "retentionPolicyV18Flux": "", "org": "greinerlive", "bucket": "smarthome", "x": 1020, "y": 220, "wires": [] }, { "id": "30c96cbb4a2930d9", "type": "influxdb out", "z": "cb0670fbfefba3c9", "influxdb": "93bf5275153947d9", "name": "", "measurement": "watermeter", "precision": "", "retentionPolicy": "", "database": "database", "precisionV18FluxV20": "s", "retentionPolicyV18Flux": "", "org": "greinerlive", "bucket": "smarthome", "x": 1020, "y": 360, "wires": [] }, { "id": "24da087c9fe43d14", "type": "function", "z": "cb0670fbfefba3c9", "name": "Convert to influx payload", "func": "total_m3 = Number(msg.payload)\n\nmsg.payload = {\n total_m3: total_m3\n}\n\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 750, "y": 100, "wires": [ [ "d120716ae221118e" ] ] }, { "id": "70edffe44ea0eacb", "type": "function", "z": "cb0670fbfefba3c9", "name": "Convert to influx payload", "func": "total_last_year_m3 = Number(msg.payload)\n\nmsg.payload = {\n total_last_year_m3: total_last_year_m3\n}\n\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 750, "y": 220, "wires": [ [ "c0fb12d0661a6b5f" ] ] }, { "id": "cba0bd88a2cf229f", "type": "function", "z": "cb0670fbfefba3c9", "name": "Convert to influx payload", "func": "date_last_year_reset = msg.payload\n\nmsg.payload = {\n date_last_year_reset: date_last_year_reset\n}\n\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 750, "y": 360, "wires": [ [ "30c96cbb4a2930d9" ] ] }, { "id": "0b2c896eedbacc8f", "type": "mqtt-broker", "name": "Greiner.live", "broker": "Greiner.live", "port": "1883", "clientid": "nodered-ha", "autoConnect": true, "usetls": false, "protocolVersion": "4", "keepalive": "60", "cleansession": true, "birthTopic": "", "birthQos": "0", "birthPayload": "", "birthMsg": {}, "closeTopic": "", "closeQos": "0", "closePayload": "", "closeMsg": {}, "willTopic": "", "willQos": "0", "willPayload": "", "willMsg": {}, "sessionExpiry": "" }, { "id": "93bf5275153947d9", "type": "influxdb", "hostname": "127.0.0.1", "port": "8086", "protocol": "http", "database": "homeassistant", "name": "HA Influx", "usetls": false, "tls": "", "influxdbVersion": "2.0", "url": "http://192.168.178.34:8086", "rejectUnauthorized": true } ]