Capabilities with numeric type in Android App details view have a range from 0 to 100, by default

Capabilities with numeric type in Android App, details view have a range from 0 to 100 by default.

Hi @nayelyz,

  • I don’t know how long this has been happening, it used to work fine a while ago
  • The capability has no defined lower or upper limit
{
    "id": "legendabsolute60149.numberFieldOne",
    "version": 1,
    "status": "proposed",
    "name": "Number Field One",
    "ephemeral": false,
    "attributes": {
        "numberFieldOne": {
            "schema": {
                "type": "object",
                "properties": {
                    "value": {
                        "type": "number"
                    }
                },
                "additionalProperties": false,
                "required": [
                    "value"
                ]
            },
            "setter": "setNumberFieldOne",
            "enumCommands": []
        }
    },
    "commands": {
        "setNumberFieldOne": {
            "name": "setNumberFieldOne",
            "arguments": [
                {
                    "name": "value",
                    "optional": false,
                    "schema": {
                        "type": "number"
                    }
                }
            ]
        }
    }
}
  • The presentation does not have a defined range either in details view or in automation/actions
{
    "dashboard": {
        "states": [
            {
                "label": "{{numberFieldOne.value}}" 
            }
        ],
        "actions": []
    },
    "detailView": [
        {
            "label": "{{i18n.label}}",
            "displayType": "numberField",
            "numberField": {
                "value": "numberFieldOne.value",    
                "valueType": "number",
                "command": "setNumberFieldOne",     
                "argumentType": "number"
            }
        }
    ],
    "automation": {
        "conditions": [
            {
                "label": "{{i18n.label}}",
                "displayType": "numberField",       
                "numberField": {
                    "value": "numberFieldOne.value",
                    "valueType": "number"
                }
            }
        ],
        "actions": [
            {
                "label": "{{i18n.label}}",
                "displayType": "numberField",       
                "numberField": {
                    "command": "setNumberFieldOne", 
                    "argumentType": "number"        
                }
            }
        ]
    },
    "id": "legendabsolute60149.numberFieldOne",
    "version": 1
}
  • If in the details view you try to enter a value other than the range 0 to 100, it does not let you

  • In an actions routine, it allows you enter any value, they have no range, as it should be.

Thanks

2 Likes

Hi, @Mariano_Colmenarejo

Thank you for your report. I’ll do some tests and report it to the engineering team. Based on your configuration, it is strange the app indicates there’s a limit when it was never defined…

2 Likes

Hi @nayelyz

In addition to the unwanted limits, I also see that both the details view and the history do not show decimals, they show it as an integer.

However, in the mosaic the decimals are shown.

1000012716

Mmm, ok, thank you for mentioning it. I’ve received other reports about that but with some stock capabilities, so now, I’m wondering if they’re related. I’ll ask the corresponding team.

2 Likes

Hi, @Mariano_Colmenarejo
Can you provide more details about the values that you can set in those number fields, please?

I mean, do you know the range of numbers they would accept?

Hi @nayelyz

It is a problem with any capability with a numerical type, which is shown in the app, details view, it also happens in atmosPressure stock capability with the kPa values

I have defined in the presentation a range from -10000000 to 10000000 to override the default range that the app sets from 0 to 100

Yes, I asked the plugin team and they mentioned it was a limit that existed since 2022, and it’s set when the range is not defined in the presentation, so, I wanted to get more context to see in which cases it could be a problem, but the range you set is accepted and has no issues, right?

Yes values are accepted but not decimal showed in detail view capability. It showed rounded value

Ok, then I don’t think it will be modified and instead, we’ll create a ticket to add a note in the documentation about it.
The issue about the value being rounded is in a separate ticket along with the capabilities of atmosphericPressure and gasMeter

1 Like