[
{
"id": "ce5d7c18.92579",
"type": "tab",
"label": "Day17_Rooms2",
"disabled": true,
"info": ""
},
{
"id": "d38000b4.68858",
"type": "mqtt in",
"z": "ce5d7c18.92579",
"name": "",
"topic": "NodeESP/[PID]/button/state/get/out",
"qos": "2",
"broker": "3c53c9b8.8965a6",
"x": 200,
"y": 120,
"wires": [
[
"374e05a9.b7df0a"
]
]
},
{
"id": "374e05a9.b7df0a",
"type": "json",
"z": "ce5d7c18.92579",
"name": "",
"property": "payload",
"action": "",
"pretty": false,
"x": 190,
"y": 180,
"wires": [
[
"3653b639.8f685a"
]
]
},
{
"id": "131b3bd6.0d5e54",
"type": "ui_switch",
"z": "ce5d7c18.92579",
"name": "",
"label": "LED1 (on/off)",
"group": "a260dabf.f82928",
"order": 1,
"width": 0,
"height": 0,
"passthru": true,
"decouple": "false",
"topic": "",
"style": "",
"onvalue": "true",
"onvalueType": "bool",
"onicon": "",
"oncolor": "",
"offvalue": "false",
"offvalueType": "bool",
"officon": "",
"offcolor": "",
"x": 790,
"y": 140,
"wires": [
[
"44062ba.3746ed4"
]
]
},
{
"id": "ef2a4e22.c257c",
"type": "ui_switch",
"z": "ce5d7c18.92579",
"name": "",
"label": "LED2 (on/off)",
"group": "d920fbc5.d14b98",
"order": 1,
"width": 0,
"height": 0,
"passthru": true,
"decouple": "false",
"topic": "",
"style": "",
"onvalue": "true",
"onvalueType": "bool",
"onicon": "",
"oncolor": "",
"offvalue": "false",
"offvalueType": "bool",
"officon": "",
"offcolor": "",
"x": 790,
"y": 220,
"wires": [
[
"41ace90c.2e4648"
]
]
},
{
"id": "295a58e8.6e6918",
"type": "switch",
"z": "ce5d7c18.92579",
"name": "",
"property": "payload.pin_name",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "Button1",
"vt": "str"
},
{
"t": "eq",
"v": "Button2",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 430,
"y": 180,
"wires": [
[
"984f0e52.8731b"
],
[
"715cb1ad.f2617"
]
]
},
{
"id": "3653b639.8f685a",
"type": "split",
"z": "ce5d7c18.92579",
"name": "",
"splt": ",",
"spltType": "str",
"arraySplt": 1,
"arraySpltType": "len",
"stream": false,
"addname": "",
"x": 310,
"y": 180,
"wires": [
[
"295a58e8.6e6918"
]
]
},
{
"id": "36081dd0.5bdbe2",
"type": "mqtt out",
"z": "ce5d7c18.92579",
"name": "",
"topic": "NodeESP/[PID]/pwm/state/set",
"qos": "",
"retain": "",
"broker": "3c53c9b8.8965a6",
"x": 1250,
"y": 180,
"wires": []
},
{
"id": "44062ba.3746ed4",
"type": "template",
"z": "ce5d7c18.92579",
"name": "set_pwm_state",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": " {\"cmd\":\"set_pwm_state\",\"LED1\":{{payload}}}",
"output": "str",
"x": 980,
"y": 140,
"wires": [
[
"36081dd0.5bdbe2"
]
]
},
{
"id": "41ace90c.2e4648",
"type": "template",
"z": "ce5d7c18.92579",
"name": "set_pwm_state",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": " {\"cmd\":\"set_pwm_state\",\"LED2\":{{payload}}}",
"output": "str",
"x": 980,
"y": 220,
"wires": [
[
"36081dd0.5bdbe2"
]
]
},
{
"id": "984f0e52.8731b",
"type": "function",
"z": "ce5d7c18.92579",
"name": "led1_pin_state",
"func": "var pin_state=global.get('led1_pin_state') || false;\n\nif (!msg.payload.pin_state){\n (pin_state===false) ? (pin_state= true) : (pin_state= false);\n global.set('led1_pin_state', pin_state);\n msg.payload = pin_state;\n return msg;\n}\n",
"outputs": 1,
"noerr": 0,
"x": 600,
"y": 140,
"wires": [
[
"131b3bd6.0d5e54"
]
]
},
{
"id": "715cb1ad.f2617",
"type": "function",
"z": "ce5d7c18.92579",
"name": "led2_pin_state",
"func": "var pin_state=global.get('led2_pin_state') || false;\n\nif (!msg.payload.pin_state){\n (pin_state===false) ? (pin_state= true) : (pin_state= false);\n global.set('led2_pin_state', pin_state);\n msg.payload = pin_state;\n return msg;\n}\n\n",
"outputs": 1,
"noerr": 0,
"x": 600,
"y": 220,
"wires": [
[
"ef2a4e22.c257c"
]
]
},
{
"id": "b4f87db5.409db",
"type": "mqtt in",
"z": "ce5d7c18.92579",
"name": "",
"topic": "NodeESP/[PID]/adc/state/get/out",
"qos": "2",
"broker": "3c53c9b8.8965a6",
"x": 190,
"y": 340,
"wires": [
[
"11a689a1.9a46a6"
]
]
},
{
"id": "11a689a1.9a46a6",
"type": "json",
"z": "ce5d7c18.92579",
"name": "",
"property": "payload",
"action": "",
"pretty": false,
"x": 430,
"y": 340,
"wires": [
[
"90755690.a6e1a8"
]
]
},
{
"id": "90755690.a6e1a8",
"type": "template",
"z": "ce5d7c18.92579",
"name": "set_pwm_state",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": " {\"cmd\":\"set_pwm_state\",\"LED1\":{{payload.Poti_Led1}},\"LED2\":{{payload.Poti_Led2}}}",
"output": "str",
"x": 600,
"y": 340,
"wires": [
[
"27dbc289.2db6be"
]
]
},
{
"id": "27dbc289.2db6be",
"type": "mqtt out",
"z": "ce5d7c18.92579",
"name": "",
"topic": "NodeESP/[PID]/pwm/state/set",
"qos": "",
"retain": "",
"broker": "3c53c9b8.8965a6",
"x": 870,
"y": 340,
"wires": []
},
{
"id": "bf6f47bc.9d0f48",
"type": "inject",
"z": "ce5d7c18.92579",
"name": "LED1 On",
"topic": "",
"payload": " {\"cmd\":\"set_pwm_state\",\"LED1\":\"ON\"}",
"payloadType": "str",
"repeat": "",
"crontab": "00 08 * * *",
"once": false,
"onceDelay": 0.1,
"x": 170,
"y": 440,
"wires": [
[
"f35c54f0.9d1908"
]
]
},
{
"id": "df8961c9.da296",
"type": "inject",
"z": "ce5d7c18.92579",
"name": "LED1 Off",
"topic": "",
"payload": " {\"cmd\":\"set_pwm_state\",\"LED1\":\"OFF\"}",
"payloadType": "str",
"repeat": "",
"crontab": "00 18 * * *",
"once": false,
"onceDelay": 0.1,
"x": 170,
"y": 500,
"wires": [
[
"f35c54f0.9d1908"
]
]
},
{
"id": "c890c054.3b6fc",
"type": "inject",
"z": "ce5d7c18.92579",
"name": "LED2 On",
"topic": "",
"payload": " {\"cmd\":\"set_pwm_state\",\"LED2\":\"ON\"}",
"payloadType": "str",
"repeat": "",
"crontab": "00 20 * * *",
"once": false,
"onceDelay": 0.1,
"x": 170,
"y": 580,
"wires": [
[
"a83e4a39.3b5da8"
]
]
},
{
"id": "34d187e5.511f78",
"type": "inject",
"z": "ce5d7c18.92579",
"name": "LED2 Off",
"topic": "",
"payload": " {\"cmd\":\"set_pwm_state\",\"LED2\":\"OFF\"}",
"payloadType": "str",
"repeat": "",
"crontab": "00 23 * * *",
"once": false,
"onceDelay": 0.1,
"x": 170,
"y": 640,
"wires": [
[
"a83e4a39.3b5da8"
]
]
},
{
"id": "f35c54f0.9d1908",
"type": "mqtt out",
"z": "ce5d7c18.92579",
"name": "",
"topic": "NodeESP/[PID]/pwm/state/set",
"qos": "",
"retain": "",
"broker": "3c53c9b8.8965a6",
"x": 510,
"y": 460,
"wires": []
},
{
"id": "a83e4a39.3b5da8",
"type": "mqtt out",
"z": "ce5d7c18.92579",
"name": "",
"topic": "NodeESP/[PID]/pwm/state/set",
"qos": "",
"retain": "",
"broker": "3c53c9b8.8965a6",
"x": 510,
"y": 600,
"wires": []
},
{
"id": "3c53c9b8.8965a6",
"type": "mqtt-broker",
"z": "",
"name": "fkainka.de",
"broker": "broker.fkainka.de",
"port": "1883",
"clientid": "",
"usetls": false,
"compatmode": true,
"keepalive": "60",
"cleansession": true,
"willTopic": "",
"willQos": "0",
"willPayload": "",
"birthTopic": "",
"birthQos": "0",
"birthPayload": ""
},
{
"id": "a260dabf.f82928",
"type": "ui_group",
"z": "",
"name": "LED1",
"tab": "a36589e4.c55a28",
"order": 1,
"disp": true,
"width": "6",
"collapse": false
},
{
"id": "d920fbc5.d14b98",
"type": "ui_group",
"z": "",
"name": "LED2",
"tab": "a36589e4.c55a28",
"order": 2,
"disp": true,
"width": "6",
"collapse": false
},
{
"id": "a36589e4.c55a28",
"type": "ui_tab",
"z": "",
"name": "Day14",
"icon": "dashboard",
"order": 9
}
]