Wallbox pulsar plus integration?

great! thx.

Good idea exposing the internal database to the local network and have Home Assistant poll it externally but that’s very inefficient since these values rarely change.

Although I didn’t have a need for max_charging_current or lock, I had a need to expose whether the charging cable is plugged so that the garage door doesn’t fully close on the cable when the car is parked on the driveway.

I significantly improved the MQTT Broker, see Improve MQTT Bridge by tronikos ¡ Pull Request #1 ¡ jagheterfredrik/wallbox-tooling ¡ GitHub

With my previous changes forwarding internal read only MQTT, see Wallbox pulsar plus integration? - #751 by tronikos I don’t have a need for the cloud integration anymore.

2 Likes

@tronikos,

Do you have control over Pause / Resume, and if so, how is that accomplished?

Yes via MQTT. See PR linked in my earlier post. With that I now get the following:

And with the much earlier post that forwards the micro2wallbox internal MQTT I get:

1 Like

Excellent work @tronikos

It looks as though almost all pieces of the puzzle have been found but I think there is still one thing missing…

The current (cloud) integration provides a sensor: Added Energy

With your MQTT bridge, you only provide an Energy sensor if an External Energy Meter is connected and it’s not clear whether this is the energy used to charge the EV, or total energy coming in from the grid.

The cloud integration provides this sensor regardless of whether an External Energy Meter is connected or not. How can added energy for the charging session be calculated without the external energy meter being present?

Will it be necessary to calculate instantaneous Wattage using Volts x Amps and add this to a separate sensor with the totalling function enabled? This would need to be reset whenever the cable is unplugged.

I’m trying to root my wallbox, in the terminal it says sending pwnware and after a minute or so the wifi connection with the wallbox hotspot closes.
The Bluetooth connection is still active and terminal still saying sending pwnware.
What do I need to do next?
Is it done rooting the wallbox?

The energy in my 2nd screenshot is from the paired power meter. That’s the total energy my whole house consumes.

To calculate the EVSE power I have the following template:

template:
  - sensor:
    - name: micro2wallbox ac watt rms
      unique_id: micro2wallbox_ac_watt_rms
      state: "{{ states('sensor.micro2wallbox_ac_current_rms_l1') | float * states('sensor.micro2wallbox_ac_voltage_rms_l1') | float }}"
      device_class: "power"
      unit_of_measurement: "W"
      state_class: "measurement"

and to calculate the EVSE energy for the energy dashboard I use a Riemann sum integral sensor created via the UI.

It should be possible to create another template sensor that resets when the cable is unplugged. But I believe the information is already available in the database. I don’t have access to it right now. If I remember it’s either in the single row of the active_session table or in the last row of the sessions table. If it’s there we should be able to easily make it available via the MQTT Broker. I think the added range is also available in another column there that might be worth exposing.

1 Like

Thanks very much @tronikos for your detailed reply. Yes, I thought a template sensor might be useful for the EVSE Power.

If the EVSE Energy is already present in the database, it would be best to use it. I have become familiar with the relationship between EVSE Energy as reported by Wallbox, and Battery SoC added per session, so I would like to keep using the Wallbox figure, even though it’s not entirely accurate.

Added range isn’t useful to me, and it will vary for each different vehicle, but someone else might use it, so I guess it wouldn’t hurt to add an extra sensor while you’re working on the code.

Many thanks for all your hard work on this. It would be good to be independent of the cloud and Wallbox API, but I will wait until you’ve added the extra sensor or two.

P.S. Is the current Status Code present anywhere in the database (according to the following list)…

READY(0),
CHARGING(1),
CONNECTED_WAITING_CAR(2),
CONNECTED_WAITING_SCHEDULE(3),
PAUSED(4),
SCHEDULE_END(5),
LOCKED(6),
ERROR(7),
CONNECTED_WAITING_CURRENT_ASSIGNATION(8),
UNCONFIGURED_POWER_SHARING(9),
QUEUE_BY_POWER_BOOST(10),
DISCHARGING(11),
CONNECTED_WAITING_ADMIN_AUTH_FOR_MID(12),
CONNECTED_MID_SAFETY_MARGIN_EXCEEDED(13),
OCPP_UNAVAILABLE(14),
OCPP_CHARGE_FINISHING(15),
OCPP_RESERVED(16),
UPDATING(17),
QUEUE_BY_ECO_SMART(18);

