Fibaro HC3 and QuickApp's

The change I made for the upcoming release was just for “quickAppVariables”. I don’t think the change I made is going to handle these label events. And it’s not only the label events either. I don’t think you are going to be able to read those on startup.

What you are asking for now is going to be a bit more challenging. If you look at how the Home Remote’s custom Attributes are set up, they are a path to a “property” value. So before you begin looking at events, you really need to find what you want in the “properties” of the main “devices” JSON, not the events. The only place I could find your labels was the “viewLayout” JSON structure. And in there they were nested several layers deep. The path to that is rather complex & not straightforward. As it is today, I don’t believe the Home Remote will be able to find that value in the JSON through its Attributes support. If possible, I think it will be in your best interest to forward those label values to a quickAppVariable. Or try to get those values forwarded to a normal property value like they were in HC2. See the pic below.

HC2 Labels

Here’s what your “properties” look like.

Even though I’m not a programmer, I understand the problem. HC3 QuickApp is a further development of HC2 VD, but now it is possible to create much more advanced functions. It is then sad that Fibaro has made it more difficult to retrieve this important Label information.
This is how I write to a label in HC2 and HC3 respectively:
HC2
fibaro:call(Car_RH , “setProperty”, “ui.lbl_Status.value”, “Auto”)
HC3
self:updateView(“lbl_Status”,“text”,“Auto”)

That I now want to use HomeRemote (previously ImperiHome) as an interface to HC2 / 3 is only because Fibaro has a ridiculously bad interface in its own apps. They do not seem to have understood that you want to be able to create a nice and practical user interface.

Most QAs are created with an interface where you can easily read or change values of various kinds. If it is then not possible to read the value from a Label, it also means that it will not be useful in HR. Not many developers are thinking of adapting their QA so that it becomes useful in HR as well. If this QA is then shared with someone else who wants to use it in HR, then they have to modify the QA code themselves, (if they even know how to do it).

For my own sake, I can redirect the values to local variables, but this will probably not be the last time you will get this question.
But you should have a big thank you for your work and your excellent support.

You’re probably right, this most likely won’t be the only time this question is asked. I am still thinking about this. What I might do is just let you define those paths as you normally would for HC2 apps & then just have the Home Remote do some special handling for these values. Basically you would just define an attribute something like this => ui.lbl_Status.text

One thing I am noticing is that the current values might not even be in the “api/devices/191” file. For example, I don’t see the current value of lbl_Avresetid, which is Avresa: 12:00. What this means is that these label values might only be reported through “refreshStates”. Which is fine.

What I’d like for you to do now is, right down the current values for both “lbl_Status” & “lbl_Avresetid”. Then download the JSON from “/api/devices/191”.

Would you mind posting an updated JSON file for “http://192.168.1.27/api/devices/191”?

That’s the only one I need. Don’t worry about any refreshStates.

And let me know what the values of “lbl_Status” & “lbl_Avresetid” at the time you downloaded the file.

Here is the information you requested, but forget about previous JSON files, they are no longer valid.
It is quite correct that you say that current label values are not visible in the json file.
When creating the json file, the values were as follows:

lbl_Avresetid = “Avresa: 11:00”
lbl_Status = “Auto”

In the json file, the value is “- - -” for all label’s, but that value is only visible in the QA editor’s interface. I can write what I want there, but there you usually write information about what to write for this label.
In the previous json file it said “Avresetid”, but I have now changed this to “- - -” to make it easier to see changes in output data.
Attached pictures show how I configure a label, as well as what the QA editor’s interface looks like before a simulation.

The last image shows the status of the QuickApp when the json file was created.
Hope this can help you solve the problem.

API_devices_191_2021-01-03.txt (4.6 KB)

Label config
lbl_Avresetid

Interface QA-editor
QA_editor_interface

QA interface when running
QA_Interface

So I guess the question now is, if that data isn’t available in “api/devices”, then where is it & how do we get it?

I have made the change so the events of type “PluginChangedViewEvent” are processed, but we need a way to get it initially. Any time the app refreshes its connections that data is going to be lost. We’ll need a way to read that in during our startup routine. What I’ve got right now would really only work for someone that has the Home Remote app running 24/7 on a wall mounted tablet.

I also do not know how to do this, but is it not the case that when a value (label) is updated, it will show the correct information?
It then does not matter if the car heater does not show any value, because when I want to program a departure time, the app will be updated.
And if I have a QA that shows e.g. wind data, the values are updated as soon as there is a change in input data.
If it works this way, it may not matter if there are no values at startup.
And in my case, it’s a 24/7 tablet.

Yes. What I’m saying is that if you were to click the refresh button, switch apps, turn the screen off, etc. It’s going to lose those values. When the app resumes it resets all values, reads the current ones from “api/devices” & starts its “api/refreshStates” loop. You will see what I mean when 3.17.0.0 is available to test.

I totally agree with you! This is a need for me too, I have never been comfortable with their horrible apps. Fortunately, HR is here to make up for all this mess. I have HC2 and I am waiting to recover the HC3 which is with my daughter in February. I think I will do well with the changes made with HC3.

3.17.0.0 is live. It has fixes for QuickAppVariables not updating. It also adds support for monitoring those “PluginChangedViewEvent” changes. To monitor them you’ll need to add Attributes for them to the Device objects. As discussed, the values will probably remain empty until there is a change. Then the Home Remote will have the value.

To monitor “lbl_Status”, add this attribute:

ui.lbl_Status.text

Attached is an updated example.
Fibaro_QuickApp_v2.hrp (3.9 KB)

Thanks Bill, Label works really well now. The label window is empty when I start HR, but it is updated correctly if I press any button. I have a delay now of 4-8 seconds, but I think it’s due to a bug in HC3 software (5.061.36 beta).

But I have two more QAs that are not visible under HC3 Devices. The Car heater was a QA created as an Binary Switch. But my QA Wind ID 142 which is created as a Wind Sensor is not visible under HC3 Devices, nor my QA Netatmo 2.5, ID 145 with children ID 146 to 157.

But we can start with QA Wind ID 142. It retrieves local wind data via Domoticz and presents its values in four labels. Unfortunately I did not find this QA under devices but it may be because this QA is created from another template (wind sensor).
I enclose a json file that you can view.
API_devices_142_Wind_2021-01-10.txt (2.5 KB)

I will look at the JSON & see why this device isn’t syncing. For the time being you can create it manually. Just copy the car heater device object & update the Id & Attribute properties.

Bill, will the problem with QuickApp’s in HC3 not being synced be fixed in version 3.18 ?
Here is another QA that for unknown reason does not want to be synchronized.

For now just copy & paste an existing device & update the “Id”. I may be able to add this to the device sync in the future. I don’t know. The debate is that the Home Remote does not have any pre-built templates for this device. If someone were to add this directly to the Home Remote app there would be nothing to show for it.

The Wind Sensor from your previous post was at least advertised in the JSON as a “com.fibaro.windSensor”. The Home Remote does have templates it can use for that device so it will be included in the next release.

I’m also curious to know just how well these QuickApp Labels actually work in Home Remote. Since the latest values are not in the “devices” JSON, that means we need to wait for events.

How long does it take to actually start seeing these labels populate after starting the simulator?

On my QA car heater, it can take up to a minute before the label is updated, but that’s because the QuickApp itself is only updated every minute.
If you then press a new time with the buttons, it takes between 2 and 3 seconds before the label is updated. Here you would want a faster response, especially if you have to press many times to set the right time.

Bill
I just want to tell you that in version 3.18 all my QA’s pop up as they should, even those that were previously invisible.
So thanks for an important update.

1 Like