In the old ST app, you can add a virtual motion device and clicking on that device will toggle it from active to inactive. Does anyone have an idea on how to duplicate that behavior with Sharptools dash?
If the virtual device has a method for setting or toggling the state, you could call that method from a SharpTools rule (and configure your dashboard tile to run the rule when tapped).
Or depending on your need, a SharpTools Variable (true/false) might do what you need and has more native integration in both dashboards and rules.
Hmm, not sure if there’s such a thing with the HE virtual motion but I have an idea and will see if this pans out. Thanks, will report back if it’s a fail or not.
I finally got this working on hero attribute tile. I’ve looked at the css tweaks but I have not found one that targets just one tile? I’d like to increase the size to make it a little more proportion to the surrounding tiles.
You should be able to tweak the Main Content Size setting in the Hero Attribute tile to increase the size of the icon / content.
Oh wow, I’ve seen that 2x a few times and didn’t even bother touching it. For some reason I thought it was referring to tile size.
Thank you! That worked out perfect!
Last question for the day… is it possible to pass the device/thing name of the tile I just clicked to the a rule?
This is how I’m calling the rule url right now…
This is what my tile looks like so far.
You could pass a parameter to the rule and then access that from a Context Variable in your rule.
Is the thing/device name available as a variable to include as a parameter? I can hardcode the name but I was thinking of reusing the rule so I can just pass device names to it.
Details about the tile that that was clicked are not available. If you use the $.runRule()
syntax, there is some general context information available about the dashboard and who clicked the tile.
But my point was that you can still make the rule dynamic by passing unique parameter values from each tile/hyperlink. In each tile, you would configure either the $.get()
or $runRule()
call with a parameter with a value to identify the Thing however you see fit.
Example Hyperlink
$.runRule("RULE-ID", { "thing": "MyCoolThing" })
Example Rule
(You could also use an HTTP Trigger if you are more comfortable with that)
The REST API and $.runRule syntax thread linked above is a good resource as it has examples of using parameters. That article also links to another article on how you can access parameters using context variables in a rule.