So I am pulling dynamic energy proces from an API and I want them in Home Assistant to make a graph. I’ve put several hours in this but just can’t figure it out. I created a rest-sensor in HA and that works fine and it’s peanuts to get those values in HA. But I want to do it the other way around. This is the dictionary I create from the API-call:
[{"Time":"2024-09-16T00:00:00","Price":0.2313,"Price excluding taxes":0.105,"Price level":"NORMAL"},{"Time":"2024-09-16T01:00:00","Price":{"total":0.1975,"energy":0.078,"startsAt":"2024-09-16T01:00:00.000+02:00","level":"CHEAP"},"Price excluding taxes":0.078,"Price level":"CHEAP"},{"Time":"2024-09-16T02:00:00","Price":{"total":0.2049,"energy":0.0839,"startsAt":"2024-09-16T02:00:00.000+02:00","level":"CHEAP"},"Price excluding taxes":0.0839,"Price level":"CHEAP"},{"Time":"2024-09-16T03:00:00","Price":{"total":0.2245,"energy":0.0996,"startsAt":"2024-09-16T03:00:00.000+02:00","level":"CHEAP"},"Price excluding taxes":0.0996,"Price level":"CHEAP"},{"Time":"2024-09-16T04:00:00","Price":{"total":0.2411,"energy":0.1128,"startsAt":"2024-09-16T04:00:00.000+02:00","level":"NORMAL"},"Price excluding taxes":0.1128,"Price level":"NORMAL"},{"Time":"2024-09-16T05:00:00","Price":{"total":0.2722,"energy":0.1377,"startsAt":"2024-09-16T05:00:00.000+02:00","level":"NORMAL"},"Price excluding taxes":0.1377,"Price level":"NORMAL"},{"Time":"2024-09-16T06:00:00","Price":{"total":0.357,"energy":0.2056,"startsAt":"2024-09-16T06:00:00.000+02:00","level":"EXPENSIVE"},"Price excluding taxes":0.2056,"Price level":"EXPENSIVE"},{"Time":"2024-09-16T07:00:00","Price":{"total":0.822,"energy":0.5776,"startsAt":"2024-09-16T07:00:00.000+02:00","level":"VERY_EXPENSIVE"},"Price excluding taxes":0.5776,"Price level":"VERY_EXPENSIVE"},{"Time":"2024-09-16T08:00:00","Price":{"total":1.8594,"energy":1.4075,"startsAt":"2024-09-16T08:00:00.000+02:00","level":"VERY_EXPENSIVE"},"Price excluding taxes":1.4075,"Price level":"VERY_EXPENSIVE"},{"Time":"2024-09-16T09:00:00","Price":{"total":1.3146,"energy":0.9717,"startsAt":"2024-09-16T09:00:00.000+02:00","level":"VERY_EXPENSIVE"},"Price excluding taxes":0.9717,"Price level":"VERY_EXPENSIVE"},{"Time":"2024-09-16T10:00:00","Price":{"total":0.8082,"energy":0.5665,"startsAt":"2024-09-16T10:00:00.000+02:00","level":"VERY_EXPENSIVE"},"Price excluding taxes":0.5665,"Price level":"VERY_EXPENSIVE"},{"Time":"2024-09-16T11:00:00","Price":{"total":0.6668,"energy":0.4534,"startsAt":"2024-09-16T11:00:00.000+02:00","level":"VERY_EXPENSIVE"},"Price excluding taxes":0.4534,"Price level":"VERY_EXPENSIVE"},{"Time":"2024-09-16T12:00:00","Price":{"total":0.698,"energy":0.4784,"startsAt":"2024-09-16T12:00:00.000+02:00","level":"VERY_EXPENSIVE"},"Price excluding taxes":0.4784,"Price level":"VERY_EXPENSIVE"},{"Time":"2024-09-16T13:00:00","Price":{"total":0.6674,"energy":0.4539,"startsAt":"2024-09-16T13:00:00.000+02:00","level":"VERY_EXPENSIVE"},"Price excluding taxes":0.4539,"Price level":"VERY_EXPENSIVE"},{"Time":"2024-09-16T14:00:00","Price":{"total":0.6916,"energy":0.4732,"startsAt":"2024-09-16T14:00:00.000+02:00","level":"VERY_EXPENSIVE"},"Price excluding taxes":0.4732,"Price level":"VERY_EXPENSIVE"},{"Time":"2024-09-16T15:00:00","Price":{"total":0.7072,"energy":0.4858,"startsAt":"2024-09-16T15:00:00.000+02:00","level":"VERY_EXPENSIVE"},"Price excluding taxes":0.4858,"Price level":"VERY_EXPENSIVE"},{"Time":"2024-09-16T16:00:00","Price":{"total":0.7085,"energy":0.4868,"startsAt":"2024-09-16T16:00:00.000+02:00","level":"VERY_EXPENSIVE"},"Price excluding taxes":0.4868,"Price level":"VERY_EXPENSIVE"},{"Time":"2024-09-16T17:00:00","Price":{"total":0.8056,"energy":0.5645,"startsAt":"2024-09-16T17:00:00.000+02:00","level":"VERY_EXPENSIVE"},"Price excluding taxes":0.5645,"Price level":"VERY_EXPENSIVE"},{"Time":"2024-09-16T18:00:00","Price":{"total":1.1012,"energy":0.8009,"startsAt":"2024-09-16T18:00:00.000+02:00","level":"VERY_EXPENSIVE"},"Price excluding taxes":0.8009,"Price level":"VERY_EXPENSIVE"},{"Time":"2024-09-16T19:00:00","Price":{"total":0.7436,"energy":0.5148,"startsAt":"2024-09-16T19:00:00.000+02:00","level":"VERY_EXPENSIVE"},"Price excluding taxes":0.5148,"Price level":"VERY_EXPENSIVE"},{"Time":"2024-09-16T20:00:00","Price":{"total":0.7225,"energy":0.498,"startsAt":"2024-09-16T20:00:00.000+02:00","level":"VERY_EXPENSIVE"},"Price excluding taxes":0.498,"Price level":"VERY_EXPENSIVE"},{"Time":"2024-09-16T21:00:00","Price":{"total":0.4378,"energy":0.2703,"startsAt":"2024-09-16T21:00:00.000+02:00","level":"EXPENSIVE"},"Price excluding taxes":0.2703,"Price level":"EXPENSIVE"},{"Time":"2024-09-16T22:00:00","Price":{"total":0.3574,"energy":0.2059,"startsAt":"2024-09-16T22:00:00.000+02:00","level":"NORMAL"},"Price excluding taxes":0.2059,"Price level":"NORMAL"},{"Time":"2024-09-16T23:00:00","Price":{"total":0.2982,"energy":0.1585,"startsAt":"2024-09-16T23:00:00.000+02:00","level":"CHEAP"},"Price excluding taxes":0.1585,"Price level":"CHEAP"}]
I use Node-red-contrib-home-assistant-websocket. I use a sensor node. I understood that state needs to be string, number or boolean so I just took the first item in the first dictionary. Then I created an attribute in which I put msg.payload_today with a name “Prices”. That payload gives the dictionary I just showed. But I do not see any dictionary in HA! I’m going absolutely crazy. I tried many things and also spent a lot of time searching but to no avail. Does anyone have an idea?