Troubleshooting Homey Flow Trigger Card with New Wallbox Capability Values

I’ve expanded the capabilities of the wallbox project by introducing new features and incorporating additional flow trigger cards. Currently, when the value of the new capability changes, the associated flow trigger card successfully activates. However, I’ve encountered an issue where the trigger fails to activate when I specify conditions such as ‘less than’ or ‘greater than’ a certain value.

In the onInit function, I’ve registered a listener to monitor changes in the new capability. Despite this setup, the trigger cards do not respond as expected to the specified conditions.

this.registerCapabilityListener(‘charging_price’, async (value) => {
this.log(‘charging_price_greater_than :’, value)
});
and this in app.json and driver.flow.compose.jscon

{
“id”: “charging_price_greater_than”,
“title”: {
“en”: “The charging price becomes greater than”,
“nl”: “De laadprijs wordt groter dan”,
“fr”: “Le prix de facturation devient supérieur à”
},
“titleFormatted”: {
“en”: “The charging price becomes greater than [[price]]”
},
“args”: [
{
“type”: “device”,
“name”: “device”,
“filter”: “driver_id=wallbox”
},
{
“type”: “number”,
“name”: “price”,
“filter”: “driver_id=wallbox”,
“placeholder”: {
“en”: “Energy price”
}
}
]
}
Did anyone faced some issue like this or can help me to solve this problem?Preformatted text

First of all, welcome to the Homey Community!

To make sure you are aware of the forum rules, please read the Welcome to the forum post here.

Moved to Devolopers

Pls use preformated Text

image

This is a custom trigger. Do you trigger this flow in your device if the capability changes?

Triggers are only started automatically if they are named “capability_changed”.
And the getting greater than/lower than you inly get auto generated for measure* capabilities.

If you want to use your custom trigger, you have to pass your “old” value as state parameter when you call the trigger( ) method. This way you can check in you run listener if the old value is greater and new new value is lower than the argument set in the flow card (means: crossing the limit).
If it’s ok, then return true in your listener to continue the flow.

1 Like

Thanks for replaying me .
I have added “measure” to the ID of all new capabilities and the trigger cards for greater and lower is added by Homey automatically but i used custom trigger for “capability_changed” because it didn’t create it Homey and i triggered it when i set the value to capability.