Download the PHP package dutchie027/wallbox without Composer
On this page you can find all versions of the php package dutchie027/wallbox. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dutchie027/wallbox
More information about dutchie027/wallbox
Files in dutchie027/wallbox
Package wallbox
Short Description This library calls on the Wallbox API to get information about the EV statistics from their charger
License MIT
Informations about the package wallbox
wallbox
Overview
This API wrapper was written to allow me to get better metrics and usage out of my wallbox EVSE.
Usage
To start, simply download the package using composer:
After downloading it with composer, open wallbox.ini
and enter your variables and credentials.
Once you have all of that, depending on how you want to use it, create a simple PHP file that calls the library:
Running as a monitor
The most common use case for the script(s) are a monitoring system. To accomplish this, there is a function called monitor
that uses a lot of defaults and will notify you of changes to the system. It will check the EVSE every 30 seconds by default and notify you of any changes using pushover with the configuration settings in .env
. To monitor the system, first create a file called monitor.php
using the below:
After you've created the monitoring file, ensure it's executable by running chmod +x monitor.php
. Once you've done that, simply trigger it with a nohup
so it runs in the background:
Functions
checkLock
Returns true/false if the charger is locked. true
if the charger is locked, false
if the charger is unlocked.
getStats
Returns a JSON payload of stats for the charger between start and int (epoch times).
getChargerStatus
Returns a JSON payload of status of the specific charger. Sample payload
getFullPayload
Returns a JSON payload of status of the all chargers. Sample payload
getLastChargeDuration
Returns time in xh xm if hours and minutes. If only minutes it returns xm xs.
checkFirmwareStatus
Checks if the firmware is up-to-date. Returns a human string about the status
unlockCharger
Unlocks the charger.
lockCharger
Locks the charger.
getChargerData
Returns JSON payload of the specific charger data sample
getTotalChargeTime
Returns time in xh xm if hours and minutes. If only minutes it returns xm xs.
getTotalSessions
Returns an integer denoting total charge sessions
Dependencies
The code uses a few external libraries, but they're all bundled in the composer.json file.
- monolog/monolog
- guzzlehttp/guzzle
- serhiy/pushover
Acknowledgements
Shout out to the Python work that cliviu74 did. This was the foundation that gave me a lot of the URLs.
All versions of wallbox with dependencies
monolog/monolog Version ^3.0
guzzlehttp/guzzle Version ^7.5
serhiy/pushover Version ^1.1