Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,


as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.


As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!



Smart Home Forum by FIBARO Team

Search the Community

Showing results for tags 'quickapp'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • FIBARO Community
    • FIBARO Portal and Forum policy
    • FIBARO
    • Say hello!
    • Off-topics
  • FIBARO Update
    • FIBARO System Update
    • FIBARO Mobile Update
  • FIBARO Community Support
    • Scenes and Interface
    • FIBARO Products
    • FIBARO Mobile
    • FIBARO HomeKit
    • FIBARO Assistant Integrations
    • Other Devices / Third-party devices
    • Tutorials and Guides
    • Home Automation
    • Suggestions
  • FIBARO Społeczność
    • FIBARO
    • Przywitaj się!
    • Off-topic
  • FIBARO Aktualizacja
    • FIBARO System Aktualizacja
    • FIBARO Mobile Aktualizacja
  • FIBARO Wsparcie Społeczności


  • Scenes
  • Virtual Devices
  • Quick Apps
  • Icons

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start






Website URL





Found 9 results

  1. A thread to share some coding techniques for QuickApps? Because QD's are "long running scenes" (they don't have to be loaded and restarted for every event) - it is actually worthwhile to build up a library of "nice to have" code and include them in QDs. Here is Fibaro's manual for QuickApps. Here is Fibaro's manual for creating QuickAppChild devices Here is Fibaro's manual for using MQTT client List of posts: Introduction to the QuickApp anatomy - tutorial Part 1. Lua functions and object-oriented programming. (QuickApp is a OO class, so we need that base) Part 2. The basic QuickApp functions and what they do... and how. Part 3. More on QuickApp event handling - interaction with the UI and fibaro.call(<quickApp>,"name",...) Part 4. QuickAppChildren and how to raise them... Logging functions (replacement for color/html tags + tostring for customised data structure) Shared functions calls between QuickApps (Here is an improved version) Off-line HC3api to use fibaro.* calls on PCs/Linux/Mac (fibaroapiHC3.lua) Polling for triggers in a QuickApps (like fibaro.getSourceTrigger()) Here is another method using a helper QA Patching 'setTimeout' so you get an error message if the function crashes A generic template for a QuickApp A simple code-lock QuickApp (demonstrating the UI with buttons) A QuickApp for scheduling user profiles (demonstrates UI buttons that change labels/text to present options) It doesn't' actually schedules the profile yet. (here is a working version) Structuring a QuickApp using event handlers to cope with asynchronous calls - like when using net.HTTPClient() instead of FHTTP(). looping with setInterval (without drifting) A QD reporting if other QDs are crashing (leveraging the "polling for triggers" code) Coding and debugging HC3 QuickApps offline using PC/Mac/Linux and a Lua IDE (and auto-creating a proxy on the HC3) An example of a QuickApp that download and installs scenes and QuickApps from a repository (files in a flat format) Coding and debugging of HC3 scenes using fibaroapiHC3.lua (not strictly about QuickApps but related) - can speed-up time A more complex QD that reads Google calendars or iPhone calendars and schedule custom events (uses the QuickApp structure for asynchronous calls in a previous tip) A substitute for Lua's loadstring() Here is another method of loading code dynamically into a QA Creating proxy devices on the HC3 to share devices between HC2 and HC3 A "webhook" QD - pushing events to external apps Adding interfaces to QA's - ex. power and battery and updating the properties (updates the little battery and power icon UI) @tinman Using '/plugin/publishEvent' to emit 'centralSceneEvent' (and a few other) .... Ex. keyfob QA by @tinman Readers note. I started to call QuickApp devices for QDs (as in QuickApp Device, thought QAs sounded like Question and Answers). So, I use the word QD here and there but I'm not religious about it...
  2. This is a thread for the fibaroapiHC3.lua sdk that is under development (keeping it separate from the HC3 QuickApps coding - tips and tricks thread) I've started to run and test HC3 QDs offline and have made a fibaroapi.lua file that can be included to emulate the fibaro calls and call out to the HC3. fibaroapiHC3.lua: fibaroapiHC3.lua (v0.98) The code is updated weekly so please make sure you have the latest... It's similar to the old fibaroapi for the HC2 in a thread started by @riemers but with more extensive support to create a better "offline experience"... Some benefits: Use a modern development environment such as ZeroBrane Studio (free for Mac/PC/Linux, HC3 plugin here) on your laptop/PC to develop and debug QuickApps and Scenes Step through code, inspect Lua variables, set break-points etc - all that is possible in a good IDE. Faster to pin-point errors as the error messages are better than on the HC3 - stack-traces etc. Use the whole Fibaro API fibaro.call etc and net.HTTPClient(), setTimeout(), json.ecode/decode, QuickApp self:functions like self:getVariable, self:updateView Support for MQTT client and QuickApp child devices Both QuickApps and Scenes are supported. Scenes support most conditions and are triggered by real triggers from the HC3 or simulated triggers. Speed up clock to run faster than real time, to watch a Scene or QuickApp over days/weeks/months in seconds. Start at any given time and date - test if your scene behaves on week-ends ? Automatically create a proxy QuickApp on the HC3 that sends UI clicks back to the code your are running and displays self:updateView updates. This way you can test the QuickApp UI (buttons etc) and still debug the main code on your PC. Run completely disconnected from the HC3 simulating devices and other resources (now you can take your coding with you on your vacation ) There is a possibility to download resource definitions from the HC3 and use them (devices, globals etc) while running disconnected. Move the code as-is over to the HC3 when it runs in the emulator - and it will most likely run on the HC3. Scenes needs to be moved to conditions/actions part on the HC3 - may automat that in the future. And lastly, it makes it fun to develop code for the HC3 To get going define hc3_emulator.credentials = {ip=<HC3_IP>, user=<username>, pwd=<password>} and include dofile("fibaroapiHC3.lua") An example can look like if dofile then dofile("fibaroapiHC3.lua") hc3_emulator.credentials = {ip="192.168.1.X", user="<user>", pwd="<password>"} end function QuickApp:onInit() fibaro.call(88,"turnOn") -- turns on device 88 on your HC3 end if dofile then hc3_emulator.start{ -- Start emulator poll=1000, -- Poll for triggers from the HC3 every 1s } end We wrap the emulator specific stuff inside "if dofile then .... end" as the symbol 'dofile' is not defined on the HC3 and will thus be false and not include the code - This means that we can take the code as-is and paste it into the HC3 and it works. Most of the functions are there and will be improved over time. There are support for net.HTTPClient() and setTimeout/clearTimeout and api.* There are support for getting triggers and events from the HC3 Support for auto-creating a QuickApp proxy with UI elements that sends events back to the code being debugged. There are support for both QuickApps and Scenes (with conditions) Currently supported (v 0.95) fibaro.debug(type,str) fibaro.warning(type,str) fibaro.trace(type,str) fibaro.error(type,str) fibaro.call(deviceID, actionName, ...) fibaro.getType(deviceID) fibaro.getValue(deviceID, propertyName) fibaro.getName(deviceID) fibaro.get(deviceID,propertyName) fibaro.getGlobalVariable(varName) fibaro.setGlobalVariable(varName ,value) fibaro.getRoomName(roomID) fibaro.getRoomID(deviceID) fibaro.getRoomNameByDeviceID(deviceID) fibaro.getSectionID(deviceID) fibaro.getIds(devices) fibaro.getAllDeviceIds() fibaro.getDevicesID(filter) fibaro.scene(action, sceneIDs) fibaro.profile(profile_id, action) fibaro.callGroupAction(action,args) fibaro.alert(alert_type, user_ids, notification_content) fibaro.alarm(partition_id, action) fibaro.setTimeout(ms, func) fibaro.emitCustomEvent(name) fibaro.wakeUpDeadDevice(deviceID) fibaro.sleep(ms) net.HTTPClient() net.TCPSocket() api.get(call) api.put(call <, data>) api.post(call <, data>) api.delete(call <, data>) setTimeout(func, ms) clearTimeout(ref) setInterval(func, ms) clearInterval(ref) mqtt.Client.connect(uri, options) <mqttclient>:addEventListener(message,handler) <mqttclient>:subscribe(topic, options) <mqttclient>:unsubscribe(topics, options) <mqttclient>:publish(topic, payload, options) <mqttclient>::disconnect(options) plugin.mainDeviceId class QuickAppBase class QuickApp class QuickAppChild QuickApp:onInit() -- called at startup if defined QuickApp - self:setVariable(name,value) QuickApp - self:getVariable(name) QuickApp - self:debug(...) QuickApp - self:updateView(elm,type,value) QuickApp - self:updateProperty() QuickApp - self:createChildDevice(props,device) QuickApp - self:initChildDevices(table) sourceTrigger - scene trigger Supported scene events: {type='device', id=<number>, property=<string>, value=<value>} {type='global-variable', property=<string>, value=<value>} {type='date', property="cron", value={ <time> }} {type='date', property="sunset", value={ <time> }} {type='date', property="sunrise", value={ <time> }} {type='manual', property='execute'} {type='custom-event', name=<string>} {type='device' property='centralSceneEvent', id=<number>, value={keyId=<number>, keyAttribute=<string>}} json.encode(expr) json.decode(string) fhc3_emulator.start{ -- start QuickApp/Scene id=<QuickApp ID>, -- default 999 poll=<poll intervall>, -- default false. Interval i ms to poll for new rigger from the HC3. 1000-2000 is reasonable... type=<type>, -- default "com.fibaro.binarySwitch" speed=<speedtime>, -- default false proxy=<boolean> -- default false. Creates a proxy on the HC3, ignore id. quickApp=<boolean> -- default false. Connects to an existing quickapp on the HC3 with given id UI=<UI table>, -- default {} quickvars=<table>, -- default {} loadDB=<boolean> -- If true tries to load resource database (only if offline==true) } hc3_emulator.createQuickApp{ -- creates and deploys QuickApp on HC3 name=<string>, type=<string>, code=<string>, UI=<table>, quickvars=<table>, dryrun=<boolean> } hc3_emulator.createProxy(<name>,<type>,<UI>,<quickVars>) -- create QuickApp proxy on HC3 (usually called with fibaro._start) hc3_emulator.post(ev,t) -- post event/sourceTrigger hc3_emulator.offline = <boolean> -- Set to true in beginning of file if running simulated devices.. hc3_emulator.createDevice(deviceID,deviceType) -- Create an offline device of a given type. When offline device are also autocreated of type binarySwitch. More doc on this is coming hc3_emulator.copyFromHC3() -- Downloads resources from HC3 and stores in HC3sdk.db If someone wants to try this in another IDE than Zerobrane that I use (like Visual Studio) the only thing that could be an issue is to have access to the Lua libraries require ("ssl.https") require("socket.http") require("socket") require("ltn12") They are pretty standard lua libraries - based on LuaSocket. If someone manage to get it running in VisualStudio I would be interested to know. Any improvements are happily received (in code) and credits will be due granted. Links to notable post A ZeroBrane plugin to make life easier while debugging A post introducing the SDK with QuickApps. A post introducing the SDK with Scenes. Scene support is not complete. MQTT support. Another post with running a scene completly without being connected to the HC3. Some notes on the implementation of the SDK - if you would like to hack on it A collection of QA's I developed with the SDK - which means that they can be run offline ChildrenOfHue - A QA that creates QA children devices for your Hue devices (It's the Hue QA I use myself these day) iOSLocator. A iOS geopresence QA. iCal (iOS,Google) QA Telegram QA. Event watcher QA. Helper QA to get/subscribe on event triggers Vonage/Nexmo SMS service. Send SMS. Changelog: v 0.67 - numerous bug fixes caused by the restructuring. hc3_emulator.start{startTime="07:00 4/5/2000"} - will start the simulation at the given time. v 0.68 - fibaro.debug behaves more like original. v 0.70 - better offline support and speeding. v 0.72 - More offline and support for downloading HC3 resources to be used while running disconnected from the HC3 v 0.73 - Various speed-time related bugs v 0.75 - Better http sync behaviour. Set hc3_emulator.asyncHTTP=true to get some pseudo asynchronous behaviour v 0.77 - Support for 5.030.45. Initial support for childDevices and fixes for the changed handling of UI events v 0.78 - UI fix. Name of callbacks defaults to button.."Clicked", unless you have a onReleased=name or onChanged=name in the UI table struct. v 0.80 - Fixed bug in self:getVariable and self:setVariable v 0.81 - Better quickVariables handling for proxies, and self.childDevices list updated when children are deleted. v 0.83 - self:getVariable returns the empty string "" if the variable does not exists according to the latest behaviour on the HC3... 'class' is not redefined if available from Luabind... However, I've not had a chance to test if it's 100% compatible yet... v 0.84 - Initial support for mqtt. You need to have installed https://github.com/xHasKx/luamqtt so that require("mqtt") works from fibaroapiHC3.lua. I have tried to mimic the HC3 mqtt api but I have not really used mqtt that much so if someone uses it with fibaroapiHC3.lua and discovers if stuff is not compatible with the HC3 implementation please let me know and we fix it. v 0.85 - Compatibility fix for function 'class' to adhere more closely to the HC3/luabind version v 0.90 - Cleanup of code, Better handling of children and QuickApps, ZBS color output with ansi escapes; hc3_emulator.colorDebug=true v 0.93 - New model for QuickApp proxies. Better child device compatibility. v 0.95 - Various bug fixes - log prints more in line with HC3 log console. fibaro.emitCustomEvent bug fix. v 0.98 - First support for backup/download/upload with the ZeroBrane plugin (another post here)
  3. Hi, I already found lots of LUA scripts and other "inserts" for Bose Soundtouch but I can't find anything that works on HC3. Is someone already working on a QuickApp or some kind of VD for the Bose Soundtouch ? I don't have the proper skills to make something myself and I would love to integrate my Bose …. Thank you
  4. Hi, Would like to have a quickapp that would enable me to start or stop a scene with a button. I tried fibaro.scene("execute", {id}) or fibaro.scene("kill", {id}) But it doesn't work and don't stop and restart the scene. The scene i want to trigger or stop is a move detection in a room to start ligne. I would sometime like this automation not being activated and stop from a QA that is controling all room parameter. thanks for the support
  5. For watering our plants I develop a Virtual Device with HC2 using control buttons to open a valve during 15, 30, 45 and 60sec. I also had a emergency STOP button to close the valve immediately within the same VD. When I reproduce the same with HC3, it is not possible to call the STOP button (interrupt) untill the watering in progress is not completed. Any help? (and not entionning those buttons are not displayed on the portable Android/IOS...)
  6. I am trying to get a list of sections in house, to use in a QA. From my browser I can do a http request like: http://IP_HC3/api/sections to get this list. Is there a way to do this directly with a fibaro function? Can't find anything in the API docs.
  7. I have set a variable for a QuickApp in the web interface. Now I want to retrieve that variable with self:getVariable("varname") It return nil however. How come? What am I doing wrong?
  8. Being completely new to Fibaro (just bought a HC3) but not to domotica and programming I am not able to find the info I need to do the following: Receive a http request from my Synology Surveillance Station telling HC3 that camera movement has occurred and then set a zone to breached and trigger an alarm. I was thinking of creating a QuickApp device of type binary sensor and turn that on with an http GET request from the surveillance station. This part works fine: when I send the request I can catch it in Quickapp:turnOn() Can see that by checking a debug message. But now.... How do I get this device to set the zone to breached? I've tried to test it in a scene, using state "Detected" but that doesn't react to the turnOn. The updateProperty("state", true) or updateProperty("state", "Detected") methods also didn't work. Big problem here is imo the lack of documentation (at least I can't find it) E.g. where can I find a list of properties and built-in methods of the QuickApp class? The page at https://manuals.fibaro.com/home-center-3-quick-apps/ certainly does not contain all these properties and methods, doesn't it? Can anyone point me in the right direction?
  9. Hello, Does anyone already re-made the QuickApp for Siren Gen5? I want to use the different sounds of the Siren like in the HC2 with the VD.
  • Create New...