First attempt did not seem to work following those steps, the label in the app’s detailed view was unchanged. (Yes, I had a device installed using the driver). I used the first option to get the original device-config. I then modified the detail view and automations view to add the key and value. Note I am not entirely sure the “key” I parameter I used was correct (followed other examples for that).
{
"dashboard": {
"states": [
{
"component": "main",
"capability": "powerMeter",
"version": 1,
"idx": 0,
"group": "main",
"values": [],
"composite": false
}
],
"actions": [],
"basicPlus": []
},
"detailView": [
{
"component": "main",
"capability": "momentary",
"version": 1,
"values": [
{
"key": "momentary.value",
"label":"Apply Settings"
}
],
"patch": []
},
{
"component": "main",
"capability": "powerMeter",
"version": 1,
"values": [],
"patch": []
},
{
"component": "main",
"capability": "energyMeter",
"version": 1,
"values": [],
"patch": []
},
{
"component": "main",
"capability": "refresh",
"version": 1,
"values": [],
"patch": []
}
],
"automation": {
"conditions": [
{
"component": "main",
"capability": "powerMeter",
"version": 1,
"values": [],
"patch": [],
"exclusion": []
},
{
"component": "main",
"capability": "energyMeter",
"version": 1,
"values": [],
"patch": [],
"exclusion": []
}
],
"actions": [
{
"component": "main",
"capability": "momentary",
"version": 1,
"values": [
{
"key": "momentary.value",
"label":"Apply Settings"
}
],
"patch": [],
"exclusion": []
},
{
"component": "main",
"capability": "energyMeter",
"version": 1,
"values": [],
"patch": [],
"exclusion": []
},
{
"component": "main",
"capability": "refresh",
"version": 1,
"values": [],
"patch": [],
"exclusion": []
}
]
},
"type": "profile"
}
Next I ran the “create” command, and used the resulting vid & mnmn in the driver’s profile.yml (below), and repackaged/assigned/installed the new driver, then changed to using it in the app. No errors were seen in the logs during that process, but the value on the screen did not change (still the default “Standby” text for the stock momentary capability).
name: base-electric-meter
components:
- id: main
capabilities:
- id: momentary
version: 1
- id: powerMeter
version: 1
- id: energyMeter
version: 1
- id: refresh
version: 1
categories:
- name: CurbPowerMeter
preferences:
- name: powerReportInterval
title: Power report interval (seconds)
description: Time between power (w) reports in seconds
required: false
preferenceType: integer
definition:
minimum: 1
maximum: 86400
default: 300
- name: energyReportInterval
title: Energy report interval (seconds)
description: Time between energy (kwHr) reports in seconds
required: false
preferenceType: integer
definition:
minimum: 1
maximum: 86400
default: 3600
metadata:
vid: e830f1c4-eb5f-34a4-a38f-6024c6419a22
mnmn: SmartThingsCommunity
As a check, I tried running the …presentation:generate tool using the same vid that I was provided at time of creation, and it barfed on the attempt. Perhaps that indicates some problem with my device-config.
C:\Users\grhay\SynologyDrive\ST_Driver_WIP\GRH_ST_EdgeDrivers-main\MyDriverWIP>smartthings presentation:device-config:generate e830f1c4-eb5f-34a4-a38f-6024c6419a22
Error: Request failed with status code 500: {"requestId":"0CAAD803-442C-431E-A332-5DBC275990AC","error":{"code":"UnexpectedError","message":"Error generating device
configuration","details":[]}}
One odd but unrelated thing I did notice I also want to ask about, but it seems unrelated, is that when I checked my devices to get their ID’s I noticed one of the 3 meters (#5 below) that are using this modified driver shows the “generic-sensor” name, whereas the other two meters (#3&4) using the same driver show “base-electric-meter”. This predates any changes I made for the label stuff, and all 3 devices are behaving similarly and show they are using the same driver in the app query… any ideas on cause or whether I need to fix that (&how)?
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
# Label Name Type Device Id
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
1 Family Room Multi-Sensor motion-battery-temperature-illuminance-humidity ZWAVE ce196f6d-098f-45a1-b9cf-21fb329b1543
2 Front porch multi-sensor multi-functional-motion ZWAVE 9fb8511b-9ee8-42ef-b11a-fdf264c5234b
3 MR Energy Meter base-electric-meter ZWAVE 5fc34a44-72a1-4234-964a-ea0b8b42c81d
4 Net (-MR) Energy Meter base-electric-meter ZWAVE f7ce5f1d-1e0b-44e0-86c5-4d77f7602e01
5 Solar Energy Meter generic-sensor ZWAVE c65654e3-701e-433d-997e-6da9b8b0a194
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────