I'm using node-red for quite a long time and did a lot of useful things with it. Due to the documentation, forum and provided info's I was able to solve problems on my own. It seems, that I reached my personal limits now. I'm using node-red 4.0.5 running in a docker container on a RPi 5.
This project refers to our switch and energy meter devices flashed with the tasmota firmware. Since we have a lot of these devices I want to display (in a first step) the timer values in a table. To read out date via MQTT is no problem. The complete object looks like this:
I'm interested in the data from Timer1 to Action. UI-Table from the old dashboard accepts only arrays as far as I know. This is my first problem: I can't find out how to convert this object in an object into an array.
If I use the new ui-table (dashboard 2.0) it's no problem to convert the Timer1 object in an object into an object on it's own. Showing data in the new ui-table works, since it accepts objects as well. Unfortunately I'm losing the Object name "Timer1", which is essential. Otherwise I do not know to which Timer the data might belong to.
So the short version of my questions: How to make an array out of an object in an object and how can I display Timer1 in a field of the table in a column named Timers for example.
If possible, I would prefer no function nodes. This makes it much easier for me to understand your help. Thanks a lot.
That would be payload.Timer1 (capital T). And that only works for a single named Timer. If there are multiple, you would have to do something for every one which isn't scalable.
There will be a JSONata equivalent of the JS code I shared, I am just too tired to work it out.
If I might bother you again: Do you know how to convert the result into an array in order to use the old dashboard? It is definitely a question without any urge.
You are right! All questions solved. Crazy, 3 lines Jasonata and two brackets and four days of searching the web came ton an end. If you know what you do.....
Thanks again.
And you are absolutely right again: That's why I'm running all these things on an island system attached to nothing. Additionally I don't want to have anything on my productive system which isn't tested thoroughly.