Node-RED nodes for hubitat

Oh I see. Thank you so much.
Easy when you know how (like most things in life ha ha ha) :weary:

All good.
If it wasn't for the help in this thread, I'd still be struggling!
Plenty of knowledgeable people here to assist

1 Like

I think there are 2 main ways you could go about it. One would be as @bdydrp showed you, another would be setting/using context variables:

Leave your Mode node where it is, and put a Change node after it, using that Change node to set a flow (or global) context variable every time the mode changes. You can then check that context variable within a Change node or a Function node.

I don't think there would be much/any performance difference between these two options, but if you go with option 2, you can set a global variable in one place (possibly in a different flow) and then use that context variable in Function and Switch nodes anywhere you want. I don't think there's any other way to check for the Hubitat mode from functions if you don't first set a context variable (But I could be wrong. Is there?).

2 Likes

Excellent thank you. I think I will use the Mode inline but do as you say for the context variables I want for other settings (like "motion light on in the daytime"). Thanks again!

2 Likes

line #2 of your function node, you must assign your value to the arguments property not payload:

msg.arguments = (msg.payload)/100;

The command node return the same input payload to ouput, because it doesn't use this property. You can use debug node to view all the message (not only payload) to view the request made

Or you can re-read @JasonJoel post :stuck_out_tongue:

2 Likes

How can I be that blind ? 2 times the same day :frowning:

arguments Mike. Arguments !

Damn.
[Thx, btw]

3 Likes

What I like to do, if I'm using mode in more than one function in the same flow, is pump the mode to a link out node. Then I just plop in a link in node wherever I want to use mode. But you could just as easily use a mode node every place too... :man_shrugging:

Link in/out nodes are very lightweight - low # code lines and low processing overhead, so it is technically faster/lighter on resources. But it is rare that really makes any material difference in the end unless you have a TON of nodes or are running on very low powered systems.

You will notice that I also do a 1 time trigger mode on startup (after 10s) to ensure that any mode based logic is in the correct state after a node-red restart. This is really only useful/needed if node-red was down/unavailable at the time a mode change happens, which is pretty unlikely/rare unless your machine running node-red crashed or you got really unlucky on when you restarted node-red.

Example of the link in side:

3 Likes

Hi, on this flow, group B are B1, B2 .

  • If B1 or B2 : On , then Group B : On
  • Because group B : ON, then both B1, B2 : ON
    I need :
    Group B control On/Off both B1, B2
    B1 : ON - Group B : ON, but B2 still OFF,
    or B2 : ON - Group B : ON, B1 still OFF, but I don't know how ?
    Thanks.

Anyone have a simple flow for pushover that they can post? I need to warp my head around how the blue one works. I've searched it out here, but I didn't find anything but an explanation on how to configure the node keys.

1 Like

Oh no you didn't.

Pushover example
[
    {
        "id": "361d965e.1862ea",
        "type": "tab",
        "label": "Flow 1",
        "disabled": false,
        "info": ""
    },
    {
        "id": "fbfb56ca.4eea88",
        "type": "change",
        "z": "361d965e.1862ea",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "device",
                "pt": "msg",
                "to": "JasonNote10",
                "tot": "str"
            },
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "Bleach Tank Not Communicating",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 640,
        "y": 140,
        "wires": [
            [
                "80f2a89a.a72ad8"
            ]
        ]
    },
    {
        "id": "80f2a89a.a72ad8",
        "type": "pushover api",
        "z": "361d965e.1862ea",
        "keys": "b8b684ab.0fd548",
        "title": "Pool outlet on at weird time",
        "name": "",
        "x": 840,
        "y": 140,
        "wires": []
    },
    {
        "id": "869097fb.ac1778",
        "type": "comment",
        "z": "361d965e.1862ea",
        "name": "Alert if Bleach Tank Level Isn't Communicating",
        "info": "",
        "x": 210,
        "y": 80,
        "wires": []
    },
    {
        "id": "1292282a.cd9688",
        "type": "stoptimer-varidelay",
        "z": "361d965e.1862ea",
        "duration": "60",
        "durationType": "num",
        "units": "Minute",
        "payloadtype": "num",
        "payloadval": "0",
        "name": "",
        "reporting": "last_minute_seconds",
        "persist": true,
        "x": 420,
        "y": 140,
        "wires": [
            [
                "fbfb56ca.4eea88"
            ],
            [],
            []
        ]
    },
    {
        "id": "37604547.8e00da",
        "type": "mqtt in",
        "z": "361d965e.1862ea",
        "name": "",
        "topic": "bleachtank/level/cm",
        "qos": "2",
        "datatype": "auto",
        "broker": "e14dea8f.29d7c8",
        "x": 130,
        "y": 120,
        "wires": [
            [
                "1292282a.cd9688"
            ]
        ]
    },
    {
        "id": "a0e9750a.952ba8",
        "type": "mqtt in",
        "z": "361d965e.1862ea",
        "name": "",
        "topic": "bleachtank/level/percent",
        "qos": "2",
        "datatype": "auto",
        "broker": "e14dea8f.29d7c8",
        "x": 150,
        "y": 180,
        "wires": [
            [
                "1292282a.cd9688"
            ]
        ]
    },
    {
        "id": "b8b684ab.0fd548",
        "type": "pushover-keys",
        "z": "",
        "name": "New"
    },
    {
        "id": "e14dea8f.29d7c8",
        "type": "mqtt-broker",
        "z": "",
        "name": "Home",
        "broker": "192.168.2.5",
        "port": "1883",
        "clientid": "Node-RED",
        "usetls": false,
        "compatmode": false,
        "keepalive": "60",
        "cleansession": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthPayload": "",
        "closeTopic": "",
        "closeQos": "0",
        "closePayload": "",
        "willTopic": "",
        "willQos": "0",
        "willPayload": ""
    }
]

There is a pushover node on NR. What config do you need ? Just enter API & User keys....

Thanks @JasonJoel exactly what I needed to understand how it's used.

I needed an example flow to understand what is needed to make it work. I understood the key and username.

[EDIT]
@JasonJoel now if you could only find a way to send me your pool too. :grin:

1 Like

As w all NR nodes, you can just pass the payload into pushover node. If you want to process the payload, use a function node to form the message.
PS my pool is running well & unless you're willing to pay $$$$$, I'm not sending... :cowboy_hat_face:

This is the best I can do for ya :slight_smile: :

2 Likes

So, I keep getting two errors
Application token is invalid and invalid user identifier. I've tried every key and name in my account and in hubitat. Where is this information coming from?

I use the keys from my pushover device in HE; no errors

Where are you located ?

Perhaps instead of just posting works for me you might post an example? There's obviously something I'm missing. Especially since I've already posted that I've tried every key I can find.
Sorry to sound cranky, but here's yet another node with poor documentation and I'm sorry if this node is beneath you, but the answers in this thread in general are increasingly more frustrating and searching it is almost impossible.

Have you seen these nodes?

1 Like