Page 1 of 1

Smart Nora problem Milights Domoticz

Posted: Saturday 15 June 2024 10:05
by EvJd
Hello ,

Is there someone who can help me with my Smart Nora Milights flow? After a power failure my domoticz crashed and I had to set up everything from scratch.

Unfortanely my milights Smart Nora backup flow doenst work flawless anymore, but I can't figure out whats wrong with it. Made it with help from this forum years ago, but have little knowlidge of it. When I imported the code is said that it missed "collor convert" and "unknown filter". I installed a random collor convert and filter, but it didn't do the trick..

This is the current flow:

Code: Select all

[
    {
        "id": "a90588570df2ce6e",
        "type": "tab",
        "label": "Flow 1",
        "disabled": false,
        "info": ""
    },
    {
        "id": "9f691da22339b44a",
        "type": "mqtt in",
        "z": "a90588570df2ce6e",
        "name": "",
        "topic": "domoticz/out",
        "qos": "0",
        "datatype": "auto",
        "broker": "d7976075.dda4c",
        "nl": false,
        "rap": false,
        "inputs": 0,
        "x": 90,
        "y": 660,
        "wires": [
            [
                "5081b6c0f1f64f2b"
            ]
        ]
    },
    {
        "id": "ada3a3f0df96846a",
        "type": "mqtt out",
        "z": "a90588570df2ce6e",
        "name": "",
        "topic": "domoticz/in",
        "qos": "",
        "retain": "",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "d7976075.dda4c",
        "x": 2210,
        "y": 760,
        "wires": []
    },
    {
        "id": "5081b6c0f1f64f2b",
        "type": "json",
        "z": "a90588570df2ce6e",
        "name": "",
        "property": "payload",
        "action": "",
        "pretty": false,
        "x": 50,
        "y": 920,
        "wires": [
            [
                "aeb318db0a286609"
            ]
        ]
    },
    {
        "id": "0712c25bc78c8068",
        "type": "function",
        "z": "a90588570df2ce6e",
        "name": "Function In ",
        "func": "msg.topic = msg.payload[0].idx;\nif (msg.payload[0].nvalue !== 0)\n{\n    msg.payload = {\n        on : true,\n        brightness : msg.payload[0].Level,\n        color : {\n            spectrumHsv : {\n                hue : msg.payload[1].red,\n                saturation : msg.payload[1].green/100,\n                value : msg.payload[1].blue/100\n            }\n        }\n    }\n}\nelse if (msg.payload[0].nvalue === 0)\n{\n    msg.payload = {\n        on : false,\n        brightness : msg.payload[0].Level,\n        color : {\n            spectrumHsv : {\n                hue : msg.payload[1].red,\n                saturation : msg.payload[1].green/100,\n                value : msg.payload[1].blue/100\n            }\n        }\n    }\n}\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 670,
        "y": 920,
        "wires": [
            [
                "c559ae07ebeeb624"
            ]
        ]
    },
    {
        "id": "c559ae07ebeeb624",
        "type": "switch",
        "z": "a90588570df2ce6e",
        "name": "",
        "property": "topic",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "12",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "107",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "101",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "108",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "109",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "110",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "111",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "112",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "113",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "114",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "116",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 61,
        "x": 810,
        "y": 920,
        "wires": [
            [],
            [],
            [],
            [],
            [],
            [],
            [
                "932771eca52006c0"
            ],
            [
                "de9bf9f9936d7939"
            ],
            [
                "165e700bd98d2430"
            ],
            [
                "2aa1e360d4991058"
            ],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [],
            [
                "2fb2759834f49731"
            ]
        ]
    },
    {
        "id": "b01bfb7f07c50ca2",
        "type": "function",
        "z": "a90588570df2ce6e",
        "name": "Function Out",
        "func": "var idx = parseInt(msg.topic);\nif ( msg.payload[0].on === true )\n{\n    msg.payload = {\n        \"command\" : \"setcolbrightnessvalue\",\n        \"idx\" : idx,\n        \"color\" : {\"m\":3,\"t\":0,\"r\":msg.payload[1].red,\"g\":msg.payload[1].green,\"b\":msg.payload[1].blue,\"cw\":0,\"ww\":0},\n        \"brightness\": msg.payload[0].brightness\n    };\n}\nelse if ( msg.payload[0].on === false )\n{\n    msg.payload = {\n        \"command\": \"switchlight\",\n        \"idx\": idx,\n        \"switchcmd\": \"Off\"\n        \n    };\n}\nreturn msg",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1830,
        "y": 920,
        "wires": [
            [
                "8cc07ca9e40ad070"
            ]
        ]
    },
    {
        "id": "8cc07ca9e40ad070",
        "type": "json",
        "z": "a90588570df2ce6e",
        "name": "",
        "property": "payload",
        "action": "",
        "pretty": false,
        "x": 2010,
        "y": 920,
        "wires": [
            [
                "4dd24ef23bafb55e",
                "ada3a3f0df96846a"
            ]
        ]
    },
    {
        "id": "4dd24ef23bafb55e",
        "type": "debug",
        "z": "a90588570df2ce6e",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "x": 2250,
        "y": 920,
        "wires": []
    },
    {
        "id": "9584f97848116731",
        "type": "function",
        "z": "a90588570df2ce6e",
        "name": "Create RGB Array",
        "func": "msg.payload = {\n    red : msg.payload.Color.r,\n    green : msg.payload.Color.g,\n    blue : msg.payload.Color.b\n};\nreturn msg;",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 270,
        "y": 1020,
        "wires": [
            [
                "dfc03a474d37d973"
            ]
        ]
    },
    {
        "id": "1a9d1f17d476f9d0",
        "type": "join",
        "z": "a90588570df2ce6e",
        "name": "",
        "mode": "custom",
        "build": "array",
        "property": "payload",
        "propertyType": "msg",
        "key": "topic",
        "joiner": "\\n",
        "joinerType": "str",
        "accumulate": false,
        "timeout": "",
        "count": "2",
        "reduceRight": false,
        "reduceExp": "",
        "reduceInit": "",
        "reduceInitType": "",
        "reduceFixup": "",
        "x": 510,
        "y": 880,
        "wires": [
            [
                "0712c25bc78c8068"
            ]
        ]
    },
    {
        "id": "9116143358511338",
        "type": "function",
        "z": "a90588570df2ce6e",
        "name": "Create HSV Array",
        "func": "msg.payload = {\n    hue : msg.payload.color.spectrumHsv.hue,\n    saturation : msg.payload.color.spectrumHsv.saturation,\n    value : msg.payload.color.spectrumHsv.value,\n};\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 1390,
        "y": 640,
        "wires": [
            [
                "279f5710248640a4"
            ]
        ]
    },
    {
        "id": "1ae6426a776ea421",
        "type": "join",
        "z": "a90588570df2ce6e",
        "name": "",
        "mode": "custom",
        "build": "array",
        "property": "payload",
        "propertyType": "msg",
        "key": "topic",
        "joiner": "\\n",
        "joinerType": "str",
        "accumulate": false,
        "timeout": "",
        "count": "2",
        "reduceRight": false,
        "reduceExp": "",
        "reduceInit": "",
        "reduceInitType": "",
        "reduceFixup": "",
        "x": 1650,
        "y": 920,
        "wires": [
            [
                "b01bfb7f07c50ca2"
            ]
        ]
    },
    {
        "id": "932771eca52006c0",
        "type": "noraf-light",
        "z": "a90588570df2ce6e",
        "devicename": "Plafondlamp",
        "lightcolor": true,
        "brightnesscontrol": true,
        "commandonlycolor": false,
        "turnonwhenbrightnesschanges": true,
        "passthru": false,
        "errorifstateunchaged": false,
        "statepayload": true,
        "brightnessoverride": "",
        "roomhint": "Woonkamer",
        "name": "Plafondlamp",
        "colortype": "hsv",
        "nora": "6cb1be71.0539f",
        "topic": "7",
        "onvalue": "true",
        "onvalueType": "bool",
        "offvalue": "false",
        "offvalueType": "bool",
        "temperaturemin": "2700",
        "temperaturemax": "5500",
        "twofactorpin": "",
        "filter": false,
        "x": 1010,
        "y": 800,
        "wires": [
            [
                "9116143358511338",
                "1ae6426a776ea421"
            ]
        ]
    },
    {
        "id": "165e700bd98d2430",
        "type": "noraf-light",
        "z": "a90588570df2ce6e",
        "devicename": "Keukenlamp",
        "lightcolor": true,
        "brightnesscontrol": true,
        "commandonlycolor": false,
        "turnonwhenbrightnesschanges": true,
        "passthru": false,
        "errorifstateunchaged": false,
        "statepayload": true,
        "brightnessoverride": "",
        "roomhint": "Woonkamer",
        "name": "Keukenlamp",
        "colortype": "hsv",
        "nora": "6cb1be71.0539f",
        "topic": "9",
        "onvalue": "true",
        "onvalueType": "bool",
        "offvalue": "false",
        "offvalueType": "bool",
        "temperaturemin": "2700",
        "temperaturemax": "5500",
        "twofactorpin": "",
        "filter": false,
        "x": 1010,
        "y": 620,
        "wires": [
            [
                "9116143358511338",
                "1ae6426a776ea421"
            ]
        ]
    },
    {
        "id": "de9bf9f9936d7939",
        "type": "noraf-light",
        "z": "a90588570df2ce6e",
        "devicename": "Eettafellamp",
        "lightcolor": true,
        "brightnesscontrol": true,
        "commandonlycolor": false,
        "turnonwhenbrightnesschanges": true,
        "passthru": false,
        "statepayload": true,
        "brightnessoverride": "",
        "roomhint": "Woonkamer",
        "name": "Eettafellamp",
        "colortype": "hsv",
        "nora": "6cb1be71.0539f",
        "topic": "8",
        "onvalue": "true",
        "onvalueType": "bool",
        "offvalue": "false",
        "offvalueType": "bool",
        "temperaturemin": "2700",
        "temperaturemax": "5500",
        "x": 1010,
        "y": 700,
        "wires": [
            [
                "9116143358511338",
                "1ae6426a776ea421"
            ]
        ]
    },
    {
        "id": "2aa1e360d4991058",
        "type": "noraf-light",
        "z": "a90588570df2ce6e",
        "devicename": "Slaapkamerlamp",
        "lightcolor": true,
        "brightnesscontrol": true,
        "commandonlycolor": false,
        "turnonwhenbrightnesschanges": true,
        "passthru": false,
        "statepayload": true,
        "brightnessoverride": "",
        "roomhint": "Slaapkamer",
        "name": "Slaapkamerlamp",
        "colortype": "hsv",
        "nora": "6cb1be71.0539f",
        "topic": "10",
        "onvalue": "true",
        "onvalueType": "bool",
        "offvalue": "false",
        "offvalueType": "bool",
        "temperaturemin": "2700",
        "temperaturemax": "5500",
        "x": 1080,
        "y": 960,
        "wires": [
            [
                "9116143358511338",
                "1ae6426a776ea421"
            ]
        ]
    },
    {
        "id": "2fb2759834f49731",
        "type": "noraf-light",
        "z": "a90588570df2ce6e",
        "devicename": "Werkkamerlamp",
        "lightcolor": true,
        "brightnesscontrol": true,
        "commandonlycolor": false,
        "turnonwhenbrightnesschanges": true,
        "passthru": false,
        "statepayload": true,
        "brightnessoverride": "",
        "roomhint": "Slaapkamer",
        "name": "Werkkamerlamp",
        "colortype": "hsv",
        "nora": "6cb1be71.0539f",
        "topic": "61",
        "onvalue": "true",
        "onvalueType": "bool",
        "offvalue": "false",
        "offvalueType": "bool",
        "temperaturemin": "2700",
        "temperaturemax": "5500",
        "x": 1070,
        "y": 900,
        "wires": [
            [
                "9116143358511338",
                "1ae6426a776ea421"
            ]
        ]
    },
    {
        "id": "dfc03a474d37d973",
        "type": "color-convert",
        "z": "a90588570df2ce6e",
        "input": "rgb",
        "output": "hsv",
        "outputType": "object",
        "scaleInput": false,
        "x": 490,
        "y": 1020,
        "wires": [
            [
                "1a9d1f17d476f9d0"
            ]
        ]
    },
    {
        "id": "279f5710248640a4",
        "type": "color-convert",
        "z": "a90588570df2ce6e",
        "input": "hsv",
        "output": "rgb",
        "outputType": "object",
        "scaleInput": true,
        "x": 1330,
        "y": 1060,
        "wires": [
            [
                "1ae6426a776ea421"
            ]
        ]
    },
    {
        "id": "aeb318db0a286609",
        "type": "filter",
        "z": "a90588570df2ce6e",
        "name": "Filter Dimmer",
        "property": "payload.switchType",
        "propertyType": "msg",
        "asArray": false,
        "itemProperty": "",
        "itemPropertyType": "item",
        "rules": [
            {
                "t": "eq",
                "v": "Dimmer",
                "vt": "str",
                "output": 1
            }
        ],
        "checkall": "true",
        "outputs": 1,
        "x": 240,
        "y": 920,
        "wires": [
            [
                "9584f97848116731",
                "1a9d1f17d476f9d0"
            ]
        ]
    },
    {
        "id": "d7976075.dda4c",
        "type": "mqtt-broker",
        "name": "Domoticz Master",
        "broker": "localhost",
        "port": "1883",
        "clientid": "",
        "autoConnect": true,
        "usetls": false,
        "protocolVersion": "4",
        "keepalive": "60",
        "cleansession": true,
        "autoUnsubscribe": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthPayload": "",
        "birthMsg": {},
        "closeTopic": "",
        "closeQos": "0",
        "closePayload": "",
        "closeMsg": {},
        "willTopic": "",
        "willQos": "0",
        "willPayload": "",
        "willMsg": {},
        "userProps": "",
        "sessionExpiry": ""
    },
    {
        "id": "6cb1be71.0539f",
        "type": "noraf-config",
        "name": "Smartnora",
        "group": "",
        "twofactor": "off",
        "twofactorpin": "",
        "localexecution": true,
        "structure": "Thuis",
        "storeStateInContext": false,
        "disableValidationErrors": false,
        "sendDeviceNameAndLocation": false
    }
]
It gives failures in Domoticz like:
2024-06-15 09:51:32.042 Error: MQTT Gateway: Invalid/Unhandled data received! (Topic: domoticz/in, Message: [{"red":255,"green":255,"blue":255},{"red":255,"green":255,"blue":255}])
2024-06-15 09:51:37.565 Error: MQTT Gateway: Invalid/Unhandled data received! (Topic: domoticz/in, Message: [{"red":255,"green":255,"blue":255},{"red":255,"green":255,"blue":255}])
2024-06-15 09:52:30.762 Error: MQTT Gateway: Error sending switch command!
2024-06-15 09:52:32.305 Error: MQTT Gateway: Invalid/Unhandled data received! (Topic: domoticz/in, Message: [{"red":255,"green":255,"blue":255},{"red":255,"green":255,"blue":255}])

