Hello, I am encountering an issue with a custom capability I’ve created for controlling sound volume on a device using the SmartThings Edge Driver. The capability is intended to allow users to select between three sound volume levels: Low, Medium, and High. The device takes integers 0, 1, 2, and I map integers to three levels in the list presentation under alternatives
.
The weird thing is that the Sound Volume capability always works correctly when first accessed after selecting the Edge Driver for the device. However, when I navigate away from the device screen and then return, the list presentation for Sound Volume no longer functions and results in an error “A network or server error occurred. Try again later”. I did some searching regarding this error and found this post. But since I have configured the “setter” for the attribute and it works fine the first time I use it after installation. The causes for this may be different than those in the post I found.
Furthermore, I replace the list presentation with the slider presentation, and the slider works without any issues, even after switching screens. So I guess the problem is most likely in the List presentation, but I couldn’t figure it out. Below are the JSON files of the capability and the both presentations.
SoundVolume.json
{
"name": "Sound Volume",
"attributes": {
"SoundVolume": {
"schema": {
"type": "object",
"properties": {
"value": {
"type": "integer",
"minimum": 0,
"maximum": 2
}
},
"additionalProperties": false,
"required": [
"value"
]
},
"setter": "setSoundVolume",
"enumCommands": []
}
},
"commands": {
"setSoundVolume": {
"name": "setSoundVolume",
"arguments": [
{
"name": "soundVolume",
"optional": false,
"schema": {
"type": "integer",
"minimum": 0,
"maximum": 2
}
}
]
}
}
}
list_presentation.json
{
"dashboard": {
"states": [],
"actions": []
},
"detailView": [
{
"label": "SoundVolume",
"displayType": "list",
"list": {
"command": {
"name": "setSoundVolume",
"alternatives": [
{
"key": 0,
"value": "Low"
},
{
"key": 1,
"value": "Medium"
},
{
"key": 2,
"value": "High"
}
],
"argumentType": "integer"
},
"state": {
"value": "SoundVolume.value",
"valueType": "integer",
"alternatives": [
{
"key": 0,
"value": "Low"
},
{
"key": 1,
"value": "Medium"
},
{
"key": 2,
"value": "High"
}
]
}
}
}
],
"automation": {
"conditions": [],
"actions": []
},
"id": "cloudchapter42122.soundVolume",
"version": 1
}
slider_presentation.json
{
"dashboard": {
"states": [],
"actions": []
},
"detailView": [
{
"label": "SoundVolume",
"displayType": "slider",
"slider": {
"range": [
0,
2
],
"command": "setSoundVolume",
"argumentType": "integer",
"value": "SoundVolume.value",
"valueType": "integer"
}
}
],
"automation": {
"conditions": [],
"actions": []
},
"id": "cloudchapter42122.soundVolume",
"version": 1
}
Has anyone had a similar problem? Any help with this would be greatly appreciated!