0
Answered: Discussion Open
Changing units of Voltage Measurement Tile
JBoer 6 years ago
in Things & Capabilities / Non-"Works With SmartThings" devices
•
updated by Terry (ActionTiles) (Co-Founder) 6 years ago •
3
Hi All,
I have a voltage sensor in ST actually measuring Water Tank levels and so was wanting to be able to have a % symbol rather than the 'V' units on the tile. I do have % showing in ST but I presume AT doesn't pull the unit from ST.
So is there a way for me to change the measurement unit symbol for the Voltage Sensor tile?
Thanks
Customer support service by UserEcho
Hi J,
The "units" parameter in SmartThings Events isn't used consistently by Device Type Handlers, so ActionTiles must ignore it.
You can change your DTH to make a more meaningful claim of Capability "Battery" instead of Voltage Measurement. Battery reports a single integer attribute "battery" of value 0 to 100 (representing percent). http://docs.smartthings.com/en/latest/capabilities-reference.html#battery
The ActionTiles "Battery Tile" will then be applicable to show your Water Tank level...
Make sense?
...Terry.
Thank you for your reply however I am not having much success with this as I am using ST_Anything for my sensors and so it is not as straight forward as I hoped. I have been able to change the Capability to 'Battery' but am not being able to get the values through.
If you have the time would you be able to show me what I need to change in Dan's code to get it to show as a battery in ActionTiles?
Mostly you just need to change "Voltage Measurement" to "Battery" and "voltage" to "battery"; but that doesn't cover the parse() method.
The parse() method is grabbing the keyword "voltage" (I think?) from the message from the device, and using that to set the name.
So my untested guess as to the code:
If this doesn't work, you can contact us for paid screen sharing session(s) to test & debug with your actual physical device and/or ask Dan (the original DTH coder) for assistance ... and donate to him accordingly.