Fibaro HC3 and QuickApp's

Where did you find this?

The current version will not allow you to send this callUIEvent command but I can add support for it. I would like to know though if this is the “official” way to invoke QuickActions.
https://manuals.fibaro.com/knowledge-base-browse/rest-api/

In the meantime you can send this command with a Plugin.

I asked a question on Fibaro’s forum and got an answer from the member “jgab” who is an expert and the forum’s giant.
What jgab does not know is not worth knowing. Jgab is also Swedish which makes me happy, and jgab is also very active on our Swedish Fibaro forum.
My post is at the bottom of this post:
https://forum.fibaro.com/topic/24413-starting-scenes-via-api/?tab=comments#comment-222550

I also attach my file with QA properties and I will try to write a plugin. But keep in mind that I’m not a programmer so I need all the help I can get.

Properties_QA_191.txt (4.5 KB)

According to that data, this QuickAction supports “turnOn”. Are you 100% sure that doesn’t work?

http://192.168.1.27/api/callAction?deviceID=191&name=turnOn

I ask, because earlier you were using device ID 30, not 191. Also, given that ImperiHome development stopped a while ago I’d be very surprised if they are using this new HC3 “callUIEvent” command. Do by any chance know how they were controlling this QuickAction?

Hi Bill
I used ID30 (which is a switch) only to test the command. It is also true that my QuickApp is based on a QA that can act as a switch, but that is only because I want to be able to see the status change when my car heater is active (the heat button should change image).

I could send a “turnOn” command to start the heater, but then all the intelligence in it is lost because the start time is calculated based on the outdoor temperature.
It should also be easy to program the start time, which is done in the QA heater interface.

The “callUIEvent” command does not come from ImperiHome because that app does not support HC3. It is also for this reason that I and many others are looking for a similar app with HC3 support.

If your creation HR can easily handle buttons and read a Label in a QA, I know that many of my friends on the Swedish forum would be interested because automatic car heaters are very common here in “cold” Sweden (and many other applications).
Creating a scene with the same features is not interesting, because a scene has no interface with buttons and labels.

EDIT:
The new HC3 command comes from another member with extensive knowledge of Fibaro, cag014.
Here is a link to his answer of how to press a button:
https://forum.fibaro.com/topic/49405-scene-launch-via-api/?do=findComment&comment=203120

Hi again Bill
Now I’m starting to understand what you’re asking about “Call UiEvent Action”.
I found something called Swagger in Fibaron’s interface.
Under the heading “GET /plugins/callUIEvent” I found the information that you can read about in the attached PDF documents.
I entered my values in the example and got the answer as you see in my PDF. Tell me if you need more info and I will copy it for you.

This might solve how to press the QA app’s buttons, but the problem of reading the value in a Label remains.
Jang on the forum suggested that in my QA I should send the value to a global variable, and in HR read off this variable.
Is there anything that can be done, if so ,how?

Unable to send PDF so I renamed the file to a txt file.

Fibaro HC3 Plugins API.pdf.txt (600.1 KB)

Thanks for the info. I’ll add support for sending “callUIEvent” commands to the next release.

Have you looked through that file you attached earlier to see if the value you wish to read is in the JSON?

I see there are some “quickAppVariables”

Do you mean I can read a variable that is in my QuickApp?
In that case, I can easily add a variable that contains the information from the Label that I want to read.

Feel free to explain to me how I can do that. For example, a variable that I call “Departure_Time”.

I was just saying that we might not need global variables. It might exist in the device JSON that we are already polling. I don’t see Departure_Time in that data you posted the other day so we may need global variables.

If you need global variable support there is a plugin you can use. That’s another endpoint we’d be polling though. Since we are already polling the “devices” endpoint it’d be a little bit more efficient to use its data. Again, that may not be possible. You may have no choice but to use global variables.

Information about the global variables plugin can be found here.

It appears so. Did you look at that screenshot I shared earlier?

It has “quickAppVariables” in that JSON you sent me. The problem is, I don’t see Departure_Time.

I’m sorry there was a misunderstanding here.
I had not yet added the variable Departure_Time.
But if the variable could be used in HR, I could easily add it.

But now I have added a variable called “Dep_Status” and it is included in the json file (I changed to a more appropriate name).
{
“name”: “Dep_Status”,
“value”: “Standby”
}
I added the variable in HR (Label) as an “Attributes: Dep_Status”, and linked “CarheaterCar_Yh.Dep_Status” (with Device binding :).
Unfortunately it did not work, maybe I’m wrong?
Can you give me a tip on how to do this? I’ve looked in your documentation, but I can’t find anything that help me. Many thanks for your help.

My_label

EDIT:
Regarding “callUIEvent” and the buttons for the car heater.
If it is of any help, I get this message in HC3 when I press the button “Auto” in HR.

onAction: {“actionName”:“setBtn_auto”,“args”:[""],“deviceId”:191}
[WARNING] [QUICKAPP191]: Class does not have setBtn_auto function defined - action ignored

The app does not currently support nested properties. All I was having you do now is just verify the data is available in the “devices”. And based on your findings, it is there. What you have will not work because you’ll have to provide the entire property path. What I will try to add in next release is the ability to add attributes like quickAppVariables.Dep_Status. Again, this isn’t going to work right now. You’re going to have to wait until the next release. This is going to be a new feature.

Thanks Bill!
If this is for your help, I will attach the entire json file with API Plugins.
Tell me if you want more API files, such as devices, scenes, alarms / devices, voip, weather and so on, there are many of them.
Fibaro_HC3_API_Plugins.json.txt (73.9 KB)

I don’t really need anything else. I made the changes yesterday on my development machine. They will be included in the 3.15.0 release which should be out in a couple days.

I will receive the HC3 in 2 weeks I could be in reinforcement on this box with HR!

Version 3.15.0 is available everywhere except the Apple App Store. It’s waiting for Apple review there.

Attached is a project demonstrating how to use these new Quick App features. This was built using the sample data you provided earlier. All you should need to do to get this example working is update the Password on the Fibaro source.

Fibaro_QuickApp.hrp (3.9 KB)

Hi Bill
Now the buttons work perfectly, but there are some problems with updating the Label (“quickAppVariables.Dep_Status”).
When I start the app, the Label is updated with the correct information, but if I then press the buttons, the Label does not react with the new information.

If it is to work properly, this label must also respond to changes from QuickApp’s variables. For example. in Manual mode, “quickAppVariables.Dep_Status” is continuously updated every minute until a certain time has elapsed.
When programming the time in the HR app, the response to this Label must be immediate without delay.
Now it seems that the communication with my QuickApp is one-way.

I have also tried adding different Triggers to the Label, but it has not worked (or I have done wrong).

Manual start and 9 minutes left.

The Home Remote only does a full refresh on startup. After that, it monitors changes using “/api/refreshStates?last=”. This helps keep things fast & efficient. Sounds like your quick app is not sending notifications that the device has changed. Check the Fibaro forum for support on this one. Quick Apps are still new to me so I don’t know what you need to do to enable these.

Bill, thanks for all the help.
Now the car heater works the way I want it to work.
I could not use QuickApp’s own variable so I created a Global variable where HR Label can retrieve information.

A final detail that would increase clarity is that the “Auto” and “Manual” buttons change the background color when the button (command) is active. I have tried, but it did not work because those buttons are not switches. I had thought that the background color would be controlled by a variable that can have the value “Auto” or “Manual”, but I have not succeeded.

The picture shows an HR app intended for my wife’s mobile.

You can use DataTriggers to update the Background on your Button controls.