You didn't ask for it, but here's a HSL version:
Thanks, @csteele!
Where did you pull those from? I hate having to ask questions simply because I can't find the docs.
Since only the color temperature number is required do I add two commas or not? Example, 3100 or 3100,,
EDIT: It would be easy enough to try if I were hard-coding the numbers but I'm passing them in from an Function node and it could get tedious.
The screen caps are from my instance of Node-red.
The documentation is via the word Documentation at the top of this screen, then searching for the word. Developer documentation, for instance.
Must be a Windows thing. NR 3.0.2 on Linux has no "Documentation" button. Thanks anyway.
He was referring to the 'Documentation' link at the top of the forum page in your web browser. The specific document screenshot appears to be from this page: Driver Capability List | Hubitat Documentation
Oh
It turns out that the driver automatically selected when the device was added is inappropriate and getting the right driver has it working perfectly.
I am using node-red my devices - switches wont auto update. They will only update when i send a msg.attribute.
is there a way set this up
Make sure the Hubitat node has "Send Events" checked:
Since most of us create flows left to right, I'm going to say the left most node is most likely the flow initiator... the node that kicks things off. It needs that Send Events checked. Subsequent nodes do not. They are typically reacting to the msg from the initiator.
Solid box dangling below, left means it will send events, hollow means it won't.
If you wanted to have a door sensor turn on a light, only if it was off, then you might do something like:
Which would trigger BOTH on the door AND the Light changing. That would (depending on the logic that comes next) either keep the light on always or off always... not what you want.
So you turn off Send Events on the subsequent nodes to force the node to pass only the state of the light when the door changes.
@fblackburn
I may have found a bug in the Hubitat palette. I have in the past set msg.deviceID to the deviceId of one of my devices and then feed the output of that inject node into the hubitat device node. This gets me the current state of that device.
If however, I send in an erroneous deviceId, then it crashes Node Red. Here is what I see in the logs:
16 Jan 22:12:10 - [red] Uncaught Exception:
16 Jan 22:12:10 - [error] TypeError: Cannot read properties of undefined (reading 'attributes')
at HubitatDeviceNode._inputCallback (/data/node_modules/node-red-contrib-hubitat/nodes/device.js:164:59)
at /usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:210:26
at Object.trigger (/usr/src/node-red/node_modules/@node-red/util/lib/hooks.js:166:13)
at HubitatDeviceNode.Node._emitInput (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:202:11)
at HubitatDeviceNode.Node.emit (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:186:25)
at HubitatDeviceNode.Node.receive (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:485:10)
at Immediate. (/usr/src/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:831:52)
at processImmediate (node:internal/timers:466:21)
Note sure what this means, but I am not see nothing in the logs on the Hubitat side.
So it works with an correct ID, but crashes all of Node Red with a bad ID.
I love the nodes and the connection that they facilitate, but wanted to give you heads up.
Thanks for the feedback, i'll take a look
@tmichael I released a fix version: 1.8.1
You now will have this error message under node if it happens:
Device ID (12345) not found in global cache. Make sure that Maker API allows this device and restart flows
Quick upgrade to 1.8.1 confirms that it is working exactly the way you described the fix. Thanks for the responsiveness and more importantly the great set of nodes.
@fblackburn I've not run into this before so I don't understand what's failing when I try to update via NR's "Manage palette". Looks to me like the 4th line in the short log says the npm command needs to be changed.
Short log
2023-01-22T01:15:56.065Z Install : node-red-contrib-hubitat 1.8.1
2023-01-22T01:15:56.074Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-hubitat@1.8.1
2023-01-22T01:15:56.650Z [err] npm
2023-01-22T01:15:56.651Z [err] WARN config production Use `--omit=dev` instead.
2023-01-22T01:17:07.828Z [err] npm
2023-01-22T01:17:07.828Z [err] ERR!
2023-01-22T01:17:07.828Z [err] code ETARGET
2023-01-22T01:17:07.833Z [err] npm ERR!
2023-01-22T01:17:07.833Z [err] notarget No matching version found for node-red-contrib-hubitat@1.8.1.
2023-01-22T01:17:07.833Z [err] npm ERR!
2023-01-22T01:17:07.833Z [err] notarget In most cases you or one of your dependencies are requesting
2023-01-22T01:17:07.833Z [err] npm
2023-01-22T01:17:07.833Z [err] ERR! notarget a package version that doesn't exist.
2023-01-22T01:17:07.837Z [err]
2023-01-22T01:17:07.837Z [err] npm ERR!
2023-01-22T01:17:07.837Z [err] A complete log of this run can be found in:
2023-01-22T01:17:07.837Z [err] npm ERR! /data/.npm/_logs/2023-01-22T01_15_56_608Z-debug-0.log
2023-01-22T01:17:07.847Z rc=1
Full log
0 verbose cli /usr/local/bin/node /usr/local/bin/npm
1 info using npm@8.11.0
2 info using node@v16.16.0
3 timing npm:load:whichnode Completed in 1ms
4 timing config:load:defaults Completed in 2ms
5 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 1ms
6 timing config:load:builtin Completed in 2ms
7 warn config production Use `--omit=dev` instead.
8 timing config:load:cli Completed in 5ms
9 timing config:load:env Completed in 0ms
10 timing config:load:file:/data/.npmrc Completed in 0ms
11 timing config:load:project Completed in 6ms
12 timing config:load:file:/home/steve/.npmrc Completed in 1ms
13 timing config:load:user Completed in 1ms
14 timing config:load:file:/usr/local/etc/npmrc Completed in 2ms
15 timing config:load:global Completed in 2ms
16 timing config:load:validate Completed in 1ms
17 timing config:load:credentials Completed in 1ms
18 timing config:load:setEnvs Completed in 1ms
19 timing config:load Completed in 23ms
20 timing npm:load:configload Completed in 23ms
21 timing npm:load:mkdirpcache Completed in 2ms
22 timing npm:load:mkdirplogs Completed in 1ms
23 verbose title npm install node-red-contrib-hubitat@1.8.1
24 verbose argv "install" "--no-audit" "--no-update-notifier" "--no-fund" "--save" "--save-prefix" "~" "--production" "--engine-strict" "node-red-contrib-hubitat@1.8.1"
25 timing npm:load:setTitle Completed in 2ms
26 timing config:load:flatten Completed in 6ms
27 timing npm:load:display Completed in 9ms
28 verbose logfile logs-max:10 dir:/data/.npm/_logs
29 verbose logfile /data/.npm/_logs/2023-01-22T01_15_56_608Z-debug-0.log
30 timing npm:load:logFile Completed in 8ms
31 timing npm:load:timers Completed in 0ms
32 timing npm:load:configScope Completed in 0ms
33 timing npm:load Completed in 47ms
34 timing arborist:ctor Completed in 1ms
35 silly logfile start cleaning logs, removing 1 files
36 silly logfile done cleaning log files
37 timing idealTree:init Completed in 436ms
38 timing idealTree:userRequests Completed in 15ms
39 silly idealTree buildDeps
40 silly fetch manifest node-red-contrib-hubitat@1.8.1
41 timing arborist:ctor Completed in 0ms
42 http fetch GET 200 https://registry.npmjs.org/node-red-contrib-hubitat 70554ms (cache stale)
43 silly placeDep ROOT node-red-contrib-hubitat@ REPLACE for: node-red-project@0.0.1 want: 1.8.1
44 timing idealTree:#root Completed in 70580ms
45 timing idealTree:node_modules/node-red-contrib-hubitat Completed in 0ms
46 timing idealTree:steves-gate Completed in 0ms
47 timing idealTree:buildDeps Completed in 70583ms
48 timing idealTree:fixDepFlags Completed in 28ms
49 timing idealTree Completed in 71065ms
50 timing command:install Completed in 71076ms
51 verbose type version
52 verbose stack node-red-contrib-hubitat: No matching version found for node-red-contrib-hubitat@1.8.1.
52 verbose stack at module.exports (/usr/local/lib/node_modules/npm/node_modules/npm-pick-manifest/lib/index.js:209:23)
52 verbose stack at RegistryFetcher.manifest (/usr/local/lib/node_modules/npm/node_modules/pacote/lib/registry.js:125:24)
52 verbose stack at async Arborist.[nodeFromEdge] (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:1108:19)
52 verbose stack at async Arborist.[buildDepStep] (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:976:11)
52 verbose stack at async Arborist.buildIdealTree (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:218:7)
52 verbose stack at async Promise.all (index 1)
52 verbose stack at async Arborist.reify (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:153:5)
52 verbose stack at async Install.exec (/usr/local/lib/node_modules/npm/lib/commands/install.js:156:5)
52 verbose stack at async module.exports (/usr/local/lib/node_modules/npm/lib/cli.js:78:5)
53 verbose cwd /data
54 verbose Linux 6.1.7-arch1-1
55 verbose node v16.16.0
56 verbose npm v8.11.0
57 error code ETARGET
58 error notarget No matching version found for node-red-contrib-hubitat@1.8.1.
59 error notarget In most cases you or one of your dependencies are requesting
59 error notarget a package version that doesn't exist.
60 verbose exit 1
61 timing npm Completed in 71225ms
62 verbose unfinished npm timer reify 1674350156748
63 verbose unfinished npm timer reify:loadTrees 1674350156754
64 verbose code 1
65 error A complete log of this run can be found in:
65 error /data/.npm/_logs/2023-01-22T01_15_56_608Z-debug-0.log
I'm running NR 3.0.2
Mm weird, I cannot reproduce with NR 3.0.2 and nodejs 16.16.0 (through docker)
Did you have custom config in your /home/steve/.npmrc
that may be the cause? (ex: production=false
)
That file does not exist.
I have rebooted the host machine and the problem remains the same.
Can you verify each of those location
None exist outside the container and only /usr/local/etc/npmrc exists inside. It contains a single line
cache=/data/.npm
I've been using NR almost 4 years and your nodes for the last 3. Never have I had anything close to this issue with any nodes/packages.
EDIT: I suspect a broader issue but nothing else is broken, that I know of. The only substantial change I made today to my environment (all hosts/systems) is disabling IPv6. All have been rebooted and seem to be fine.
I'm even more convinced that something more global is wrong on my end after trying "npm outdated" in a docker shell and getting this error:
39 verbose stack FetchError: request to https://registry.npmjs.org/node-red-contrib-msg-profiler failed, reason: getaddrinfo EAFNOSUPPORT registry.npmjs.org
39 verbose stack at ClientRequest.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/minipass-fetch/lib/index.js:130:14)
39 verbose stack at ClientRequest.emit (node:events:527:28)
39 verbose stack at TLSSocket.socketErrorListener (node:_http_client:454:9)
39 verbose stack at TLSSocket.emit (node:events:539:35)
39 verbose stack at emitErrorNT (node:internal/streams/destroy:157:8)
39 verbose stack at emitErrorCloseNT (node:internal/streams/destroy:122:3)
39 verbose stack at processTicksAndRejections (node:internal/process/task_queues:83:21)
I apologize for involving everyone here.
Just to close the loop on this, re-enabling IPv6 in the kernel fixed the issue. Of course I'll take this up on the NR site but every outbound connection from Node-RED was failing with the EAFNOSUPPORT error with IPv6 disabled. Only within NR though. I could issue the same commands from the command line and there was no problem.