Re: Smart Nora problem Milights Domoticz

Posted: Saturday 15 June 2024 10:45
by waltervl
Moved to node red sub forum...

Re: Smart Nora problem Milights Domoticz

Posted: Sunday 16 June 2024 14:13
by FireWizard
Hello @EvJd

Well, this is a well known flow, I do remember :)

See: https://www.domoticz.com/forum/viewtopi ... ht#p236896


You wrote:
When I imported the code is said that it missed "collor convert" and "unknown filter". I installed a random collor convert and filter, but it didn't do the trick.
These nodes are "custom" nodes and are not installed by default in Node RED. So after a new install of NR, you have to install them again by using the "manage palette" option.

You need:

- node-red-contrib-filter. See: https://flows.nodered.org/node/node-red-contrib-filter
- node-red-contrib-color-convert. See: https://flows.nodered.org/node/node-red ... or-convert

Try to install these 2 nodes first and if you have more issues, please ask.

Regards

Re: Smart Nora problem Milights Domoticz

Posted: Sunday 16 June 2024 14:28
by EvJd
These notes I allready downloaded and used in the flow. So luckely I picked the right ones.
Unfortunately it isnt working

Re: Smart Nora problem Milights Domoticz

Posted: Sunday 16 June 2024 14:36
by FireWizard
Hi, @EvJd,

