It is very simple, in English, to say what I want to do (it’s captured in the Subject line).
Unfortunately, it is a little(?) harder to tell it to SmartThings (it’s in this whole thread and “condensed” below).
Let’s see how hard it is to say to SmartThings …
I don’t ever want to change which capabilities are displayed.
I don’t want to change how any of them are displayed except that I want 1 to be the minimum dimmer value.
Correct me if I am wrong but …
smartthings devices:presentation -y $device_id > presentation/dimmer-devices-presentation.yaml
…, for a targeted dimmer $device_id, seems to be the way to answer which.
Unfortunately, it only answers the question right now and cannot anticipate how the question might be answered when SmartThings decides better/differently.
What happens then?
Do I need to monitor and revisit this?
Ugh!
Use this to get the structure and edit it for content.
cp presentation/dimmer{-devices-presentation,}.yaml
vi presentation/dimmer.yaml
At the trunk, remove everything but the dashboard
, detailView
and automation
branches.
At the tips of the remaining branches, remove everything but
- component: main
capability: *
version: 1
For all the capability: switchLevel
tips, add
values:
- key: level.value
range:
- 1
- 100
step: 1
All told …
dashboard:
states:
- component: main
capability: switch
version: 1
actions:
- component: main
capability: switch
version: 1
detailView:
- component: main
capability: switch
version: 1
- component: main
capability: switchLevel
version: 1
values:
- key: level.value
range:
- 1
- 100
step: 1
automation:
conditions:
- component: main
capability: switch
version: 1
- component: main
capability: switchLevel
version: 1
values:
- key: level.value
range:
- 1
- 100
step: 1
actions:
- component: main
capability: switch
version: 1
- component: main
capability: switchLevel
version: 1
values:
- key: level.value
range:
- 1
- 100
step: 1
Use this for creating …
smartthings presentation:device-config:create -i presentation/dimmer.yaml > presentation/dimmer-presentation-device-config.yaml
… and consuming a tiny bit that needs to be appended to the dimmer profile
(echo metadata:; head -2 presentation/dimmer-presentation-device-config.yaml | sed 's/^/ /') >> profiles/dimmer.yaml
Apparently, the vid: UUID in the dimmer profile now references a resource in the SmartThings cloud that the SmartThings App knows how to get and use.
I hope there is some garbage collection going on because I have created a lot of such resources in my flailing but am only referencing the last one.
It works!
That wasn’t too hard to say … or was it?
Now, will this statement break when the presentation that it was based on (today’s) changes tomorrow?
What needs to be done?