Skip to content

dgthomson/nodered-shellrecharge

Repository files navigation

Warning

[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.

[02-05-2024] If you get HTTP Error [403:x], try replacing the subflow with version 2.5.

About this subflow

This subflow will control Shell Recharge or Newmotion car charging equipment.

The latest version is sr-2-30.json which needs Node-RED version 3.02 or later.

Buy Me A Coffee

Getting started

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" }

Data

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.

Screenshot 2023-02-26 at 11 15 27

Inputs

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.

Outputs

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.

Problems

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.

Contact

via Github

About

A subflow for Nodered to control Shell Recharge car charging equipment.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published