[APP][Pro] Advanced Virtual Device (Device Capabilities App) with Unique Text Status Indicator

My appoligish if im seeing ghost, but for me, the errors only appeart after the Stack messages.
And while i have gotten the CreateClientTimeout, it never killed my apps or prevented a reboot or something like that.
HP2023 with my apps was working (for the most part) well for the last few weeks.
I have restarted HP2023 many many times, and every time all apps loaded nicely behind BLL.
Now since yesterday, apps dependend on BLL will just not boot: the just keep spinning and need manual restarts. This was not the case during development the lasts weeks for me.

I would just simple resolve init, except, i cannot restart the app.
So dependency that are required to function properly, like the Better Logic Library, need to be await, and else the app should, as it did before, alert the user that BLL needs to be installed, and then kill the app.

But again, im sorry that i made a mistake.

2 Likes

No those are different things.
On the HP2023 i already had it working and this one works on it as well.

Its the WebApi and Athom has “migrated” to a new version.
And while it ntr working right might have been me implementing something wrong, there are also a few functions not working correct.

EDIT


It appears i was wrong about the situation.

@Peter_Kawa thanks, I would add as below

and for further clarity (in post 1):
The Status [Indicator] Field is unique, and can be used as a textual (and number) status on the device tile in the Web/Mobile App [use the mobile app to select the status indicator]

I also wondered if the remark and screenshot following that line are now outdated (see screenshot provided by @Peter_Kawa) ?

Thanks for the great app!

2 Likes

While I am still in the process of converting/adding more Advanced Virtual Devices, I have the following suggestions:

A. CURRENT THERMOSTAT

  1. When adding just one thermostat in an AVD, can you show the name of the thermostat? (When adding two, there is a drop down list)

Especially when the name for the thermostat target temperature and the temperature is different, it would be great to show the name inside as well instead of “current temperature”.

B. USING THERMOSTATS FOR OTHER THINGS
I often (ab)use thermostats to set and track completely different things, not related to temperature.
The nice thing about the thermostats is that you can easily set a manual target in the mobile app.

It could be a time counter or a cycle counter or something else.
Examples:
Setting target hours for a pump and tracking the actual time (in the current temperature field).
Setting target cycles and tracking the actual cycles (in the current temperature field).
Setting target luminance and tracking the actual luminance (in the current temperature field)

And since AVD already asks me to set the unit, I can easily set it to h or lux or cycles.

C. ALTERNATIVE INPUT for TIME SCHEDULE
Just a thought: use the AVD to set a clock start/stop/duration schedule.
An example is my water heater: it should be started 3 times a day at certain times, subject to if it is sunny or not (when it is sunny, the solar heating will heat the water).
AFAIK there is in Homey no way to flexibly add a time schedule.

I could add three thermostats in the AVD, one for each start time and set a target duration in another thermostat, but it would not be very user friendly on the app nor flexible. This may not belong to AVD either. Suggestions/tips welcome!

No, sorry, i have no control over the UI (i already set the name, but the UI only shows it with the dropdown).

Yeah, i already thought about creating an option for a Combination Lock :slight_smile:
And once that’s done, there will be a basis for “misusing” temperature.

But that you have a suggestion here for something to add to DC/AVD? Or just a group suggestions?
Because else i missed it :wink:

Yeah, i allready have (tried to) thought of ways to make Time input nicer.
But the current best way i see is the Homey Alarms, much nicer UI, and with the new Action Scheduler App, i’m not sure i can create a nicer UI/UX for this.

But perhaps once the “Temperature” controls are done…

USING THERMOSTATS FOR OTHER THINGS
It was a suggestion, hoping it would be a small adjustment in the UI to remove Degrees Celsius and current temperature and replace them with the Unit and the name label. But if the UI is fixed for you then I can live with it until there is a better way to manually input values.

ALTERNATIVE INPUT for TIME SCHEDULE
The combination lock principle seems great to manually input a time or number value, combined with the right name label (start time 1, stop time 1, duration).

Thank you for the tip on the Action Scheduler App. It looks nice but seems to require installing one device for each trigger time for my use case. With AVD I am trying to reduce virtual devices.
I like Homey Alarms too, wow, completely missed that :smiling_face_with_tear:

