Compare commits

...

2 Commits

Author SHA1 Message Date
Carsten Schmiemann e261a24a17 Add node-red flow for reading Tibber node locally 2023-08-08 23:37:15 +02:00
Carsten Schmiemann 5abff3afa6 Update reamde 2023-08-08 23:36:53 +02:00
3 changed files with 420 additions and 6 deletions

View File

@ -37,13 +37,9 @@ I try to integrate every datapoint from Batriums BMS to fill Victrons registers.
- capacity to full or to empty is not transmitted by Batrium (transmission of 0x00111900 is missing against documentation)
- Ah, kWh charged and discharged is calcualated by script (see above)
- Capacity of battery must be entered into script batrium.py (see above)
- dbus script is started by rc.local which gets executed last, so all mppts and multiplus' showing temporarily "BMS missing" and need to be cleared after (re-)boot of Venus OS
- <del>dbus script is started by rc.local which gets executed last, so all mppts and multiplus' showing temporarily "BMS missing" and need to be cleared after (re-)boot of Venus OS</del> fixed
- include calculation of State Of Health, based on Ah discharge and SoC State after full charge, because Batrium does not have
### Victrons datapoints
This script will emulate one of Victrons own BMS, therefore are many registers to fill, but I dont know how to fill all.
For example what means average Ah discharged. I implemented datapoints to my best knowledge and it is working for me.
# dbus-node-red-XXX Service files
### Configuration

View File

@ -138,7 +138,7 @@ class DbusBatteryService:
self._dbusservice['/History/ChargedEnergy'] = self._settings['HistoryChargedEnergy']
self._dbusservice['/History/DischargedEnergy'] = self._settings['HistoryDischargedEnergy']
self.ChargedEnergy = self._settings['HistoryChargedEnergy']
self.DischargedEnergy = self._settings['HistoryDischargedEnergy']
self.DischargedEnergy = self._settings['HistoryDischargedEnergy'] * -1
self._dbusservice.add_path('/History/TimeSinceLastFullCharge', 0)
self._dbusservice.add_path('/History/MinCellVoltage', self._settings['MinCellVoltage'])
self._dbusservice.add_path('/History/MaxCellVoltage', self._settings['MaxCellVoltage'])

View File

