Node-RED nodes for hubitat

change

Is this part correct on what you are saying? Also on the setHumidity function I may need a bit of help if you can I have no clue on how to code those from anything other than the basic msg.attribute = "humidity" anything above that is a greek to me.

No, you want something like this:

2 Likes

I'm getting this now from the change node to the virtual device.

How would I do the function node to translate to a numeric value?

make sure that you selected the "msg" in the drop down box here

Here is everything hopefully you can see where or what I'm lacking.

humid1

humid2

humid3

humid4

Hmmm. the flow looks correct. Any MakerAPI error messages in Hubitat?

Nope

Now the virtual device shows

humid5

You are on the latest version of the node-red plugin, right? I can't see anything wrong......

Yes I believe so
humid6

Do me a favor, add a debug node to the output of the "Set arguments" node and select in the debug node the "complete msg object" as the output. I want to see what the msg.arguments is set to before it hits the command node

Lol, I am seeing it now.....

In you change node, set the field to msg.payload and not msg.payload.value.
I can see in the debug node that the value is right away in payload...

I did the debug and made the change in the payload.value.

Just waiting on the sensor to report again.

humid7

That did it......Once again THANK YOU!

humid8

1 Like

New version 0.0.23

No big features, but so much cleaning and :heart:

changes

  • Fix code styling with a linter (eslint) --> the best invisible feature ever :slight_smile:
  • Use Node-RED logging system. Take a look to your log, it's now really clean
    • Now, warning/error log will output in the Node-RED interface too
    • If you want to have debug output, just set Node-RED log level to debug (in the settings.js)
  • config node: Node-RED server field has now a default value (not only a placeholder)
  • config node: Re-add the helper (and fix it) to avoid to configure multi hubs with the same webhook path
  • Sorting device is now case insensitive
  • Better errors handling
8 Likes

I've been doing my best to contribute as I've been trying to piece together a new "device" that is targeted at a bulb where in one node you can set Hue, Sat and Level. Alternatively a subflow may work as well if I can figure out how to pass in the device to the subflow from the outside flow

I haven't admittedly gotten too far in this yet though, maybe this weekend

If I wanted to share a node with someone else, what do I need to do to protect privacy? Anything?

Attn: Users who also have a Vera hub to use. If you want to run your Schlage Locks on the Vera and control them with Hubitat, thanks to the magic of @dan.t here is a basic motion activated flow based on mode and door closed (all sensors and mode is via Hubitat only the Lock is on Vera)

