Node-RED nodes for hubitat

File permissions?

Perhaps, can look into this more
Tho i can access that directory plus other docker directories from othe machines

You should use a relative path. ~ is home directory for that specific Docker instance.

So ~/file-name will work for sure.

~/directory-name/file-name will work as long as you create that directory.

That Docker instance doesn't have the permissions to access the root directory tree - so /mnt/etc/etc isn't working.

The simplest solution is to use a relative path.

i have tried all the file path suggestions, still get path not found!!
I have created the file inside the directory.

Maybe im a bit confused then on file permissions, but when i add palettes, i can see them saved inside the root directory...

Hey all! Things still working well this am..

my upstairs hub STILL rebooted so just did a soft reset. I suspect I have ghost GE devices but haven't used my Z-stick on that hub yet.

I do have one quirky thing I'm trying to work out..

I have the Amazon Echo Skill app on my control hub and was using it to control a group of sengled bulbs ("Den Lights") via HubConnect on my main hub. When I shifted everything over I could no longer do this so I created a virtual RGBW bulb and tried to sync it with "Den Lights" using NR. I have been unable to do anything except "on" or "off". I know about "CT" / "RGB" modes so assume there is something else I need to do. I just get errors when trying to send other commands to the command node. If I could figure out the Maker API calls I could probably do it via HTTP nodes directly.

@aaiyar - I was reading your earlier posts about something similar. Do you have any thoughts on this?

Great find! This works very well, is way easy to set up.

Cool! I'll give it a shot later today. Stormy, so I'm even more restricted to the house than 'usual'.

EDIT: It was easy to implement. Just need to let some data build up and give it a reboot to test it out! Not working for me, as my node-red is in a docker container, I'm sure it has something to do with that. I'll play with it more later.

Good morning @erktrek - yes, I have this working in an analogous situation (capture and restore). I capture values of various dimmers and bulbs when the TV turns on and then restore them when the TV turns off. In principle, there is no reason why the same approach cannot be used to mirror the values of one dimmer or bulb to another.

I have made an example of capture/restore flows that you can import and modify for your needs. I did this using an RGBW bulb, because it is a superset of what I do for just CT bulbs or dimmers.

Here are the two sequences:

