Issues changing the default range of a stock capability

Hello, @nayelyz,

I have created a presentation VID, which includes a limit of the range for the capability voltageMeasurement, it creates the VID well, but it does not limit the range in automation conditions or in the color bar equivalent to the value in detailView.

I have used as values key: the Attribute “voltagewithout “.value” as I used in others VID’s with “temperature.value” range, since if I add the values key I write “voltage.value” it gives error 500 when creating the VID

I have also seen that a new field has appeared in the presentation. Is it the one that the app uses to change the device icon?

"iconUrl": null,
{
    "mnmn": "SmartThingsCommunity",
    "vid": "8fa5c744-5d52-3b4a-925f-236a303cd3f8",
    "version": "0.0.1",
    "type": "profile",
    "iconUrl": null,
    "dashboard": {
        "states": [
            {
                "component": "main",
                "capability": "waterSensor",      
                "version": 1,
                "idx": 0,
                "group": "main",
                "values": [],
                "composite": false
            }
        ],
        "actions": []
    },
    "detailView": [
        {
            "component": "main",
            "capability": "waterSensor",
            "version": 1,
            "values": [],
            "patch": []
        },
        {
            "component": "main",
            "capability": "temperatureMeasurement",
            "version": 1,
            "values": [],
            "patch": []
        },
        {
            "component": "main",
            "capability": "voltageMeasurement",
            "version": 1,
            "values": [
                {
                    "key": "voltage",
                    "enabledValues": [],
                    "range": [
                        0,
                        3.5
                    ]
                }
            ],
            "patch": []
        },
        {
            "component": "main",
            "capability": "battery",
            "version": 1,
            "values": [],
            "patch": []
        },
        {
            "component": "main",
            "capability": "refresh",
            "version": 1,
            "values": [],
            "patch": []
        }
    ],
    "automation": {
        "conditions": [
            {
                "component": "main",
                "capability": "waterSensor",
                "version": 1,
                "values": [],
                "patch": [],
                "exclusion": []
            },
            {
                "component": "main",
                "capability": "temperatureMeasurement",
                "version": 1,
                "values": [],
                "patch": [],
                "exclusion": []
            },
            {
                "component": "main",
                "capability": "voltageMeasurement",
                "version": 1,
                "values": [
                    {
                        "key": "voltage",
                        "enabledValues": [],
                        "range": [
                            0,
                            3.5
                        ]
                    }
                ],
                "patch": [],
                "exclusion": []
            },
            {
                "component": "main",
                "capability": "battery",
                "version": 1,
                "values": [],
                "patch": [],
                "exclusion": []
            }
        ],
        "actions": []
    },
    "presentationId": "8fa5c744-5d52-3b4a-925f-236a303cd3f8",
    "manufacturerName": "SmartThingsCommunity"
}
1 Like

I got the same error at first but I think it’s due to the following:

  • In the Detail View, this capability uses a state display type which means it’s “read-only”.
  • It doesn’t have a presentation in Automation > actions.

You always need to refer to the attribute’s value using attributeName.value if it’s not accepted, it can be caused by another reason.

I created a presentation (VID: 11ed84bb-7f25-3015-922c-eaeabf7db175) using the following device-config:

{
    "dashboard": {
        "states": [
            {
                "component": "main",
                "capability": "thermostatMode",
                "version": 1,
                "values": []
            }
        ],
        "actions": [
            {
                "component": "main",
                "capability": "thermostatMode",
                "version": 1
            }
        ]
    },
    "detailView": [
        {
            "component": "main",
            "capability": "thermostatMode",
            "version": 1
        },
        {
            "component": "main",
            "capability": "voltageMeasurement",
            "version": 1,
            "values": [],
            "patch": []
        }
    ],
    "automation": {
        "conditions": [
            {
                "component": "main",
                "capability": "thermostatMode",
                "version": 1
            },
            {
                "component": "main",
                "capability": "voltageMeasurement",
                "version": 1,
                "values": [
                    {
                        "key": "voltage.value",
                        "range": [
                            0,
                            3.5
                        ]
                    }
                ],
                "patch": [],
                "exclusion": []
            }
        ],
        "actions": [
            {
                "component": "main",
                "capability": "thermostatMode",
                "version": 1
            },
            {
                "component": "main",
                "capability": "voltageMeasurement",
                "version": 1,
                "values": [],
                "patch": [],
                "exclusion": []
            }
        ]
    },
    "type": "profile"
}

The range changes but it doesn’t accept a value with decimals, so, I will check that part with the engineering team.

1 Like

It sounds to me like he doesn’t want to limit the automation conditions, he wants to change how the green bar is displayed in the detail view.

1 Like

I think he is referring to this bar. I think that he expects fuller bar than this

1 Like

@nayelyz,
I will try
thanks

Is he doesn’t want to limit the automation conditions by the way thank you for sharing this.

Indeed if you add a range in detailView for voltage.value it gives error 500 when create a VID

    "detailView": [
        {
            "component": "main",
            "capability": "temperatureMeasurement",
            "version": 1,
            "values": [],
            "patch": []
        },
        {
            "component": "main",
            "capability": "voltageMeasurement",
            "version": 1,
            "values": [
                {
                    "key": "voltage.value",
                    "enabledValues": [],
                    "range": [1, 4]
                }                   
            ],
            "patch": []
        },

For temperature attribute this works fine

    "detailView": [
        {
            "component": "main",
            "capability": "temperatureMeasurement",
            "version": 1,
            "values": [
                {
                    "key": "temperature.value",
                    "enabledValues": [],
                    "range": [-50, 1000]
                } 
            ],
            "patch": []
        },

In automation conditions it works fine, with integer values

In automation actions even if you put a range it is not seen in automations since it is only read.

The result is that the color bar representing the value in volts does not support a smaller custom range of representation due to not support key: voltage.value

Thanks

Limiting the input ranges for the automation conditions I think it can also be useful, to not be able to enter values out of the range of the battery voltage

The presentation should be able to enter decimal values since it is a number type attribute

Thanks

ooh, about the Detail view, it could be related to the fact that this capability doesn’t have a default range, I will report that too, thanks for reminding me everyone :smiley:

1 Like