[Custom capabilities] Issue triggering Automations (enums with spaces in the conditions section)

Hi @nayelyz

Are you see some about this?

Hi @nayelyz Update:

Automation Actions works fine with blanks spaces in values.
Automation Conditions does nor fire routines with blank spaces.

I have other Example, What I will to modify:

{
    "dashboard": {
        "states": [
            {
                "label": "{{effectsSetCommand.value}}"
            }
        ],
        "actions": []
    },
    "detailView": [
        {
            "label": "Effects Set Command",
            "displayType": "list",
            "list": {
                "command": {
                    "name": "setEffectsSetCommand",   
                    "alternatives": [
                        {
                            "key": "Inactive",
                            "value": "Inactive",
                            "type": "inactive"
                        },
                        {
                            "key": "BlinkON",
                            "value": "Blink ON",
                            "type": "active"
                        },
                        {
                            "key": "BlinkOFF",
                            "value": "Blink OFF",
                            "type": "inactive"
                        }
                    ],
                    "argumentType": "string"
                },
                "state": {
                    "value": "effectsSetCommand.value",
                    "valueType": "string",
                    "alternatives": [
                        {
                            "key": "Inactive",
                            "value": "Inactive",
                            "type": "inactive"
                        },
                        {
                            "key": "BlinkON",
                            "value": "Blink ON",
                            "type": "active"
                        },
                        {
                            "key": "BlinkOFF",
                            "value": "Blink OFF",
                            "type": "inactive"
                        }
                    ]
                }
            }
        }
    ],
    "automation": {
        "conditions": [
            {
                "label": "Effects Set Command",
                "displayType": "list",
                "list": {
                    "alternatives": [
                        {
                            "key": "Inactive",
                            "value": "Inactive",
                            "type": "inactive"
                        },
                        {
                            "key": "BlinkON",
                            "value": "Blink ON",
                            "type": "active"
                        },
                        {
                            "key": "BlinkOFF",
                            "value": "Blink OFF",
                            "type": "inactive"
                        }
                    ],
                    "value": "effectsSetCommand.value",
                    "valueType": "string"
                }
            }
        ],
        "actions": [
            {
                "label": "Effects Set Command",
                "displayType": "list",
                "list": {
                    "alternatives": [
                        {
                            "key": "Inactive",
                            "value": "Inactive",
                            "type": "inactive"
                        },
                        {
                            "key": "BlinkON",
                            "value": "Blink ON",
                            "type": "active"
                        },
                        {
                            "key": "BlinkOFF",
                            "value": "Blink OFF",
                            "type": "inactive"
                        }
                    ],
                    "command": "setEffectsSetCommand",
                    "argumentType": "string"
                }
            }
        ]
    },
    "id": "legendabsolute60149.effectsSetCommand",
    "version": 1
}

Hi @Mariano_Colmenarejo

We can’t reproduce the issue, so, to get more details about your case, please, provide the following info:

  1. Were you able to replicate the issue reported by the user?
  2. If so, is there still a capability with this issue?
  3. Is it possible to get the driver logs from the device when the event for the capability’s attribute “currentTwilight” is sent?

We were wondering if the problem was how the event from the device was emitted, in the capability presentation, the text in “value” shouldn’t affect the routine’s execution.
We remember a similar report about this but the text was using symbols like “>=” and they could’ve cause the issue. In this case, there are no special symbols.

Hi @AlejandroPadilla

There were symbols, but there were also blank spaces and the problem focused only on the symbols <>=. Now i think the problem was the spaces

Yes i can replicate the problem.

The capability legendabsolute60149.currentTwilight was updated without spaces and works fine

Capability legendabsolute60149.effectsSetCommand still with spaces and does not work with automations conditions.

The problem is not the emit event, the problem is the driver emit event “current Twilight” value and the automation condition comparation is false then driver does not received any command from routine, i can see log of event emitted but any log from command received

You can try one routine as this:

You will see that routine does not fire

@AlejandroPadilla
UPDATE

I just tried it and now routine works, the day before yesterday it didn’t work, I had the routine done on February 21 and I just had to try it again and it works. :thinking:

Has something changed?

Hi @Mariano_Colmenarejo

That is unusual, I will try to investigate the capability legendabsolute60149.effectsSetCommand, but if the routine work maybe I can’t reproduce the issue, also I will be pending if another user has the same problem.

Thanks a lot for the information.

Hi @AlejandroPadilla

Something has changed since the day the user reported it and I reproduced it 2 different capabilities that had blank space in the value and did not have it in the Key.

I have a graphic proof from when I was making ascreenshos for the publication of the new functions, let me explain.

  • When the event is emitted in the emit_even () I send the value of the “CivilTwilight” key without spaces, for example and that is seen in the log
device:emit_event(current_Twilight.currentTwilight("CivilTwilight", {visibility = { displayed = true }}))
  • The app should show the value, not the key, and on February 13, when I made this screenshot, the key was shown, not the value.

UPDATE: So what did I do to fix this error? I emits the value instead of the key so that in the app it will be displayed with the space and that made the automation not work.

I changed he emit_event to:

device:emit_event(current_Twilight.currentTwilight("Civil Twilight", {visibility = { displayed = true }}))

Now I can send you the logs and the captures with the capability that keeps the spaces legendabsolute60149.effectsSetCommand and that now works fine, and before yesterday it didn’t work:

  • This is the log of emit_event “BlinkOFF” in the log of can see the key (without space):

2023-02-24T18:56:52.276023523+00:00 TRACE Zigbee Light Multifunction Mc Received event with handler capability
2023-02-24T18:56:52.280977189+00:00 INFO Zigbee Light Multifunction Mc <ZigbeeDevice: 84944c69-fa8e-417e-bb62-92b7d5087d63 [0x1786] (Luz Mesita)> received command: {“args”:{“value”:“BlinkOFF”},“capability”:“legendabsolute60149.effectsSetCommand”,“command”:“setEffectsSetCommand”,“component”:“main”,"positional_args":[“BlinkOFF”]}
2023-02-24T18:56:52.299003189+00:00 TRACE Zigbee Light Multifunction Mc Found CapabilityCommandDispatcher handler in zigbee_light_multifunctions
2023-02-24T18:56:52.300546523+00:00 PRINT Zigbee Light Multifunction Mc <<< effects_Set_Command_handler: BlinkOFF
2023-02-24T18:56:52.301724523+00:00 INFO Zigbee Light Multifunction Mc <ZigbeeDevice: 84944c69-fa8e-417e-bb62-92b7d5087d63 [0x1786] (Luz Mesita)> emitting event: {“attribute_id”:“effectsSetCommand”,“capability_id”:“legendabsolute60149.effectsSetCommand”,“component_id”:“main”,“state”:{“value”:“BlinkOFF”}}

  • In the capability app you can see the value (with space):

  • in the app history you can see the Key (without space):

In feb 13 with legendabsolute60149.currentTwilight capability this was not the case and the routines did not work