Betatest - Renault ZE Services Binding

Thanks for quick answer, but…
As i said, no idea about programming. I don´t see how to manage this.
These requirements

  • Renault Zoe with active data subscription
  • Webserver with PHP 5.3 (or newer) and cURL installed
  • Write permissions for the script in its own folder
    are too much for me, as well as integration into openhab.
    Despite everything, many thanks for engagement

You don’t have to do any programming.

If you have a ZOE, your dealer should have already enabled this (I guess you are using the Android App, so if that works you are good to go)

That is just a cheap webspace with php from any provider for a couple of bucks.

This is done by default.

The only step you have to do is copying some files to your webspace. And of course setting up your Things, Items and Rules in openHAB.

Puh…
as i said, i´m to stupid for this stuff!
I downloadet the script from Github unpacked and changed php.config with email and password. First problem: with or without the ´ on beginning and end?
What to do with the src folder - i putted in into the scripts-folder in OpenHAB, but nothing happend.
I have a NAS-system with PHP and cUrl, but where to put what file?
You see, question about question - i don`t believe in succes!

With.

You have to load it to your webspace, not openHAB.

That is a whole different story: you need to open your NAS to the ZOE Api, but that could be a security risk if done wrong. I would strongly recommend to use some kind of cheap webspace.

Just follow the few steps from the readme :grinning:

Thank you, Sihui, for your answers!
I guess, this thing is to great for me! I`m afraid to disturb anything an my NAS or in OpenHAB.
I will wait, untill there is a binding, otherwise i had to manage the ZOE as in time.
Thank you for your efforts!!
Cheers

Hi shuo,

I installed and configured pyze. I’m able to login and I get the status from my Zoe. I edited the status.py script and compiled but after running pyze status I’m getting the following error:

openhabian@openHab:/home/pyze$ pyze status --km
Traceback (most recent call last):
  File "/usr/local/bin/pyze", line 11, in <module>
    load_entry_point('PyZE==0.6.0', 'console_scripts', 'pyze')()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2793, in load_entry_point
    return ep.load()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2411, in load
    return self.resolve()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2417, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 668, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible
  File "/usr/local/lib/python3.7/dist-packages/PyZE-0.6.0-py3.7.egg/pyze/cli/__main__.py", line 10, in <module>
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 668, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible
  File "/usr/local/lib/python3.7/dist-packages/PyZE-0.6.0-py3.7.egg/pyze/cli/status.py", line 142, in <module>
NameError: name 'status' is not defined

Whats wrong here???

Thanks!

Hi community

big thanks to @sihui for helping me with a rule to limit charging the Twingo electric to 90% (basically same functionality as Zoe) by switching of my wallbox attached to a bticino actor.

rule "switch off wallbox"
when
        Item ZOE_current_battery changed
then
        if (ZOE_current_battery.state>=90) AND (ZOE_charging.state=ON) {
        //switch off wallbox
        TeslaWallbox.sendCommand(off)
    }
end

Following question:

Would like to have a switch in the sitemap where I can switch between 90% charge limit and 100% (Twingo’s full charge is around 22kwh and sometimes full charge would be appreciated to have)

Meaning 100% should ignore the rule and 90% should use it…

Can someone help me with this?

thanks in advance,
kind regards, Christian

That won’t work:

if (ZOE_current_battery.state>=90 && ZOE_charging.state==ON) {

Need to enhace the rule otherwise the wallbox will be switched off if Zoe is above 90% charge even it is not connected?

Sorry, I don’t understand that part :innocent:

If you need to check if your car is connected you could use

if (ZOE_current_battery.state>=90 && ZOE_plug_connected.state.toString=="Ja") {

if you are using the string item with the german mapping.

Thanks,
I wanted to avoid that the wallbox switches off when the Zoe has over 90% charge and thus another car cannot be charged.
That’s why I wanted to check the charge level of the Zoe and whether it is connected at all.

Back to my question:

Can someone help me with creating a switch for switching between 100% charge (by ignoring the rule) and 90% (using the rule)?

thanks,

ZOE_plug_connected.state.toString=="Ja" will only give you true as long as the plug is inserted into the wallbox.

If you need to know if your car is still charging you could use

ZOE_charging.state.toString=="Ja"

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": ""
    }
]
2 Likes

You will probably get a “You have reached your quota limit” very soon :slight_smile:

Didn’t happen in the last 3 weeks, is there a quota overview somewhere? And it’s quite easy to change the frequency in the nodered injector.

Not that I know of. It just stops working if you hit the quota limit. You need to disable the api access for a couple of hours/days, then it works again.

I had no problems with 10 minutes intervals, at the moment I am trying 5 minutes, so far no problems. I did hit the quota limit with values below 5 minutes, though.

I have started to translate the python renault-api (Renault API — Renault API documentation) into an openhab binding (https://github.com/dougculnane/openhab-addons/tree/renault/bundles/org.openhab.binding.renault). It is very basic (and read only at the moment) but if you want to test it please do.

It looks like it works with my computer and car…

JAR here:
https://drive.google.com/file/d/1Rq9X1WidTgwqaqW5RIH1YNEIecRn_bEE/view?usp=sharing

1 Like

Nice, would like to try but I need to login to download the jar (which I won’t do …).