1 Like

Sure, just create some tickets, and i’ll remember to take this into account when developing the “lock”/temperature pages/settings.
QlusterIT / nl.qluster-it.DeviceCapabilities / issues / new — Bitbucket

1 Like

Coming soon to the Device Capabilities App: Reflection of Variables or Chronographs in AVDs!

You can now (well, when it’s published) select entities from other apps to be reflected as value of the AVD field!

For example, let it reflect a Better Logic Library variable:

Or let it reflect a Chronograph:


Here the Elapsed time is formatted with the BLL expression to fit the textfield with a nicely timestamp.

You can also let a button reflect the Running (or removed) status of a Chronograph:

Chronograph options:

Better Logic Library options:

N.b. to use formatting, you will need the Better Logic Library.

1 Like

Wow m8, it’s getting big!
It might be obvious, but to be sure: We don’t need a flow for the values to be displayed and updated? The apps ‘talk’ to eachother?

Ah it’s explained in the timeline :wink: Without flows it is :wink:

Yep, indeed!
(And thus: no timeouts when it’s executed to many times :slight_smile: )

Optionally ofc, if you do not have Chronograph or BLL, you cannot set them.

BLL is needed for using a BLL expression.

But Expression are only required for fields with different properties.

Like, setting a text-field cannot be done directly from a number-variable: that would need to be converted.

But it’s very handy for timers and stopwatches:
Status, text, numbers, buttons, yes/no’s, it can al reflect variables or chronographs directly :slight_smile:

1 Like

I just restart Homey: Every works again automaticly :slight_smile:

3 Likes

Sorry, but I don’t understand the benefit. :see_no_evil:
Could someone explain it with a useful example, please?

Well, i’ll work on an example later, today i’ve got some business to attend too.

But the use case for me: I have multiple devices, sensors and lights, grouped together and controlled by variables and Chronograph timers/transitions (and countdowns).
The result is many devices and flows to maintain and it’s not a nice overview.

I will create one AVD for each of those situation, like the Halway lights for example.
For that i will create an AVD with:

  • The lux sensor value(s).
  • The motion sensor value(s).
  • The button to control the lights/group.
  • The BLL variables that control if the lights should switch on atomaticly or not.
  • The Chronograph timer information when the light is in Auto mode.
    Since, after no motion for a while, a timer will start running to shut the lights off.
  • A button that shows the timer running and when pushed will pause the timer.

All information and needed buttons in one sweet AVD :slight_smile:

EDIT:


Hang on, i’ll make a short example.

2 Likes

Here Fantross, this will be my use case, except the AVDs will contain a lott of other stuff to, but just to show the use of reflection:
I have just created a new AVD: Fantross Example.
I have added 2 fields, one number one text:

The number field

All i did here is set Reflection to Chronograph and selected the specific stopwatch: TAG test.
The property is automaticly set to Elapsed.
When no BLL expression is given, the Elapsed duration will be converted from milliseconds (true value of the Chronographs) into not-rounded seconds (with 3 decimals).
Thus, al one needs todo to show it as normal seconds (which is what most would want i suppose), is set the Decimals to zero (0).
And filled unit with seconds.

The text field:


Here i selected the same stopwatch.
I only added the BLL expression to format the time.

Result:

As soon as i press Pause or Resume on the Stopwatch in Chronograph, the AVD is updated.

No need for any flow!

2 Likes

All in test now:

Hi Arie, thx for explanation.
The first use case sounds interesting. I guess it’s something like a “Control Center”. You have an overview and it’s possible to switch the “Auto Light Mode” on or off.

But the second example…
Ok, the stopwatch time can be converted more readable, but I can also look up the stopwatch time in the settings. You also have another device tile, which can make the device view more confusing. With many device tiles, it is sometimes faster to look in the settings than to search for the device tile (even though you have set up separate zones).
Please don’t get me wrong. It is not my intention to make something bad. I probably haven’t quite understood the advantage yet, so I’m looking forward to seeing more examples.

Btw, what impact does something like this have on Homey’s processing performance and RAM?

