Python plugin: Wallbox EV charger

Python and python framework

Moderator: leecollings

Lokonli
Posts: 2296
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Python plugin: Wallbox EV charger

Post by Lokonli »

I've created a plugin for integration of the Wallbox EV charger into Domoticz.

The plugin uses the Wallbox API.

See:
https://github.com/lokonli/domoticz-wallbox

Verstuurd vanaf mijn SM-A526B met Tapatalk

User avatar
sincze
Posts: 1302
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Python plugin: Wallbox EV charger

Post by sincze »

Cewl.
Happy with this charger ??
I'm looking at the 'Copper SB' as the others seem to have wifi range issues.
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
forkboy
Posts: 13
Joined: Saturday 20 January 2018 13:12
Target OS: -
Domoticz version:
Contact:

Re: Python plugin: Wallbox EV charger

Post by forkboy »

Thanks, great plugin :D .

Just installed it without too much problems, and seems to work great!
Minor comment which I just noticed, The device "Charging current" should be power in kW instead of current in Ampere; at least the metric corresponds to that in the Wallbox app.
User avatar
sincze
Posts: 1302
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Python plugin: Wallbox EV charger

Post by sincze »

Works like a charm with Walbox Copper.

Anyone successful with integrating Walbox with OCCP 1.6 in Node-Red for example?
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
User avatar
sincze
Posts: 1302
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Python plugin: Wallbox EV charger

Post by sincze »

forkboy wrote: Sunday 16 July 2023 20:16 Thanks, great plugin :D .

Just installed it without too much problems, and seems to work great!
Minor comment which I just noticed, The device "Charging current" should be power in kW instead of current in Ampere; at least the metric corresponds to that in the Wallbox app.
Updated the plugin a bit:

Code: Select all

https://github.com/sincze/domoticz-wallbox
Wallbox-New.png
Wallbox-New.png (113.08 KiB) Viewed 15847 times
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
User avatar
sincze
Posts: 1302
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Python plugin: Wallbox EV charger

Post by sincze »

Found this trick.
https://github.com/jagheterfredrik/wallbox-pwn

together with:
https://github.com/jagheterfredrik/wallbox-mqtt-bridge

It allows you to obtain full control and all data locally from the Wallbox without breaking the Cloud functionality.
It publishes data to MQTT every second.
Wallbox-Local.png
Wallbox-Local.png (70.5 KiB) Viewed 15193 times
We could add this to a separate plugin or use something like a ShellyTeacher4Domo kinda approach to automatically create these devices in Domoticz.
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
User avatar
waltervl
Posts: 7005
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2026.3
Location: NL
Contact:

Re: Python plugin: Wallbox EV charger

Post by waltervl »

Or use the mqttmapper plugin. I think this would be the easiest way.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
sincze
Posts: 1302
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Python plugin: Wallbox EV charger

Post by sincze »

waltervl wrote: Friday 12 April 2024 9:29 Or use the mqttmapper plugin. I think this would be the easiest way.
Again, your knowledge (walking wiki) always seems to amaze me. Thanks for the tip!!
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
tarmacalastair
Posts: 95
Joined: Wednesday 30 October 2019 14:11
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Great Britain
Contact:

Re: Python plugin: Wallbox EV charger

Post by tarmacalastair »

Hello,

Interesting topic. I've looked at the two versions of the plugin mentioned in this topic:
Which one should I use? I've just tried installing them both (to folders wallbox and wallbox1) and I can't see work out what the differences are!
Thanks
Running Domoticz and Dashticz beta on Raspberry Pi OS 32 bit - has anyone had success with 64 bit?

Desktop access from Ubuntu Linux
User avatar
sincze
Posts: 1302
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Python plugin: Wallbox EV charger

Post by sincze »

tarmacalastair wrote: Wednesday 17 April 2024 21:27 Hello,

Interesting topic. I've looked at the two versions of the plugin mentioned in this topic:
Which one should I use? I've just tried installing them both (to folders wallbox and wallbox1) and I can't see work out what the differences are!
Thanks
Hi tarmacalastair
https://github.com/lokonli/domoticz-wallbox is leading.
I forked it (to create pull requests for improvements) and if agreed upon lokonli merges them in his release.
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
tarmacalastair
Posts: 95
Joined: Wednesday 30 October 2019 14:11
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Great Britain
Contact:

Re: Python plugin: Wallbox EV charger

Post by tarmacalastair »

Ah great, thanks for explaining.
Running Domoticz and Dashticz beta on Raspberry Pi OS 32 bit - has anyone had success with 64 bit?

Desktop access from Ubuntu Linux
edwinh81
Posts: 5
Joined: Wednesday 27 December 2017 17:20
Target OS: Linux
Domoticz version: 2024.4
Location: NLD
Contact:

Re: Python plugin: Wallbox EV charger

Post by edwinh81 »

