Warning
[23-06-2024] There are problems with Node-RED 4.0.0 and this subflow. Please see this thread for more information and how to get around them for now.
[02-05-2024] If you get
HTTP Error [403:x]
, try replacing the subflow with version 2.5.[21-09-2023] Shell Recharge and the Shell Go+ loyalty program now share the same login details. You may need to change your password inside the flow.
This subflow will control Shell Recharge or Newmotion car charging equipment.
The latest version is sr-2-50.json which needs Node-RED version 3.02 or later.
Drag the Shell Recharge node into a flow.
Double-click on the new node.
Using the credentials used to login to the Shell Recharge website, enter the username and password into the respective fields of the Edit subflow instance: <xxx>
box which appears.
To find suitable values for Charger ID and Card ID, send a payload (using an inject node, for example) to Input containing:
msg.payload = { "action": "setup" }
Inspect the output (by connecting a debug node to the Debug output). Find your charger and RFID token card/keyfob details in this- these match the information shown on the Shell Recharge website. The array index for msg.payload.chargePoints and msg.payload.chargeTokens (highlighted by the red circles in the image above) should be entered in the configuration fields Charger ID and Card ID respectively. These will be a number, usually 0
.
Warning
Card ID and Charger ID must only contain a number derived from the process above. Do not enter the charge card number as printed on a key fob/RFID token card or charge point serial number.
msg.payload = { "action": "ACTION" }
...where ACTION is:
start and stop
Start or stop a charging session using the configured charger and RFID card/token.
Override the node settings for Charger ID ('cid') and Card ID ('tid') with:
msg.payload = { "action": "start", "cid": <number>, "tid": <number> }
Add a random delay (between 0 and 5 minutes) to the start of a charge with:
msg.payload = { "action": "start", "delay": true }
reset
Reset the charging equipment.
poll
Poll the charging equipment once for status information: this gives details directly from Shell Recharge like 'Charging' and 'Occupied'.
msg.payload = { "action": "poll" }
rpoll and nopoll
Repeatedly poll the charging equipment for status information.
The polling interval (in seconds) can be set in (number) msg.rpoll.interval and the duration (in seconds) can be set in (number) msg.rpoll.duration, for example:
msg.payload = { "action": "rpoll", "poll": {"interval": 5, "duration": 20 } }
This would poll every 5 seconds for 20 seconds.
Stop polling with nopoll.
After start, stop and reset, polling will automatically run every 20 seconds for 120 seconds.
energy
Get energy consumption information.
The start time is set in (number) msg.range.start and the end time is set in (number) msg.range.end, both in Unix timestamp format, for example:
msg.payload = { "action": "energy", "range": {"start": 1692054000000, "end": 1694645999999 } }
expire
Delete the current Shell Recharge API token. This will force a login attempt during the next interaction with Shell Recharge.
flush
Delete the current Shell Recharge API token, session and cache (which stores account details like chargers and token cards).
dump
Show the internal cache.
The Output payload is (boolean) true if a charge is in progress, otherwise it is (boolean) false. This is also updated when polling is in progress. All other output is from Debug labelled with topics like status, poll, response, energy and error.
HTTP Error [401:x]
This means 'Unauthorised'. Check your username and password, or try expire.
HTTP Error [409:x]
"The HTTP 409 Conflict response status code indicates a request conflict with the current state of the target resource."
In the context of Shell Recharge, this probably means you're trying to start a charge while the system is in the process of stopping a session, or maybe resetting. Wait, then try again.
"TypeError: Cannot read properties of undefined (reading '[evses|uuid]')"
Do not enter the value of uuid
or rfid
given the {"action":"setup"}
process into the Edit subflow instance: <xxx>
section. Charger ID
and Card ID
should be a number, usually 0
.
Otherwise, get in touch.
via Github