@ -0,0 +1,418 @@
[
{
"id": "8d1576fc0be96b4a",
"type": "http request",
"z": "154ae691bb56f6e7",
"name": "http req. Tibber Pulse SML",
"method": "GET",
"ret": "bin",
"paytoqs": "ignore",
"url": "http://10.1.0.11/data.json?node_id=1",
"tls": "",
"persist": false,
"proxy": "",
"insecureHTTPParser": false,
"authType": "basic",
"senderr": false,
"headers": [],
"credentials": {},
"x": 420,
"y": 300,
"wires": [
[
"a82fbeb90cddaba3"
]
]
},
{
"id": "66b56bf77c1e2db4",
"type": "inject",
"z": "154ae691bb56f6e7",
"name": "Request every 3s",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "3",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 130,
"y": 300,
"wires": [
[
"8d1576fc0be96b4a"
]
]
},
{
"id": "af078be60e1168a2",
"type": "smartmeter",
"z": "154ae691bb56f6e7",
"name": "parse SML",
"datasource": "2cc5d556b9271b80",
"protocol": "SmlProtocol",
"transport": "LocalFileTransport",
"requestInterval": "99999",
"d0WakeupCharacters": "",
"d0SignOnMessage": "",
"d0BaudrateChangeoverOverwrite": "",
"protocolSmlIgnoreInvalidCRC": false,
"debugging": false,
"x": 870,
"y": 300,
"wires": [
[
"bcb656baff6e2422",
"90e11ee613d8a8d8"
]
]
},
{
"id": "a82fbeb90cddaba3",
"type": "file",
"z": "154ae691bb56f6e7",
"name": "",
"filename": "/tmp/tibber_sml.data",
"filenameType": "str",
"appendNewline": false,
"createDir": false,
"overwriteFile": "true",
"encoding": "none",
"x": 680,
"y": 300,
"wires": [
[
"af078be60e1168a2"
]
]
},
{
"id": "bcb656baff6e2422",
"type": "function",
"z": "154ae691bb56f6e7",
"name": "filter 1.8.0",
"func": "msg.payload = msg.payload[\"1-0:1.8.0*255\"].values[0].value;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 800,
"y": 380,
"wires": [
[
"99439952c9f0698e"
]
]
},
{
"id": "90e11ee613d8a8d8",
"type": "function",
"z": "154ae691bb56f6e7",
"name": "filter 16.7.0",
"func": "msg.payload = msg.payload[\"1-0:16.7.0*255\"].values[0].value;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 810,
"y": 420,
"wires": [
[
"3416a1bf3d6e4db5"
]
]
},
{
"id": "609c6f6c087622eb",
"type": "influxdb out",
"z": "154ae691bb56f6e7",
"influxdb": "dee207f7.f8e2b8",
"name": "",
"measurement": "evu_1_8_0",
"precision": "",
"retentionPolicy": "",
"database": "database",
"precisionV18FluxV20": "ms",
"retentionPolicyV18Flux": "",
"org": "Klotz",
"bucket": "energy_meter",
"x": 1300,
"y": 380,
"wires": []
},
{
"id": "99439952c9f0698e",
"type": "delay",
"z": "154ae691bb56f6e7",
"name": "",
"pauseType": "rate",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "60",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": true,
"allowrate": false,
"outputs": 1,
"x": 1030,
"y": 380,
"wires": [
[
"609c6f6c087622eb"
]
]
},
{
"id": "cf1e5fe6d9e2b8cb",
"type": "influxdb out",
"z": "154ae691bb56f6e7",
"influxdb": "dee207f7.f8e2b8",
"name": "",
"measurement": "evu_16_7_0",
"precision": "",
"retentionPolicy": "",
"database": "database",
"precisionV18FluxV20": "ms",
"retentionPolicyV18Flux": "",
"org": "Klotz",
"bucket": "energy_meter",
"x": 1310,
"y": 420,
"wires": []
},
{
"id": "7d112572b3df1bc9",
"type": "http request",
"z": "154ae691bb56f6e7",
"name": "http req. Tibber Pulse Metric",
"method": "GET",
"ret": "obj",
"paytoqs": "ignore",
"url": "http://10.1.0.11/metrics.json?node_id=1",
"tls": "",
"persist": false,
"proxy": "",
"insecureHTTPParser": false,
"authType": "basic",
"senderr": false,
"headers": [],
"credentials": {},
"x": 420,
"y": 600,
"wires": [
[
"9de9ed09efa9fc09",
"dc55cf9772b06948",
"128089ad6b44d136"
]
]
},
{
"id": "1a000ee3584d95a9",
"type": "inject",
"z": "154ae691bb56f6e7",
"name": "Request every 1m",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "60",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 140,
"y": 600,
"wires": [
[
"7d112572b3df1bc9"
]
]
},
{
"id": "9de9ed09efa9fc09",
"type": "function",
"z": "154ae691bb56f6e7",
"name": "battery voltage",
"func": "msg.payload = msg.payload.node_status.node_battery_voltage;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 680,
"y": 600,
"wires": [
[
"3418ac83e0994fd7"
]
]
},
{
"id": "dc55cf9772b06948",
"type": "function",
"z": "154ae691bb56f6e7",
"name": "temperature",
"func": "msg.payload = msg.payload.node_status.node_temperature;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 670,
"y": 640,
"wires": [
[
"edd18b7ad90a3bb5"
]
]
},
{
"id": "128089ad6b44d136",
"type": "function",
"z": "154ae691bb56f6e7",
"name": "RSSI",
"func": "msg.payload = msg.payload.node_status.node_avg_rssi;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 650,
"y": 680,
"wires": [
[
"0af0bfae91209540"
]
]
},
{
"id": "3418ac83e0994fd7",
"type": "influxdb out",
"z": "154ae691bb56f6e7",
"influxdb": "dee207f7.f8e2b8",
"name": "",
"measurement": "node_battery_voltage",
"precision": "",
"retentionPolicy": "",
"database": "database",
"precisionV18FluxV20": "ms",
"retentionPolicyV18Flux": "",
"org": "Klotz",
"bucket": "tibber",
"x": 1080,
"y": 600,
"wires": []
},
{
"id": "edd18b7ad90a3bb5",
"type": "influxdb out",
"z": "154ae691bb56f6e7",
"influxdb": "dee207f7.f8e2b8",
"name": "",
"measurement": "node_temperature",
"precision": "",
"retentionPolicy": "",
"database": "database",
"precisionV18FluxV20": "ms",
"retentionPolicyV18Flux": "",
"org": "Klotz",
"bucket": "tibber",
"x": 1070,
"y": 640,
"wires": []
},
{
"id": "0af0bfae91209540",
"type": "influxdb out",
"z": "154ae691bb56f6e7",
"influxdb": "dee207f7.f8e2b8",
"name": "",
"measurement": "node_rssi",
"precision": "",
"retentionPolicy": "",
"database": "database",
"precisionV18FluxV20": "ms",
"retentionPolicyV18Flux": "",
"org": "Klotz",
"bucket": "tibber",
"x": 1040,
"y": 680,
"wires": []
},
{
"id": "3416a1bf3d6e4db5",
"type": "delay",
"z": "154ae691bb56f6e7",
"name": "",
"pauseType": "rate",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "3",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": true,
"allowrate": false,
"outputs": 1,
"x": 1020,
"y": 420,
"wires": [
[
"cf1e5fe6d9e2b8cb"
]
]
},
{
"id": "2cc5d556b9271b80",
"type": "smartmeter-connection",
"sourcetype": "file",
"serialport": "/dev/null",
"serialbaud": "9600",
"databits": "8",
"parity": "none",
"stopbits": "1",
"httphost": "localhost",
"httpport": "80",
"tcphost": "localhost",
"tcpport": "502",
"filepath": "/tmp/tibber_sml.data"
},
{
"id": "dee207f7.f8e2b8",
"type": "influxdb",
"hostname": "127.0.0.1",
"port": "8086",
"protocol": "http",
"database": "database",
"name": "Influx Devil",
"usetls": false,
"tls": "",
"influxdbVersion": "2.0",
"url": "http://10.1.0.36:8086",
"rejectUnauthorized": false
}
]