Hi
I am trying to build an countdown from a number (7777777777).
Every 4 Seconds it should decrease at 1
And this number is shown in Dashboard.
That works all.
Now my Question: If the Raspyery gets off from Power and restarts the Number starts decreasing from 7777777777. i want to start decreasing from the number where the raspberry get out of power. so i have to give the latest output in an variable, so i think. but how can i do that?
Thanks for Help
Here is my flow
[
{
"id": "3bcdcc3bcf7c430e",
"type": "tab",
"label": "Flow 1",
"disabled": false,
"info": "",
"env": []
},
{
"id": "0bdf612159e2a8ec",
"type": "function",
"z": "3bcdcc3bcf7c430e",
"name": "function 2",
"func": "var count = context.get('count') || 0;\ncount += 1;\nmsg.payload = Number (7777777777) - count;\ncontext.set('count', count);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 420,
"y": 180,
"wires": [
[
"7fbee56ef37d9748",
"5f8d5d36cf1f74d6",
"82d96936305edca3"
]
]
},
{
"id": "d4b4a1e8b2e8fa31",
"type": "inject",
"z": "3bcdcc3bcf7c430e",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "4",
"crontab": "",
"once": true,
"onceDelay": 0.1,
"topic": "",
"payload": "ON",
"payloadType": "str",
"x": 190,
"y": 180,
"wires": [
[
"0bdf612159e2a8ec"
]
]
},
{
"id": "7fbee56ef37d9748",
"type": "debug",
"z": "3bcdcc3bcf7c430e",
"name": "debug 4",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 640,
"y": 140,
"wires": []
},
{
"id": "5f8d5d36cf1f74d6",
"type": "ioBroker out",
"z": "3bcdcc3bcf7c430e",
"name": "Counter",
"topic": "0_userdata.0.Counter",
"ack": "false",
"autoCreate": "false",
"stateName": "",
"role": "",
"payloadType": "",
"readonly": "",
"stateUnit": "",
"stateMin": "",
"stateMax": "",
"x": 640,
"y": 260,
"wires": []
},
{
"id": "82d96936305edca3",
"type": "ui_text",
"z": "3bcdcc3bcf7c430e",
"group": "316dca5a2cf81cf0",
"order": 0,
"width": "20",
"height": "6",
"name": "",
"label": "Counter",
"format": "{{msg.payload}}",
"layout": "col-center",
"className": "",
"x": 640,
"y": 200,
"wires": []
},
{
"id": "316dca5a2cf81cf0",
"type": "ui_group",
"name": "Standard",
"tab": "0a3fda28b8bfc042",
"order": 1,
"disp": false,
"width": "20",
"collapse": false,
"className": ""
},
{
"id": "0a3fda28b8bfc042",
"type": "ui_tab",
"name": "Home",
"icon": "dashboard",
"disabled": false,
"hidden": true
}
]