Hi @ all!
Now I’m writing on the next driver stumbling over the same issue. That’s why I want to start continuing the discussion from Help needed: st.zigbee.cluster_base understanding here.
I want to create a custom capability like the ActivitySensor. It has only one defined attribute that can have a list of enumerated states. These states are changed only by the driver script and not by the app tiles.
In my last issue I tried to solve this by adding a “setter” to the attribute and a command to set the states, but then the app tile was adjustable, which indeed makes no sense here.
cap.json:
{
"name": "Valve Operation State",
"attributes": {
"valveOperationState": {
"schema": {
"type": "object",
"additionalProperties": false,
"properties": {
"value": {
"type": "string",
"enum": ["flow", "stopped"]
}
},
"required": ["value"]
},
"type": "ENUM",
"values": ["flow", "stopped"]
}
},
"commands": {}
}
cap_pres.json:
{
"dashboard": {
"states": [],
"actions": []
},
"detailView": [
{
"label": "{{i18n.label}}",
"displayType":"state",
"state": {
"value": "valveOperationState.value",
"valueType": "string",
"alternatives": [
{
"key": "flow",
"value": "{{i18n.attributes.valveOperationState.i18n.value.flow.label}}"
},
{
"key": "stopped",
"value": "{{i18n.attributes.valveOperationState.i18n.value.stopped.label}}"
}
]
}
}
],
"automation": {
"conditions": [],
"actions": []
},
"id": "preparestream40760.valveOperationState",
"version": 1
}
log:
2022-05-17T12:55:31.773099765+00:00 INFO Valve <ZwaveDevice: d036d2bd-b1d8-4333-8984-3be33ef5ab0d
[12] (Valve)> emitting event: {"attribute_id":"valveOperationState","capability_id":"preparestream40760.valveOperationState","component_id":"main","state":{"value":"flow"}}
in the app tile “Water flow” the status is empty:
under my.smartthings.com it’s shown:
Btw. the same problem is with the default refresh capability.
Thank you in advance.