Fibaro HC3 and QuickApp's

I have been using ImperiHome for many years but am now looking for a replacement for it as ImperiHome has now disappeared from the market.
When I was looking for a replacement, I found Home Remote which after a bit of testing seems to be a very competent replacement.
In Home Remote I have much greater opportunities to create my own design, ImperiHome was much more limited.

One of my demands was also that the program could handle Fibaro HC3 with devices, scenes and above all Fibaro’s new QuickApp’s.

In HC3 I have a QuickApp that controls a car heater (I live in cold Sweden). I want to be able to handle this QuickApp in Home Remote, just as I could in ImperiHome.

The car heater has 7 buttons for setting time etc., as well as a label that should show Departure time and Status.
But I have not managed to get either buttons or label to “talk to” HC3 QuickApp.

I then did a test and created the same app with data from a VD in HC2 that I also have. There, the car heater worked as it should.
Retrieving and displaying, for example, temperature data from HC3 was no problem, but it does not want to “talk” to any QuickApp.

So how do I get on with my QuickApp in HC3?
I found an example of a script required to start a scene, do I need a similar script to communicate with a QuickApp?
Can someone please, give me a push in the right direction.
In Home Remote I have much greater opportunities to create my own design, ImperiHome was much more limited.

And do I have to buy four licenses of Home Remote when I plan to use two Tablets and two mobiles?

From what I’ve been told, QuickApps are very similar to Virtual Devices in HC2. So you’ll add quickapps to the Home Remote kind of like you would a virtual device for HC2. An example is linked below. We also found out a few months ago that for HC3, you’ll need to use your “admin” account to run QuickApps & Scenes. Check to see which account you are using.

You do not need 4 PRO licenses. They are per account. You’ll only need multiple licenses if you are using a multiple platforms like Android & iOS. Apple, Google, & Microsoft will never bill you twice for the same thing. Just click the button in the app & it’ll restore your original purchase.

Or maybe, based on what I am reading here, quickapps look more similar to an actual device. In this discussion, Roger seems to be activating his quickapp with a standard “turnOn” command for a switch.

Fibaro has a pretty straight forward API to send commands. They are just HTTP GET requests so you can test them pretty easily by entering the URLs in web browsers like Google Chrome.

Here’s the URL he was using. Try substituting your values & running this command.
http://10.10.0.100/api/callAction?deviceID=784&name=turnOn

Find the HTTP request you need then I’ll show you how to send it in Home Remote. In this example above, all he had to do was copy & paste an existing switch & update the Id field.

Thanks Bill for the quick response!
Yes, I use my admin account so I have full rights in HC3. As I wrote earlier, I have created a similar app by a VD in HC2 that works, but the syntax in HC3 is different.

I can also turn on or off a lamp in HC3 with the commands
http://192.168.1.27/api/callAction?deviceID=30&name=turnOn
http://192.168.1.27/api/callAction?deviceID=30&name=turnOff
and then gets the answer {“id”:0,“jsonrpc”:“2.0”,“result”:{“result”:0}}.

But I do not know what the command looks like to press a button in my QA.
For example, the Auto button has these parameters
ID: btn_auto
Label: Auto
onReleased : onButton_AutoChanged

ID for my QA is 191
I also try to find out what an http command to press the button should look like. I have asked on Fibaro’s forum, but have not received an answer yet.

http://192.168.1.27/api/callAction?deviceID=191&name=btn_auto
or
http://192.168.1.27/api/callAction?deviceID=191&name=onButton_AutoChanged
does not work.

EDIT:
If we start with the command to press a button in a QA, it looks like this:
http://<HC3_IP>/api/plugins/callUIEvent?deviceID=<QA_Id>&elementName=<button_ID>&eventType=onReleased

I have tested the code and it works perfectly with this command:
http://192.168.1.27/api/plugins/callUIEvent?deviceID=191&elementName=btn_auto&eventType=onReleased

I’m allowed to come back as I know how to read the contents of a Label.

The contents of the Label will probably be in the device “properties”. Open this URL to see what it shows.
http://192.168.1.27/api/devices/191

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!