i want to simply create a thing which is able to count.
(my idea: im not able to monitor my daily energy consumption, but i know that for example every day i consume xx KWHs - therefore i want to create a thing showing my initial energy KWH meter and add with WebCoRe everyday my value x : initial value xx + daily y = @new value)
therefore i created a simple energy tile and now i need to create a variable which i can fill with Webcore
tgauchat
(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy)
2
A Device exposes Attributes not variables (variables are for internal use only).
So if you have created a DTH with Capability “Energy Meter”, you have can expose an ad hoc custom Command called like “def addToEnergy( amount )” and that Command can use the sendEvent(...) method to update the Attribute “energy”.
I know that’s just a sketch … but does it make sense?
Using a Command to update an Attribute is pretty common, but not ubiquitous. Most DTHs get their updates through the parse() method which silently calls sendEvent(...) at its end.