Here is the code:
[
{
    "id": "e0926e29.ca80d",
    "type": "hubitat device",
    "z": "4b9eee9a.b8d118",
    "name": "Living Room LEVEL",
    "server": "a22e0ea9.276dc8",
    "deviceId": "1481",
    "attribute": "level",
    "sendEvent": false,
    "x": 660,
    "y": 440,
    "wires": [
        [
            "14d88c2b.ab6394"
        ]
    ]
},
{
    "id": "14d88c2b.ab6394",
    "type": "change",
    "z": "4b9eee9a.b8d118",
    "name": "flow.livingroom_level",
    "rules": [
        {
            "t": "set",
            "p": "livingroom_level",
            "pt": "flow",
            "to": "payload.value",
            "tot": "msg"
        }
    ],
    "action": "",
    "property": "",
    "from": "",
    "to": "",
    "reg": false,
    "x": 941,
    "y": 440,
    "wires": [
        []
    ]
},
{
    "id": "73d55c43.5c3934",
    "type": "hubitat device",
    "z": "4b9eee9a.b8d118",
    "name": "Living Room ON/OFF",
    "server": "a22e0ea9.276dc8",
    "deviceId": "1481",
    "attribute": "switch",
    "sendEvent": false,
    "x": 660,
    "y": 263,
    "wires": [
        [
            "6137ceaf.5e6a5"
        ]
    ]
},
{
    "id": "6137ceaf.5e6a5",
    "type": "change",
    "z": "4b9eee9a.b8d118",
    "name": "flow.livingroom_switch",
    "rules": [
        {
            "t": "set",
            "p": "livingroom_switch",
            "pt": "flow",
            "to": "payload.value",
            "tot": "msg"
        }
    ],
    "action": "",
    "property": "",
    "from": "",
    "to": "",
    "reg": false,
    "x": 941,
    "y": 263,
    "wires": [
        []
    ]
},
{
    "id": "3801100a.200dd8",
    "type": "hubitat device",
    "z": "4b9eee9a.b8d118",
    "name": "Living Room CT",
    "server": "a22e0ea9.276dc8",
    "deviceId": "1481",
    "attribute": "colorTemperature",
    "sendEvent": false,
    "x": 639,
    "y": 380,
    "wires": [
        [
            "beaabed4.96e14"
        ]
    ]
},
{
    "id": "beaabed4.96e14",
    "type": "change",
    "z": "4b9eee9a.b8d118",
    "name": "flow.livingroom_ct",
    "rules": [
        {
            "t": "set",
            "p": "livingroom_ct",
            "pt": "flow",
            "to": "payload.value",
            "tot": "msg"
        }
    ],
    "action": "",
    "property": "",
    "from": "",
    "to": "",
    "reg": false,
    "x": 930,
    "y": 380,
    "wires": [
        []
    ]
},
{
    "id": "8a9669e1.ba1568",
    "type": "hubitat device",
    "z": "4b9eee9a.b8d118",
    "name": "Living Room RGB/W",
    "server": "a22e0ea9.276dc8",
    "deviceId": "1481",
    "attribute": "colorMode",
    "sendEvent": false,
    "x": 661,
    "y": 322,
    "wires": [
        [
            "6ec5ba51.17178c"
        ]
    ]
},
{
    "id": "6ec5ba51.17178c",
    "type": "switch",
    "z": "4b9eee9a.b8d118",
    "name": "RGB/W",
    "property": "payload.value",
    "propertyType": "msg",
    "rules": [
        {
            "t": "cont",
            "v": "CT",
            "vt": "str"
        },
        {
            "t": "cont",
            "v": "RGB",
            "vt": "str"
        }
    ],
    "checkall": "true",
    "repair": false,
    "outputs": 2,
    "x": 900,
    "y": 322,
    "wires": [
        [
            "d194a65a.0046b8"
        ],
        [
            "7c10c25f.c7a49c"
        ]
    ]
},
{
    "id": "d194a65a.0046b8",
    "type": "change",
    "z": "4b9eee9a.b8d118",
    "name": "flow.livingroom_w=1 (CT)",
    "rules": [
        {
            "t": "set",
            "p": "livingroom_w",
            "pt": "flow",
            "to": "1",
            "tot": "str"
        }
    ],
    "action": "",
    "property": "",
    "from": "",
    "to": "",
    "reg": false,
    "x": 1130,
    "y": 300,
    "wires": [
        []
    ]
},
{
    "id": "7c10c25f.c7a49c",
    "type": "change",
    "z": "4b9eee9a.b8d118",
    "name": "flow.livingroom_w=0 (RGB)",
    "rules": [
        {
            "t": "set",
            "p": "livingroom_w",
            "pt": "flow",
            "to": "0",
            "tot": "str"
        }
    ],
    "action": "",
    "property": "",
    "from": "",
    "to": "",
    "reg": false,
    "x": 1140,
    "y": 340,
    "wires": [
        []
    ]
},
{
    "id": "9430889e.31a708",
    "type": "hubitat device",
    "z": "4b9eee9a.b8d118",
    "name": "Living Room HUE",
    "server": "a22e0ea9.276dc8",
    "deviceId": "1481",
    "attribute": "hue",
    "sendEvent": false,
    "x": 650,
    "y": 500,
    "wires": [
        [
            "188c23c2.2c17cc"
        ]
    ]
},
{
    "id": "f19eac3a.64d0f8",
    "type": "hubitat device",
    "z": "4b9eee9a.b8d118",
    "name": "Living Room SATURATION",
    "server": "a22e0ea9.276dc8",
    "deviceId": "1481",
    "attribute": "saturation",
    "sendEvent": false,
    "x": 680,
    "y": 560,
    "wires": [
        [
            "a49555f8.dc9cb8"
        ]
    ]
},
{
    "id": "188c23c2.2c17cc",
    "type": "change",
    "z": "4b9eee9a.b8d118",
    "name": "flow.livingroom_hue",
    "rules": [
        {
            "t": "set",
            "p": "livingroom_hue",
            "pt": "flow",
            "to": "payload.value",
            "tot": "msg"
        }
    ],
    "action": "",
    "property": "",
    "from": "",
    "to": "",
    "reg": false,
    "x": 940,
    "y": 500,
    "wires": [
        []
    ]
},
{
    "id": "a49555f8.dc9cb8",
    "type": "change",
    "z": "4b9eee9a.b8d118",
    "name": "flow.livingroom_sat",
    "rules": [
        {
            "t": "set",
            "p": "livingroom_sat",
            "pt": "flow",
            "to": "payload.value",
            "tot": "msg"
        }
    ],
    "action": "",
    "property": "",
    "from": "",
    "to": "",
    "reg": false,
    "x": 932,
    "y": 560,
    "wires": [
        []
    ]
},
{
    "id": "951ea2f7.9e75b8",
    "type": "inject",
    "z": "4b9eee9a.b8d118",
    "name": "",
    "topic": "",
    "payload": "",
    "payloadType": "date",
    "repeat": "",
    "crontab": "",
    "once": false,
    "onceDelay": 0.1,
    "x": 380,
    "y": 400,
    "wires": [
        [
            "73d55c43.5c3934",
            "8a9669e1.ba1568",
            "3801100a.200dd8",
            "e0926e29.ca80d",
            "9430889e.31a708",
            "f19eac3a.64d0f8"
        ]
    ]
},
{
    "id": "e83fd2e2.51f008",
    "type": "switch",
    "z": "4b9eee9a.b8d118",
    "name": "livingroom_switch=on",
    "property": "livingroom_switch",
    "propertyType": "flow",
    "rules": [
        {
            "t": "eq",
            "v": "on",
            "vt": "str"
        }
    ],
    "checkall": "true",
    "repair": false,
    "outputs": 1,
    "x": 660,
    "y": 760,
    "wires": [
        [
            "7ef9f337.e6904c",
            "487c429b.8ec68c"
        ]
    ]
},
{
    "id": "7ef9f337.e6904c",
    "type": "switch",
    "z": "4b9eee9a.b8d118",
    "name": "CT or RGB",
    "property": "livingroom_w",
    "propertyType": "flow",
    "rules": [
        {
            "t": "eq",
            "v": "1",
            "vt": "str"
        },
        {
            "t": "eq",
            "v": "0",
            "vt": "str"
        }
    ],
    "checkall": "true",
    "repair": false,
    "outputs": 2,
    "x": 911,
    "y": 760,
    "wires": [
        [
            "35ab90a5.fdc918",
            "8892a7c4.eecb78"
        ],
        [
            "8892a7c4.eecb78",
            "2373891a.ec748e",
            "83766ade.7f93b"
        ]
    ]
},
{
    "id": "487c429b.8ec68c",
    "type": "hubitat command",
    "z": "4b9eee9a.b8d118",
    "name": "Living Room ON",
    "server": "a22e0ea9.276dc8",
    "deviceId": "1481",
    "command": "on",
    "commandArgs": "",
    "x": 900,
    "y": 820,
    "wires": [
        []
    ]
},
{
    "id": "35ab90a5.fdc918",
    "type": "change",
    "z": "4b9eee9a.b8d118",
    "name": "livingroom_ct=xx",
    "rules": [
        {
            "t": "set",
            "p": "arguments",
            "pt": "msg",
            "to": "livingroom_ct",
            "tot": "flow"
        }
    ],
    "action": "",
    "property": "",
    "from": "",
    "to": "",
    "reg": false,
    "x": 1150,
    "y": 720,
    "wires": [
        [
            "a8966139.1ccc48"
        ]
    ]
},
{
    "id": "8892a7c4.eecb78",
    "type": "change",
    "z": "4b9eee9a.b8d118",
    "name": "livingroom_level=xx",
    "rules": [
        {
            "t": "set",
            "p": "arguments",
            "pt": "msg",
            "to": "livingroom_level",
            "tot": "flow"
        }
    ],
    "action": "",
    "property": "",
    "from": "",
    "to": "",
    "reg": false,
    "x": 1160,
    "y": 760,
    "wires": [
        [
            "361dd22a.25eb16"
        ]
    ]
},
{
    "id": "2373891a.ec748e",
    "type": "change",
    "z": "4b9eee9a.b8d118",
    "name": "livingroom_hue=xx",
    "rules": [
        {
            "t": "set",
            "p": "arguments",
            "pt": "msg",
            "to": "livingroom_hue",
            "tot": "flow"
        }
    ],
    "action": "",
    "property": "",
    "from": "",
    "to": "",
    "reg": false,
    "x": 1150,
    "y": 800,
    "wires": [
        [
            "ae5986c7.990898"
        ]
    ]
},
{
    "id": "83766ade.7f93b",
    "type": "change",
    "z": "4b9eee9a.b8d118",
    "name": "livingroom_sat=xx",
    "rules": [
        {
            "t": "set",
            "p": "arguments",
            "pt": "msg",
            "to": "livingroom_sat",
            "tot": "flow"
        }
    ],
    "action": "",
    "property": "",
    "from": "",
    "to": "",
    "reg": false,
    "x": 1150,
    "y": 840,
    "wires": [
        [
            "63eedc9a.4e7cf4"
        ]
    ]
},
{
    "id": "ed7202d6.d79f6",
    "type": "hubitat command",
    "z": "4b9eee9a.b8d118",
    "name": "Living Room CT",
    "server": "a22e0ea9.276dc8",
    "deviceId": "1481",
    "command": "setColorTemperature",
    "commandArgs": "msg.arguments",
    "x": 1560,
    "y": 720,
    "wires": [
        []
    ]
},
{
    "id": "fadd5eb2.2bcf3",
    "type": "hubitat command",
    "z": "4b9eee9a.b8d118",
    "name": "Living Room LVL",
    "server": "a22e0ea9.276dc8",
    "deviceId": "1481",
    "command": "setLevel",
    "commandArgs": "msg.arguments",
    "x": 1570,
    "y": 760,
    "wires": [
        []
    ]
},
{
    "id": "2239622c.c873ae",
    "type": "hubitat command",
    "z": "4b9eee9a.b8d118",
    "name": "Living Room HUE",
    "server": "a22e0ea9.276dc8",
    "deviceId": "1481",
    "command": "setHue",
    "commandArgs": "msg.arguments",
    "x": 1570,
    "y": 800,
    "wires": [
        []
    ]
},
{
    "id": "80eb999c.be44e",
    "type": "hubitat command",
    "z": "4b9eee9a.b8d118",
    "name": "Living Room SAT",
    "server": "a22e0ea9.276dc8",
    "deviceId": "1481",
    "command": "setSaturation",
    "commandArgs": "msg.arguments",
    "x": 1570,
    "y": 840,
    "wires": [
        []
    ]
},
{
    "id": "361dd22a.25eb16",
    "type": "delay",
    "z": "4b9eee9a.b8d118",
    "name": "50ms",
    "pauseType": "delay",
    "timeout": "50",
    "timeoutUnits": "milliseconds",
    "rate": "1",
    "nbRateUnits": "1",
    "rateUnits": "second",
    "randomFirst": "1",
    "randomLast": "5",
    "randomUnits": "seconds",
    "drop": false,
    "x": 1371,
    "y": 760,
    "wires": [
        [
            "fadd5eb2.2bcf3"
        ]
    ]
},
{
    "id": "a8966139.1ccc48",
    "type": "delay",
    "z": "4b9eee9a.b8d118",
    "name": "100ms",
    "pauseType": "delay",
    "timeout": "100",
    "timeoutUnits": "milliseconds",
    "rate": "1",
    "nbRateUnits": "1",
    "rateUnits": "second",
    "randomFirst": "1",
    "randomLast": "5",
    "randomUnits": "seconds",
    "drop": false,
    "x": 1371,
    "y": 720,
    "wires": [
        [
            "ed7202d6.d79f6"
        ]
    ]
},
{
    "id": "ae5986c7.990898",
    "type": "delay",
    "z": "4b9eee9a.b8d118",
    "name": "75ms",
    "pauseType": "delay",
    "timeout": "75",
    "timeoutUnits": "milliseconds",
    "rate": "1",
    "nbRateUnits": "1",
    "rateUnits": "second",
    "randomFirst": "1",
    "randomLast": "5",
    "randomUnits": "seconds",
    "drop": false,
    "x": 1371,
    "y": 800,
    "wires": [
        [
            "2239622c.c873ae"
        ]
    ]
},
{
    "id": "63eedc9a.4e7cf4",
    "type": "delay",
    "z": "4b9eee9a.b8d118",
    "name": "100ms",
    "pauseType": "delay",
    "timeout": "100",
    "timeoutUnits": "milliseconds",
    "rate": "1",
    "nbRateUnits": "1",
    "rateUnits": "second",
    "randomFirst": "1",
    "randomLast": "5",
    "randomUnits": "seconds",
    "drop": false,
    "x": 1371,
    "y": 840,
    "wires": [
        [
            "80eb999c.be44e"
        ]
    ]
},
{
    "id": "3fc82f77.970d88",
    "type": "inject",
    "z": "4b9eee9a.b8d118",
    "name": "",
    "topic": "",
    "payload": "",
    "payloadType": "date",
    "repeat": "",
    "crontab": "",
    "once": false,
    "onceDelay": 0.1,
    "x": 380,
    "y": 760,
    "wires": [
        [
            "e83fd2e2.51f008"
        ]
    ]
},
{
    "id": "d80d80b6.620e48",
    "type": "comment",
    "z": "4b9eee9a.b8d118",
    "name": "Capture - on/off, rgb/ct, CT, Level, Hue, Saturation",
    "info": "",
    "x": 490,
    "y": 180,
    "wires": []
},
{
    "id": "59aa1437.47e9dc",
    "type": "comment",
    "z": "4b9eee9a.b8d118",
    "name": "Restore if the bulb is on, the restore: CT mode restore CT+level; RGB mode restore HSL",
    "info": "",
    "x": 610,
    "y": 680,
    "wires": []
},
{
    "id": "a22e0ea9.276dc8",
    "type": "hubitat config",
    "z": "",
    "name": "HubitatM",
    "usetls": false,
    "host": "192.168.1.46",
    "port": "80",
    "token": "496f7f11-256d-44c9-99c6-4ed460d3efb0",
    "appId": "1522",
    "nodeRedServer": "http://192.168.1.4:1880",
    "webhookPath": "/hubitat/webhook"
}

]