I will check this flow later,

Any details of what is not working?
Maybe something has changed.

Regards

Re: Smart Nora problem Milights Domoticz

Posted: Sunday 16 June 2024 15:46
by EvJd
It looks different in Domoticz log. First I got an idx mention what I remember.

Thanks for all your efford!

Re: Smart Nora problem Milights Domoticz

Posted: Sunday 16 June 2024 17:13
by FireWizard
Hi @EvDj,

What do you mean with your previous post?
Has the issue been solved and is the flow running?

Regards

Re: Smart Nora problem Milights Domoticz

Posted: Sunday 16 June 2024 17:35
by EvJd
No unfortunately problem is not solvef. Nothing changed on my first post.

Message in Domoticz is different from what I remembered before. I thought I always saw something with idx=7 for instance.
Now the message is id=7 ( what in this example is my woonkamerlamp).

Smart nora sees the lights. But when I turn lights on or of in smartnora account, nothing happens with my lights.

Re: Smart Nora problem Milights Domoticz

Posted: Sunday 16 June 2024 17:45
by FireWizard
Hi @EvDj,

Then I know what is going on, as there has been changes since I created the flow.
I 'll come back later with a solution.

Regards

Re: Smart Nora problem Milights Domoticz

Posted: Tuesday 18 June 2024 11:51
by EvJd
Hello, problem solved.

I had 2 milight iboxes and after power break the ip adresses switched. So thats why my bulbs didnt do anything when called on by Smartnora.

Set in the right ip adresses, and everything works as it seems for right now.

Thanks for you help!

Re: Smart Nora problem Milights Domoticz

Posted: Tuesday 18 June 2024 14:14
by FireWizard
Okay,

Thats nice, as I had just planned this afternoon, to look at your issue.

But for now, I leave it. If you need support for anything else, let me know.

I will delete, your flow from my test system.

Regards