I take the Wifi strength from my Sonoff devices in MQTT and send a command to a virtual Humidity device in HE that sets the humidity equal to the wifi strength. I'm lazy because I should probably create a custom device w/ Wifi strength as an attribute but this works fine.
So.... Battery Level should be easy to pass to a virtual device in HE. I think one-word status should be easy thru the Hubitat Nodes also because you can also send "active" or "inactive" to a motion sensor using a Command node. You can also probably pass a multi-word status but I would bet that sending "Roomba is done" will turn into "Roomba%20is%20done" due to Maker API.
If you were to create your own device driver with the attribute(s) you want, I am 95% sure you could get what you want. Unfortunately, I don't know how to solve the "%20" issue.
I was curious from a conversation a few weeks ago about preserving variables across restarts/reboots.... maybe the exact directions are posted elsewhere in this sea of posts on this thread, but I looked at 5-6 posts talking about this without seeing them, so just in case, i wanted to share this link with others
The great thing is setting things up like this with a separate store name is that you don't have to use it, but when you need that extra functionality it's just a matter of adding the store name as a third parameter on the "set" (or second param on the "get")
Create a Virtual Omni Sensor. It has the ability to store a variable value. Then, in NR, send a command of setVariable and then your argument is a text string.
But, I was right, it will add "%20" for blank spaces. If yours are just one word, it should work .
What do you mean by this? This might be why my "persistant" globals/flows dont seem to be persistant. Do I need to add something in the flow.get // global.get ?
If I could ask one more question, how would I inject a custom message into the SetVariable argument? I tried using a change node with Set msg.Arguments to a string but that didn't work. I'm afraid my node-red-fu is still sadly lacking.
EDIT: ignore that, msg.arguments is the correct parameter!
You need to add the filesystem store name if it’s anything other than default
So say you use the exact configuration I posted above:
-- flow.set(“foo”, “bar1”) : saves key/value in default memory based store (this technically assumes “default” as the store name)
— flow,set(“foo”, ”bar2”, “fs”) : saves to the file based “fs”-named store
-- flow.get(“foo”) : tries to pull out of default memory based store (this technically assumes “default” as the store name)
— flow,get(“foo”, “fs”) : tries to pull out of the file based “fs”-named store
In these examples: flow.get(“foo”) !== flow.get(“foo”, “fs”)
That help makes sense?
I’m not too sure how super reliable the filesystem method is as the article mentions :
“We can enable a new way of storing the data in variables. NodeRED v19 can save the data stored in the variables to a local file structure. These are saved automatically every 30 sec. It’s not enabled by default and we have to configure settings.js file to enable this.”
I was running some tests earlier and really couldn’t see the 30 second thing as a problem but I still neeed some more real world testing
I had previously enabled that option in settings.js
Here is a snippet
Do I need to update my flow.get//global.get to get from filesystem? Because, I dont think it's getting from filesystem at present, as my globals/flows dont seem to be persistent over a reboot.
I just found this simple app in another thread. I could have used this when getting started with NR and the Hubitat Nodes to understand what all of the devices can do. This is a cleaner process than using the HTTP requests in Maker API page.
What you should see when using persistent storage is that a directory called "context" in your Node-RED data directory gets filled with files - one for each flow that uses flow variables in persistent storage, and a "global" for all global scoped variables that use persistent storage.
That said, I do it like the article @morningz posted, as with slow storage on my RPi storing everything to disk could impact performance, so I use memory for default and only file system when needed.
Thanks, i'm using a Odroid with 16GB eMMC, so I hope I wont have issues. It was spare, I wanted it for something else, and that didnt pan out, so I now use it for Node Red
Save 5% with code JOINUS. They've run better deals, but that appears to be the current offering.
It's a moderately interesting device. Pretty good for announcements. Someone ported the ST driver to Hubitat. It didn't really work well in my experience. So I pass switches to ST via HubConnect. Node-red should be more flexible.
Hubitat is nothing but a way to get devices to show up in Node-RED for me at this point, I didn't look to install anything on HE to make this LaMetric work.
Yeah, he does, but it is pretty minor (I took a peek when the feature was added to the beta release). All in due time...
I was going to try and make a PR for it, but he is changing so many things in the nodes/making new nodes right now I wasn't sure I could keep up... Lots of commits in the code right now.