Hey @nayelyz
this is what I get calling the presentationID:
{
"mnmn": "SmartThingsCommunity",
"vid": "2ae224e8-8a30-3fc6-9978-3e5764afeda0",
"version": "0.0.1",
"iconUrl": null,
"dashboard": {
"states": [
{
"label": "{{temperature.value}} {{temperature.unit}}",
"alternatives": [
{
"key": "C",
"value": "°C",
"type": "active"
},
{
"key": "K",
"value": "°K",
"type": "active"
},
{
"key": "F",
"value": "°F",
"type": "active"
}
],
"capability": "temperatureMeasurement",
"version": 1,
"component": "main",
"composite": false,
"group": "main"
}
],
"actions": [],
"basicPlus": []
},
"detailView": [
{
"capability": "preparestream40760.windowOpenDetection",
"version": 1,
"label": "Window Open Detection",
"displayType": "list",
"list": {
"state": {
"value": "windowOpenDetection.value",
"valueType": "string",
"alternatives": [
{
"key": "quarantine",
"value": "Quarantine",
"type": "inactive"
},
{
"key": "closed",
"value": "Closed",
"type": "inactive"
},
{
"key": "opened",
"value": "Opened",
"type": "active"
},
{
"key": "hold",
"value": "Opening or Closing ...",
"type": "active"
},
{
"key": "opened_alarm",
"value": "Attention! Window was opened from the outside.",
"type": "active"
}
]
}
},
"state": null,
"component": "main"
},
{
"capability": "preparestream40760.heatMode",
"version": 1,
"label": "Heat Mode",
"displayType": "list",
"list": {
"state": {
"value": "setpointMode.value",
"valueType": "string",
"alternatives": [
{
"key": "fast",
"value": "Fast",
"type": "active"
},
{
"key": "normal",
"value": "Normal",
"type": "active"
},
{
"key": "eco",
"value": "Eco",
"type": "active"
}
]
}
},
"state": null,
"component": "main"
},
{
"capability": "thermostatHeatingSetpoint",
"version": 1,
"label": "___PO_CODE_CAPABILITY.SMARTTHINGS.THERMOSTATHEATINGSETPOINT_DEFAULT",
"displayType": "slider",
"slider": {
"range": [
5.0,
35.0
],
"step": 0.5,
"unit": "heatingSetpoint.unit",
"command": "setHeatingSetpoint",
"argumentType": "number",
"value": "heatingSetpoint.value",
"valueType": "number"
},
"state": null,
"component": "main"
},
{
"capability": "battery",
"version": 1,
"label": "___PO_CODE_CAPABILITY.SMARTTHINGS.BATTERY_DEFAULT",
"displayType": "slider",
"slider": {
"range": [
0.0,
100.0
],
"step": null,
"unit": "battery.unit",
"value": "battery.value",
"valueType": "integer"
},
"state": null,
"component": "main"
},
{
"capability": "temperatureMeasurement",
"version": 1,
"label": "___PO_CODE_CAPABILITY.SMARTTHINGS.TEMPERATUREMEASUREMENT_DEFAULT",
"displayType": "slider",
"slider": {
"range": [
-20.0,
50.0
],
"step": null,
"unit": "temperature.unit",
"value": "temperature.value",
"valueType": "number"
},
"state": null,
"component": "main"
},
{
"capability": "refresh",
"version": 1,
"label": "___PO_CODE_CAPABILITY.SMARTTHINGS.REFRESH_DEFAULT",
"displayType": "pushButton",
"pushButton": {
"command": "refresh"
},
"state": null,
"component": "main"
}
],
"automation": {
"conditions": [
{
"capability": "preparestream40760.windowOpenDetection",
"version": 1,
"label": "Window Open Detection",
"displayType": "list",
"list": {
"alternatives": [
{
"key": "quarantine",
"value": "Quarantine",
"type": "inactive"
},
{
"key": "closed",
"value": "Closed",
"type": "inactive"
},
{
"key": "opened",
"value": "Opened",
"type": "active"
},
{
"key": "hold",
"value": "Opening or Closing ...",
"type": "active"
},
{
"key": "opened_alarm",
"value": "Attention! Window was opened from the outside.",
"type": "active"
}
],
"value": "windowOpenDetection.value",
"valueType": "string"
},
"exclusion": [],
"component": "main"
},
{
"capability": "preparestream40760.heatMode",
"version": 1,
"label": "Heat Mode",
"displayType": "list",
"list": {
"alternatives": [
{
"key": "fast",
"value": "Fast",
"type": "active"
},
{
"key": "normal",
"value": "Normal",
"type": "active"
},
{
"key": "eco",
"value": "Eco",
"type": "active"
}
],
"value": "setpointMode.value",
"valueType": "string"
},
"exclusion": [],
"component": "main"
},
{
"capability": "thermostatHeatingSetpoint",
"version": 1,
"label": "___PO_CODE_CAPABILITY.SMARTTHINGS.THERMOSTATHEATINGSETPOINT_DEFAULT",
"displayType": "numberField",
"numberField": {
"value": "heatingSetpoint.value",
"valueType": "number",
"unit": "heatingSetpoint.unit",
"range": [
5.0,
35.0
]
},
"exclusion": [],
"component": "main"
},
{
"capability": "battery",
"version": 1,
"label": "___PO_CODE_CAPABILITY.SMARTTHINGS.BATTERY_DEFAULT",
"displayType": "numberField",
"numberField": {
"value": "battery.value",
"valueType": "integer",
"unit": "battery.unit",
"range": [
0.0,
100.0
]
},
"exclusion": [],
"component": "main"
},
{
"capability": "temperatureMeasurement",
"version": 1,
"label": "___PO_CODE_CAPABILITY.SMARTTHINGS.TEMPERATUREMEASUREMENT_DEFAULT",
"displayType": "numberField",
"numberField": {
"value": "temperature.value",
"valueType": "number",
"unit": "temperature.unit",
"range": [
-20.0,
50.0
]
},
"exclusion": [],
"component": "main"
}
],
"actions": [
{
"capability": "thermostatHeatingSetpoint",
"version": 1,
"label": "___PO_CODE_CAPABILITY.SMARTTHINGS.THERMOSTATHEATINGSETPOINT_DEFAULT_COMMANDS_SETHEATINGSETPOINT",
"displayType": "numberField",
"numberField": {
"command": "setHeatingSetpoint",
"argumentType": "number",
"unit": "heatingSetpoint.unit",
"range": [
0.0,
40.0
]
},
"component": "main",
"exclusion": []
},
{
"capability": "preparestream40760.heatMode",
"version": 1,
"label": "Heat Mode",
"displayType": "list",
"list": {
"alternatives": [
{
"key": "fast",
"value": "Fast",
"type": "active"
},
{
"key": "normal",
"value": "Normal",
"type": "active"
},
{
"key": "eco",
"value": "Eco",
"type": "active"
}
]
},
"component": "main",
"exclusion": []
}
]
},
"dpInfo": [
{
"os": "ios",
"dpUri": "plugin://com.samsung.ios.plugin.stplugin/assets/files/index.html"
},
{
"os": "android",
"dpUri": "plugin://com.samsung.android.plugin.stplugin"
},
{
"os": "web",
"dpUri": "wwst://com.samsung.one.plugin.stplugin"
}
],
"language": [
{
"locale": "en",
"poCodes": [
{
"label": "Heating temperature",
"po": "___PO_CODE_CAPABILITY.SMARTTHINGS.THERMOSTATHEATINGSETPOINT_DEFAULT_ATTRIBUTES_HEATINGSETPOINT"
},
{
"label": "Heating temperature",
"po": "___PO_CODE_CAPABILITY.SMARTTHINGS.THERMOSTATHEATINGSETPOINT_DEFAULT"
},
{
"label": "Heating temperature",
"po": "___PO_CODE_CAPABILITY.SMARTTHINGS.THERMOSTATHEATINGSETPOINT_DEFAULT_COMMANDS_SETHEATINGSETPOINT"
},
{
"label": "Refresh",
"po": "___PO_CODE_CAPABILITY.SMARTTHINGS.REFRESH_DEFAULT"
},
{
"label": "Refresh",
"po": "___PO_CODE_CAPABILITY.SMARTTHINGS.REFRESH_DEFAULT_COMMANDS_REFRESH"
},
{
"label": "Temperature",
"po": "___PO_CODE_CAPABILITY.SMARTTHINGS.TEMPERATUREMEASUREMENT_DEFAULT_ATTRIBUTES_TEMPERATURE"
},
{
"label": "Temperature",
"po": "___PO_CODE_CAPABILITY.SMARTTHINGS.TEMPERATUREMEASUREMENT_DEFAULT"
},
{
"label": "Battery",
"po": "___PO_CODE_CAPABILITY.SMARTTHINGS.BATTERY_DEFAULT_ATTRIBUTES_BATTERY"
},
{
"label": "Battery",
"po": "___PO_CODE_CAPABILITY.SMARTTHINGS.BATTERY_DEFAULT"
},
{
"label": "setpointMode",
"po": "___PO_CODE_CAPABILITY.PREPARESTREAM40760.HEATMODE_DEFAULT_ATTRIBUTES_SETPOINTMODE"
},
{
"label": "fast",
"po": "___PO_CODE_CAPABILITY.PREPARESTREAM40760.HEATMODE_DEFAULT_ATTRIBUTES_SETPOINTMODE_FAST"
},
{
"label": "Heat Mode",
"po": "___PO_CODE_CAPABILITY.PREPARESTREAM40760.HEATMODE_DEFAULT"
},
{
"label": "eco",
"po": "___PO_CODE_CAPABILITY.PREPARESTREAM40760.HEATMODE_DEFAULT_ATTRIBUTES_SETPOINTMODE_ECO"
},
{
"label": "normal",
"po": "___PO_CODE_CAPABILITY.PREPARESTREAM40760.HEATMODE_DEFAULT_ATTRIBUTES_SETPOINTMODE_NORMAL"
},
{
"label": "quarantine",
"po": "___PO_CODE_CAPABILITY.PREPARESTREAM40760.WINDOWOPENDETECTION_DEFAULT_ATTRIBUTES_WINDOWOPENDETECTION_QUARANTINE"
},
{
"label": "opened_alarm",
"po": "___PO_CODE_CAPABILITY.PREPARESTREAM40760.WINDOWOPENDETECTION_DEFAULT_ATTRIBUTES_WINDOWOPENDETECTION_OPENED_ALARM"
},
{
"label": "closed",
"po": "___PO_CODE_CAPABILITY.PREPARESTREAM40760.WINDOWOPENDETECTION_DEFAULT_ATTRIBUTES_WINDOWOPENDETECTION_CLOSED"
},
{
"label": "hold",
"po": "___PO_CODE_CAPABILITY.PREPARESTREAM40760.WINDOWOPENDETECTION_DEFAULT_ATTRIBUTES_WINDOWOPENDETECTION_HOLD"
},
{
"label": "opened",
"po": "___PO_CODE_CAPABILITY.PREPARESTREAM40760.WINDOWOPENDETECTION_DEFAULT_ATTRIBUTES_WINDOWOPENDETECTION_OPENED"
},
{
"label": "windowOpenDetection",
"po": "___PO_CODE_CAPABILITY.PREPARESTREAM40760.WINDOWOPENDETECTION_DEFAULT_ATTRIBUTES_WINDOWOPENDETECTION"
},
{
"label": "Window Open Detection",
"po": "___PO_CODE_CAPABILITY.PREPARESTREAM40760.WINDOWOPENDETECTION_DEFAULT"
}
]
}
],
"manufacturerName": "SmartThingsCommunity",
"presentationId": "2ae224e8-8a30-3fc6-9978-3e5764afeda0"
}
This is what I got in the WebGUI:
and this is what I can see in the ST app on android (Samsung Galaxy S3):
I’ve already tried different things like adjusting device presentation to renew vid ID, restart ST app/ smartphone/ST hub several times, uninstall the driver etc … checking/removing/adding both custom caps again and again without no success …
Here are my custom caps:
window open detection cap:
{
"name": "Window Open Detection",
"attributes": {
"windowOpenDetection": {
"schema": {
"type": "object",
"properties": {
"value": {
"type": "string",
"enum": [
"quarantine",
"closed",
"hold",
"opened",
"opened_alarm"
]
}
},
"additionalProperties": false,
"required": [
"value"
]
},
"enumCommands": []
}
},
"commands": {}
}
window open detection cap presentation:
{
"dashboard": {
"states": [],
"actions": [],
"basicPlus": []
},
"detailView": [
{
"label": "Window Open Detection",
"displayType": "list",
"list": {
"state": {
"value": "windowOpenDetection.value",
"valueType": "string",
"alternatives": [
{
"key": "quarantine",
"value": "Quarantine",
"type": "inactive"
},
{
"key": "closed",
"value": "Closed",
"type": "inactive"
},
{
"key": "opened",
"value": "Opened",
"type": "active"
},
{
"key": "hold",
"value": "Opening or Closing ...",
"type": "active"
},
{
"key": "opened_alarm",
"value": "Attention! Window was opened from the outside.",
"type": "active"
}
]
}
}
}
],
"automation": {
"conditions": [
{
"label": "Window Open Detection",
"displayType": "list",
"list": {
"alternatives": [
{
"key": "quarantine",
"value": "Quarantine",
"type": "inactive"
},
{
"key": "closed",
"value": "Closed",
"type": "inactive"
},
{
"key": "opened",
"value": "Opened",
"type": "active"
},
{
"key": "hold",
"value": "Opening or Closing ...",
"type": "active"
},
{
"key": "opened_alarm",
"value": "Attention! Window was opened from the outside.",
"type": "active"
}
],
"value": "windowOpenDetection.value",
"valueType": "string"
}
}],
"actions": []
},
"id": "preparestream40760.windowOpenDetection",
"version": 1
}
heat mode cap:
{
"name": "Heat Mode",
"attributes": {
"setpointMode": {
"schema": {
"type": "object",
"properties": {
"value": {
"type": "string",
"enum": [
"fast",
"eco",
"normal"
]
}
},
"additionalProperties": false,
"required": [
"value"
]
},
"enumCommands": [
{
"command": "fast",
"value":"fast"
},
{
"command": "normal",
"value":"normal"
},
{
"command": "eco",
"value":"eco"
}
]
}
},
"commands": {
"fast": {
"name": "fast",
"arguments": []
},
"normal":{
"name": "normal",
"arguments": []
},
"eco":{
"name": "eco",
"arguments": []
}
}
}
heat mode cap presentation:
{
"dashboard": {
"states": [],
"actions": [],
"basicPlus": []
},
"detailView": [
{
"label": "Heat Mode",
"displayType": "list",
"list": {
"state": {
"alternatives": [
{
"key": "fast",
"value": "Fast",
"type": "active"
},
{
"key": "normal",
"value": "Normal",
"type": "active"
},
{
"key": "eco",
"value": "Eco",
"type": "active"
}
],
"value": "setpointMode.value",
"valueType": "string"
}
},
"state": null
}
],
"automation": {
"conditions": [
{
"label": "Heat Mode",
"displayType": "list",
"list": {
"alternatives": [
{
"key": "fast",
"value": "Fast",
"type": "active"
},
{
"key": "normal",
"value": "Normal",
"type": "active"
},
{
"key": "eco",
"value": "Eco",
"type": "active"
}
],
"value": "setpointMode.value",
"valueType": "string"
}
}
],
"actions": [
{
"label": "Heat Mode",
"displayType": "list",
"list": {
"alternatives": [
{
"key": "fast",
"value": "Fast",
"type": "active"
},
{
"key": "normal",
"value": "Normal",
"type": "active"
},
{
"key": "eco",
"value": "Eco",
"type": "active"
}
]
}
}
]
},
"id": "preparestream40760.heatMode",
"version": 1
}
This is my customized device presentation:
{
"dashboard": {
"states": [
{
"component": "main",
"capability": "temperatureMeasurement",
"version": 1,
"idx": 0,
"group": "main",
"values": [],
"composite": false
}
],
"actions": [],
"basicPlus": []
},
"detailView": [
{
"component": "main",
"capability": "preparestream40760.windowOpenDetection",
"version": 1,
"values": [],
"patch": []
},
{
"component": "main",
"capability": "preparestream40760.heatMode",
"version": 1,
"values": [],
"patch": []
},
{
"component": "main",
"capability": "thermostatHeatingSetpoint",
"version": 1,
"values": [{
"key": "heatingSetpoint.value",
"enabledValues": [],
"range": [
5,
35
],
"step": 0.5
}],
"patch": []
},
{
"component": "main",
"capability": "battery",
"version": 1,
"values": [],
"patch": []
},
{
"component": "main",
"capability": "temperatureMeasurement",
"version": 1,
"values": [],
"patch": []
},
{
"component": "main",
"capability": "refresh",
"version": 1,
"values": [],
"patch": []
}
],
"automation": {
"conditions": [
{
"component": "main",
"capability": "preparestream40760.windowOpenDetection",
"version": 1,
"values": [],
"patch": [],
"exclusion": []
},
{
"component": "main",
"capability": "preparestream40760.heatMode",
"version": 1,
"values": [],
"patch": []
},
{
"component": "main",
"capability": "thermostatHeatingSetpoint",
"version": 1,
"values": [{
"key": "heatingSetpoint.value",
"enabledValues": [],
"range": [
5,
35
],
"step": 0.5
}],
"patch": [],
"exclusion": []
},
{
"component": "main",
"capability": "battery",
"version": 1,
"values": [],
"patch": [],
"exclusion": []
},
{
"component": "main",
"capability": "temperatureMeasurement",
"version": 1,
"values": [],
"patch": [],
"exclusion": []
}
],
"actions": [
{
"component": "main",
"capability": "thermostatHeatingSetpoint",
"version": 1,
"values": [{
"key": "heatingSetpoint.value",
"enabledValues": [],
"range": [
5,
35
],
"step": 0.5
}],
"patch": [],
"exclusion": []
},
{
"component": "main",
"capability": "preparestream40760.heatMode",
"version": 1,
"values": [],
"patch": []
},
{
"component": "main",
"capability": "refresh",
"version": 1,
"values": [],
"patch": []
}
]
},
"type": "profile"
}
Nevertheless, my heatmode capability command seems to be passed through via the CLI:
Thermostat
Capabilities:
┌───┬────────────────────────────────────────┐
│ 1 │ preparestream40760.windowOpenDetection │
├───┼────────────────────────────────────────┤
│ 2 │ preparestream40760.heatMode │
├───┼────────────────────────────────────────┤
│ 3 │ thermostatMode │
├───┼────────────────────────────────────────┤
│ 4 │ thermostatHeatingSetpoint │
├───┼────────────────────────────────────────┤
│ 5 │ powerSource │
├───┼────────────────────────────────────────┤
│ 6 │ battery │
├───┼────────────────────────────────────────┤
│ 7 │ temperatureMeasurement │
├───┼────────────────────────────────────────┤
│ 8 │ firmwareUpdate │
├───┼────────────────────────────────────────┤
│ 9 │ refresh │
└───┴────────────────────────────────────────┘
? Enter capability index or id 2
Commands:
┌───┬──────────┐
│ 1 │ eco() │
├───┼──────────┤
│ 2 │ normal() │
├───┼──────────┤
│ 3 │ fast() │
└───┴──────────┘
? Enter command 1
Command executed successfully
PS Q:\smartthings>
But I end up with the following error:
2022-04-06T07:27:08.355943542+00:00 TRACE Thermostat Received event with handler capability
2022-04-06T07:27:08.374915875+00:00 INFO Thermostat <ZigbeeDevice: c0c56f39-0417-4b3e-beb6-015b31b2c0df [0x213A] (Thermostat)> received command: {"args":[],"component":"main","positional_args":[],"capability":"preparestream40760.heatMode","command":"eco"}
2022-04-06T07:27:08.381206542+00:00 TRACE Thermostat Found CapabilityCommandDispatcher handler in popp-smart-thermostat
2022-04-06T07:27:08.386679542+00:00 DEBUG Thermostat ### heat_cmd_handler ...
2022-04-06T07:27:08.403806209+00:00 ERROR Thermostat Thermostat thread encountered error: [string "st/dispatcher.lua"]:229: Error encountered while processing event for <ZigbeeDevice: c0c56f39-0417-4b3e-beb6-015b31b2c0df [0x213A] (Thermostat)>:
arg1: table: 0x23ab288
[string "common.lua"]:118: [string "dkjson.lua"]:397: bad argument #1 to 'strfind' (string expected, got light userdata)
My handler look like this:
capability_handlers = {
...
[HeatingMode.ID] = {
[HeatingMode.commands.fast.NAME] = common.heat_cmd_handler,
[HeatingMode.commands.normal.NAME] = common.heat_cmd_handler,
[HeatingMode.commands.eco.NAME] = common.heat_cmd_handler
}
}
And the called function looks like this:
function common.heat_cmd_handler(driver, device, command)
device:emit_event(HeatingMode.setpointMode(command.command))
end
I’ve tried several tries like these (inspired by alot of examples in the SDK and other ST repositories):
device:send_to_component(command.component, HeatingMode.setpointMode({value = "Fast"})) // is it the caps attribute value??
device:emit_event(HeatingMode.setpointMode({value = tostring(command.command)})) // eco, fast, normal ???
device:emit_event(HeatingMode.setpointMode({value = command.command}))
device:emit_event(HeatingMode.setpointMode({state = command.command }))
device:emit_event(HeatingMode.setpointMode(HeatingMode.setpointMode.eco.NAME))
device:emit_event(HeatingMode.setpointMode("eco")) fast, normal ???
device:emit_event(HeatingMode.setpointMode({value = {command.command}}))
device:emit_event(HeatingMode.setpointMode.eco())
but I got still the same error … What am I doing wrong and how the the correct device:emit_event() should look like n my case?
Thank you in advance.