1 Like

This looks wonderful thank you!!!! Am digging in now will let you know what happens.

Thanks again your continued help and advice is much appreciated - you guys are really helping me ramp up on this incredible system and have taken my HE experience even further than I thought possible.

1 Like

Your welcome. As far as I'm concerned, I'm paying back the help I've received from @dan.t and @JasonJoel, and paying forward the help I'll get from you ....

2 Likes

@aaiyar and @erktrek Thanks for your help I try both and dosen't seem to work? I wondering if it has any thing to do with the switch that I using because I have other switch from different brand that works just fine. Thanks for the info.

@leeonestop

The brand shouldn't matter, but the device type matters. The sequences I posted are for RGBW bulbs (for which I've enabled pre-staging).

What properties show up under current states on the hubitat device page for the switch you are using?

Edit: For example:

RGBW bulb properties:
Screen Shot 2020-04-04 at 9.16.10 AM

Dimmer properties:
Screen Shot 2020-04-04 at 9.16.42 AM

@aaiyar here is what I have.

image

So this device is a binary switch. For capture & restore, the only property that matters can be used is "switch".

Yes sir and that the way I'm using it? But it been very inconsistent.

I commented one line of code in the Konnected (Connect) app (Line 60 in the screenshot, the "//" in the beginning of the line changes it to a commented line in groovy) and now it does not fill my log with absolutely pointless and useless garbage. I only commented that one line as it is written out to the log every 5 minutes. You can comment the others in this app that does logging as well (look for log.info and log.debug) but for me that one line was the biggest nuisance. They should have made their app configurable to eliminate useless log messages, but they have not touched their code in 14 months so I am not holding my breath.

Are you trying to capture the other parameters also? Or only switch?

Just the switch.

When you double click on the device node you are capturing (in NR), is the box marked as "Send Events" checked on? It should NOT be checked on. If it is checked, then this will not work.

Screen Shot 2020-04-04 at 9.25.11 AM

Edit: Also make sure that the attribute switch is selected (and it is not Undefined)

Here is the way that I have it?

image