I started using this plugin earlier this week.
Was very excited at first but over first days it broke on me and I cannot find the reason for it.
The domoticz log says:
2024-06-21 20:27:52.257 Error: wallbox: (Wallbox) failed to load 'plugin.py', Python Path used was '/opt/domoticz/userdata/plugins/wallbox/:/usr/lib/python39.zip:/usr/lib/python3.9:/usr/lib/python3.9/lib-dynload:/usr/local/lib/python3.9/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.9/dist-packages'.
2024-06-21 20:27:52.268 Error: wallbox: Traceback (most recent call last):
2024-06-21 20:27:52.269 Error: wallbox: File "/opt/domoticz/userdata/plugins/wallbox/plugin.py", line 66, in <module>
2024-06-21 20:27:52.269 Error: wallbox: from wallbox import Wallbox, Statuses
2024-06-21 20:27:52.269 Error: wallbox: ModuleNotFoundError: No module named 'wallbox'
I cannot find any errors in the plugin.py file from the original. Any suggestions?

Running domoticz 2024.4 in docker.
User avatar
sincze
Posts: 1302
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Python plugin: Wallbox EV charger

Post by sincze »

It seems docker does not know wallbox.
Probably the docker was renewed??

How did you install the plugin in the docker?
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
edwinh81
Posts: 5
Joined: Wednesday 27 December 2017 17:20
Target OS: Linux
Domoticz version: 2024.4
Location: NLD
Contact:

Re: Python plugin: Wallbox EV charger

Post by edwinh81 »

I cannot really reproduce how I did it.
I adapted the installation like described on github a little.

I kicked the pip install line again with a commandline and it works again for now.

Do you have any advice on what would be a proper way to do it in docker?
User avatar
sincze
Posts: 1302
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Python plugin: Wallbox EV charger

Post by sincze »

I created a customstart.sh. So everytime my Domoticz container is re-created the wallbox is re-installed.
https://www.domoticz.com/wiki/Docker#cu ... _container

The plugin itself is maintained as this is mounted into the docker.

Code: Select all

#!/bin/bash

if [ -f /opt/domoticz/FIRSTRUN ]; then true
else
echo 'Installing Wallbox'
pip install -r /opt/domoticz/userdata/plugins/wallbox/requirements.txt
echo 'Creating FIRSTRUN file so script can check on next run'
touch /opt/domoticz/FIRSTRUN
cd /opt/domoticz || return
fi
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
edwinh81
Posts: 5
Joined: Wednesday 27 December 2017 17:20
Target OS: Linux
Domoticz version: 2024.4
Location: NLD
Contact:

Re: Python plugin: Wallbox EV charger

Post by edwinh81 »

Thank you!
Far as I can see now this did the trick for me.
underscore4
Posts: 21
Joined: Sunday 19 March 2017 22:06
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Wallbox EV charger

Post by underscore4 »

Really nice plugin ( and easy as well :-)).
Is there possible to change thw counter and set the ramp of changirng Amps instead of °C?

Could you please suggest actions?
Attachments
A ricarica.png
A ricarica.png (59.74 KiB) Viewed 13363 times
User avatar
waltervl
Posts: 7005
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2026.3
Location: NL
Contact:

Re: Python plugin: Wallbox EV charger

Post by waltervl »

You can do that yourself to click on the edit button and change C in A.

It could be that the plugin reset it to its default and then it is up to the plugin author to create a correct setpoint device.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
E2VInfo
Posts: 3
Joined: Monday 21 March 2016 20:36
Target OS: Linux
Domoticz version:
Contact:

Re: Python plugin: Wallbox EV charger

Post by E2VInfo »

I was using Wallbox plugin, but recently it stopped working. I removed the plugin/ dir, everything. When trying to re-install I get error:

error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.

If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.

If you wish to install a non-Debian packaged Python application,
it may be easiest to use pipx install xyz, which will manage a
virtual environment for you. Make sure you have pipx installed.

See /usr/share/doc/python3.11/README.venv for more information.

I recently updated my debian to bookworm. Python version 3.11.2. I also have libpython3.11

Is the suggested installation of a lower python version with venv the way to go? Or, any other suggestions?
hkhk
Posts: 32
Joined: Wednesday 15 November 2017 16:42
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python plugin: Wallbox EV charger

Post by hkhk »

I'm no expert but have been struggling with this too when upgrading to 2026 and moving to docker.
Looking at your post I assume you're not running in docker.
Going the venv way is the suggested method but be aware that it yields for all python plugins you use.
https://wiki.domoticz.com/Using_Python_plugins describes how to set it up
Or... you can go this way and run pip install -r requirements.txt --break-system-packages in the wallbox folder.

If you do use docker, be sure to run this in the docker image. You can do this by adding this in customstart.sh in the userdata folder (because an update of the docker image will purge the requirements so this will have to be redone)
Post Reply