@complex1 : yes that was the solution, mainly the usageType:. After changing it to 1 it gave the correct value. I also searched the code and found it there, and there you see when you select gas it changes the value to 3. Thanks for your help, Iām starting to understand it a bit. I do notice that it does not load the last hour of the day after, I think there is still something wrong with the time notation in the end time
fromDate: >
{{(now().strftime('%Y-%m-%d')|as_datetime).isoformat()}}Z
tillDate: >
{{((now()+ timedelta(days=2)).strftime('%Y-%m-%d')|as_datetime).isoformat()}}Z
And I found another site where I can get the data from:
https://www.easyenergy.com/nl/iframe/energietarieven-stroom-nieuwestroom
and the url for the data:
https://mijn.easyenergy.com/nl/api/tariff/getapxtariffs?startTimestamp=2022-11-20T23%3A00%3A00.000Z&endTimestamp=2022-11-21T23%3A00%3A00.000Z&grouping=&includeVat=false
But from this url comes an xml file, which I also got to work in node red but I donāt know how to get todayās date in node red. This section:
fromDate: >
{{(now().strftime('%Y-%m-%d')|as_datetime).isoformat()}}Z
tillDate: >
{{((now()+ timedelta(days=2)).strftime('%Y-%m-%d')|as_datetime).isoformat()}}Z
This is the code in Node-Red:
[{"id":"0438d6830456e250","type":"http request","z":"a468b9631abe51c4","name":"","method":"GET","ret":"obj","paytoqs":"body","url":"","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":670,"y":260,"wires":[["1d6fd45c9a7cd789"]]},{"id":"1d6fd45c9a7cd789","type":"debug","z":"a468b9631abe51c4","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1060,"y":260,"wires":[]},{"id":"a8a9402d64df24e0","type":"inject","z":"a468b9631abe51c4","name":"Energy prices","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"https://mijn.easyenergy.com/nl/api/tariff/getapxtariffs?startTimestamp=2022-11-20T23%3A00%3A00.000Z&endTimestamp=2022-11-21T23%3A00%3A00.000Z&grouping=&includeVat=false","payloadType":"str","x":270,"y":260,"wires":[["70154cd4.de1444"]]},{"id":"70154cd4.de1444","type":"change","z":"a468b9631abe51c4","name":"","rules":[{"t":"set","p":"url","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":470,"y":260,"wires":[["0438d6830456e250"]]}]