Not sure I have the best use case for this. More of me trying to make things simple/dynamic being lazy
On the Habitat side I have a super simple virtual device driver which creates state variables dynamically through a method.
Pass in a key & value and it creates a variable with the key as name and value as…value.
Since these variables aren’t attributes, obviously they aren’t going to appear on SP side.
It has 1 attribute. attributeUpdated.
When a variable is created or updated,
I do a sendEvent on attributeUpdated, it’s value is set to a simple key=value pair (json).
Now that - arrives over at sharp tools no problem, no need to auth, no new virtaul device, etc.
Just a nice way to bypass having to worry about device capabilities, and re-authorizing between platforms just to expose a piece of information from there to here.
I can use HTTP. This just seemed like low effort way to do it.
You create this 1 virtual device and it’ll store as many “hub wide” state variables as you’d like and you can share them in either RM through event listening.
In the rules machine on Hubitat or Shaprtools you just trigger on the event of attributeUpdated being changed then you filter if it’s the variable you’re looking for or not. (If I could parse %value%)
There should not be a vast need for this, but when you do need it ,it’s nice to just be able to work in the 2 rules engines without making a new virtual device and reauthorizing.
My thought is more to expose some of the existing rules engine options for HTTP to variables.
Anyways - I’m in the middle of learning a lot of this and groovy - i’m sure there is a “well you could just do this” I’ve not thought of.