I am using Node-red to make a program for home automation. I take energy prices from the norpool api+ and format these values to just get the timestamp and also the prices per hour.
I get these values for every hour of the day. Is it possible to just get the price of the hour we are closest to. For example when it is 14/3/2023 10:0:0 to just get the price 0.1544. I want to show this value on the dashboard and also I want to make an automatisation that send values to some devices according to the current energy prices.
The code to get these values is:
flows.json (1.2 KB)
{"today":[{"Tijd":"14/3/2023 00:00:00","Prijs":0.01914},{"Tijd":"14/3/2023 01:00:00","Prijs":0.00902},{"Tijd":"14/3/2023 02:00:00","Prijs":0.00818},{"Tijd":"14/3/2023 03:00:00","Prijs":0.00426},{"Tijd":"14/3/2023 04:00:00","Prijs":0.00774},{"Tijd":"14/3/2023 05:00:00","Prijs":0.02138},{"Tijd":"14/3/2023 06:00:00","Prijs":0.09126000000000001},{"Tijd":"14/3/2023 07:00:00","Prijs":0.18872},{"Tijd":"14/3/2023 08:00:00","Prijs":0.20022},{"Tijd":"14/3/2023 09:00:00","Prijs":0.18762},{"Tijd":"14/3/2023 10:00:00","Prijs":0.1544},{"Tijd":"14/3/2023 11:00:00","Prijs":0.12192},{"Tijd":"14/3/2023 12:00:00","Prijs":0.09337999999999999},{"Tijd":"14/3/2023 13:00:00","Prijs":0.11236},{"Tijd":"14/3/2023 14:00:00","Prijs":0.13136},{"Tijd":"14/3/2023 15:00:00","Prijs":0.1218},{"Tijd":"14/3/2023 16:00:00","Prijs":0.16091999999999998},{"Tijd":"14/3/2023 17:00:00","Prijs":0.268},{"Tijd":"14/3/2023 18:00:00","Prijs":0.314},{"Tijd":"14/3/2023 19:00:00","Prijs":0.4096},{"Tijd":"14/3/2023 20:00:00","Prijs":0.3207},{"Tijd":"14/3/2023 21:00:00","Prijs":0.35926},{"Tijd":"14/3/2023 22:00:00","Prijs":0.31760000000000005},{"Tijd":"14/3/2023 23:00:00","Prijs":0.3092}]}
Thanks in advance