This driver is for integrating Hubitat with your Wallbox EV Charger.
A Wallbox EV Charger connected to the intenet
Your credentials for the my.wallbox portal
Your charger ID. This is the charger's serial number that you can see in Wallbox app, Charger Info screen
The initial version of the Hubitat drivers support the following capabilities:
Retrieve certain attributes of the charger (i selected the ones I thought were useful, there are more let me know if you need any to add them)
Set maximum charging current (in amperes, varies with the model/region - in Europe 6A to 32A)
Restart the charger
Not supported features
I have built the driver for a single charger. It would be possible to auto-detect multiple chargers in an account, as well as the groups hierarchy used by wallbox, but for now I created a simple one-device driver. If there is the need for more complex implementation I may consider in the future.
I have only tested with a Pulsar Plus charger, European 22kw version.
Copy the code for the driver into Hubitat
Create a new Virtual Device of type Wallbox Charger
Enter the correct parameters for the configuration
a. Username used for the wallbox portal
b. Password used for the wallbox portal
c. Id of the charger (as described in pre-requisites)
d. Token validity: driver refreshes access token if more than x days have passed. As far as I know, validity currently stands at 15 days
e. Log Level: i. 0: Error only ii. 1: Also Warnings iii. 2: Also Information iv. 3: Also Debug v. 4: Also Trace
f. Press Save Preferences
No worries. Great job and I'm able to test now.
Couple of things:
status or other information do not update automatically or...do not update in few minutes. So user need to do manual "refresh" for the device. You can test it by looking "statusName". Set charger to pause and wait for it to update to hubitat side. It doesn't most likely happen.
I do not know how it is made on HA side but it updates information almost realtime.
really slow to send commands (pause, resume for example). Not sure if it has nothing to do with your code but it takes 2min to set pause/resume.
I think we need all the attributes that we have been using with HA side. Definitely charging power and charging speed atleast.
Regarding updates to data: my approach is that the device driver should not auto-refresh. As data is pulled from the server, and not pushed to Hubitat by wallbox, my suggestion is that you create a rule in Rule Machine to trigger the refresh command as often as you like. I am not sure though if Wallbox has any limitations in volume of API calls.
As for slow commands, I tried with Lock/Unlock and the app is updated almost instantly. Mind you, I am far from the charger itself to confirm that the charger is actually locked, but at least the app is updated, so even if it is late it would not be something under my control. For Pause/Resume, my car is currently unplugged so I cannot test this - the API returns Forbidden in this case. But yesterday when testing I don't remember it taking a long time. Try checking logs (increase logging to 4) to see if API call is triggered immediately, if yes then any delays are not under the control of the driver.
Finally, about attributes, I will have a look at HA implementation to see what API calls are being used and attribute mapping, and will get back with a new version. Some of the attributes I see in the screenshot are not provided by the API I am using.
One thing. I see a poll option in device and makes me wonder if there is a possibility to set poll timer to device? It would be so much nicer than create a rule to webcore (os rule engine) to run poll from there.
It is possible, of course, let me have a look if i can do something configurable because I don’t want it active for myself
But, just curious why you prefer the driver itself to autoschedule instead of a rule? With a rule you can get far more control over conditions and schedules for triggering a refresh, without any code.
In the meantime I could not workout which APIs HA is using to retrieve all the attributes. I found for added energy and power, but needs reengineering of some code - the only api i found retrieving this is the one getting all chargers in the account. Will have a look over the weekend.
About the polling. I think it more like this.. all the devices report exact realtime status and with that information I'm able to do next level stuff like automation.. "if-then-else things" in webcore. Some of the devices that I use are not able to report status to Hubitat but I see it as a Hubitat's job to deliver and if it's possible to update status on Hubitat side it's more convenient for me
It's true that same thing can be achieved by using webcore or rule engine but I want to run next level automation there and not to update status of the certain device.
I do not understand much about coding or creating device drivers so I'm really happy what you have done already. So it is up to you and at the moment it is just me who is asking this So no pressure there.
About the attributes. Not sure if HA side helps you at all but here's the topic:
Please note I use Hubitat only, and when I meant rule engine, I meant Hubitat's Rule Machine. For example, with the below you can get the device to refresh every 30 seconds but only between 8am and 8pm
2.5kwh for 20km range would make your car’s range over 550km. Of course, if the charger doesn’t know what car you have it is not possible to be accurate. I am getting my BEV this week, will check if something is different afterwards.
Hi @pedro.f.andrade . Is there a way to make Wallbox device to be used with SharpTools? Sharptools is a dashboard app for Hubitat (also HA) users and at the moment SharpTools doesn't recognize Wallbox device with its attributes as a device that could be used.
I have learned that device driver should have "capabilities" so that SharpTools is able to use device with all its attributes. Could it be possible to add capabilities for a driver? @josh from SharpTools could be the right guy to help (us) you out
I actually added Switch capability to drive code and after that pulsar device was ready to be authorized to sharptools but device did not ever show up. That is probably just because I do not know what else should be added to drive code than capability line.
You could try updating the device selections within the SharpTools Hubitat app (within the Hubitat hub UI), and proceed through the 'Next' confirmations to see if it will sync over the new device that way.