[
    {
        "id": "44d75aaf.30b094",
        "type": "tab",
        "label": "Flow 1",
        "disabled": false,
        "info": ""
    },
    {
        "id": "dbac0d3.abba2f",
        "type": "debug",
        "z": "44d75aaf.30b094",
        "name": "This should be your Vera Lock",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "x": 1250,
        "y": 340,
        "wires": []
    },
    {
        "id": "e53a6ad4.959118",
        "type": "change",
        "z": "44d75aaf.30b094",
        "name": "Build Vera Command",
        "rules": [
            {
                "t": "set",
                "p": "topic",
                "pt": "msg",
                "to": "Main:Front Door Lock",
                "tot": "str"
            },
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "1",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 958,
        "y": 248.7499761581421,
        "wires": [
            [
                "785a5ae0.1cf444",
                "dbac0d3.abba2f"
            ]
        ]
    },
    {
        "id": "5a209365.e6799c",
        "type": "switch",
        "z": "44d75aaf.30b094",
        "name": "Is door closed?",
        "property": "payload.value",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "closed",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 1,
        "x": 713.0000114440918,
        "y": 253.75,
        "wires": [
            [
                "e53a6ad4.959118"
            ]
        ]
    },
    {
        "id": "ae675623.4d78b8",
        "type": "hubitat device",
        "z": "44d75aaf.30b094",
        "name": "Get Door Sensor",
        "server": "c725ca1f.7770a",
        "deviceId": "5229",
        "attribute": "contact",
        "sendEvent": false,
        "x": 500.50000762939453,
        "y": 252.50000095367432,
        "wires": [
            [
                "5a209365.e6799c"
            ]
        ]
    },
    {
        "id": "476bbb67.109c94",
        "type": "switch",
        "z": "44d75aaf.30b094",
        "name": "active/inactive",
        "property": "payload.value",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "active",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "inactive",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 280.00000762939453,
        "y": 209.74999904632568,
        "wires": [
            [
                "c3866689.355a78"
            ],
            [
                "ae675623.4d78b8"
            ]
        ]
    },
    {
        "id": "c091ee53.7a5d1",
        "type": "hubitat device",
        "z": "44d75aaf.30b094",
        "name": "Motion Sensor",
        "server": "c725ca1f.7770a",
        "deviceId": "4652",
        "attribute": "motion",
        "sendEvent": true,
        "x": 85,
        "y": 210.99999904632568,
        "wires": [
            [
                "476bbb67.109c94"
            ]
        ]
    },
    {
        "id": "c3866689.355a78",
        "type": "hubitat mode",
        "z": "44d75aaf.30b094",
        "name": "Get current Mode",
        "server": "c725ca1f.7770a",
        "sendEvent": false,
        "x": 486.25000762939453,
        "y": 177.24999856948853,
        "wires": [
            [
                "3f525a79.4c53d6"
            ]
        ]
    },
    {
        "id": "3f525a79.4c53d6",
        "type": "switch",
        "z": "44d75aaf.30b094",
        "name": "Mode Day or Evening",
        "property": "payload.value",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "Day",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "Evening",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 718.7500152587891,
        "y": 175.24999904632568,
        "wires": [
            [
                "15200fd4.d37a7"
            ],
            [
                "15200fd4.d37a7"
            ]
        ]
    },
    {
        "id": "15200fd4.d37a7",
        "type": "change",
        "z": "44d75aaf.30b094",
        "name": "Build Vera Command",
        "rules": [
            {
                "t": "set",
                "p": "topic",
                "pt": "msg",
                "to": "Main:Front Door Lock",
                "tot": "str"
            },
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "0",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 960,
        "y": 180,
        "wires": [
            [
                "785a5ae0.1cf444",
                "34288c20.55c3d4"
            ]
        ]
    },
    {
        "id": "34288c20.55c3d4",
        "type": "debug",
        "z": "44d75aaf.30b094",
        "name": "This should be your Vera Lock",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "x": 1250,
        "y": 140,
        "wires": []
    },
    {
        "id": "785a5ae0.1cf444",
        "type": "mios-out",
        "z": "44d75aaf.30b094",
        "name": "Front Door Lock",
        "server": "c618bb5c.380678",
        "item": "Main:Front Door Lock:Target",
        "x": 1200,
        "y": 220,
        "wires": []
    },
    {
        "id": "c725ca1f.7770a",
        "type": "hubitat config",
        "z": "",
        "name": "Hubitat",
        "usetls": false,
        "host": "",
        "port": "80",
        "token": 
        "appId": "",
        "nodeRedServer": "",
        "webhookPath": "/hubitat/webhook"
    },
    {
        "id": "c618bb5c.380678",
        "type": "mios-server",
        "z": "",
        "name": "Vera",
        "host": "",
        "port": ""
    }
]
2 Likes

Note that your Maker API token is listed in that flow export... Not the end of the world if you don't allow remote Maker API access, but I thought I would point that out.

Good catch, I did have Remote checked on, but I don't need it so turned it off can I just delete the "token" and be good?

Depends how private you are. :slight_smile:

When you export flows, it includes the config/server nodes. So in the case of hubitat flows it would include your hub IP, app id, and token.

Now, you could wipe/change those values after exporting, or leave it in there, but it is something to consider.

1 Like

Just upgraded. No obvious errors or issues. Thanks!

1 Like