It would be very handy to have access to that too.

I don’t remember seeing the status in the database, MQTT, or redis. Maybe it’s computed by various bits of information. @jagheterfredrik have you encountered the status anywhere?

I’ve started over but this time with a windows laptop instead of linux and I’ve got passed “sending pwnware” and got back to the prompt.
so I guess the rooting was successful?
but when I want to ssh to the wallbox it returns permission denied (publickey).
sorry for the noob questions, can someone tell me why the permission is denied?
need some help plz.

never mind, I’ve got it working now.
restarting the charger and repeating the root procedure fixed it.

1 Like

@tronikos I’m following your guide for local readout, I have installed the mosquitto broker, rooted my wallbox, adapted configuration.yaml, created /mqtt/wallbox.yaml etc… but I do have one question, in point 2 you talk about etc/mosquitto/mosquitto.conf, is this a file to create on the wallbox via ssh? or is this a file in HA?

Once you ssh to your wallbox run: vi /etc/mosquitto/mosquitto.conf and add the mentioned lines at the end of the file. If you aren’t familiar with vi you first have to press i to enter insert mode. Save and quit with :wq. Then either restart the mosquito service or the whole machine.

I did it with mkdir, touch and nano, I guess that’s ok too, or is there a difference?
I also restarted the wallbox. in HA I can see the new entities in MQTT but they are all unknown.
Do I need to install something else on the wallbox?
There is not much going on when I ls the wallbox, there is a zip file, an sql, an (empty) telemetry directory and the new etc directory.
There was no etc directory to begin with, so I think I need to install mqtt on the wallbox first?

If you want Wallbox local control with:

  • pause
  • lock
  • set max charging current
  • added energy (useful for the energy dashboard)
  • added range
  • cable connected
  • charging power

follow the instructions at https://github.com/jagheterfredrik/wallbox-tooling/tree/main/mqtt-bridge

(that’s after Further improve the MQTT broker by tronikos · Pull Request #2 · jagheterfredrik/wallbox-tooling · GitHub is merged)


If you want access to power meter readings with information like voltage and current per phase, total energy, and more:

follow the instructions at Wallbox pulsar plus integration? - #751 by tronikos

1 Like

Thx for pointing me in the right direction, I will look into that.

@tronikos I get “Failed to enable unit: No such file or directory” when trying to systemctl enable mqtt-bridge?
all the previous steps were successful.
I guess the ln command did not work properly? there is no lib/systemd/… to be found.

Are you sure you are running these commands on the Wallbox? If you run uname -a do you get something like Linux WBXXXXXX 4.9.30 #7 SMP Wed Aug 11 15:37:27 UTC 2021 armv7l armv7l armv7l GNU/Linux? I have a Wallbox Pulsar Plus. What do you have? Maybe the Linux structure is different between models or versions. Were you able to successfully run python bridge.py? If yes, you just need to figure out the proper commands for your case to enable the systemd service.

I’m running these commands on my Wallbox.
I have two Copper SB chargers.
uname -a returns: Linux WBxxxxxx 5.4.83 #1 SMP Mon Oct 25 22:08:04 UTC 2021 armv7l armv7l armv7l GNU/Linux
and python bridge.py was successful too.

when i try to redo the ln command, it returns ln: failed to create symbolic link ‘/lib/systemd/system/mqtt-bridge.service’: File exists
implying the first command was successfully executed?
shouldn’t I be able to cd to /lib/systemd/…?

edit:
Ok I can cd into lib/systemd/… they’re hidden files I guess.
when I nano the mqtt-bridge.service, the file is empty and when I cat the file it does not exist. Is this supposed to be like this?