Fibaro HC3 and QuickApp's

The addition on line 3 is my own note. I did many tests so I wrote this note to know what I did.
Dep_Status was added when I created the Global variables. I’m sorry if they’ve been misleading to you.
It’s late tonight now but tomorrow I can create new json files for you that you can work with.
As you can see, I’m concerned that there will be good HC3 support for Home Remote. ImperiHome was a fantastic tool, but I see that HR can be even better because you can create the layout you want and that HR also has support for Fibaro HC3.

1 Like

Now I have “cleaned up” my QuickApp and removed the Global variables, so now we forget what I have previously written.
The files I attach only contain local variables and other local QA information.

A QA contains at least 3 parameters that your creation Home Remote must be able to handle, and in my QA it is:
A) Buttons, e.g. btn_Hour (This now works in HR)
B) quickAppVariables, e.g. my variables Dep_Status, Heat_Status and more.
C) Labels, e.g. lbl_Avresetid, lbl_Status
There is also a controller called “slider”, but I do not use it here. (We can add it later)

Attached files:
The file “1_HC3_API_Devices_ID191.txt” is the result of the command “http://192.168.1.27/api/devices/191

The file “2_HC3_refreshStates_Before_Settings.txt” is the result of “http://192.168.1.27/api/refreshStates?last=…” before any parameters in QA have been changed, and contains no info about QA ID191.

The file “3_HC3_refreshStates_Hour_Changed.txt” is the result when I changed the start time from 11:00 to 12:00.

The file “4_HC3_refreshStates_Standby_to_Auto.txt” is the result when I then changed the status from Standby to Auto.

Files number 3 and 4 contain data from both variables and labels that HR could retrieve.

In file 3_HC3 … you will find e.g. the variable “Dep_Hour” on lines 289, 327, 383, 421, 772. And the label “lbl_Avresetid” time on lines 350 and 478.

In file 4_HC3 … you will find the label “lbl_Avresetid” on line 291 and “lbl_Status” on line 181. The variable Dep_Status is found on lines 132, 170, 226, 264, and 475.

So variables and labels are updated correctly in the event of a change, you just have to get them updated in Home Remote.
Let me know if you need more information, I will be happy to help.

1_HC3_API_Devices_ID191.txt (4.6 KB) 2_HC3_refreshStates_Before_Settings.txt (1.9 KB) 3_HC3_refreshStates_Hour_Changed.txt (10.8 KB) 4_HC3_refreshStates_Standby_to_Auto.txt (6.4 KB)

Hi Roy,
Thats look very good. do you mind share your quick app. Then i would try to change it so it works for my Webasto if thats possible or if you have any idea.
Great work.
Thanks in advanced.
Martin

OK Roy, I think I see the issue here. It looks like the controller is sending these “changes” as string values. So I need to parse that string to load the array. The code that processes the changes was skipping this because it was expecting an actual array, not a string. I’ll get this fixed in the next release.

Thanks Bill, I’m looking forward to the next release.
When you create a QuickApp, you can choose which type of QA to use (Binary sensor, Binary switch, Multilevel sensor, Wind sensor and more) yes there are 23 different variants to use.

We can only hope that HR can retrieve data from these with the same method. In addition to my own QA, I also have a QA Wind sensor and a QA Multilevel sensor to test this on. Then there are QuickApp child devices that I do not yet know how to use.

Here are some links to Fibaro’s manuals.
https://manuals.fibaro.com/home-center-3-quick-apps/
https://manuals.fibaro.com/knowledge-base-browse/hc3-quick-apps-managing-child-devices/

Hi again Bill, I just want to remind you that QuickApp’s Label should also be read out. It contains data that is very useful in most QuickApp’s.
The last line of text string contains only “quickAppVariables”.

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?