[APP][Pro] Device Capabilities - Enhance the capabilities of devices

Yes, it works for me when I use a text field:

Var value = 3.9
Screenshot from 2022-08-29 18-09-35

Flowcard calc 3.9*1000
Screenshot from 2022-08-29 18-09-52

Device text value = 3900
Screenshot from 2022-08-29 18-10-09

2 Likes

Nice I was looking at number boxes and then I couldn’t make a calculation. going to try it via text.

Yes it works on text field but then you don’t see anything on the tile and it doesn’t match with unit.

1 Like

Not yet, but i will add Set Number (Expression) cards, based on my HOOP model: a All javascript expression are valid and you can have custom pre-definded functions through settings.

But first let me finish all button types correctly.

1 Like

It also works with status.
You can enter any unit you like, that’s one fun part of this app :upside_down_face:

Screenshot_20220829-201656_Homey

1 Like

Version 1.9.85 in test right now:
Buttons are pretty much finished, all option combo’s that i currently can see are implemented.

Some more testing has been done with .84:

  1. Seems like I can’t remove the default yes/no capability, does seem like a removeCapability() is being executed (the device reloads in the web GUI), but the capability stays, have tried different ways, removing just the on/off, remove all default capabilities at the same time, tried just giving it a different name, the old on/off stays.
    I can remove the new on/off capability, so looks like the ID internally is wrong from the start.

  2. seems you have a small racing condition issue or something, when you change a lot of capabilities (replace the default, and add additional ones), some default capabilities might stay as if the ID is already changed internally (the new ones do stay, so not entirely sure that it is really is a racing condition)
    Looks kinda the same thing as point 1, if it is an internal ID issue.

1 Like

Thanks m8!

Okay, next version is in test.
I found a var instead of a let. And some other bugfixes. Could you try it again?

Nope, unfortunately the default on/off capability keeps wanting to be there on .86.

PS: Not sure if you log anything useful, and thus if you want the log every time?

1 Like

Could you use this script in HomeyScript:

var _devices = (await Homey.devices.getDevices());

for(var deviceID in _devices) {
        var device = _devices[deviceID];
        if(device.name=='DC VD') console.log(device.capabilitiesObj);
    }

Where DC VD is the device name.
And an image of device settings with the yes/no fields.

Then i can maybe simulate it.

Does this also happen with a new device created with this version?

It is everytime with a new device, but looking at the result from the HomeyScript i probably already see what is going wrong, indeed an ID issue:

Default:
alarm_devicecapabilities_boolean.boolean1
New/Changed:
devicecapabilities_boolean.boolean1

  'alarm_devicecapabilities_boolean.boolean1': {
    value: null,
    lastUpdated: null,
    type: 'boolean',
    getable: true,
    setable: true,
    title: 'Yes/No',
    desc: null,
    units: null,
    id: 'alarm_devicecapabilities_boolean.boolean1',
    options: {},
    values: undefined
  },
  'devicecapabilities_boolean.boolean1': {
    value: null,
    type: 'boolean',
    getable: true,
    setable: true,
    title: 'Test',
    desc: null,
    units: null,
    id: 'devicecapabilities_boolean.boolean1',
    options: {
      title: 'Test',
      preventInsights: false,
      insightsTitleTrue: 'True',
      insightsTitleFalse: 'False'
    },
    values: undefined
  }
1 Like

Okay, next version.

Indeed, number1, status1 could go wrong.
yes/no1 always went wrong.

Should be fixed now.

Just dont use settings :wink:

(Joke)

yay, you did it!
Now for some more testing :stuck_out_tongue: but looks good so far.

1 Like

Now in TEST!
@Peter_Kawa , @HuisCHovens

image

image

This will set the Yes/No to false/no.

i run a vm sandbox, which includes Math, lodash-core (_) and functions you can pre-define in App Settings.

image
image

image
image

Here are the settings:

Here i have a random function:

Now you can use that with the expression card.
image

All fields can be set through this one card, just make sure it returns string, number or yes/no as needed.

1 Like

Next up (but not today anymore) “Show as” for number fields: Slider, battery, alarm_barttery, etc.

If anyone finds bugs in 1.9.9, please let me know.

Hey Ruijter,

You can now even use Custom icons for capabilities!

Well done Arie! I just knew you could perform magic :muscle:

1 Like

Hey Cactus,

I have tried a couple of ways to manipulate the data, but have not found a solution as of yet.
Still have one option to try, but i first wanna complete numbers Show As.

Version 1.9.91 is in Test:

Added many Button Show as options and Numbers Show as Options.
Next to custom options, the following default “options” are implemented:

  • Button
    ‘onoff’, ‘button’, ‘locked’, ‘garagedoor_closed’, ‘windowcoverings_closed’,‘volume_mute’, ‘speaker_playing’,
    ‘volume_up’, ‘volume_down’, ‘channel_up’, ‘channel_down’, ‘windowcoverings_tilt_up’, ‘windowcoverings_tilt_down’
  • Number
    ‘target_temperature’, ‘dim’, ‘light_hue’, ‘light_saturation’, ‘light_temperature’,
    ‘measure_battery’, ‘volume_set’, ‘windowcoverings_tilt_set’, ‘windowcoverings_set’, ‘speaker_duration’, ‘speaker_position’

This way you can, for instance, completly design your own Music Player Or Buttonbox.

Show as for Boolean will be extended and Show as for numbers will be added (so you can set a artist or albumname for instance).

1.9.92 is in test.
Basicly, most types got the Create Flow Cards (and buttons) checkbox.
When this is enabled, it will make sure the capability, for instance speaker_playing, is really that capability.
This makes Homey recognize the capability and create flowcards for it, and place it in the correct screen.

If you disable the CreateFlowCards, then all capabilities will be linked so that Homey does not recognize the capability.

Only one type of each default capability can be used to create flows.

Yeah, Full control over your device!