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

Well, inserting the value is not needed since a while; if no parameter is given, the $value is automaticly inserted.

About 1 or 2 HH, this only means the minimum padding.
Like with 6 hours left, H will give 6 while HH will give 06.
So it depends on how you want it shown :wink:

See the BLL app settings for all examples on the formatting. Scroll the bottom to Time formating:


Thx m8. I was confused about the $value part.
I can’t keep up so it seems :rofl:

1 Like

Thank you Arie, it’s always simple if you know how to do it :+1:

Happy New Year.

1 Like

Thanks, you and everyone else to: happy new year!

6 Likes

Hi all,

I need a little help.

Is it possible to reflect a boolean of a device in a text field and convert its value to a custom text? For example if the boolean is ‘yes’ then convert to “off course” and if ‘no’ then convert to “off course not”. I can do this from a flow, but is it also possible to do it from the device settings menu by using an expression and call a function that returns the right string?

Yes, and its pretty easy, place this in the BLL expression field:
$value ? 'Off course' : 'off course not'

1 Like

Works perfectly! Thanks, Arie!

1 Like

Do you have more of these handy dandy expressions? Or is there some sort of online summary what I can look for?

Yeah, well, i guess i could explain it a bit more in the app settings:

The expressions are just javascript expressions, with some wrapped around BLL stuff.
I have buildin extra modules and methods, and the posibility to create own custom functions to be used in the expressions.

But its basicly just JavaScript executions, just as you could do within HomeyScript. But more customisable and usable within way more flowcard for putting stuff in variables etc., PLUS you can use all that either within textarguments in flowcards from other apps that include BLL coding, or in BLL expression fields, like in Device Capabilities, Google Services, FTP client, Simple (Sys) Logging, BLL itself, etc.

Well, just see/learn how JavaScript expressions work. And see the BLL app settings (and there links) for info on the included modules and methods.
Where other properties exists, like in the AVD field reflections, those properties are shown in the popup infobutton next to the field, as examples, $value and $values.

Now, in my answer

Correction, technicly better should have been $value === true ? 'Off course' : 'off course not'

That is just a basic javascript expression returning based on the value of the first object, in this case the variable containing the value, and if true (or “filled” with a object or value other than undefined, null, 0 or false) it will display the first given value after the questionmark, if it is an undefined, null, 0 or false it will return the last value, the one after the :.

So, for example, if you want a button for a dimmer, that will be On if the dimmer is 1% or more, you could create a buttonfield with on/off, and use this Javascript expression: $value > 0.00 ? true : false.
Or if you want to create a Sensor Textfield for a dimmertext:
$value == 1.00 ? 'Full on' : $value > 0.50 ? 'Half on' : $value > 0.00 ? 'Low on' : 'Off'

Also, everything know to the javascript engine on Homey, like the default Date object or the default Math, is available. Basicly everything thats available in HomeyScript, is available in BLL expressions, except the added stuff in HS like Homey or the tag stuff.

Here is a site about JavaScript, and explaines, among other things, the Primitive Expressions.
It’s perhaps a bit advanced or deep, but contains some good info and enough “images”/examples, that might trigger creative solutions or ideas.

Expressions and Operators - JavaScript: The Definitive Guide, 7th Edition [Book].

1 Like

Is it still an bug causing problems for you/the app since the custom lists submitted all the way back from october still haven’t made their way into the experimental release? :thinking:

Indeed, sorry about that m8. I have thursday planned to furture update the homey-api dependency or to build workarounds to be able to release the testversion.

1 Like

No problem :v: Hopefully you will find a way around it!

1 Like

Hi @Arie_J_Godschalk , I have issues that are possibly related to short free memory issues of my Homey 2023?
When I look at my apps using memory there are a few that go higher than all the others. Device capabilities and Better logic are going up to 91 mb for Device capabilities and 77 mb for Better logic.
Not sure if this is normal for your apps but when I disable them and enable them again they both use about 20 mb less memory. After 30 minutes I see Device capabilities go back to around 85 mb.

I have 55 AVD’s doing all kind of things with better logic and chronograph so maybe I ask to much of the app and my Homey?

There is no way of disabling AVD’s to see whitch ones are responsible. I know I can create a TEF, delete them and import them again but that is not the most friendly way.

Is there anything else I can do to let Device capabilities and Better logic use lees memory?

After disabling Device capabilities and BLL

30 minutes later


BLL ca5f473b-cf07-425e-8b7a-cc85eaa5bdaa
DC 509b621b-5f23-4e24-b3c6-128d07f62bdb

Thanks.

Thanks for the extensive answer! It makes a little bit more sense now. :+1::+1::+1:

Are you using the testversion or the stabile one?

Test version 2.15.4

A well, once the new version is working correctly, and my hp2023 is up again, ill migrate and see if i can improve it more on live situations.

3 Likes

When I use the App … started card, it works when I use it for some but not all apps. Do you know why?

App Device Capabilities started: works
App Better Logic Library started: does not work
App Power by the Hour started: does not work.

No i didnt know about that.
Yesterday i migrated to the hp2023 again, im hoping it will work stable finally, so i can fasttrack my development again.

1 Like

Nope, i just switched back to the hp2019 :thinking:

1 Like