Now that the device name is the node's topic, is it possible to override the device in a command node like we can override the command? For example, could I set up a command node to turn on Light A but then have an inject node that overrides the device and instead turns on Light B?
This thread has been moving pretty fast so I apologize if I missed how to do it.
Global, flow, and context variables are all the same - the only difference is scope.
Can set any of them in change nodes. Can do truth logic on any of them in switch nodes.
Can use any of them in function nodes. Note that for a context variable, you can only use in the node it was defined in, so could only use a context variable in a function node that was defined in that function node.
Technically, the topic is not the device name, but the node name
Also a device name is not unique in HE, to make a such feature you will need to pass the device ID.
Setting the deviceId as message property is easy to do (technically), but I don't think it should be implemented. Making the device field optional (to keep consistency) and allowing to choose device with the input just make the device node too generic. For this, you can directly use the HTTP request node.
I'm open to discuss about it, but you should prove me some scenarios that cannot be done in another way or without adding complexity
That makes perfect sense. So I will ask if someone has a solution to reduce the number of nodes in my Vacation Lighting sequence WITHOUT utilizing a Function Node
The pink nodes on the left are from node-red-contrib-presence-faker. Basically, it randomly sends off & on payloads and topics based on time parameters that you set. The sequence ends by writing what device changed and when it changed to a text file. As you can see, I have 7 parallel paths so I was hoping that there was a way to consolidate somewhere after the Presense Faker nodes again without using a Function Node. If there isn't, no big deal, this seems to work just fine. It's definitely not a reason to do anything weird in your integration.
In this sequence, I was originally using HTTP Requests and a Template node to generate the URL so the Topic for each of the Presence Fakers' node is already the deviceID.
EDIT: Ok, now that I have gone back and looked at this again, I think I can lose the Change Nodes and the Device Node (blue) now that the device name is part of the payload. I created this before that was an option. Also, i forgot to mention I change your Command Nodes to Red and Device Nodes to blue to help me distiguish.
Funny, I wasn't sure how you meant that (other way around), but now that I re-read it I see exactly what you mean. lol. English... What a language! Which then makes me think about...
Have now converted every rule machine rule I had over to Node Red, except for those that use Sonos TTS, when a solution to this is found then I will be completely platform independent on the automation. My last one (thermostat scheduler) took some time as I went from this
config node: support multi hub (big thank you to @dan.t)
config node: allow to customize the webhook path. This allow to:
distinguish endpoints when using many hubs
secure the path to avoid guessing attacks *
config node: small validation on Node-RED Server field to avoid typo with white space
device node: fix bug that remove the status when requesting device attribute
command node: fix bug when sending integer 0 as command arguments
* I will not add more effort to add security on the webhook endpoint.
I think that with SSL/TLS on your server and a custom path containing a uuid (e.i. the token), you can play with Node-RED even if it's hosted on internet.
But, I still do not recommend this setup for real usage and don't take the responsibility for doing this
Ongoing
I will take the time to update my flows with the last version (still on 0.0.14 ...). I also want to have fun with NR
In other words: no big changes planned, only bug fixes if found
I assume you tried using characters other than space? Dash (minus), maybe? Just seems that there should be SOME non-pronounced character that could be substituted for spaces... But maybe not?