How can I go about creating a custom DTH for a simulated switch? I want to replicate a regular simulated switch, except I want to modify the text on the switch from “ON” and “OFF” to custom text defined in the switch’s settings. Are there any good guides on how to do this? Perhapsa known template to start from?
Thanks!
tgauchat
(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy)
#2
Perfect! Simple enough for me to play with. Perhaps a presence sensor is a better template as I want to display bibary status, not control. Off to the playground!
Is there any online guide as to the parts and pieces to a custom DTH? I am looking at 3 binary sensor DTH files (Presence, Motion & Contact) and comparing them side by side along with the proposed switch one above.
Also, I see many of these seem to reference icons, is there a master list of existing icons?
Finally, if I want my simulated sensor to have settings that can be user defined, how do I establish this? Perhaps user provided “open” and “closed” labels as well as user selected icons under the sensor settings?
tgauchat
(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy)
#6
Though not the quickest; I always recommend reading all of the Developer Documentation:
Once you’ve done that; make tiny incremental changes - ONE at a time - compiling and testing it each time until it breaks. Then go back a step and try again and again and again.
SmartThings is a super complex system that would be a 2-term college class at least. Don’t expect to learn it in a week!
Thanks for the direction! No worries, I plan to keep my day job Action Tiles will remain safe!
I just like to tinker and learn
1 Like
tgauchat
(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy)
#8
It’s definitely fun to learn, but takes some patience; hence the iterative “test one change at a time” approach.
And: Never trust the Simulator: It is much less frustrating, though a tiny bit slower, to keep using “Publish - For me” and then testing in the SmartThings App on your phone or tablet.
One more hint: Frequently pasting your code into GitHub will allow you to not only track your changes to make it easier to backtrack when something breaks, but also super easy to share the entire DTH here (just like I pasted the sample above…) so that folks can copy it to their own environment to help see the exact bug you have encountered.