1 Like

With Example 2 you mean the Fantross Example AVD right?
That’s just to show you HOW example 1 would look like, well, the Timer/Stopwatch part of it.
Example 2 is this line from Example 1:

Creating Example 2 as it is, would indeed be pointless, because Chronograph already can create a device for stopwatches/timers/transitions.
But that would create an extra device tile, which is what i don’t want!

Especially for devices that run on a timer and are grouped, i right now have multiple device tiles (and still not any timer information because i don’t create the extra devices…) for sensor, lux, and control.
Like explained in example 1, i will convert certain (timered) groups into one Single AVD tile.

Perhaps Example 2 was a bad example, but i wanted to keep it short and retricted to the implementation of a Chronograph.

But the whole point of this reflection is: Lesser Device Tiles, Lesser Flows.

About the performance, i have let it test on HP2023 and HP2019 the whole night, with multiple timers and stopwatches and Variables being changed, this morning, memory usages aws lower then last night, so there are nog instabilities. At least multiple variables and multiple timers and stopwatches were being updated each second the whole night.

The inclusion of BLL and Chronograph is “the option variant”, meaning, it doesn’t build up a framework and is not dependend on it. It just listenes to realtime messages from the AppAPI’s and executes, when requested in the app, a few AppAPI-calls (like, on startup, DC/AVD’s will check if there are reflected Variables in use, and if so, it will retrieve the variables through the already existing api-call that BLL has.
Also, when no reflection is used, DC does still get’s updates from BLL and Chronograph, but doesn’t do anything with it.

Now, when you indeed let BLL/Chronograph connect with DC, there is about 1MB memory increase per app (more apps = lesser growth).
Now, for people using the functionalities, this is not a lot (keep in mind that it will keep flows from being triggered and the memory usage that comes with that).

Ofc, If you do not have BLL or Chronograph installed, there is no memory increase, because it doesn’t connect and get’s no notifications/changes.

And for the (few?) people :slight_smile: that do have Chronograph and/or Better Logic Library installed, but want to save the memory usage, i will create a toggle’s in the Device Capabilities App Settings, so you can switch the connecting with optionally included apps off. That way, you can f.i. disable inclusion of BLL, and than it will not even initialize the BL object: there is no memory overhead than, nothing build, nothing listening.
(Perhaps i could automate this, based on the usage off apps in Reflection in AVDs)

That’s what I think too… :wink:
Because as you wrote, there is already the possibility to create stopwatches/timers/transitions device tiles.

So I will keep following your threads, which I do anyway, and look forward to new examples that make sense for me. And thank you for the detailed explanation regarding Homey’s processing performance and the RAM. That sounds good for me! :+1:t2:

1 Like

Indeed.
But there were already multiple topics/posts about users:
a) wanting to be able to recieve the duration of Chronographs, because it didn’t exposes those values before (so i created the Get Elapsed/Duration Of […] flowcards).
b) how to format that duration into hours/minutes/etc.
c) how to display this on a AVD (so as to minimize the Amount of (Virtual) devices.

Because, currently (with the live versions), there are, in basis, just 2 ways of updating an AVD with timer-data:

  • Set a flow each second (?) to check if a CHronograph timer/stopwatch changed etc. and then update the AVD with it (needing to format or use limitted tokens).
  • Or, create a Chronograph device and create flows with triggeres from that device.
    Now, i first tested this, and, that was no fun at all! Chronograph updates it’s devices 4 times a second, now, if you trully need this, use them.
    However, since the milliseconds is not that accurate (when did the flow start the timer and when did it actually started, there might be a second or more between them, certainly not millisecond specific).

So, imho, using Chronograph Devices as basis for AVD creates unneeded devices and device updates.
Reflection seems like a better UI/UX when you want to combine them into AVDs.

While i personally must say, except for testing, i don’t use the Chronograph devices.
The decimal goes away every now and again (when there is no value behind the decimal), i don’t like the red-flashing-motion info you get when a stopwatch is started and the buttons i am also personally not very font of.


And building all kinds of customisations into Chronograph seems like useless to be, since thats what AVD does.