Wanted to share my solution, its way less effort, it uses nodered to query the my renault services every 3 minutes and update openhab items:
You can import this flow to node red, all you need to do is install the node-red-contrib-renault-ze
package, setup your renault-ze credentials and insert the openhab token.
Should also work for zoe’s and other my renault cars, theres even more information in the messages, you can just add more outputs/transforms if wanted.
Note: I’m using node-red-contrib-openhab3
however the nodered functions are still called openhab2, but everything works as intended, it should be easily adaptable for openhab2.
[
{
"id": "8df494c97fed8112",
"type": "tab",
"label": "Twingo",
"disabled": false,
"info": ""
},
{
"id": "c1370f4c30388dcc",
"type": "debug",
"z": "8df494c97fed8112",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 440,
"y": 160,
"wires": []
},
{
"id": "411656e01d832569",
"type": "openhab2-out2",
"z": "8df494c97fed8112",
"name": "",
"controller": "7cd34b3687b61c43",
"itemname": "twingo_soc",
"topic": "ItemUpdate",
"payload": "",
"onlywhenchanged": false,
"x": 570,
"y": 600,
"wires": []
},
{
"id": "1523fd2f96c7d045",
"type": "renault-ze",
"z": "8df494c97fed8112",
"name": "",
"x": 300,
"y": 300,
"wires": [
[
"c1370f4c30388dcc",
"720302aafa5370f9"
]
]
},
{
"id": "811a23167c6ddcfb",
"type": "inject",
"z": "8df494c97fed8112",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "300",
"crontab": "",
"once": true,
"onceDelay": 0.1,
"topic": "",
"payloadType": "date",
"x": 130,
"y": 300,
"wires": [
[
"1523fd2f96c7d045"
]
]
},
{
"id": "720302aafa5370f9",
"type": "switch",
"z": "8df494c97fed8112",
"name": "battery-status/cockpit/location",
"property": "topic",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "battery-status",
"vt": "str"
},
{
"t": "eq",
"v": "cockpit",
"vt": "str"
},
{
"t": "eq",
"v": "location",
"vt": "str"
}
],
"checkall": "false",
"repair": false,
"outputs": 3,
"x": 190,
"y": 440,
"wires": [
[
"886f9016d25931c7",
"bd09ea8935f7d7aa",
"14ce162e496a9c21",
"c3ea321e98393e89",
"62a5c0e9f6b923f3"
],
[
"5ae3419593a01f3f"
],
[
"1b99ada3ce05fde4"
]
]
},
{
"id": "886f9016d25931c7",
"type": "change",
"z": "8df494c97fed8112",
"name": "batteryLevel",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.data.attributes.batteryLevel",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 530,
"y": 540,
"wires": [
[
"411656e01d832569"
]
]
},
{
"id": "bd09ea8935f7d7aa",
"type": "change",
"z": "8df494c97fed8112",
"name": "plugStatus",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.data.attributes.plugStatus",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 530,
"y": 660,
"wires": [
[
"2c5561d16b07921a"
]
]
},
{
"id": "2c5561d16b07921a",
"type": "openhab2-out2",
"z": "8df494c97fed8112",
"name": "",
"controller": "7cd34b3687b61c43",
"itemname": "twingo_plugstatus",
"topic": "ItemUpdate",
"payload": "",
"onlywhenchanged": false,
"x": 590,
"y": 720,
"wires": []
},
{
"id": "9e40ac47c9a9b6ae",
"type": "openhab2-out2",
"z": "8df494c97fed8112",
"name": "",
"controller": "7cd34b3687b61c43",
"itemname": "twingo_range",
"topic": "ItemUpdate",
"payload": "",
"onlywhenchanged": false,
"x": 580,
"y": 840,
"wires": []
},
{
"id": "14ce162e496a9c21",
"type": "change",
"z": "8df494c97fed8112",
"name": "batteryAutonomy",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.data.attributes.batteryAutonomy",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 550,
"y": 780,
"wires": [
[
"9e40ac47c9a9b6ae"
]
]
},
{
"id": "c3ea321e98393e89",
"type": "change",
"z": "8df494c97fed8112",
"name": "batteryAvailableEnergy",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.data.attributes.batteryAvailableEnergy",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 560,
"y": 900,
"wires": [
[
"9f98659361cb668e"
]
]
},
{
"id": "9f98659361cb668e",
"type": "openhab2-out2",
"z": "8df494c97fed8112",
"name": "",
"controller": "7cd34b3687b61c43",
"itemname": "twingo_energy",
"topic": "ItemUpdate",
"payload": "",
"onlywhenchanged": false,
"x": 580,
"y": 960,
"wires": []
},
{
"id": "0c128b72c6f5c860",
"type": "openhab2-out2",
"z": "8df494c97fed8112",
"name": "",
"controller": "7cd34b3687b61c43",
"itemname": "twingo_km",
"topic": "ItemUpdate",
"payload": "",
"onlywhenchanged": false,
"x": 550,
"y": 480,
"wires": []
},
{
"id": "5ae3419593a01f3f",
"type": "change",
"z": "8df494c97fed8112",
"name": "totalMileage",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.data.attributes.totalMileage",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 510,
"y": 420,
"wires": [
[
"0c128b72c6f5c860"
]
]
},
{
"id": "b8b9c3ad24117b0f",
"type": "openhab2-out2",
"z": "8df494c97fed8112",
"name": "",
"controller": "7cd34b3687b61c43",
"itemname": "twingo_location",
"topic": "ItemUpdate",
"payload": "",
"onlywhenchanged": false,
"x": 580,
"y": 1220,
"wires": []
},
{
"id": "1b99ada3ce05fde4",
"type": "template",
"z": "8df494c97fed8112",
"name": "build coords",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "{{payload.data.attributes.gpsLatitude}},{{payload.data.attributes.gpsLongitude}}",
"output": "str",
"x": 530,
"y": 1140,
"wires": [
[
"b8b9c3ad24117b0f"
]
]
},
{
"id": "62a5c0e9f6b923f3",
"type": "change",
"z": "8df494c97fed8112",
"name": "chargingStatus",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.data.attributes.chargingStatus",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 540,
"y": 1020,
"wires": [
[
"47086bb2243cd62a"
]
]
},
{
"id": "47086bb2243cd62a",
"type": "openhab2-out2",
"z": "8df494c97fed8112",
"name": "",
"controller": "7cd34b3687b61c43",
"itemname": "twingo_chargingstatus",
"topic": "ItemUpdate",
"payload": "",
"onlywhenchanged": false,
"x": 600,
"y": 1080,
"wires": []
},
{
"id": "2f6420025ebc5f2c",
"type": "openhab2-monitor2",
"z": "8df494c97fed8112",
"d": true,
"name": "",
"controller": "7cd34b3687b61c43",
"x": 170,
"y": 140,
"wires": [
[
"c1370f4c30388dcc"
],
[],
[
"c1370f4c30388dcc"
]
]
},
{
"id": "7cd34b3687b61c43",
"type": "openhab2-controller2",
"name": "",
"protocol": "http",
"host": "localhost",
"port": "8080",
"path": "",
"username": "",
"password": "",
"ohversion": "v3",
"token": ""
}
]