Tile updates Temperature vs Power using simulated devices.
I have many centralite appliance outlets in my house. I also have neruio whole house power monitoring.
I have a panel that shows current power consumption of every centralite outlet. I want to add up all my outlets into a total watts in use tile.
It seems that the "Simulated Power Meter" is no longer a built in device in the IDE. So I used "Simulated Temperature Sensor" and webcore to add up all the outlets in to a single Total number.
This works great! Except, it shows up as a temperature with the degree symbol next to it, and without power (w) at the bottom of the tile. (don't yell at me, I know this is pretty trivial in the grand scheme of things)
I modify "Virtual Temperature Sensor" and make it a "Simulated Power Meter"
This works, however the update/refresh of the tile is many, many times slower, maybe in the 5 minute range?
I can see in the ST app that I am getting the update correctly reflected every 30 seconds, same as the temp, but the temp tile updates, and the power tile takes forever.
Is there something in the device handler that dictates how actiontiles treats the refresh? I'm hoping something jumps out at someone in the know. Thanks in advance.
Answers
A side note: Simulated devices (as opposed to Virtual devices) were actually intended only for testing and debugging of SmartApps. For example, if you were writing a SmartApp that turned a Switch off after a certain number of Watts were consumed, you would attached a simulated Power Meter or Power Metering Switch to the SmartApp debug window.
But even Virtual devices are pretty much a unofficial and hidden. So who the heck knows how much of a code difference there is supposed to between them. Simulated Switch, for example, has 4 custom Commands: onPhysical(), offPhysical(), markDeviceOnline(), markDeviceOffline(). Those are Commands that should never be needed in a "real" Device, and therefore less likely be required in a Virtual device.
So: Don't worry about not finding Simulated Power Meter no longer "built-into" the IDE if you can just manage to find source code somewhere - nope; I can't find it. You could take the code for Simulated Temperature Sensor and use that as your template to build a Simulated Power Meter. They're pretty similar, but you need to know Groovy and SmartThings programming.
Back to the meat of the question:
Is there something in the device handler that dictates how actiontiles treats the refresh?
ActionTiles updates immediately for all events which are State Changes, except for Power, because Power events are too frequent. Power events are filtered based on certain percentage thresholds. Except you're using Temperature as your Attribute - So ActionTiles's filters should not affect you.
Regardless, to check, please use Live Logging to check what events are actually occuring and which are being sent to ActionTiles.
Thanks Terry! This completely explains the behavior I am seeing. Every 30 seconds webcore adds up outlets 1-15, sets temperature of Simulated Temp device, also sets power of simulate power device. Temp changes, power only changes if there is a big enough difference between the last power, and current power. I believe it's "working as intended"
Customer support service by UserEcho
A side note: Simulated devices (as opposed to Virtual devices) were actually intended only for testing and debugging of SmartApps. For example, if you were writing a SmartApp that turned a Switch off after a certain number of Watts were consumed, you would attached a simulated Power Meter or Power Metering Switch to the SmartApp debug window.
But even Virtual devices are pretty much a unofficial and hidden. So who the heck knows how much of a code difference there is supposed to between them. Simulated Switch, for example, has 4 custom Commands: onPhysical(), offPhysical(), markDeviceOnline(), markDeviceOffline(). Those are Commands that should never be needed in a "real" Device, and therefore less likely be required in a Virtual device.
So: Don't worry about not finding Simulated Power Meter no longer "built-into" the IDE if you can just manage to find source code somewhere - nope; I can't find it. You could take the code for Simulated Temperature Sensor and use that as your template to build a Simulated Power Meter. They're pretty similar, but you need to know Groovy and SmartThings programming.
Back to the meat of the question:
ActionTiles updates immediately for all events which are State Changes, except for Power, because Power events are too frequent. Power events are filtered based on certain percentage thresholds. Except you're using Temperature as your Attribute - So ActionTiles's filters should not affect you.
Regardless, to check, please use Live Logging to check what events are actually occuring and which are being sent to ActionTiles.
Thanks Terry! This completely explains the behavior I am seeing. Every 30 seconds webcore adds up outlets 1-15, sets temperature of Simulated Temp device, also sets power of simulate power device. Temp changes, power only changes if there is a big enough difference between the last power, and current power. I believe it's "working as intended"