OpenWB
Integration OpenWB in FHEM
Ausgangssituation ist ein funktionierendes FHEM-System, bei dem bereits der digitale Stromzähler ("Moderne Meßeinrichtung") über das Modul 47_OBIS und der PV-Wechselrichter über ein entsprechendes Modul, z.B. ModbusAttr integriert sind. Als OpenWB-System wurde hier eine reale OpenWB-Wallbox angebunden.
Datenquellen
Die OpenWB erwartet 1-3 Typen von Datenquellen in dieser Konstellation:
- Die EVU-Schnittstelle, mit der als wesentlicher Steuerparameter der Ladeleistung die Leistungsmessung am Hausübergang herangezogen wird, und daneben die Zählerwerte für Netzbezug und Einspeisung zur Visualisierung übertragen werden sollten. Nur, falls phasenbezogenes Lastmanagement erforderlich sein sollte, sind auch die einzelnen Phasenleistungswerte vom Stromzähler nötig (was nicht jede Moderne Meßeinrichtung auf der OBIS-Schnittstelle bereitstellt)
- Die PV-Schnittstelle, die ebenfalls primär visualisierende Bedeutung hat.
- Die Batteriespeicher-Schnittstelle
OpenWB kann auch z.B. rein mit einer PV-Schnittstelle betrieben werden, in diesem Fall wird ein konstanter Leistungswert für den Hausbezug angenommen.
Kommunikationsprotokoll
Zur Kommunikation mit FHEM bieten sich 2 Methoden an:
- HTTP-Abfrage durch OpenWB bei FHEM durch das generische HTTP-Modul von OpenWB Diese Methode beschreibe ich nicht, weil sie mehr Overhead erzeugt und seitens FHEM die Einrichtung eines CSRF-Token-freien Web-Kanals erfordert
- MQTT-Push durch FHEM zur OpenWB Diese Methode erscheint mir vorteilhafter, weil auf einer stehenden TCP-Verbindung lediglich Meßwerte gepusht werden.
Implementierung
Vorbereitung
In der OpenWB-Web-UI unter Modulkonfiguration die entsprechenden Module (EVU, PV, Batterie) auf MQTT stellen. Hinweis: Nicht alle dabei erscheinenden MQTT-Topics müssen mit Werten beliefert werden! Sowohl bei der EVU-Schnittstelle wie bei PV reichen Momentanleistung und Zählerstände für eine zufriedenstellende Anbindung!
Definition der OpenWB als MQTT-Target
defmod openwb_mqtt MQTT2_CLIENT <ip-der-openwb>:1883 attr openwb_mqtt autocreate simple attr openwb_mqtt subscriptions openWB/lp/1/#
Übertragung der EVU-Meßwerte
In diesem Beispiel heißt das die Stromzählerdaten liefernde Device am OBIS-Modul "MT175". Die Zahlen werden per Notify von diesem Device auf MQTT kopiert:
defmod openwb_evu_cons notify MT175:total_consumption:.* { fhem("set openwb_mqtt publish openWB/set/evu/WhImported " . $EVTPART1); } defmod openwb_evu_feed notify MT175:total_feed:.* { fhem("set openwb_mqtt publish openWB/set/evu/WhExported " . $EVTPART1); } defmod openwb_evu_w notify MT175:power:.* { fhem("set openwb_mqtt publish openWB/set/evu/W " . int($EVTPART1)); }
Übertragung der PV-Meßwerte
Sofern die Daten für Momentanleistung und Zählerstand direkt in einem Device vorliegen, können analoge Notifys für dieses Device implementiert werden. Die Zielwerte lauten:
- Für den Momentan-Leistungswert
openWB/set/pv/1/W
- Für den Zählerstand
openWB/set/pv/1/WhCounter
Dabei muss beachtet werden, dass - wie bei der EVU-Schnittstelle - nur Integerwerte für die Momentanleistung übertragen werden dürfen.
Anbindung an Alexa
Der generische Smarthome-Skill "FHEMConnector" erlaubt nur die leider immer noch sehr limitierte Syntax von Amazon Alexa. Im Folgenden werden die Definitionen für die Befehle:
- "Alexa, schalte Überschussladen ein"
- "Alexa, schalte Überschussladen aus"
- "Alexa, schalte Überschussladen auf 6 (Prozent)"
dargestellt. "Überschussladen auf 6" bedeutet dabei real den "Min+PV", also Überschussladen mit Minimalleistung von 6 Ampere. Je nach Tagesform von Amazon ist dabei das Sprechen von "Prozent" nötig, auch wenn dies natürlich sachlich falsch ist.
define openwb_ueberschuss dummy attr openwb_ueberschuss alexaName Überschussladen attr openwb_ueberschuss genericDeviceType light attr openwb_ueberschuss readingList pct attr openwb_ueberschuss setList on off pct define openwb_ueberschuss_on notify openwb_ueberschuss:on set openwb_mqtt publish openWB/set/ChargeMode 2 define openwb_ueberschuss_off notify openwb_ueberschuss:off set openwb_mqtt publish openWB/set/ChargeMode 3 define openwb_ueberschuss_pct notify openwb_ueberschuss:pct:.* set openwb_mqtt publish openWB/config/set/pv/minCurrentMinPv $EVTPART1 ;; set openwb_mqtt publish openWB/set/ChargeMode 1
Anwendungs Beispiele
Komplexe Anbindung
Hier mal ein Beispiel mit weiteren Schnittstellen in der Haussteuerung.
Verwendete Schnittstellen / Devices
openWB MQTT
Wie oben beschrieben mit folgender MQTT definition
defmod Kia_connect MQTT2_DEVICE
attr Kia_connect DbLogExclude .*
attr Kia_connect DbLogInclude .*
attr Kia_connect IODev MQTT2_FHEM_Server
attr Kia_connect alias Kia_connect
attr Kia_connect autocreate 1
attr Kia_connect devicetopic bluelinky
attr Kia_connect group PV Eigenverbrauch-Steuerung
attr Kia_connect icon car
attr Kia_connect readingList $DEVICETOPIC/status:.* { json2nameValue($EVENT) }\
$DEVICETOPIC/location.* { json2nameValue($EVENT) }\
$DEVICETOPIC/odometer:.* { json2nameValue($EVENT) }\
$DEVICETOPIC/req_received:.* req_received\
$DEVICETOPIC/req_active:.* req_active
attr Kia_connect room MQTT2_DEVICE,Strom->Photovoltaik
attr Kia_connect setList getOdometer req/$DEVICETOPIC/get_odometer get_odometer\
getStatus req/$DEVICETOPIC/get_status get_status\
getLocation req/$DEVICETOPIC/get_location get_location\
getTripinfo req/$DEVICETOPIC/get_tripinfo\
getAll req/$DEVICETOPIC/get_all get_all\
setChargeTargetSoc req/$DEVICETOPIC/set_chargetargets\
startCharge req/$DEVICETOPIC/start_charging start_charging\
stopCharge req/$DEVICETOPIC/stop_charging stop_charging\
stopClimate req/$DEVICETOPIC/stop_climate stop_climate\
startClimate req/$DEVICETOPIC/start_climate
attr Kia_connect sortby 402
attr Kia_connect userReadings atHomeStanding:location.* { ((abs(AttrVal("global","latitude",49.85) - ReadingsVal($NAME,"location_coord_lat",0)) <= 0.001) && (abs(AttrVal("global","longitude",8.49) - ReadingsVal($NAME,"location_coord_lon",0)) <= 0.001) && (ReadingsVal($NAME,"location_speed_value",1) == 0)) ? 'true' : 'false';;;; },\
batSOC:status.* { ReadingsVal($NAME,"status_evStatus_batteryStatus",0);;;;},\
connected:status.* { (ReadingsVal($NAME,"status_evStatus_batteryPlugin",0) != 0) ? 'true' : 'false';;;;},\
charging:status.* { ReadingsVal($NAME,"status_evStatus_batteryCharge",'false');;;;},\
targetSOC:status.* { ReadingsVal($NAME,"status_evStatus_reservChargeInfos_targetSOClist_2_targetSOClevel",0);;;;},\
time2targetSOC:status.* { my $t = ReadingsVal($NAME,"status_evStatus_remainTime2_atc_value",1);;;; sprintf("%02d:%02d", $t/60%60, $t%60);;},\
range:status.* { ReadingsVal($NAME,"status_evStatus_drvDistance_1_rangeByFuel_totalAvailableRange_value",0);;;;},\
bat12v:status.* { ReadingsVal($NAME,"status_battery_batSoc",0);;;;}
Node-red
Node-red habe ich einfach in einem Docker Container runter geladen und gestartet. Über Port 1880 kommt man direkt in die GUI und kann den ersten Flow laden.
node-red:
image: nodered/node-red:latest
environment:
- TZ=Europe/Berlin
ports:
- 1880:1880
volumes:
- ./node-red/data:/data
Kia Connect
Kia connect ist eine API für Kia und Hyunday E-Autos mit der man Daten vom Auto abfragen kann und auch einige Steuerungen möglich sind. Mit Node-red und BlueLinky wird die Schnittstelle bedient. Der Flow ist nicht ursprünglich von mir, wurde jedoch noch erweitert und ist immer noch in der Weiterentwicklung.
[ {
"id": "866c75dd.edd9a8",
"type": "tab",
"label": "Kia e-Niro",
"disabled": false,
"info": ""
},
{
"id": "bb13a99d.68b8f8",
"type": "mqtt-broker",
"name": "mqtt_Server",
"broker": "<FHEM MQTT IP Adresse>",
"port": "1883",
"clientid": "",
"autoConnect": true,
"usetls": false,
"compatmode": false,
"protocolVersion": "4",
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"birthMsg": {},
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"closeMsg": {},
"willTopic": "",
"willQos": "0",
"willPayload": "",
"willMsg": {},
"sessionExpiry": ""
},
{
"id": "452a3304.58c8fc",
"type": "bluelinky",
"username": "<Mail Adresse bei Kia>",
"password": "<Passwort>",
"region": "EU",
"pin": "<Pin>",
"vin": "<VIN>",
"brand": "kia"
},
{
"id": "91a345fa.5757a8",
"type": "mqtt in",
"z": "866c75dd.edd9a8",
"name": "",
"topic": "req/bluelinky/get_status",
"qos": "0",
"datatype": "auto",
"broker": "bb13a99d.68b8f8",
"inputs": 0,
"x": 260,
"y": 280,
"wires": [
[
"15dfb508.c6497b",
"ce62ba4f.d86548",
"3f82a275.5a0b6e",
"24d5e0b.3aafc2"
]
]
},
{
"id": "5ad085b9.05739c",
"type": "mqtt in",
"z": "866c75dd.edd9a8",
"name": "",
"topic": "req/bluelinky/start_climate",
"qos": "0",
"datatype": "auto",
"broker": "bb13a99d.68b8f8",
"nl": false,
"rap": false,
"inputs": 0,
"x": 270,
"y": 680,
"wires": [
[
"b27d74de.38c808",
"33b1bc85.662694",
"ce62ba4f.d86548",
"24d5e0b.3aafc2"
]
]
},
{
"id": "15dfb508.c6497b",
"type": "car-status",
"z": "866c75dd.edd9a8",
"name": "Get status",
"dorefresh": true,
"parsed": false,
"bluelinky": "452a3304.58c8fc",
"x": 1110,
"y": 280,
"wires": [
[
"cccc9476.d56dd8",
"226ed925.607bb6"
]
]
},
{
"id": "87abdd88.8ff4d",
"type": "car-odometer",
"z": "866c75dd.edd9a8",
"name": "Get car odometer",
"bluelinky": "452a3304.58c8fc",
"x": 1130,
"y": 200,
"wires": [
[
"40d2361c.579588",
"226ed925.607bb6"
]
]
},
{
"id": "31100f9a.40008",
"type": "function",
"z": "866c75dd.edd9a8",
"name": "locationWrapper",
"func": "if(msg.payload.hasOwnProperty(\"body\")) {\n msg.payload = {\"error\":true};\n return msg;\n}\nelse {\n\n msg.payload = { \n \"location\": msg.payload,\n \"error\": false\n };\n \n return msg;\n}",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1490,
"y": 120,
"wires": [
[
"85a07155.a0f9f",
"262df5dc.57916a",
"f487d6d6.a4d568"
]
]
},
{
"id": "bea1d927.0f3908",
"type": "car-location",
"z": "866c75dd.edd9a8",
"name": "Get car location",
"bluelinky": "452a3304.58c8fc",
"x": 1120,
"y": 120,
"wires": [
[
"31100f9a.40008",
"226ed925.607bb6"
]
]
},
{
"id": "3c949d67.0d83b2",
"type": "mqtt in",
"z": "866c75dd.edd9a8",
"name": "",
"topic": "req/bluelinky/get_location",
"qos": "0",
"datatype": "auto",
"broker": "bb13a99d.68b8f8",
"nl": false,
"rap": false,
"inputs": 0,
"x": 270,
"y": 120,
"wires": [
[
"bea1d927.0f3908",
"ce62ba4f.d86548",
"3f82a275.5a0b6e",
"24d5e0b.3aafc2"
]
]
},
{
"id": "cccc9476.d56dd8",
"type": "function",
"z": "866c75dd.edd9a8",
"name": "analyseStatus",
"func": "if(msg.payload.hasOwnProperty(\"body\")) {\n msg.payload = {\"error\":true};\n return msg;\n}\nelse {\n let status = msg.payload;\n status.airTemp.value = 14+(parseInt(status.airTemp.value,16)/2);\n try{\n status.evStatus.reservChargeInfos.reservChargeInfo.reservChargeInfoDetail.reservFatcSet.airTemp.value = 14+(parseInt(status.evStatus.reservChargeInfos.reservChargeInfo.reservChargeInfoDetail.reservFatcSet.airTemp.value,16)/2);\n status.evStatus.reservChargeInfos.reserveChargeInfo2.reservChargeInfoDetail.reservFatcSet.airTemp.value = 14+(parseInt(status.evStatus.reservChargeInfos.reserveChargeInfo2.reservChargeInfoDetail.reservFatcSet.airTemp.value,16)/2);\n } catch(e) {}\n\n let time = status.evStatus.remainTime2.atc.value/60;\n let result = { \n \"batSOC\": status.evStatus.batteryStatus,\n \"connected\": (status.evStatus.batteryPlugin !== 0),\n \"charging\": status.evStatus.batteryCharge,\n \"targetSOC\": status.evStatus.reservChargeInfos.targetSOClist[1].targetSOClevel,\n \"time2targetSOC\": (Math.floor(time) + \":\" + (\"0\" + Math.floor((time % 1)*60)).slice(-2)), // h:mm\n \"range\": status.evStatus.drvDistance[0].rangeByFuel.totalAvailableRange.value,\n \"bat12v\": status.battery.batSoc\n };\n \n //msg.payload = result;\n msg.payload = {\n \"status\": status,\n \"error\": false\n \n };\n return msg;\n}",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 1480,
"y": 280,
"wires": [
[
"3efceea0.c81b12",
"262df5dc.57916a",
"f487d6d6.a4d568"
]
]
},
{
"id": "85a07155.a0f9f",
"type": "mqtt out",
"z": "866c75dd.edd9a8",
"name": "",
"topic": "bluelinky/location",
"qos": "",
"retain": "",
"broker": "bb13a99d.68b8f8",
"x": 1910,
"y": 120,
"wires": []
},
{
"id": "3efceea0.c81b12",
"type": "mqtt out",
"z": "866c75dd.edd9a8",
"name": "",
"topic": "bluelinky/status",
"qos": "",
"retain": "",
"broker": "bb13a99d.68b8f8",
"x": 1900,
"y": 280,
"wires": []
},
{
"id": "327104fc.71e1bc",
"type": "mqtt out",
"z": "866c75dd.edd9a8",
"name": "",
"topic": "bluelinky/odometer",
"qos": "",
"retain": "",
"broker": "bb13a99d.68b8f8",
"x": 1910,
"y": 200,
"wires": []
},
{
"id": "844a32f4.2e029",
"type": "mqtt in",
"z": "866c75dd.edd9a8",
"name": "",
"topic": "req/bluelinky/stop_climate",
"qos": "0",
"datatype": "auto",
"broker": "bb13a99d.68b8f8",
"inputs": 0,
"x": 270,
"y": 760,
"wires": [
[
"7d3ae860.d8c9a8",
"33b1bc85.662694",
"ce62ba4f.d86548",
"24d5e0b.3aafc2"
]
]
},
{
"id": "57d91e50.7e96",
"type": "mqtt in",
"z": "866c75dd.edd9a8",
"name": "",
"topic": "req/bluelinky/start_charging",
"qos": "0",
"datatype": "auto",
"broker": "bb13a99d.68b8f8",
"inputs": 0,
"x": 280,
"y": 820,
"wires": [
[
"6eebc52c.ee23dc",
"33b1bc85.662694",
"ce62ba4f.d86548",
"24d5e0b.3aafc2"
]
]
},
{
"id": "6029f0a0.b73e",
"type": "mqtt in",
"z": "866c75dd.edd9a8",
"name": "",
"topic": "req/bluelinky/stop_charging",
"qos": "0",
"datatype": "auto",
"broker": "bb13a99d.68b8f8",
"nl": false,
"rap": false,
"inputs": 0,
"x": 280,
"y": 880,
"wires": [
[
"84a1ae.74912e5",
"33b1bc85.662694",
"ce62ba4f.d86548",
"24d5e0b.3aafc2"
]
]
},
{
"id": "c5ecf76c.e753c8",
"type": "start-car",
"z": "866c75dd.edd9a8",
"name": "Start car",
"bluelinky": "452a3304.58c8fc",
"x": 1100,
"y": 680,
"wires": [
[
"811aa567.e89f98",
"f487d6d6.a4d568"
]
]
},
{
"id": "6eebc52c.ee23dc",
"type": "start-charge",
"z": "866c75dd.edd9a8",
"name": "Start Charging",
"bluelinky": "452a3304.58c8fc",
"x": 1120,
"y": 820,
"wires": [
[
"811aa567.e89f98",
"f487d6d6.a4d568"
]
]
},
{
"id": "84a1ae.74912e5",
"type": "stop-charge",
"z": "866c75dd.edd9a8",
"name": "Stop Charging",
"bluelinky": "452a3304.58c8fc",
"x": 1120,
"y": 880,
"wires": [
[
"811aa567.e89f98",
"f487d6d6.a4d568"
]
]
},
{
"id": "7d3ae860.d8c9a8",
"type": "stop-car",
"z": "866c75dd.edd9a8",
"name": "Stop car",
"bluelinky": "452a3304.58c8fc",
"x": 1100,
"y": 760,
"wires": [
[
"811aa567.e89f98",
"f487d6d6.a4d568"
]
]
},
{
"id": "b27d74de.38c808",
"type": "json",
"z": "866c75dd.edd9a8",
"name": "",
"property": "payload",
"action": "obj",
"pretty": false,
"x": 750,
"y": 680,
"wires": [
[
"c5ecf76c.e753c8",
"33b1bc85.662694"
]
]
},
{
"id": "45a6a8e6.2abfd8",
"type": "mqtt in",
"z": "866c75dd.edd9a8",
"name": "",
"topic": "req/bluelinky/get_odometer",
"qos": "0",
"datatype": "auto",
"broker": "bb13a99d.68b8f8",
"inputs": 0,
"x": 280,
"y": 200,
"wires": [
[
"87abdd88.8ff4d",
"ce62ba4f.d86548",
"3f82a275.5a0b6e",
"24d5e0b.3aafc2"
]
]
},
{
"id": "33b1bc85.662694",
"type": "debug",
"z": "866c75dd.edd9a8",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 930,
"y": 920,
"wires": []
},
{
"id": "ce62ba4f.d86548",
"type": "mqtt out",
"z": "866c75dd.edd9a8",
"name": "",
"topic": "bluelinky/req_received",
"qos": "",
"retain": "",
"broker": "bb13a99d.68b8f8",
"x": 860,
"y": 480,
"wires": []
},
{
"id": "1babee6c.1c2982",
"type": "mqtt in",
"z": "866c75dd.edd9a8",
"name": "",
"topic": "req/bluelinky/get_all",
"qos": "0",
"datatype": "auto",
"broker": "bb13a99d.68b8f8",
"inputs": 0,
"x": 250,
"y": 360,
"wires": [
[
"ce62ba4f.d86548",
"3f82a275.5a0b6e",
"24d5e0b.3aafc2",
"4375fbb9.00fb44"
]
]
},
{
"id": "262df5dc.57916a",
"type": "debug",
"z": "866c75dd.edd9a8",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1850,
"y": 80,
"wires": []
},
{
"id": "811aa567.e89f98",
"type": "debug",
"z": "866c75dd.edd9a8",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1470,
"y": 1040,
"wires": []
},
{
"id": "3f82a275.5a0b6e",
"type": "debug",
"z": "866c75dd.edd9a8",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 930,
"y": 80,
"wires": []
},
{
"id": "24d5e0b.3aafc2",
"type": "change",
"z": "866c75dd.edd9a8",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "pending",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 790,
"y": 1140,
"wires": [
[
"4dd1ea4a.52f144",
"fecad185.324f8"
]
]
},
{
"id": "f487d6d6.a4d568",
"type": "change",
"z": "866c75dd.edd9a8",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "idle",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1910,
"y": 760,
"wires": [
[
"4dd1ea4a.52f144",
"fecad185.324f8"
]
]
},
{
"id": "4dd1ea4a.52f144",
"type": "mqtt out",
"z": "866c75dd.edd9a8",
"name": "",
"topic": "bluelinky/req_active",
"qos": "",
"retain": "",
"broker": "bb13a99d.68b8f8",
"x": 2140,
"y": 1100,
"wires": []
},
{
"id": "fecad185.324f8",
"type": "debug",
"z": "866c75dd.edd9a8",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 2110,
"y": 1160,
"wires": []
},
{
"id": "40d2361c.579588",
"type": "function",
"z": "866c75dd.edd9a8",
"name": "odometerWrapper",
"func": "if(msg.payload.hasOwnProperty(\"body\")) {\n msg.payload = {\"error\":true};\n return msg;\n}\nelse {\n msg.payload = { \n \"odometer\": msg.payload,\n \"error\": false\n };\n\n return msg;\n}",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1490,
"y": 200,
"wires": [
[
"327104fc.71e1bc",
"262df5dc.57916a",
"f487d6d6.a4d568"
]
]
},
{
"id": "226ed925.607bb6",
"type": "debug",
"z": "866c75dd.edd9a8",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1430,
"y": 80,
"wires": []
},
{
"id": "4375fbb9.00fb44",
"type": "car-fullstatus",
"z": "866c75dd.edd9a8",
"name": "Get full status",
"dorefresh": true,
"bluelinky": "452a3304.58c8fc",
"x": 1120,
"y": 360,
"wires": [
[
"226ed925.607bb6",
"69b6c4df.ea6bcc",
"89681a97.9e24d8",
"92dc3ff4.1d6e3"
]
]
},
{
"id": "69b6c4df.ea6bcc",
"type": "function",
"z": "866c75dd.edd9a8",
"name": "locationFromFullstatus",
"func": "if(msg.payload.hasOwnProperty(\"body\")) {\n msg.payload = {\"error\":true};\n return msg;\n}\nelse {\n\n msg.payload = { \n \"location\": msg.payload.vehicleLocation,\n \"error\": false\n };\n \n return msg;\n}\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 1500,
"y": 360,
"wires": [
[
"85a07155.a0f9f",
"331e5860.907808"
]
]
},
{
"id": "92dc3ff4.1d6e3",
"type": "function",
"z": "866c75dd.edd9a8",
"name": "statusFromFullstatus",
"func": "if(msg.payload.hasOwnProperty(\"body\")) {\n msg.payload = {\"error\":true};\n return msg;\n}\nelse {\n let status = msg.payload.vehicleStatus;\n try{\n status.airTemp.value = 14+(parseInt(status.airTemp.value,16)/2);\n status.evStatus.reservChargeInfos.reservChargeInfo.reservChargeInfoDetail.reservFatcSet.airTemp.value = 14+(parseInt(status.evStatus.reservChargeInfos.reservChargeInfo.reservChargeInfoDetail.reservFatcSet.airTemp.value,16)/2);\n status.evStatus.reservChargeInfos.reserveChargeInfo2.reservChargeInfoDetail.reservFatcSet.airTemp.value = 14+(parseInt(status.evStatus.reservChargeInfos.reserveChargeInfo2.reservChargeInfoDetail.reservFatcSet.airTemp.value,16)/2);\n } catch(e) {}\n\n msg.payload = { \n \"status\": status,\n \"error\": false\n };\n \n return msg;\n}\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 1500,
"y": 480,
"wires": [
[
"3efceea0.c81b12",
"f487d6d6.a4d568",
"331e5860.907808"
]
]
},
{
"id": "89681a97.9e24d8",
"type": "function",
"z": "866c75dd.edd9a8",
"name": "odometerFromFullstatus",
"func": "if(msg.payload.hasOwnProperty(\"body\")) {\n msg.payload = {\"error\":true};\n return msg;\n}\nelse {\n\n msg.payload = { \n \"odometer\": msg.payload.odometer,\n \"error\": false\n };\n \n return msg;\n}\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 1510,
"y": 420,
"wires": [
[
"327104fc.71e1bc",
"331e5860.907808"
]
]
},
{
"id": "331e5860.907808",
"type": "debug",
"z": "866c75dd.edd9a8",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1850,
"y": 520,
"wires": []
},
{
"id": "aa4d220b.f7e19",
"type": "set-chargetargets",
"z": "866c75dd.edd9a8",
"name": "Set charge targets",
"bluelinky": "452a3304.58c8fc",
"x": 1130,
"y": 960,
"wires": [
[
"811aa567.e89f98",
"f487d6d6.a4d568"
]
]
},
{
"id": "4c03338d.2f15ec",
"type": "login",
"z": "866c75dd.edd9a8",
"name": "Login",
"bluelinky": "452a3304.58c8fc",
"x": 1090,
"y": 1040,
"wires": [
[
"811aa567.e89f98"
]
]
},
{
"id": "28b868f5.16cb48",
"type": "inject",
"z": "866c75dd.edd9a8",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "43200",
"crontab": "",
"once": true,
"onceDelay": "12",
"topic": "",
"payloadType": "date",
"x": 950,
"y": 1040,
"wires": [
[
"4c03338d.2f15ec"
]
]
},
{
"id": "db9ecdb5.a9683",
"type": "mqtt in",
"z": "866c75dd.edd9a8",
"name": "",
"topic": "req/bluelinky/set_chargetargets",
"qos": "0",
"datatype": "auto",
"broker": "bb13a99d.68b8f8",
"nl": false,
"rap": false,
"inputs": 0,
"x": 290,
"y": 960,
"wires": [
[
"7064a8d53256b646",
"ce62ba4f.d86548",
"24d5e0b.3aafc2"
]
]
},
{
"id": "44155ad70c47b0dd",
"type": "inject",
"z": "866c75dd.edd9a8",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 940,
"y": 260,
"wires": [
[
"15dfb508.c6497b"
]
]
},
{
"id": "7064a8d53256b646",
"type": "json",
"z": "866c75dd.edd9a8",
"name": "",
"property": "payload",
"action": "obj",
"pretty": false,
"x": 750,
"y": 960,
"wires": [
[
"33b1bc85.662694",
"aa4d220b.f7e19"
]
]
},
{
"id": "7064395e56292844",
"type": "inject",
"z": "866c75dd.edd9a8",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 940,
"y": 340,
"wires": [
[
"4375fbb9.00fb44"
]
]
},
{
"id": "5f9ff828080f5fe6",
"type": "lock-car",
"z": "866c75dd.edd9a8",
"name": "Lock car",
"bluelinky": "452a3304.58c8fc",
"x": 1100,
"y": 560,
"wires": [
[
"811aa567.e89f98",
"f487d6d6.a4d568"
]
]
},
{
"id": "492f5b94a865e47b",
"type": "inject",
"z": "866c75dd.edd9a8",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 940,
"y": 540,
"wires": [
[
"5f9ff828080f5fe6"
]
]
},
{
"id": "d6f3f148e765caf9",
"type": "mqtt in",
"z": "866c75dd.edd9a8",
"name": "",
"topic": "req/bluelinky/car_lock",
"qos": "0",
"datatype": "auto",
"broker": "bb13a99d.68b8f8",
"nl": false,
"rap": false,
"inputs": 0,
"x": 260,
"y": 560,
"wires": [
[
"5f9ff828080f5fe6",
"ce62ba4f.d86548"
]
]
},
{
"id": "cdc13a486db22b8e",
"type": "mqtt in",
"z": "866c75dd.edd9a8",
"name": "",
"topic": "req/bluelinky/car_unlock",
"qos": "0",
"datatype": "auto",
"broker": "bb13a99d.68b8f8",
"nl": false,
"rap": false,
"inputs": 0,
"x": 270,
"y": 620,
"wires": [
[
"99f5c3a41ac3e754",
"ce62ba4f.d86548"
]
]
},
{
"id": "99f5c3a41ac3e754",
"type": "unlock-car",
"z": "866c75dd.edd9a8",
"name": "Unlock car",
"bluelinky": "452a3304.58c8fc",
"x": 1110,
"y": 620,
"wires": [
[
"f487d6d6.a4d568",
"811aa567.e89f98"
]
]
},
{
"id": "ab557a0ea621403a",
"type": "inject",
"z": "866c75dd.edd9a8",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 940,
"y": 600,
"wires": [
[
"99f5c3a41ac3e754"
]
]
},
{
"id": "a525de86e4374518",
"type": "inject",
"z": "866c75dd.edd9a8",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 940,
"y": 740,
"wires": [
[
"7d3ae860.d8c9a8"
]
]
},
{
"id": "0b8cb92c042fe140",
"type": "inject",
"z": "866c75dd.edd9a8",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 940,
"y": 800,
"wires": [
[
"6eebc52c.ee23dc"
]
]
},
{
"id": "ae4c2139b08aaa28",
"type": "inject",
"z": "866c75dd.edd9a8",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 940,
"y": 860,
"wires": [
[
"84a1ae.74912e5"
]
]
},
{
"id": "dd23108ce63f456d",
"type": "get-monthlyreport",
"z": "866c75dd.edd9a8",
"name": "Get monthly report",
"bluelinky": "452a3304.58c8fc",
"x": 1130,
"y": 1280,
"wires": [
[
"e57eb97531129426"
]
]
},
{
"id": "a6e5e8deb52145f1",
"type": "inject",
"z": "866c75dd.edd9a8",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 940,
"y": 1260,
"wires": [
[
"dd23108ce63f456d"
]
]
},
{
"id": "95f1b6f32aafd65b",
"type": "get-tripinfo",
"z": "866c75dd.edd9a8",
"name": "Tripinfo",
"bluelinky": "452a3304.58c8fc",
"x": 1100,
"y": 1220,
"wires": [
[
"e57eb97531129426"
]
]
},
{
"id": "fb2b99958bc48593",
"type": "json",
"z": "866c75dd.edd9a8",
"name": "",
"property": "payload",
"action": "",
"pretty": false,
"x": 750,
"y": 1220,
"wires": [
[
"95f1b6f32aafd65b"
]
]
},
{
"id": "5230ebe391325b17",
"type": "mqtt in",
"z": "866c75dd.edd9a8",
"name": "",
"topic": "req/bluelinky/get_tripinfo",
"qos": "2",
"datatype": "auto",
"broker": "bb13a99d.68b8f8",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 270,
"y": 1220,
"wires": [
[
"fb2b99958bc48593"
]
]
},
{
"id": "e57eb97531129426",
"type": "debug",
"z": "866c75dd.edd9a8",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1470,
"y": 1220,
"wires": []
},
{
"id": "4fdf3b1b7811c89f",
"type": "mqtt in",
"z": "866c75dd.edd9a8",
"name": "",
"topic": "req/bluelinky/get_tripinfo",
"qos": "2",
"datatype": "auto",
"broker": "bb13a99d.68b8f8",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 270,
"y": 1280,
"wires": [
[
"dd23108ce63f456d"
]
]
}
]
- Kostal Plenticore mit Speicher
Zu diesem Thema gibt es noch eine andere Wiki Seite, die alles rund um den Wechselrichter und vieles mehr erklärt.
Ich schreibe gerade hier noch weiter :-) 2021-11-23 14:20
- DOIF mit uiTable