Custom Capability and CLI Developer Preview

This happens to me CONSTANTLY, and is my biggest issue with Edge at this point. For me, with LAN drivers, if the driver re-install does proceed, it is often stopped by a cosock error and then goes into an infinite re-install loop. I was SO disappointed this wasn’t fixed with the new firmware…

Yes, I just made a test using the SmokeDetector capability and it worked.

    "component": "main",
    "capability": "smokeDetector",
    "version": 1,
    "values": [],
    "patch": [],
    "visibleCondition": {
        "capability": "smokeDetector",
        "version": 1,
        "component": "main",
        "value": "smoke.value",
        "operator": "EQUALS",
        "operand": "detected"

Although, I need to ask the team for more details, as it didn’t work with the thermostatMode capability but maybe it was caused by something specific in it.
Please, let me know if you find something strange.


Very cool; thank you!

I’ve been successful with it; I use it my LAN Device Monitor driver and it works well.

Please, where can I find information on this in the documentation?

Is this condition set in the vid presentation por capability presentation?


This property is used in the device-configuration, you can find more details about it in the API reference documentation > create device-configuration. Open the sub-menu in Detail View and you’ll find the supported operators inside visibleCondition

1 Like

4 posts were split to a new topic: [Capabilities] issue with ultraviolet Index

2 posts were split to a new topic: [Custom capabilities] Issue with the capability’s label (iOS)

I have a switch device where I am displaying a numeric value for the state on the dashboard. Unfortunately this is disabling the active/inactive state changes of the dashboard icon since the state isn’t the switch’s on/off state. However I still want the active/inactive icon to work based on the state of the switch. Is there any way to do this?

I was thinking that if it was possible to show 2 items for state - both the switch state and my numeric value, then maybe the dashboard active/inactive icon would work? In the device configuration API it shows that the dashboard state section is an array, so does that mean you can indeed have more than one state displayed on the dashboard? But I don’t know if this would fix the active/inactive problem…

You can definitely show more than one state in the dashboard view, and, last time I checked the icon reacted to the first state configured.
You can display different states in the dashboard by separating them into groups.
For example:

"dashboard": {
    "states": [
            "component": "main",
            "capability": "switch",
            "version": 1,
            "group": "main", 
            "values": []
            "component": "main",
            "capability": "customCapabilityName",
            "version": 1,
            "group": "Numeric Value",
            "values": []

Remember the text in group will identify which capabilities belong to the same one and it’s the text that will be displayed as their title.
I remember that changes to that text weren’t considered a modification in the presentation, so be careful with them and put the right name to avoid issues


Is specifying a group mandatory to be able to display more than one state? Or can I simply list two different capabilities? I guess I’m not clear what using a group really does.

And does a group name have to have been defined in the capability definition or its presentation as well?

The group name is what shows where Temperature, Humidity, etc are in the screenshot. One group has to be main, which shows up top where motion is in the screenshot. I believe only one state and one command are allowed per group. Inactive/active status for each group happens independently.

1 Like

Yes, it is required.

thanks, @philh30!
It also helps you identify which capability in states can be grouped with the capability in actions
Despite a capability being in the dashboard.state section and the other in actions, they are put together because they belong to the same group. Consider this layout (VID: 2056d8b1-da5a-3248-ae51-e56f049b2906):


Thank-you; a picture is worth 1000 words!

1 Like

Wow this creates a huge tile!! Is there anyway to control the size? I have just the two states, so it seems to be a lot bigger than it needs to be…

By the way, something I wanted to report was that there is a significant delay in the state units getting updated on the dashboard. The value updates right away, but the units don’t update at the same time. Instead it seems to take a more significant app refresh to get the right one to appear.

Sorry, up to now the size of the tile cannot be controlled.

Can you provide more details about this?

I understand you’re sending capability events but some have different units than the previous events, is that right?

The user can change the units displayed for a value via a device preference setting. The driver includes the unit value whenever it does an emit. So if user chooses a different unit value, the dashboard isn’t changing right away even though there have been new emits with the new unit value


I wanted to share something that might be useful to other developers that create custom capabilities:

In certain cases I wanted to use a toggle switch to turn something on or off, but I wanted a third “pending” state shown in the switch label when the switch was initially pressed. When the device actually comes back and confirms it successfully turn ‘on’, THEN I wanted the switch label to say ‘On’ or something more specific.

In other words:

Switch Action           Switch Label
-------------           -------------
on                      'Turn On Action pending...'
                        'Turned On'
off                     'Turned Off'

The way the switches work has prohibited me from doing this. They don’t like anything besides the binary on/off state.

So now that multiple attributes are supported I had the idea to create a second attribute that I would set with the label text that I wanted. And in the presentation for the switch state label, I specify my second attribute string value instead of the switch value. The driver takes care of setting both the switch state and label value in the command handler function.

And it all seems to work! The switch remains in the highlighted ‘on’ state during both the ‘pending’ and ‘confirmed on’ as I wanted it to be. :+1:t3:

The trick is not to mess with the command or switch state part of the capability and presentation definition. Just add a second string attribute and use it as the switch state label.


Forgive me if this has been previously asked and answered, but couldn’t find it…

Is there a way to get the smaller font size for the units labels as seen in the stock capabilities?

Unfortunately, up to now, UI things like font size or button/status bar colors cannot be modified.