Node-RED nodes for hubitat

I don't think that will give you the outcome your looking for. The motion node is not set to send commands so it won't do anything accept when triggered by sunrise or sunset.

If I was doing it I would use 2 sequences. One to control the lights triggered by sunrise/set . Then a second one triggered by motion, then run it thru a time check if between rise/set go to 100% give timer and then go back to 25%. (or whatever it was).

When you get it, add it to the Node sharing theard for others to use, sounds like a good one.

If you still have trouble LKM and I can throw something together I think will work.

EDIT: This one is close just add the time node after your motion, remove the light check (since it is between the correct times you don't need it), and it should work fine

1 Like

I'm at work and rushed this. needs a motion node - it doesn't have one. I Guess you can use the timeframe as reference for your existing. someone should slap me for rushing this.
:raised_back_of_hand:

3 Likes

So, I am trying to access a function of one of my Kasa dimmers that is exposed to NR. I was wondering, does anyone know if it is possible to send data from the msg.payload message into the argument of the command node?

Specifically, I am trying to set the level per mode, and depending on the mode, the level is changed and added to the msg.payload. I tried msg.payload.level in my case in the argument field and in the logs of Hubitat the log is shown below:

dev:672020-07-21 03:36:38.282 pm errorjava.lang.NumberFormatException: For input string: "msg.payload.level" on line 118 (presetLevel)
dev:692020-07-21 03:36:38.255 pm errorjava.lang.NumberFormatException: For input string: "msg.payload.level" on line 118 (presetLevel)
dev:682020-07-21 03:36:38.216 pm errorjava.lang.NumberFormatException: For input string: "msg.payload.level" on line 118 (presetLevel)

This is the debug for the message being sent:
image

This is the setup for the command node:
image

This shows that it's not actually parsing the message data but just the text I wrote into the argument. Any ideas on what I can do?

You can't specify the msg.payload.level in the command node itself. You would use a change or function node before the command node and set msg.arguments to msg.payload.level.

I could provide an example later, but am in the middle of cooking right now.

1 Like

Oh, so the argument of the hubitat nodes are hard coded to look for msg.arguments? If so, that would be a feature request for me, being able to reference any message in the arguments.

Update: All working now after changing my Change node to this

The node supports explicitly putting in a value, or overriding the node value with msg.arguments. That is a normal way for a node-red node to work.

But changing it or not is up to @fblackburn . If he changes it, he would have to make it have a type selector (like some of the in-box nodes have) to select between msg and value specification.

Oh definitely and I understand that. My only experience with NR, noob over here, is with node-red-contrib-alexa-remote2 and with that it has this for controlling the volume of an echo device for example, which allows you to reference the msg directly.

Understood. That could definitely be done - and you are right, there are many nodes that allow varying types of input like that.

1 Like

I'm open to the idea. There is already a similar PR with global flow variable.
Unfortunately, it was not requested by anyone and the owner of the PR didn't response/fix it

Currently it's not on my priority list, but if it's a feature that some of you need, you can open an issue on github to request it or you can continue the PR (I can rebase it too) :slight_smile:

1 Like

Yeah, I don't think I know enough about how Node-RED works yet, but I can look at that request. But like I said, my problem was solved, but for anything too sophisticated I could see that the change nodes to add whichever argument I want getting out of hand easily.

1 Like

I'll have some time tomorrow to add caution and warning about websocket. I hope it will reduce question/error related :disappointed:

Question: why do I have to keep clicking on 'configure webhook' for devices to work..When I add a new device it pics up the initial state (e.g. motion inactive, but does not update, the only way around this is to click 'configure webhook' when adding each device.

Do have makerapi set to post events ?
image



Yep, It was 2 new devices I connected that were not posting events, but they do now and work fine. I've just had to do it a few times on a couple of instances of adding a device node

Make sure there are no "spaces" before the http part of it, or at the end. That has happened a few times and broke the webhook connection.

The weird thing is @JasonJoel is that it's all working perfectly now after I clicked the configure webhook button. Everything is updating status and working, but I had this last time and I had to click that again to kick it in gear

That is weird. It is normal for it to update ONCE after hitting save/configure webhook (as it goes out via maker api and gets the initial status - that doesn't use the webhook).

But for it to keep updating and then die randomly isn't something I've seen.

1 Like

As already said, you should not have to click on this button more than once. It only trigger a call to the API to configure the URL to send device events to by POST, nothing more. In fact, if you fill this section correctly in Maker API setting, you don't need to click on this button

It already had been fixed and now all spaces are removed automatically [code] :nerd_face:

I forgot you already fixed/improved that. :slight_smile:

This is my path in the node config:
/data/cookie/alexa-cookie.json

In my docker settings i set a mount path to the same location