Thx, i have looked only to mqtt
Hey @Madradrakie & @35e, I would really appreciate a helping hand on where to put your user email and Password?
I’ve searched through the flow but cannot seem to find it.
Any steer would be great
This was a Free new Motion Charger otherwise i would have returned it.
Zero smarts.
Hi 35e, Thx for sharing this. Works great.
I have a question on the dashboard information of the Shell Recharge site
I would like to access the Charge sessions information → Date Time and kWh used. Can you hint me in the right direction how to achieve that in NodeRed.
Thx,
PPee
I don’t have a subscription so don’t get that information.
Have a look at this library from line 286.
You are awesome
i know!
new version here… a complete rewrite. should work as a drop-in replacement, and should give energy statistics although i can’t test that as i have no subscription.
Thx, but I cannot test it right now. I’m abroad now. Will try later!
I’m struggling getting the Node RED flow working. I imported it, there was a unused Home Assistant server node which I removed and it deploys perfectly:
However, I’m not seeing any MQTT payloads come by from any of the topics. Is there anything else I should do?
your own system would need to be generating those mqtt payloads in response to an action somewhere.
if you’re not familiar with node-red you should investigate node-red-contrib-home-assistant-websocket which can trigger the flow from, for example, a button press on the home assistant dashboard.
That doesn’t really answer my question. The flow seems to work with MQTT. I set up the MQTT broker and it should be connected successfully. Furthermore, in your initial version you spoke about sending payloads to MQTT topics:
Sending any payload to the MQTT topic
nrcom/shellRechargeStatus
I use MQTT Explorer to see anything from all topics. I do not see the nrcom topic. Even when I publish a packet through the MQTT broker, I don’t get a response. I’m probably doing something wrong here, but I’m not even looking at any MQTT buttons for that matter. Also, I don’t think the NodeRED websocket when I purely want to look at the MQTT side.
@35e I want to use this flow to add the charge point to my energy dashboard. The flow returns data on the individual charge sessions, but not the total kWh used. Which is shown in the dashboard
Would it be possible to add that data point?
Furthermore, I have been struggling with adjusting the date range. It says that ‘from’ and ‘to’ need to be added to the payload parameters, but being the Node red noob that I am, I don’t know how. I tried doing it the way you can see on the screenshot, but that doesn’t seem to work
@Wout - takes a bit to get what node-red’s about, i agree.
try returning that ‘setup’ node you’ve given a screenshot for back to what it was (delete ‘set flow.from’ and set ‘flow.to’), then wire an inject node to the leftmost input of the shellrecharge node like so…
the inject node will need to look something like…
note the selection ‘{}’ and you can click on the ‘…’ icon there to see something like…
{
"action": "info",
"from": 1651014000000,
"to": 1653605999999
}
that’s where your date range goes.
i get something back like…
i guess you get full data. what does energy-total say?
It returns the total number of charge sessions for the date range
ok, thanks. i don’t know how to get the total energy straight from shell but maybe i arrange things to calculate it from the other results? could you send over a copy of your msg.payload.energy and i’ll have a look?
I changed the ‘from’ value to a date before I had the charge point installed, and it correctly returns a total of about 200 charge sessions. Problem is, it only returns details for the last 50 of them so I don’t think this will work
@wout some work done by @siumba might give the answer… if only shell would document their systems.
internally there’s a request to url https://ui-chargepoints.shellrecharge.com/api/facade/v1/user-sessions/charge-points with a body of…
{
"chargePointSerials":["{{#payload.chargePointSerials}}{{.}}{{/payload.chargePointSerials}}"],
"endDateTime": "{{payload.end}}",
"offset": "0",
"sortField": "startDateTime",
"sortOrder": "desc",
"startDateTime": "{{payload.start}}",
"userId": "{{payload.id}}"
}
the offset bit might be relevant here? i’ll add something to make that changeable, and maybe setting offset: 50
will give the next block of 50 results with another request…? let me have a fiddle.
So I figured out what I was doing wrong with your flow before, so I got everything working via MQTT (getting and sending info). I don’t really understand why you want to trigger the flow via a button in Home Assistant, but that’s something else to discuss.
@wout What I did in the NodeJS app to get the total usage is to determine the firstConnection. FirstConnection is variable that gets the installation date of your home charger. This installation date is like the very first point that data can be generated. I do a select of all sessions since that firstConnection date and therefore I get the “total usage”.
I’m also updating my NodeJS app with the new Shell Recharge URL’s, then I can actually break down the URL for retrieving totalUsage ;).
Would you be able to share your config?