Keresés

Új hozzászólás Aktív témák

  • sparks

    senior tag

    válasz Rolly #13905 üzenetére

    Szia!
    Nekem frissíti. Vagy lehet nem jól értelek, nálam frissíti az állapotokat. Tehát, ha mondjuk felkapcsolom a nappali lámpát a z-wave-es villanykapcsolóval és megnézem a home-ban, akkor mutatja, hogy felkapcsoltam. Én a domoticz fórum oldalon található példát honosítottam és azzal oda-vissza megy az állapotjelentés. Ez volt az alap:
    [     {         "id": "76efc51b.db2e8c",         "type": "mqtt in",         "z": "46580878.ba4bd8",         "name": "",         "topic": "domoticz/out",         "qos": "0",         "datatype": "auto",         "broker": "9748a36f.44bdd",         "x": 230,         "y": 240,         "wires": [             [                 "ed9342a4.d56ec"             ]         ]     },     {         "id": "ed9342a4.d56ec",         "type": "json",         "z": "46580878.ba4bd8",         "name": "",         "property": "payload",         "action": "",         "pretty": false,         "x": 370,         "y": 240,         "wires": [             [                 "ebe7e2e1.4a69d"             ]         ]     },     {         "id": "ebe7e2e1.4a69d",         "type": "function",         "z": "46580878.ba4bd8",         "name": "Function In on/off",         "func": "msg.topic = msg.payload.idx\nif (msg.payload.nvalue === 1)\n{\n    msg.payload = true\n}\nelse if (msg.payload.nvalue === 0)\n{\n    msg.payload = false\n}\n    return msg;",         "outputs": 1,         "noerr": 0,         "x": 570,         "y": 240,         "wires": [             [                 "cd626796.602738"             ]         ]     },     {         "id": "cd626796.602738",         "type": "switch",         "z": "46580878.ba4bd8",         "name": "",         "property": "topic",         "propertyType": "msg",         "rules": [             {                 "t": "eq",                 "v": "112",                 "vt": "str"             },             {                 "t": "eq",                 "v": "92",                 "vt": "str"             },             {                 "t": "eq",                 "v": "42",                 "vt": "str"             },             {                 "t": "eq",                 "v": "151",                 "vt": "str"             },             {                 "t": "eq",                 "v": "66",                 "vt": "str"             },             {                 "t": "eq",                 "v": "169",                 "vt": "str"             },             {                 "t": "eq",                 "v": "170",                 "vt": "str"             },             {                 "t": "eq",                 "v": "171",                 "vt": "str"             },             {                 "t": "eq",                 "v": "172",                 "vt": "str"             },             {                 "t": "eq",                 "v": "173",                 "vt": "str"             },             {                 "t": "eq",                 "v": "174",                 "vt": "str"             },             {                 "t": "eq",                 "v": "53",                 "vt": "str"             },             {                 "t": "eq",                 "v": "155",                 "vt": "str"             }         ],         "checkall": "true",         "repair": false,         "outputs": 13,         "x": 750,         "y": 240,         "wires": [             [],             [],             [],             [],             [],             [                 "89c0375f.018278"             ],             [],             [],             [],             [],             [],             [],             []         ]     },     {         "id": "89c0375f.018278",         "type": "nora-light",         "z": "46580878.ba4bd8",         "devicename": "Dining table",         "lightcolor": false,         "brightnesscontrol": false,         "passthru": false,         "statepayload": true,         "brightnessoverride": "",         "roomhint": "Living room",         "name": "Dining table",         "nora": "4aa17da2.220c54",         "topic": "169",         "onvalue": "true",         "onvalueType": "bool",         "offvalue": "false",         "offvalueType": "bool",         "x": 910,         "y": 220,         "wires": [             [                 "d4f7bf20.d6a37"             ]         ]     },     {         "id": "d4f7bf20.d6a37",         "type": "function",         "z": "46580878.ba4bd8",         "name": "Funkcja ON/OFF",         "func": "var idx = msg.topic\nif ( msg.payload === true )\n{\nmsg.payload = { \"command\": \"switchlight\", \"idx\": idx, \"switchcmd\": \"On\" };\n}\nelse if ( msg.payload === false )\n{\nmsg.payload = { \"command\": \"switchlight\", \"idx\": idx, \"switchcmd\": \"Off\" };\n}\nreturn msg\n",         "outputs": 1,         "noerr": 0,         "x": 1130,         "y": 220,         "wires": [             [                 "bf3249c4.4cabd8"             ]         ]     },     {         "id": "bf3249c4.4cabd8",         "type": "template",         "z": "46580878.ba4bd8",         "name": "Gen MQTT On/Off",         "field": "payload",         "fieldType": "msg",         "format": "handlebars",         "syntax": "mustache",         "template": "{\"command\": \"switchlight\", \"idx\": {{payload.idx}}, \"switchcmd\": \"{{payload.switchcmd}}\" }",         "output": "str",         "x": 1350,         "y": 220,         "wires": [             [                 "152b62fe.c8183d"             ]         ]     },     {         "id": "152b62fe.c8183d",         "type": "mqtt out",         "z": "46580878.ba4bd8",         "name": "",         "topic": "domoticz/in",         "qos": "",         "retain": "",         "broker": "9748a36f.44bdd",         "x": 1410,         "y": 300,         "wires": []     },     {         "id": "9748a36f.44bdd",         "type": "mqtt-broker",         "z": "",         "broker": "localhost",         "port": "1883",         "clientid": "",         "usetls": false,         "compatmode": true,         "keepalive": "60",         "cleansession": true,         "birthTopic": "",         "birthQos": "0",         "birthPayload": "",         "willTopic": "",         "willQos": "0",         "willPayload": ""     },     {         "id": "4aa17da2.220c54",         "type": "nora-config",         "z": "",         "name": "nora config",         "group": "",         "notify": false     } ]

Új hozzászólás Aktív témák