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

No, not throught the app.
Perhaps with HS?
Only solution for this is using the Create Hidden fields option every AVD field has.
This is why the option is there: it will create extra hidden fields that never change the ID, so that you can use those fields for the insights, which will then never change. Even when changing icons or whatever, the hidden fields will keep the insights.

I am not sure. I guess a little bit yeah, but how much that effect is, i do not know.

Okay, never knew this.
I guess here you can also check the option for hidden fields to create insights.

1 Like

@Arie_J_Godschalk It is still a little difficult to me, I appreciate your patience. I would prefer to discuss current status only and not old stuff that may confuse.
I refer to this option, which you approve:

image

I am not aware why anyone would update the Unit(s) field of a number field? Do you mean the Units field where in the example it says “min.”?
Are you perhaps referring to an old trick?

What do you mean with “shown as DeviceTileText”? Is this something internal?
Do you mean the status indicator field of the device?

Because it used to be the only way to show text on the device tile.

Both examples that you use, use the same resources (and are not heavy).

1 Like

Yes, since my call with Emile, since about one year, you van select any Textfield as Status Indicator, which will be shown on the device tile.
If you want to show text on the device tile, using a text field is the best way for that.

1 Like

I assume the answer can be found somewhere in this topic, but I have been unable to find it so far.

I am now adding advanced virtual devices to be able to easily make a sum of the values measured by other actual devices. Previously I managed this with flows, but this method works better.

However I would also like to calculate the difference between two values (or actually three :slight_smile: ), but I can only select to have the sum of those values as calculation. Is it possible to also do some basic calculations here?

Like; value1 + value2 - value3
Not sure of BLL expressions can help here?

Haven’t seen a question about diff as well.
This works in homeyscript:

let diff = _.difference([1, 3], [2, 6]);
log (diff);

Returns: [1] [3]

Source

Now I think it could work like this, but no results (I miss error msgs)

Edited:
BLL expression used:
_.difference([ $values[0], $values[1] ])

_

This should work I think

Edited:
round($values[0] + $values[1] - $values[2])

2 Likes

@fmb
@Peter_Kawa

Peters examples should work except, you should use $values[x] instead of $value[x].

So, for example, place this in the Calculation BBL expression:
$values[0] + $values[1] - $values[2]

And then just leave the plane BLL expression field empty.

4 Likes

Thanks @Peter_Kawa & @Arie_J_Godschalk
This works!

[Above edited based on reply]

So I used indeed:
Calculation: BLL
Calculation BBL expression: $values[0] + $values[1] - $values[2]
BLL expression: [leave empty, so unchanged from default]

Oops, missed that one. And indeed, that works as well. Will adjust my earlier reply.

I wonder if any "Show as options as Boolean, where change by Tags / script possible (but not allowing UI to change)

To test, created fresh AVD (also) for boolean-type of data:

e.g. boolean “sensor” :
image
and boolean “ON/OFF button”
image

When trying to update each (with HomeyScript)

result = await device.setCapabilityValue(capability, target);

field4 (1233w) allowing change of value wo issue - result looks like:

{ transactionId: ‘homey-api-axxxx-63a1-4dac-a1a7-e5xxxxxx’,
transactionTime: 1725260095481,
value: true}

but on field3 (1233r) I get error “Capability Not Setable”:

Failed to update value: HomeyAPIError: Capability Not Setable
at Device.setCapabilityValue (file:///node_modules/@athombv/homey-core/dist/lib/Device.mjs:749:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
statusCode: 400,
description: ‘Capability Not Setable’
}

same error if changing to any of “show as: alarm xxxx” - must be due below:

‘alarm_devicecapabilities_boolean-custom_17.boolean1’: {
id: ‘alarm_devicecapabilities_boolean-custom_17.boolean1’,
type: ‘boolean’,
…
getable: true,
setable: false,
…
}

Is the only way to set is as number sensor? Then would be e.g. (and can live with it if no other choice :zipper_mouth_face: ):

image
where:

‘measure_devicecapabilities_number-custom_17.number29’: {
id: ‘measure_devicecapabilities_number-custom_17.number29’,
type: ‘number’,
…
getable: true,
setable: true,
…
min: 0,
max: 1,
step: 1,
units: null,
decimals: 0,
…
}
}

Bottons not used as no insights:
image

To me it seems very logical when insights only are created & become available after the first event.
No initial event = no insights :man_shrugging:

Im not entirely sure i understand what you want.
But booleans also have only insights in the Homey App, the same as buttons.

But you can set Booleans through the flowcards.

Curious, did you get some results with
_.difference([ $values[0], $values[1] ])
?

Don’t know, did not test it :slight_smile:

My Homey is offline (mod data failed for some reason :face_with_thermometer:), so giving principle answer only…

Let me explain basic reason and idea I have implemented:

  • AVD has say 60 values to be updated from external (actual) device (via http)
  • around 10 of them of above values are also writable (via http)
  • Out of read/write variables some are status 1/0 (of which I wanted to show as True/False in UI)

main issue: I have noticed, that sometimes write command is refused even originally reported OK (can happen even minutes away due ext.device own logic / protections) (sidenote only: yes, I do misuse (safely) that device to me benefit :slight_smile: )

To counter that my idea was to

  • separate read and write parameter e.g. 1234r and 1234w
  • allow user to change (only) write-parameter (i.e. only 1234w)
  • read parameter is always actual value from ext.device and shown to user as sensor value)
  • And when both 1234r and 1234w has insights (1/0) I can compare them easily for trouble shooting

Regarding flow-cards I (always) try to minimize them as much as possible - instead using generic scripts (thanks to this forum help), so that multiplying device and its functionality has been very easy… (even in this case will have only one of these, want to follow same philosophy…)

I hope this clarifies my reasons and intentions…

No initial event = no insights :man_shrugging:

Finally Homey back online so can show some new findings on my AVD:

Example “write” parameter has these settings (i.e. with insights):
image
vs. “read” one
image

Then I push 1215w ON and OFF (from UI) several rounds of :
image
and
image

and can see from AVD-history-log:
image

Now to (refreshed) insights - so changed 1215w (botton one) not seen, but only 1215r (number one):
image

(Just to close to loop…)
Resolved issue by moving all write “botton”/boolean to be as sliders/number

e.g. 1215w as slider - testing (1215tw) was OK for UI (web and app) and Insights point of view:
image
image

Can live with this :slight_smile:

add:
now device online, and seem to work as wished for (delay acceptable as only <10s) e.g. 0 => 1 => 0

I have an questions regarding insights for a device I have. The Device has the following Status Indicator Fields:







With these settings there should be insights for the following fields:

  • Gem. afgelopen uur
  • Gem. afgelopen uur (licht sensor)
  • Donker

But when I check with Insights I have the following insights:

Is there any way to only see the Fields that I selected?

Does anyone have an idea how to solve this?

Just one thing I have seen before: If you create AVD with some insights, then rename field / change something (e.g. symbol) / remove insight selection, old ones also remains in selection (even if not new data).

Create new AVD with Repair / export TEF and copy to desktop / create new AVD / import TEF

I hope this is solving your doubt…