Hello,
as a newbie to node-red I may ask a simple question but for me it has been a stopper for the last couple of days.
The scenario:
On an ESP8266 I run Tasmota to control 3 switches via timers. Ie. Timer1 sets the starttime for switch 2 and timer2 sets the off-time, nexts pair for the next switch and so forth.
I can set the timers from node-red vis mqtt in tasmota but I want to display the timers on the dashboard .
Below is what I "constructed" in node-red:
[
{
"id": "48c89b70.eef6dc",
"type": "debug",
"z": "630d4b3f.00cbf4",
"name": "tas-beregnung send",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": true,
"complete": "true",
"targetType": "full",
"statusVal": "payload",
"statusType": "auto",
"x": 900,
"y": 140,
"wires":
},
{
"id": "791c34c6.0135fc",
"type": "ui_text",
"z": "630d4b3f.00cbf4",
"group": "c02a6b55.2fc118",
"order": 1,
"width": 3,
"height": 1,
"name": "T1 Time (Start) ",
"label": "Start: ",
"format": "{{msg.payload.Timers.Timers1.Timer1.Time}}",
"layout": "row-left",
"x": 620,
"y": 200,
"wires":
},
{
"id": "e59fdba1.77c77",
"type": "ui_text",
"z": "630d4b3f.00cbf4",
"group": "3c738b31.8b3f8c",
"order": 1,
"width": 4,
"height": 1,
"name": "Timers EN ",
"label": "Zeitschalter: ",
"format": "{{msg.payload.Timers}}",
"layout": "row-left",
"x": 610,
"y": 100,
"wires":
},
{
"id": "cfd85c23.01eac",
"type": "ui_text",
"z": "630d4b3f.00cbf4",
"group": "c02a6b55.2fc118",
"order": 2,
"width": 2,
"height": 1,
"name": "T2 Time (Stop) ",
"label": "- ",
"format": "{{msg.payload.Timers.Timers1.Timer2.Time}}",
"layout": "row-left",
"x": 620,
"y": 240,
"wires":
},
{
"id": "b92d2d84.d4fc6",
"type": "mqtt in",
"z": "630d4b3f.00cbf4",
"name": "",
"topic": "stat/tas-beregnung/RESULT",
"qos": "0",
"datatype": "json",
"broker": "5c8bcfe4.56282",
"x": 220,
"y": 120,
"wires": [
[
"48c89b70.eef6dc",
"791c34c6.0135fc",
"cfd85c23.01eac",
"e59fdba1.77c77",
"12eaee0b.6a694a"
]
]
},
{
"id": "12eaee0b.6a694a",
"type": "ui_text",
"z": "630d4b3f.00cbf4",
"group": "c02a6b55.2fc118",
"order": 4,
"width": 3,
"height": 1,
"name": "T1 En ",
"label": "Enable: ",
"format": "{{msg.payload.Timer1.Enable}}",
"layout": "row-left",
"x": 590,
"y": 160,
"wires":
},
{
"id": "c02a6b55.2fc118",
"type": "ui_group",
"name": "Circuit 1",
"tab": "ed710c0d.999868",
"order": 2,
"disp": true,
"width": "6",
"collapse": false
},
{
"id": "3c738b31.8b3f8c",
"type": "ui_group",
"name": "Overall",
"tab": "ed710c0d.999868",
"order": 1,
"disp": true,
"width": 4,
"collapse": false
},
{
"id": "5c8bcfe4.56282",
"type": "mqtt-broker",
"name": "CCU-Jack",
"broker": "192.168.2.170",
"port": "1883",
"clientid": "",
"usetls": false,
"compatmode": false,
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"willTopic": "",
"willQos": "0",
"willPayload": ""
},
{
"id": "ed710c0d.999868",
"type": "ui_tab",
"name": "Test TAS",
"icon": "dashboard",
"order": 6,
"disabled": false,
"hidden": false
}
]
This is what the console in Tasmota shows:
[22:20:30] cmnd/tas-beregnung/timers1
[22:20:30] stat/tas-beregnung/RESULT {"Timers":"ON"}
[22:20:30] stat/tas-beregnung/RESULT {"Timers1":{"Timer1":{"Enable":1,"Mode":0,"Time":"18:35","Window":0,"Days":"1010111","Repeat":1,"Output":3,"Action":1},"Timer2":{"Enable":1,"Mode":0,"Time":"18:45","Window":0,"Days":"1111111","Repeat":1,"Output":3,"Action":0},"Timer3":{"Enable":0,"Mode":0,"Time":"00:00","Window":0,"Days":"0000000","Repeat":0,"Output":1,"Action":0},"Timer4":{"Enable":0,"Mode":0,"Time":"00:00","Window":0,"Days":"0000000","Repeat":0,"Output":1,"Action":0}}}
[22:20:30] stat/tas-beregnung/RESULT {"Timers2":{"Timer5":{"Enable":0,"Mode":0,"Time":"00:00","Window":0,"Days":"0000000","Repeat":0,"Output":1,"Action":0},"Timer6":{"Enable":0,"Mode":0,"Time":"00:00","Window":0,"Days":"0000000","Repeat":0,"Output":1,"Action":0},"Timer7":{"Enable":0,"Mode":0,"Time":"00:00","Window":0,"Days":"0000000","Repeat":0,"Output":1,"Action":0},"Timer8":{"Enable":0,"Mode":0,"Time":"00:00","Window":0,"Days":"0000000","Repeat":0,"Output":1,"Action":0}}}
[22:20:30] stat/tas-beregnung/RESULT {"Timers3":{"Timer9":{"Enable":0,"Mode":0,"Time":"00:00","Window":0,"Days":"0000000","Repeat":0,"Output":1,"Action":0},"Timer10":{"Enable":0,"Mode":0,"Time":"00:00","Window":0,"Days":"0000000","Repeat":0,"Output":1,"Action":0},"Timer11":{"Enable":0,"Mode":0,"Time":"00:00","Window":0,"Days":"0000000","Repeat":0,"Output":1,"Action":0},"Timer12":{"Enable":0,"Mode":0,"Time":"00:00","Window":0,"Days":"0000000","Repeat":0,"Output":1,"Action":0}}}
[22:20:30] stat/tas-beregnung/RESULT {"Timers4":{"Timer13":{"Enable":0,"Mode":0,"Time":"00:00","Window":0,"Days":"0000000","Repeat":0,"Output":1,"Action":0},"Timer14":{"Enable":0,"Mode":0,"Time":"00:00","Window":0,"Days":"0000000","Repeat":0,"Output":1,"Action":0},"Timer15":{"Enable":0,"Mode":0,"Time":"00:00","Window":0,"Days":"0000000","Repeat":0,"Output":1,"Action":0},"Timer16":{"Enable":0,"Mode":0,"Time":"00:00","Window":0,"Days":"0000000","Repeat":0,"Output":1,"Action":0}}}
... and this is what the debug-node produces
[OUTPUT]
26.8.2021, 22:20:31 node: tas-beregnung send
stat/tas-beregnung/RESULT : msg : Object
object
topic: "stat/tas-beregnung/RESULT"
payload: object
Timers1: object
Timer1: object
Enable: 1
Mode: 0
Time: "18:35"
Window: 0
Days: "1010111"
Repeat: 1
Output: 3
Action: 1
Timer2: object
Enable: 1
Mode: 0
Time: "18:45"
Window: 0
Days: "1111111"
Repeat: 1
Output: 3
Action: 0
Timer3: object
Enable: 0
Mode: 0
Time: "00:00"
Window: 0
Days: "0000000"
Repeat: 0
Output: 1
Action: 0
Timer4: object
Enable: 0
Mode: 0
Time: "00:00"
Window: 0
Days: "0000000"
Repeat: 0
Output: 1
Action: 0
qos: 0
retain: false
_msgid: "bf232a17.99e518"
The problem seems to be the long path the the var in the object. For example:
To get the value of time in timer1 the path shows as "payload.timers.timers1.timer1.time".
When I try to reference this in the textnode nothigs shows.
What do I do wron or how do I have to approach this problem.
Thank you for any help.
Hansjoerg