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!

 

Regards,

Smart Home Forum by FIBARO Team


Search the Community

Showing results for tags 'quickapp'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • 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
    • Sceny i Interfejs
    • FIBARO Urządzenia
    • FIBARO Mobilnie
    • FIBARO HomeKit
    • Integracja z Amazon Alexa i Google Home
    • Urządzenia Firm Trzecich
    • Poradniki
    • Automatyka Domowa
    • Sugestie

Categories

  • Scenes
  • Virtual Devices
  • Quick Apps
  • Icons

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Facebook


Google+


Skype


Website URL


WhatsApp


Country


Gateway/s


Interests

  1. The QuickApp Air Quality OpenWeatherMap provides the current measurement for your location on Air Quality. Besides basic Air Quality Index the QuickApp provides also data about polluting gases such as Carbon monoxide (CO), Nitrogen monoxide (NO), Nitrogen dioxide (NO2), Ozone (O3), Sulphur dioxide (SO2), Ammonia (NH3), and particulates (PM2.5 and PM10). This QuickApp has Child Devices for Carbon monoxide (CO), Nitrogen monoxide (NO), Nitrogen dioxide (NO2), Ozone (O3), Sulphur dioxide (SO2), Ammonia (NH3), PM2.5 and PM10. Common Air Quality Index (CAQI) The Common Air Quality Index (CAQI) is an air quality index used in Europe since 2006. In November 2017, the European Environment Agency announced the European Air Quality Index (EAQI) and started encouraging its use on websites and for other ways of informing the public about air quality. As of 2012, the EU-supported project CiteairII argued that the CAQI had been evaluated on a "large set" of data, and described the CAQI's motivation and definition. CiteairII stated that having an air quality index that would be easy to present to the general public was a major motivation, leaving aside the more complex question of a health-based index, which would require, for example, effects of combined levels of different pollutants. The main aim of the CAQI was to have an index that would encourage wide comparison across the EU, without replacing local indices. CiteairII stated that the "main goal of the CAQI is not to warn people for possible adverse health effects of poor air quality but to attract their attention to urban air pollution and its main source (traffic) and help them decrease their exposure." The CAQI is a number on a scale from 1 to 100, where a low value means good air quality and a high value means bad air quality. The index is defined in both hourly and daily versions, and separately near roads (a "roadside" or "traffic" index) or away from roads (a "background" index). As of 2012, the CAQI had two mandatory components for the roadside index, NO2 and PM10, and three mandatory components for the background index, NO2, PM10 and O3. It also included optional pollutants PM2.5, CO and SO2. A "sub-index" is calculated for each of the mandatory (and optional if available) components. The CAQI is defined as the sub-index that represents the worst quality among those components. Here is a description of Air Quality index levels Pollutant concentration in μg/m3: Index NO2 PM10 O3 PM25 (optional) Good 1 0-50 0-25 0-60 0-15 Fair 2 50-100 25-50 60-120 15-30 Moderate 3 100-200 50-90 120-180 30-55 Poor 4 200-400 90-180 180-240 55-110 Very Poor 5 >400 >180 >240 >110 See more on CAQI: https://en.wikipedia.org/wiki/Air_quality_index IMPORTANT You need an API key and Polygon ID from https://home.openweathermap.org/users/sign_up The API is free up to 60 calls per minute Version 0.1 (9th October 2021) Initial version Variables (mandatory): apiKey = Get your free API key from https://agromonitoring.com latitude = latitude of your location (Default is the latitude of your HC3) longitude = longitude of your location (Default is the longitude of your HC3) interval = [number] in seconds time to get the data from the API timeout = [number] in seconds for http timeout debugLevel = Number (1=some, 2=few, 3=all, 4=simulation mode) (default = 1) Download the QuickApp here (download the file and un-zip): https://github.com/GitHub4Eddy/air_quality_openweathermap/archive/refs/tags/air_quality_owm-01.zip How to install: Open the Configuration Interface Go to Settings > Devices Click + Choose Other Device Choose Upload File Choose file from your computer with .fqa
  2. This Quickapp retrieves energy consumption, energy production and gas usage from the Toon Energy meter. This QuickApp has Child Devices for Consumption (Watt), Production (Watt), Consumption High (kWh), Consumption Low (kWh), Production High (kWh), Production Low (kWh), Gas Usage (l/h) and Total Gas (m³). The Energy Usage from the Child devices Consumption High, Consumption Low, Production High and Production Low can be used for the HC3 Energy Panel Your Toon Energy Meter needs to be rooted, see: https://github.com/JackV2020/Root-A-Toon-USB-Stick. This is the recommended all in one solution with a one time boot from USB stick, 10 minutes of work and done. After rooting you don't need a subscription anymore and you have access to a ToonStore with a growing number of apps. For more technical people there is a possibility to ssh into the Toon if they want with username root and password toon. Rooting is at your own risk, look here for further support and info: See also: https://github.com/ToonSoftwareCollective/Root-A-Toon (if you already have a running Linux environment) See also: https://toonforum.nl/ See also: https://www.domoticaforum.eu/ Version 1.0 (3th October 2021) Ready for download Version 0.2 (30th September 2021) Gas from m³/h to l/h Splashed a bug Version 0.1 (29th September 2021) Initial version Variables (mandatory): IPaddress = IP address of your Toon Meter Interval = Number in seconds debugLevel = Number (1=some, 2=few, 3=all, 4=simulation mode) (default = 1) Download the QuickApp here (download the file and un-zip): https://github.com/GitHub4Eddy/toon_energy/archive/refs/tags/toon_energy-1.zip How to install: Open the Configuration Interface Go to Settings > Devices Click + Choose Other Device Choose Upload File Choose file from your computer with .fqa
  3. This QuickApp gives access to real-time pollen count and risk category for grass pollen, weed pollen and tree pollen of any location from Tomorrow.io Pollen is a fine powder produced by trees and plants Pollen can severely affect people, especially those with different ailments such as asthma and respiratory issues. Version 0.1 (15th August 2021) Initial working version Pollen: Grass Pollen: Pollen grains from grasses Weed Pollen: Weeds are annual and perennial herbs and shrubs. A single plant may produce about a billion grains of pollen per season. Tree Pollen: Pollen from trees such as Birch and Oak Risk: 0: None 1: Very low 2: Low 3: Medium 4: High 5: Very High IMPORTANT You need an API key from https://app.tomorrow.io The API is free up to 500 calls / per day, 25 calls / per hour, 3 calls / per second (Pollen is 5% of rate limit) You need to create your location in https://app.tomorrow.io/locations to get a location ID and copy it to the QuickApp variable Variables (mandatory): Variables (mandatory): apiKey = Get your free API key from Tomorrow.io location = Tomorrow.io location ID (created in https://app.tomorrow.io/locations) interval = [number] in seconds time to get the data from the API timeout = [number] in seconds for http timeout debugLevel = Number (1=some, 2=few, 3=all, 4=simulation mode) (default = 1) icon = [numbber] User defined icon number (add the icon via an other device and lookup the number) Download the QuickApp here (download the file and un-zip): https://github.com/GitHub4Eddy/Tomorrow.io_Pollen/archive/refs/tags/tomorrow_io_pollen-01.zip How to install: Open the Configuration Interface Go to Settings > Devices Click + Choose Other Device Choose Upload File Choose file from your computer with .fqa
  4. This QuickApp gives access to real-time and 5-day forecast pollen count and risk category for grass pollen, mold spores, ragweed pollen and tree pollen of any location from AccuWeather.com Pollen is a fine powder produced by trees and plants Pollen can severely affect people, especially those with different ailments such as asthma and respiratory issues. It can aggravate these existing conditions or cause these issues in high risk groups Grass Pollen: Pollen grains from grasses Mold Spores: The fungus produces spores that can become airborne Radweed Pollen: Ragweeds are annual and perennial herbs and shrubs. A single plant may produce about a billion grains of pollen per season. Tree Pollen: Pollen from trees such as Birch and Oak The QuickApp provides a risk evaluation with levels in particles/m³ Grass Pollen Risk Begin Range End Range Low 0 4.99 Moderate 5 19.99 High 20 199.99 Very High 200 299.99 Extreme 300 1000000 Mold Spores Risk Begin Range End Range Low 0 6499.99 Moderate 6500 12999.99 High 13000 49999.99 Very High 50000 64999.99 Extreme 65000 1000000 Ragweed Pollen Risk Begin Range End Range Low 0 9.99 Moderate 10 49.99 High 50 499.99 Very High 500 649.99 Extreme 650 1000000 Tree Pollen Risk Begin Range End Range Low 0 14.99 Moderate 15 89.99 High 90 1499.99 Very High 1500 2999.99 Extreme 3000 1000000 IMPORTANT You need an API key from https://developer.accuweather.com The API is free up to 50 API calls/day, one key Variables (mandatory): apiKey = Get your free API key from AccuWeather locationKey = AccuWeather number from your HC3 Lon/Lat interval = [number] in seconds time to get the data from the API timeout = [number] in seconds for http timeout debugLevel = Number (1=some, 2=few, 3=all, 4=simulation mode) (default = 1) icon = [numbber] User defined icon number (add the icon via an other device and lookup the number) ownload the QuickApp here (download the file and un-zip): https://github.com/GitHub4Eddy/accuweather_pollen/archive/refs/tags/accuweather_pollen-01.zip How to install: Open the Configuration Interface Go to Settings > Devices Click + Choose Other Device Choose Upload File Choose file from your computer with .fqa
  5. TQAE.lua v0.33 -- Main emulator, loads other modules TQAEmodules/sync.lua -- timers with fake asynchronous IO TQAEmodules/async.lua -- timers with asynchronous IO based on cops TQAEmodules/copas.lua -- copas.* functions TQAEmodules/net.lua -- net.* functions TQAEmodules/api.lua -- api.* and web api TQAEmodules/json.lua -- json library TQAEmodules/fibaro.lua -- fibaro.* functions TQAEmodules/class.lua -- class function TQAEmodules/files.lua -- support for loading files, *.lua and *.fqa files TQAEmodules/QuickApp.lua -- QuickApp classes TQAEmodules/devices.json -- device templates TQAEmodules/webserver.lua -- web server for remote calls (ex. from proxy) TQAEmodules/proxy.lua -- creates QA proxy on the HC3 for funnelling back onAction and UIevents TQAEmodules/ui.lua -- Local Web UI for QA TQAEmodules/time.lua -- Time manipulation - changing start time... TQAEmodules/refreshStates.lua -- /refreshStates support TQAEmodules/Scene.lua -- Initial support TQAEmodules/offline.lua -- Support for local shadowing resources. Currently /globalVariables TQAEmodules/stdQA.lua -- Standard (simulated) devices TQAEmodules/web/main.html -- Web - Main emulator page TQAEmodules/web/qa.html -- Web - QuickApp info TQAEmodules/web/ui.html -- Web - QuickApp UI TQAEmodules/web/timers.html -- Web - list of active timers TQAEexamples/MyQuickApp.lua -- Example, Simple QuickApp TQAEexamples/Hue.lua -- Example, Hue QuickApp with QuickAppChildren TQAEexamples/Scheduler.lua -- Example, Simple minute based scheduler TQAEexamples/Ping.lua -- Example, Ping QuickApp that loads Pong QuickApp and exchanges fibaro.calls... TQAEexamples/Pong.lua TQAEexamples/TestScene.lua -- Test scene TQAEexamples/Backup.lua -- Non-QA code that backs up QuickApps from the HC3 to the local filesystem as *.fqa files TQAE.tar.gz -- Every file in one archive Installation The source for the emulator is available at the Fibaro forum link or directly from my GitHub <link> (It's a bit messy...) First time download the archive, TQAE.tar.gz and unpack it in a suitable directory on your PC/Mac/Linux. On Linux: >tar xvf TQAE.tar.gz On PC/Mac use suitable archive program to unpack the archive. ../TQAE.lua ../TQAE_QA.lua ../TQAEmodules/* ../TQAEexamples/* Download ZeroBrane studio <link> Open ZBS and open the TQAE_QA.lua file Set project directory in ZBS to the current file, TQAE_QA.lua (Project->Project Directory->Set From Current File) Also set Lua interpreter to Lua 5.3 (Project->Lua Interpreter->Lua 5.3) Now, run TQAE_QA.lua (F5 in ZBS). The output will look something like: ---------------- Tiny QuickAppEmulator (TQAE) v0.30 ------------- [11.10.2021] [08:33:23] | SYS|: No connection to HC3 [11.10.2021] [08:33:23] | SYS|: Created WebAPI at 192.168.1.18:8976 [11.10.2021] [08:33:23] | SYS|: sunrise 07:43, sunset 19:50 Note first that there is no connection to the HC3 - we are missing user, password, and IP for the HC3. Secondly, note the WebAPI address. 192.168.1.18 is my machine, your IP address may be different. The port is 8976. While TQAE_QA.lua is running open http://192.168.1.18:8976/web/main in your browser. (the Web UI only works while the emulator is running) Goto [Settings] in the web page menu (upper right). In the right hand column "Settings file", fill in User ID, Password, and IP address for the HC3. Scroll down to the bottom of the page and click "Save" Hopefully there is now a TQAEconfigs.lua file with the HC3 credentials that the emulator can use. Go back to ZBS and stop the program (Shift-F5) and run it again: ---------------- Tiny QuickAppEmulator (TQAE) v0.30 ------------- [11.10.2021] [09:13:43] | SYS|: Using config file TQAEconfigs.lua [11.10.2021] [09:13:43] | SYS|: Created WebAPI at 192.168.1.18:8976 [11.10.2021] [09:13:43] | SYS|: sunrise 07:14, sunset 17:52 It loads the config file and doesn't complain that there is no connection to the HC3 anymore. Great we are up and running! Supported functions (v0.20) 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.clearTimeout(ref) fibaro.setInterval(ms, func) fibaro.clearInterval(ref) fibaro.emitCustomEvent(name) fibaro.wakeUpDeadDevice(deviceID) fibaro.sleep(ms) net.HTTPClient() net.TCPSocket() net.UDPSocket() net.WebSocketClient() net.WebSocketClientTLS() 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) 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) json.encode(expr) json.decode(string) plugin.mainDeviceId plugin.deleteDevice(deviceId) plugin.restart(deviceId) plugin.getProperty(id,prop) plugin.getChildDevices(id) plugin.createChildDevice(prop) 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:trace(...) QuickApp - self:warning(...) QuickApp - self:error(...) QuickApp - self:updateView(elm,type,value) QuickApp - self:updateProperty(name,value) QuickApp - self:createChildDevice(props,device) QuickApp - self:initChildDevices(table) The idea and reason that I implement an offline emulator for the HC3 is that it is generally speaking a pain to debug a moderately complex QuickApp on the HC3. You are left to using debug statements and it slow you down as you can not set breakpoint and step through the code to understand what logic it is following. With an offline emulator running on a PC/Mac you can use a modern IDE like ZeroBrane or VisualStudio to develop your QA. You can quickly put together 99.9% of your QA and the speed/productivity tripples. When it works in the emulator you can move the code to the HC3 and it will work. No need to develop on the HC3 and accidentally crash the whole box and make your family upset. Here is a video showing a typical workflow. (Note that the Web UI now has a button "Upload" that uploads the QuickApp when it's ready to the HC3) Writing HC3 (HC2) emulators seems to be a hobby for me - but what better thing to do on a vacation? So far I have HC2 Scene emulator - quite ok and feature complete, not actively developed anymore but still works well (not much has happened to the HC2 scene framework lately) HC3 emulator (fibaroapiHC3.lua) - gazillion of features, 9.5k lines - haven't come across any QA it can't run. Also some basic Scene support HC3 micro emulator - ~70 lines of Lua that can run QAs in parallel but have a very limited function support. Developed to prove that we could enhance the call model of QAs without much work Well, the micro emulator got my interest and I have evolved it to a more full featured emulator - Tiny QuickApp Emulator (TQAE). Runs multiple QAs in parallel - can test fibaro.calls between them Supports net.HTTPClient, setTimeout, clearTimeout, setInterval, clearInterval, json.*, class, property Supports QuickApp methods - self:setVariable, self.getVariable, self:updateProperty, self:updateView Supports fibaro.* functions Supports QuickAppChild devices Supports simple web UI to test QuickApp buttons/sliders Supports proxy QA on the HC3 to make to emulated QA interact with QAs running on the HC3 - Real HC3 QAs can call the QA you are running in the emulator. (and you get a real UI too) The main idea is that the emulator could be used as a light weight playground for testing out QAs It's still under 1000 lines with current modules but stuff like json support and the whole fibaro.* sdk requires quite some code so it tends to swell - in any case it's modular. Dependencies on luasocket. (I recommend the free ZeroBrane Studio as it comes with the necessary libraries and is a specialised development environment for Lua) local http = require("socket.http") local socket = require("socket") local ltn12 = require("ltn12") It has an easy structure (I think). There are limitations compared to fibaroapiHC3.lua. Some of the api.* requests will not work as they mostly go to the HC3 and don't take the local QAs into account (except for some /devices/... requests). However if you mostly stick to the fibaro.* calls it will work out quite well. net.HTTPClient is in reality synchronous but simulates asynchronous callbacks. Changes in QA properties will not generate HC3 events. (If you run with HC3 proxy it will) No support for net.UDP,MQTT etc. (yet) ...and the main thing is that the TQAE is more synchronous and don't use the asynchronous I/O that fibaroapiHC3.lua uses. IT's mainly noticeable in http requests that will make the TQAE emulator temporarily block until the requests returns. Advantages compared to fibaroapiHC3.lua. Easier to debug as code is not as asynchronous as it is in the fibaroapiHC3 scheduler. Uses a vanilla fibaro.* implementation only leveraging api.* and __fibaro_* calls, so it should be easy to upgrade if we get new fibaro.* calls. Structure makes it easy to add new libraries etc. It's modular. 2 ways to use the emulator. Include it in your QA code _=loadfile and loadfile("TQAE.lua"){ user="admin", pwd="admin", host="192.168.1.57" } --%%name='Test' --%%id=99 --%%quickVars={x=88,y=99} function QuickApp:onInit() self:debug(self.name,self.id) self:debug("y=",self:getVariable("y")) local n = 5 setInterval(function() n=n-1 if n <= 0 then os.exit() end self:debug("PING") end,1000) end The loadfile at the top loads in the emulator and run your QA. The { ... } table after loadfile("TQAE.lua") is a table with configuration options to the emulator. The emulator needs ip, user and password to access the HC3. If you don't want to type that you can store a config file for TQAE with you standard settings. The default name for the file is "TQAEconfigs.lua" and it can look like return { user="admin", pwd="admin", host="192.168.1.57", verbose=false, modPath = "TQAEmodules/", temp = "temp/" --localModules = {"myModule.lua"} --globalModules = {"UDP.lua"} } However, you still need to call loadfile("TQAE.lua"){} with and empty table. If you would like to have another name of the file you can specify that loadfile("TQAE.lua"){ config = "myTQAEconfigfile.lua" } The config is parameters for the emulator. Then you can also set "parameters" for the individual QAs that you run using --%% directives The --%% directives in your QA code are collected into a Lua table. In the case above { name='Test', id=99, quickVars = { x=88, y=99 } } and if present will be used to add fields to the QA. This is the way to tell what name, id and type you want your QA to have. A special field is quickVars that will be inserted as quickAppVariables of the QA at startup. Note that each field can only be one line. It's easy to startup another QA from within your code _=loadfile and loadfile("TQAE.lua"){ user="admin", pwd="admin", host="192.168.1.57" } --%%name='Test' --%%id=99 hc3_emulator.installQA{id=444,file='MyOtherQA.lua'} -- Load in another QA and set id to 444 function QuickApp:onInit() self:debug(self.name,self.id) fibaro.call(444,"test",5,6) -- call other QA end If the other file is open in the IDE you can set breakpoints in it and jump between the QAs. In fact, hc3_emulator.installQA{id=444,file='MyThirdQA.fqa'} will load in a .fqa file directly. In that case temporary files are stored for each of the files in the .fqa. This means we can do trick like this, downloading a QA from the HC3 and run it in the emulator with one line of code _=loadfile and loadfile("TQAE.lua"){ user="admin", pwd="admin", host="192.168.1.57" } hc3_emulator.installQA{id=700,code=api.get("/quickApp/export/700")} -- Load in QA 700 from HC3 and run it function QuickApp:onInit() self:debug(self.name,self.id) fibaro.call(700,"test",5,6) -- call QA 700 end Another useful directive is --FILE:<filename>,<name>; that allow us to include extra files in our QA. A QA can consist of several files but it must have a 'main' file. The QA code you run in the emulator will always be the main, and then you can include extra files that will be added to the QA as "files". Ex. _=loadfile and loadfile("TQAE.lua"){ user="admin", pwd="admin", host="192.168.1.57" } --FILE:myUtilities.lua,utilities; function QuickApp:onInit() self:debug(self.name,self.id) LOG("This is a test") -- Using global LOG function defined in myUtilities.lua end Use the playground in the emulator This is not as easy as the code needs to be provided as multiline Lua strings. But it's a quick and dirty way to test stuff. See main() in TQAE.lua Examples TBD Running and logs When running there will be output of two types. Standard logging that the QA does with fibaro.debug, self:debug etc,. System debugs, that are the emulators way to inform on what is ongoing. How much the system logs depends on the configuration parameter .logLevel. ---------------- Tiny QuickAppEmulator (TQAE) v0.5 ------------- [29.07.2021] [11:17:34] |SYS |: Loading QA:TestQA1 - ID:1001 Start [29.07.2021] [11:17:34] |SYS |: Starting QA:TestQA1 - ID:1001 [29.07.2021] [11:17:34] [DEBUG] [QUICKAPP1001]: TestQA1 - 1001 Here we se the system log (|SYS |) that the QA is loading and then the log that it's running. The first is when the QA code is loaded and all functions are defined. Also if you do something on top-level, outside functions it will run here. In the example the QA does a print("Start") on top-level of the QA so that is executed when loading. Then, if the QA is successfully loaded, it will be "started, meaning that the function QuickApp:onInit() will be called if it's defined. That's the second SYS log. It's good to pay notice to this. If you get an error before Loading it typically means that you have a syntactic error in the QA code - non-valid Lua code. If you get an error after Loading but before Starting it's something on top-level that is run, outside of function QuickApp:onInit() If you get an error after Starting, well, then it's just something wrong with your code when it runs. A run-time error will look like: [29.07.2021] [12:27:47] [ERROR] [QUICKAPP1002]: [string "temp/main_16546.lua"]:5: attempt to call a nil value (global 'foo') This tells us that the error was in the QA with id 1002 (unless you have changed __TAG) The QA file is 'main'. A QA can consist of many files and this gives us the clue in what file the error was. If you only have one file, its name is 'main'. Then it tells us that is was line 5 where the error occurred ([string "temp/main_16546.lua"]:5:) and then that we tried to call a global variable 'foo' that didn't have a value (a function) So, in the main file look for a foo() call on line 5 - that's the error... Turning up logLevel will also log modules loaded etc. It also sets a Lua global in the QA, LOGLEVEL to the level, so that variable can be used by you to also allow your code to log more or less. Other features A QA can also be saved in a .fqa format that can be uploaded to the HC3 The directive --%%save="myQAs/QA42.fqa" will package and save the QA to myQAs/QA42.fqa when finished. It you have included multiple files with the --FILE: directive they will also be included. A simple way to code and create multi-file QAs. The directive 'interfaces' Ex. --%%interfaces={"power"} will add the interfaces as the initialInterfaces property of the .fqa. An easy way to include and extra interface in the ready .fqa. Emulator options: (set in the header _=loadfile and loadfile("TQAE.lua"){...} ) user=<user> Account used to interact with the HC3 via REST api pwd=<Password> Password for account used to interact with the HC3 via REST api host=<IP address> IP address of HC3 configFile = <filename> File used to load in emulator options instead of specifying them in the QA file. Great place to keep credentials instead of listing them in the QA code, and forget to remove them when uploading codeto forums... Default "TQAEconfigs.lua" debug={ traceFibaro=<boolean> -- default false QA=<boolean>, --default true module=<boolean>, --defaul false module2=<boolean>, --defaul false lock=<boolean>, --default false child=<boolean>, --default true device=<boolean>, --default true refreshStates=<boolean> -- default false } modPath = <path>, Path to TQAE modules. Default "TQAEmodules/" temp = <path> Path to temp directory. Default "temp/" startTime=<time string> Start date for the emulator. Ex. "12/24/2024-07:00" to start emulator at X-mas morning 07:00 2024. Default, current local time. htmlDebug=<boolean>. If false will strip html formatting from the log output. Default true colorDebug=<boolean>. If true will log in ZBS console with color. Default true copas=<boolean> If true will use the copas scheduler. Default true. noweb=<boolean> If true will not start up local web interface. Default false lateTimers=<seconds> If set to a value will be used to notify if timers are late to execute. Default false timerVerbose=<boolean> If true prints timer reference with extended information (expiration time etc) QuickApp options: (set with --%% directive n file) --%%name=<name> --%%id=<number> --%%type=<com.fibaro.XYZ> --%%properties={<table of initial properties>} --%%interfaces={<array of interfaces>} --%%quickVars={<table of initial quickAppVariables>} --%%proxy=<boolean> --%%save=<boolean> Documentation Emulator parameters and QA parameters Web UI - and QA UI Some implementation notes Notes and ToDos Mostly developed as a playground for my own coding and it fits my workflow. I may add features/fix bugs if others are using it - but no more than 500 lines of code
  6. Version 1.0.2

    32 downloads

    About This File Onkyo QuickApp INTRODUCTION Onkyo has a range of network connected Audio/Video receivers that can be controlled via a network UTP connection. This QuickApp provides basic control of the A/V receiver. Tested on an Onkyo TX-NR616. QuickApp should be easy to adapt to other models if required. This is my first QuickApp, any suggestion to make it better highly appreciated. PREREQUISITES Tested on Fibaro Home Center HC3L and Yubii Home with firmware 5.071.52 An Onkyo AV Receiver FEATURES Basic On/Off Volume Control Mute On/Off toggle switch 8 Input selectors, label can be customised using variables 4 Listening Modes On/off line status indicator INSTALLATION Please check provided User Manual. Upload file in the device section. AVAILABLE DOWNLOAD Onkyo 2021-06-23.fqa Icons - found on the forum and slightly adapted TERMS AND CONDITIONS Permission to use, copy, modify and distribute this software and its documentation for educational, research, personal use and non-profit purposes, without fee and without a signed licensing agreement is hereby granted, provided that the copyright notice, with "Terms and conditions" and "Disclaimer" appear in all copies, modifications and distributions. It is strictly forbidden to sell, rent, lease and/or lend this software for profit without prior consent from the Author. DISCLAIMER This software is provided by copyright owner "as is" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the author and distributor be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage. Fibar Group S.A. and their employees are not responsible for support of the ABC VD. VERSION HISTORY 1.0.2 - First public release
  7. Hello, Can someone tell me whether there is a possibility to integrate sensors from Aqara at Fibaro and then use them for scenes? Regards
  8. This QuickApp contains devices of soil moisture, soil temperature and surface temperature, from accumulated temperature and precipitation data from OpenWeather via Agro Monitoring. Soil temperature and moisture are essential indices that allow your customer to adjust irrigation work and prevent crop roots damage. Accumulated temperature and precipitation is essential to make a right decision depends on a threshold setting. Temperature quantity index calculated as the sum of daily temperatures. Humidity quantity index expressed as the sum of daily precipitation. Current soil data is updated 2 times a day. The soil temperature is provided in Kelvins and in this quickapp converted to Celsius (C = K - 273.15) IMPORTANT You need an API key and Polygon ID from https://agromonitoring.com You need to create your Api key and Polygon ID at https://agromonitoring.com/dashboard/dashboard-start After your registration click the "New" button in the top of the "Create polygon" screen. Click on the polygon icon or square icon on the map. Draw your polygon. If you choose a polygon shape icon do not forget to merge the first and last points to finish your polygon. Fill in the "Name" field and click the "Create" button to save your polygon. The API is free up to 60 calls per minute and a total area of polygons of 1000ha See: https://agromonitoring.com/dashboard/dashboard-start See: https://openweathermap.medium.com/dashboard-update-current-and-historical-soil-data-24422fc75c5b What is soil moisture? The science behind the measurement: https://www.metergroup.com/environment/articles/what-is-soil-moisture-science-behind-the-measurement/ Version 0.2 (24th May 2021)) Changed Soil Moisture (child) device from multilevelSensor to humiditySensor with percentage presentation Version 0.1 (22 May 2021) Initial version Variables (mandatory): apiKey = Get your free API key from https://agromonitoring.com polygon = Create your Polygon ID at https://agromonitoring.com/dashboard/dashboard-start interval = [number] in seconds time to get the data from the API timeout = [number] in seconds for http timeout debugLevel = Number (1=some, 2=few, 3=all, 4=simulation mode) (default = 1) icon = [numbber] User defined icon number (add the icon via an other device and lookup the number) Download the QuickApp here (download the file and un-zip): https://github.com/GitHub4Eddy/agro_monitor/archive/refs/tags/agro_monitor-02.zip How to install: Open the Configuration Interface Go to Settings > Devices Click + Choose Other Device Choose Upload File Choose file from your computer with .fqa
  9. Ambee changed their API policy to only paid and a (too) short trial time. This QuickApp gives access to real-time water vapor level of any location in Asia, Europe, North America, Australia and New Zealand by latitude and longitude. Water vapor resolution varies from 1 hour to 2 days, based on the availability of data and the change of data with respect to a particular location. IMPORTANT You need an API key form https://www.getambee.com UPDATE 6th of August 2021: The API is free up to 100 API calls/day for 15 days, with zero limitations on country, access to air quality, pollen, weather and fire data and dedicated support. After 15 days you have to migratie to a paid plan. Variables (mandatory): apiKey = Get your free API key from https://www.getambee.com interval = [number] in seconds time to get the data from the API timeout = [number] in seconds for http timeout debugLevel = Number (1=some, 2=few, 3=all, 4=simulation mode) (default = 1) icon = [numbber] User defined icon number (add the icon via an other device and lookup the number)
  10. Ambee changed their API policy to only paid and a (too) short trial time. This QuickApp gives access to real-time soil moisture (Volumetric Soil Moisture (VSM) level in percentage (%)) and soil temperature (temperature of the soil in celsius (℃)) levels of any location in Asia, Europe, North America, Australia and New Zealand by latitude and longitude. Soil data resolution is set at 7 days (with Ambee). Soil moisture is the amount of water content present in soil. Soil moisture depends on precipitation, temperature, soil characteristics, ground water content and more. Soil temperature affects the soil moisture content. Optimal soil temperature and moisture content is needed for crop yield. IMPORTANT You need an API key form https://www.getambee.com UPDATE 6th of August 2021: The API is free up to 100 API calls/day for 15 days, with zero limitations on country, access to air quality, pollen, weather and fire data and dedicated support. After 15 days you have to migratie to a paid plan. Variables (mandatory): apiKey = Get your free API key from https://www.getambee.com interval = [number] in seconds time to get the data from the API timeout = [number] in seconds for http timeout debugLevel = Number (1=some, 2=few, 3=all, 4=simulation mode) (default = 1) icon = [numbber] User defined icon number (add the icon via an other device and lookup the number)
  11. Ambee changed their API policy to only paid and a (too) short trial time. This QuickApp gives access to real-time pollen count - tree, grass and weed, of any location in Asia, Europe, North America, Australia and New Zealand by latitude and longitude. Pollen is a fine powder produced by trees and plants. Pollen can severely affect people, especially those with different ailments such as asthma and respiratory issues. It can aggravate these existing conditions or cause these issues in high risk groups. Grass Pollen: Pollen grains from grasses. Measuring unit is pollen particles/m³ Tree Pollen: Pollen from trees such as Birch and Oak. Measuring unit is pollen particles/m³ The QuickApp provides a risk evaluation with levels Low - Mild risk to those with severe respiratory issues. No risk for the general public Moderate - Risky for those with severe respiratory problems. Mild risk for the general public High - Risky for all groups of people Very High - Highly risky for all groups of people IMPORTANT You need an API key from https://www.getambee.com UPDATE 6th of August 2021: The API is free up to 100 API calls/day for 15 days, with zero limitations on country, access to air quality, pollen, weather and fire data and dedicated support. After 15 days you have to migratie to a paid plan. Variables (mandatory): apiKey = Get your free API key from https://www.getambee.com interval = [number] in seconds time to get the data from the API timeout = [number] in seconds for http timeout debugLevel = Number (1=some, 2=few, 3=all, 4=simulation mode) (default = 1) icon = [numbber] User defined icon number (add the icon via an other device and lookup the number)
  12. Hi, need to controll Epson projector (send PWR On, PWR Off, PWR?) messages For controllinhg Epson, need to send a command for establishing connection (0x450x530x430x2F0x560x0500x2E0x6E0x650x740x100x030x000x000x000x00) and after that send the command for interogating power status (0x500x570x520x3f0x0d) Testing this from Hercules utility, works great When coding in LUA, after sending first command, when trying to send second command I get Connection reset by peer error If sending just first command, I get a proper response, so, no error in connection or command string Here is my code: function QuickApp:onInit() self:debug("onInit") self.ip = self:getVariable("ip") self.port = tonumber(self:getVariable("port")) self.sock = net.TCPSocket() end function QuickApp:parseData(str) while true do if string.find(str, '0x') then i,j = string.find(str, '0x') str = string.sub(str, 1, i - 1) .. self:fromhex(string.sub(str, i + 2, j +2)) .. string.sub(str, j + 3) else return str end end end function QuickApp:fromhex(str) return (str:gsub('..', function(cc) return string.char(tonumber(cc, 16)) end)) end function QuickApp:connect(successCallback) print("connecting:", self.ip, self.port) self.sock:connect(self.ip, self.port, { success = function() self:debug("connected") successCallback() end, error = function(err) self.sock:close() self:debug("connection error connect", err) end, }) end function QuickApp:init(event) --self:connect() self:send("0x450x530x430x2F0x560x0500x2E0x6E0x650x740x100x030x000x000x000x00", true, "0x500x570x520x3f0x0d") end function QuickApp:send(dataToSend, waitForResponse, pwr) self:connect(function() local dataConverted = self:parseData(dataToSend) local pwrConverted = self:parseData(pwr) self.sock:write(dataConverted) fibaro.setTimeout(1000, function() self.sock:write(pwrConverted) end) self.sock:read({ success = function(data) self:debug("response data:", data) --self.sock:close() end, error = function(err) self:debug("response error wait ", err) --self.sock:close() end }) fibaro.setTimeout(1000, function() self.sock:write(pwrConverted) end) self.sock:read({ success = function(data) self:debug("response data:", data) --self.sock:close() end, error = function(err) self:debug("response error wait ", err) --self.sock:close() end }) end) end Looks like the connection is closed after frist call, but do not know how to keep alive, tried everything Can anybody help me? Regards
  13. This QuickApp monitors your SolarEdge managed Solar Panels. The QuickApp has (child) devices for current Power, solar Power, lastday, lastmonth, lastyear and lifetime energy. The peak power and currency setting are retrieved from the inverter. The readings for lastmonth, lastyear and lifetime energy are automatically set to the right Wh unit (Wh, kWh, MWh or GWh). The energy production is added to the (new) HC3 energy panel. Changes version 1.2 (26th August 2021) Added values update main device to power interface to show usage in Power consumption chart Solved a bug in the lifeTimeData.revenue existence check Changes version 1.1 (21th August 2021) Changed back currentPower measurement to Watt and lastDayData, lastMonthData to kWh (not to mess up statistics in Energy panel or InfluxDB/Grafana installations) Changed Child device currentPower to Main device with type com.fibaro.powerSensor (Watt). So the Main device will show the current power production, no Child device necessary. Changed Child device lastDayData to type com.fibaro.energyMeter (kWh). These values will be shown in the new energy panel. Added automaticaly change rateType interface of Child device lastDayData to "production" Added extra check on apiKey and siteID, if not OK then change to simulation mode SolarEdge Monitor settings currency and PeakPower also available in simulation mode Changed the lastUpdateTime to format dd-mm-yyyy hh:mm Changes version 1.0 (30th July 2021) Total m² solar panels added to log text and label text Check for API existance of lifeTimeData_revenue (not available in older firmware) Automatic conversion added for lastmonthData, lastYearData and lifetimeData production to Wh, kWh, MWh or GWh Automatic conversion added for currentPower to Watt, Kilowatt, Megawatt or Gigawatt (yes, Megawatt and Gigawatt is optimistic) Get the Peakpower and Currency settings from Inverter Peakpower added to label text and child device log text Changes version 0.3 (12th April 2021) Added last update date / time Cleaned up the code Changes version 0.2 (12th April 2021) Disabled revenue value (not for lifeTimeData) Changes version 0.1 (11th April 2021) First (test) version QuickApp variables (mandatory, they will be automatically added with the default values): siteID = Site ID of your SolarEdge installation (see your Inverter Site Details) apiKey = API key of your SolarEdge Inverter (contact your installer if you don't have one) solarM2 = The amount of m2 Solar Panels (use . for decimals) for calculating Solar Power m2 (default = 0) interval = The daily API limitiation is 300 requests. The default request interval is 360 seconds (6 minutes). debugLevel = Number (1=some, 2=few, 3=all, 4=simulation mode) (default = 1) icon = User defined icon number (add the icon via an other device and lookup the number) (default = 0) Tested with: SolarEdge firmware version 4.12.35 and 4.13.40 Download the QuickApp here (download the file and un-zip): https://github.com/GitHub4Eddy/solaredge_monitor/archive/refs/tags/solaredge_monitor-12.zip How to install: Open the Configuration Interface Go to Settings > Devices Click + Choose Other Device Choose Upload File Choose file from your computer with .fqa
  14. QA for full control of PC from HC3 (On, Off, Restart, Sleep and Hibernate states) You will need: 1. PC is connected via Fibaro wall plug (or other device with power measurement) 2. installed application Switch Off 3.5.1 from Airytec on your computer http://www.airytec.com/en/switch-off/get.aspx 3. In Switch Off application - go to menu -> Options -> Remote -> Edit web interface settings -> you have to define your port ie. 28100 and password 4. In PC firewall you have to allow Incoming rule for TCP port that you have defined in SwitchOff application ie.28100 5. Working WakeOnLAN (WOL) on your PC (allowed in PC BIOS and on your net card) Installation: 1. Upload this QA to HC3 2. In QA variables you have to define: - PC_DevID : ID of your PC power plug in HC3 - PCAirytecPort: port define for web interface in SwitchOff application from Airytec - PCAirytecPassw: password define for web interface in SwitchOff application from Airytec - PC_IP_Address: IP address of your PC ie. 192.168.1.10 - PC_MacAddress: MacAddress of your PC for WakeOnLAN (WOL) ie. 4B:BC:24:D1:E5:25 - PC_WOL_Port: Port for WakeOnLAN (WOL) - usually 9 - Level<xxx>PC : power in W for showing correct PC state: power >= LevelRunPC PC state: running power >= LevelSleepPC PC state: sleeping power >= LevelHiberPC PC state: hibernating power >= LevelOffPC PC state: off power = 0 PC state: fully off (power>0 to LevelOffPC also means PC state: off) QA PC version: 0.20 - 13.2.2021 PC.fqa
  15. QA for creating HomeTable in global variables in HC3. Why using hometable? Instalation: 1. upload this QA 2. In QA variables you can change name for hometable, name for scenes and time for regular update of hometable 3. In QA -> source files -> ManualData you can add your own data (it will be also saved in final hometable in global variables) How to read data from hometable: -- in case that your name for hometable is default=HomeTable local tbl = fibaro.getGlobalVariable("HomeTable") local HT = json.decode(tbl) -- structure for devices is <room>.<deviceName> local idQA_TV=HT.LivingRoom.TV -- structure for scenes is <ScenesName>.<sceneName> -- default value for <ScenesName> is Scenes local idSc_Lights=HT.Scenes.Lights -- structure for your own inputs from ManualData local myValue1=HT.myData1.myNameValue1 -- 0 local myValue2=HT.myData1.myNameValue2 -- "default value" Names for rooms, devices and scenes are corrected by following replaces: {["%."]="",["-"]="",["%("]="",["%)"]="",["&"]="",[":"]="",["%["]="",["%]"]="",["%+"]="",["%%"]="",["%/"]="",["%$"]=""} {["Á"]="A",["Ä"]="A",["Ą"]="A",["À"]="A",["Â"]="A",["Č"]="C",["Ć"]="C",["Ç"]="C",["Ď"]="D",["É"]="E",["Ě"]="E",["Ë"]="E",["Ę"]="E",["È"]="E",["Ê"]="E",["Í"]="I",["Ï"]="I",["Î"]="I",["Ĺ"]="L",["Ľ"]="L",["Ł"]="L",["Ň"]="N",["Ń"]="N",["Ó"]="O",["Ô"]="O",["Ö"]="O",["Ő"]="O",["Œ"]="O",["Ŕ"]="R",["Ř"]="R", ["Š"]="S",["Ś"]="S",["Ť"]="T",["Ú"]="U",["Ů"]="U",["Ü"]="U",["Ű"]="U",["Ù"]="U",["Û"]="U",["Ý"]="Y",["Ÿ"]="Y",["Ž"]="Z",["Ż"]="Z",["Ź"]="Z",["á"]="a",["ä"]="a",["ą"]="a",["à"]="a",["â"]="a",["č"]="c",["ć"]="c",["ç"]="c",["ď"]="d",["é"]="e",["ě"]="e",["ë"]="e",["ę"]="e",["è"]="e",["ê"]="e",["í"]="i",["ï"]="i",["î"]="i",["ĺ"]="l",["ľ"]="l",["ł"]="l",["ň"]="n",["ń"]="n",["ó"]="o",["ö"]="o",["ô"]="o",["ő"]="o",["œ"]="o",["ř"]="r",["ŕ"]="r",["š"]="s",["ś"]="s",["ť"]="t",["ú"]="u",["ů"]="u",["ü"]="u",["ű"]="u",["ù"]="u",["û"]="u",["ý"]="y",["ÿ"]="y",["ž"]="z",["ż"]="z",["ź"]="z"} Hometable in global variables will be overwrite only if newly generated hometable will be different. Version of QA HomeTable: 0.12 - 21.1.2021 HomeTable.fqa
  16. QA for Netio power sockets devices. https://www.netio-products.com/en Tested for NETIO 4All and NETIO 4C Installation: 1. In Netio you have to allow JSON API and setup user and password for READ-WRITE: 2. Name, password and IP address you have to add to Variables in QA and save it. (LoginName=Username, LoginPassword=Password) 3. You can also create child devices for every socket. Netio QA version: 0.50 - 13.2.2021 Netio.fqa NetioIcons.zip
  17. This Quickapp retrieves power consumption, solar production, gas usage and water flow from the Iungo Monitor, Solarpanel and Watermeter (Child) Devices for Consumption, Production, Solar Power, Water Flow, Consumption High, Consumption Low, Production High, Production Low, Total Gas and Total Water FLow Version 1.1 (11th September 2021) Changed the Child Devices Consumption High, Consumption Low, Production High and Production Low to device type energyMeter to facilitate the new Energy Panel Added automaticaly change rateType interface of Child device Consumption High and Low to "consumption" and Production High and Low to "production" Changed the Main Device to device type powerSensor to show the power graphs Added Net Consumption to the value of the Main Device Changed the Child Devices Consumption, Production and Solar Power to device type powerSensor to show the power graphs Changed the Water Flow unit text from m³ to Litre Added the amount of m2 Solar Panels to the log text ot the Child Device Solar Power and to the labels Changed meterreading to automatically kWh, MWh of GWh Moved tarif informatie to main device log text Added Meter measurement for Consumption High, Consumption Low, Production High, Production Low, Gas and Water to reset the measurements Added Meter measurement Date for Consumption High, Consumption Low, Production High, Production Low, Gas and Water Removed Refresh button Added some extra debug information when debug level = 3 Version 1.0 (6th February 2021) Now also supports Iungo Solarpanel and Iungo Watermeter Added a lot of Child devices Added QuickApp Variable for user defined icon Mother Device Added QuickApp Variable for Solar Power m2 Removed calculation and storage of energy consumption of Fibaro devices Version 0.6 (22nd January 2021) Now also supports Iungo basic version Version 0.5 (21 January 2021) Initial version QuickApp variables (mandatory, they will be automatically added with the default values): IPaddress = IP address of your Iungo Monitor solarPanel = true or false for use of the SolarPanel module (default is false) waterMeter = true or false for use of the Watermeter module (default is false) interval = Number in seconds, the Lungo Monitor normally is updated every 10 seconds solarM2 = The amount of m2 Solar Panels (use . for decimals) for calculating Solar Power m2 debugLevel = Number (1=some, 2=few, 3=all, 4=simulation mode) (default = 1) meterConsHigh = Last meter measurement Consumption High meterConsLow = Last meter measurement Consumption Low meterProdHigh = Last meter measurement Production High meterProdLow = Last meter measurement Production Low meterGas = Last meter measurement Gas meterWater = Last meter measurement Water meterConsHighD = Date last meter measurement Consumption High meterConsLowD = Date last meter measurement Consumption Low meterProdHighD = Date last meter measurement Production High meterProdLowD = Date last meter measurement Production Low meterGasD = Date last meter measurement Gas meterWaterD = Date last meter measurement Water Tested with: Iungo lite version Firmware Rev 3683 (07-01-2021) Download the QuickApp here (download the file and un-zip): https://github.com/GitHub4Eddy/iungo_monitor/archive/refs/tags/iungo_monitor-11.zip How to install: Open the Configuration Interface Go to Settings > Devices Click + Choose Other Device Choose Upload File Choose file from your computer with .fqa
  18. Hello, I found a project who reverse engineered the Wi-Fi protocol from the Mertik controller connected to my fireplace. Yeay! ? With the following (simplified) NodeJS code I can send the standby command to my fireplace: var net = require('net'); const prefix = '0233303330333033303830' var msg = "3136303003"; var packet = Buffer.from(prefix + msg, 'hex'); var client = new net.Socket(); client.connect(2000, '192.168.1.1'); client.write(packet); I know how to open a socket in HC3 QA but I don't get how to convert the message to a RAW buffer. The JavaScript line does it with Buffer.from(prefix + msg, 'hex'); Does some LUA god know how to convert the message in QA LUA for the HC3?
  19. Hi In a Quick App UI i can define a slider. https://manuals.fibaro.com/home-center-3-quick-apps/ function QuickApp:updateViewSample() self:updateView("label1", "text", "Device on") -- updating the text for 'label1'. self:updateView("button1", "text", "on") -- updating the text for 'button1'. self:updateView("slider1", "value", "99") -- updating the text for 'slider1'. end Is there a way to set properties on the slider - if i want to pre-define that that value accepted should be 0-5 ?
  20. Generic Fibaro HC3 Alarm system Hi Luabuilder Sharing is Caring I have see a lot of talk using Fibaro HC3 for Alarm system. I love the idea - i want that, so i tried to describe what a Generic Alarm system should be build of. Several people already tipped in with things they made og thoughts they have, issues they identified. Why invent the wheel when great tuff already has been made. @jgab has created the EventRunner4 and ChildrenOfHUE - All-in-one QA framework for HC3 - this can be used for arming and disarming the alarm - An example is provided here @10derand @JcBorgs described issue about HC3 is missing the "disable alarmExclude" - a “pre-check” for sensors before arming ALARM is needed What a good way to solve this - I way thinking of enhancing the doorstatus QA (below) ? And @FBerges already shared his version of an alarm system @Mateo created a Siren Quick APP And probably many more worked on their own solution to create a ALARM SYSTEM. Please tip IN if there is elementary features ? - that is missing for a generic HC3 Alarm! How would you structure this? ? - ONE Quick APP with everything, Variable for customising? or a QA with Scenes and Eventrunner4? Another useful idea that could be used, is the status for open windows and doors. This QA changes the Color in the matrix Bulb when a door or windows is opened. Doorstatus.fqa @10der learned me about getting the sensor possibilities with print(json.encode((api.get("/devices/hierarchy")))) com.fibaro.windowSensor com.fibaro.doorWindowSensor com.fibaro.doorSensor Perhaps some of the forum experts could create some overall structure and point the learners in right direction? ? ? Desired Functionality In case of alarm not armed Geofence • Ongoing control - have all users left the house? Message on Telephone (s) that the house is empty and the alarm is not active For ARMING the Alarm • Message on Telephone (s) about which windows are not closed. Message format Section, room, Sensor Message on Telephone (s) about which doors are not closed Message format Section, room, Sensor Message on Phone (s) When alarm is active and which Zone. Message could be Fibaro APP push, or Telegram Delay to get out the door Use a Keypad like Matrix for ARM - ala triple cut on one button and subsequently double click on another. This feature is already made by @Jgab in Eventrunner4 Use Fibaro APP for ARM LED/Bulb for show Status ARMED – I will probably use MATRIX ZDB LED in the perimeter to changes to RED By Disarm the Alarm Message on Phone (s) alarm is deactivated and if other Zones are active LED/Bulb for show Status DisARMED – I will probably use MATRIX ZDB LED in the perimeter to changes to GREEN, but could be a HUE Bulb Use Matrix for DisARM - like triple cut on one button and subsequently double click on another. This feature is already made by @jgab in Eventrunner4 Use Fibaro APP for DisARM For Alarm ACTIVE Internal sirens are triggered External sirens are triggered Light with alarm status, flashes 1 Hz SONOS speech - sound. Could be by using the Quick App - Sonos Zone Controller Message on Telephone about which device has triggered alarm - Section, room, Sensor
  21. If I restore a dead device connected to the HC3 through the mobile app. Then the device recovers immediately after the push of the button. But if I do the restore by code (in a HC3 QuickApp) then the device does not restore. I use (wakeUpDeadDevice(deviceID)) for this. local parentID = 201 fibaro.wakeUpDeadDevice(parentID) fibaro.sleep(1000) fibaro.call(parentID,'turnOn') Is there any other code similar to the code the mobile app uses?
  22. How are y'all updating your QuickApps? If it's just a one instance, it's easy; that's the one I'm working on. But I have my app 7 times in HC3 and going manually over all and copy-pasting new code seems pretty dumb.
  23. QA for Philips Hue devices (for HC3 5.040 GA or above): - support of philips hue lights, switches and sensors (motion, temperature, light) and some ikea lights connected to hue bridge - unlimited number of hue bridges - all logic and setup are centralized in QA HueMain - creating of hue devices via click on buttons in HueMain - a lot of parameters for advanced users - automatic update of all devices in case of new versions - centralized setting of favorite buttons,colors and icons (also possibility to override settings via local variables in every QAs) - power consumption calculation for lights - supported languages: en,cz,de,se,nl,sk,fr,ru,it,pl Installation: 1. Download HueMain.fqa 2. Install HueMain.fqa to HC3 3. In Variables in HueMain you have to setup: - HueBridgeName1 - you can choose any name of your bridge - it can be whatever – allowed characters: a-z, A-Z, 0-9, _ - for example MyBridge1 - HueBridgeIP1 - IP address of your bridge for example 192.168.1.200 - Save variables - HueMain should start if everything is OK 4. And than you have 2 options: a) you know your user in bridge - you can add it to Variables - item HueUser1 ie.vPCj123VmJ18uWSHqpXfidxq5sjsP1q4Wi6DiCm b) you can create user in HueMain - last part - button Create user (you will need physical access to your Hue bridge and press button there) + save/restart 5. HueMain should run (if everything is OK) and show your hue devices in menu 6. You can create QAs for group of lights, lights and sensors in menu in HueMain Files: 1. QA - HueMain HueMain20210307_300.fqa 2. Icons: Icons20200928.zip HOW TO CALL from other QAs or Scenes: -- for calling from other QAs: fibaro.call(QAID_HueMain, "HueCommands", {type='Hue', action='setscene', deviceID=QAID_HueLight, value='TVmugOA8rAACGGj',transitiontime=0}) -- for calling from scenes (you have to add json.encode): fibaro.call(249, "HueCommands", json.encode{type='Hue', action='setscene', deviceID=500, value="Sb3tQguuEpnV0gO", transitiontime=0}) --[[ -- QAID_HueMain and QAID_HueLight have to be numbers -- light on fibaro.call(QAID_HueMain, "HueCommands", {type='Hue', action='on', deviceID=QAID_HueLight}) -- light on with transition time fibaro.call(QAID_HueMain, "HueCommands", {type='Hue', action='on', deviceID=QAID_HueLight, transitiontime=0}) -- light off fibaro.call(QAID_HueMain, "HueCommands", {type='Hue', action='off', deviceID=QAID_HueLight}) -- light on with transition time fibaro.call(QAID_HueMain, "HueCommands", {type='Hue', action='off', deviceID=QAID_HueLight, transitiontime=0}) -- light on with setting of brightness (in value), if value<2 then value=100, value=<0,100> fibaro.call(QAID_HueMain, "HueCommands", {type='Hue', action='on_bri', deviceID=QAID_HueLight, value=50}) -- setup of brightness (in value) and also if value is 0 then Light off - in other cases Light on, value=<0,100> fibaro.call(QAID_HueMain, "HueCommands", {type='Hue', action='brightness', deviceID=QAID_HueLight, value=50}) fibaro.call(QAID_HueMain, "HueCommands", {type='Hue', action='brightness', deviceID=QAID_HueLight, value=50, transitiontime=0}) -- light toggle based on last refreshed data from hue bridge (fast method, in some cases can be inaccurate) fibaro.call(QAID_HueMain, "HueCommands", {type='Hue', action='toggle', deviceID=QAID_HueLight}) -- light toggle based on new request from hue bridge (slower method but accurate) fibaro.call(QAID_HueMain, "HueCommands", {type='Hue', action='toggle2', deviceID=QAID_HueLight}) -- light toggle based on last refreshed data from hue bridge (fast method, in some cases can be inaccurate), brightness is in value <0,100> fibaro.call(QAID_HueMain, "HueCommands", {type='Hue', action='toggle_bri', deviceID=QAID_HueLight, value=50}) -- light toggle based on new request from hue bridge (slower method but accurate), brightness is in value <0,100> fibaro.call(QAID_HueMain, "HueCommands", {type='Hue', action='toggle_bri2', deviceID=QAID_HueLight, value=50}) -- setup of color (in value), value=<0,100> fibaro.call(QAID_HueMain, "HueCommands", {type='Hue', action='color', deviceID=QAID_HueLight, value=50}) fibaro.call(QAID_HueMain, "HueCommands", {type='Hue', action='color', deviceID=QAID_HueLight, value=50, transitiontime=0}) -- setup of saturation (in value), value=<0,100> fibaro.call(QAID_HueMain, "HueCommands", {type='Hue', action='saturation', deviceID=QAID_HueLight, value=50}) fibaro.call(QAID_HueMain, "HueCommands", {type='Hue', action='saturation', deviceID=QAID_HueLight, value=50, transitiontime=0}) -- setup of color temperature (in value), value=<0,100> fibaro.call(QAID_HueMain, "HueCommands", {type='Hue', action='colortemp', deviceID=QAID_HueLight, value=50}) fibaro.call(QAID_HueMain, "HueCommands", {type='Hue', action='colortemp', deviceID=QAID_HueLight, value=50, transitiontime=0}) -- setup of color via RGB (in colorR, colorB, colorB <0,254>), brightness is in value=<2,100> fibaro.call(QAID_HueMain, "HueCommands", {type='Hue', action='colorRGB', deviceID=QAID_HueLight, colorR=10, colorG=200, colorB=100, value=100}) fibaro.call(QAID_HueMain, "HueCommands", {type='Hue', action='colorRGB', deviceID=QAID_HueLight, colorR=10, colorG=200, colorB=100, value=50, transitiontime=0}) -- setup of hue light based on global setting in Hue Main for button Color 1 to button Color 5 fibaro.call(QAID_HueMain, "HueCommands", {type='Hue', action='setcolor', deviceID=QAID_HueLight, typebutton='color1'}) -- setup of hue light based on global setting in Hue Main for favourite button 1 to button 5 fibaro.call(QAID_HueMain, "HueCommands", {type='Hue', action='setbutton', deviceID=QAID_HueLight, typebutton='button5'}) -- setup of hue light based on standard Philips Hue commands and values fibaro.call(QAID_HueMain, "HueCommands", {type='Hue', action='set', deviceID=QAID_HueLight, ParamHue={"on":true,"hue":0,"sat":254,"bri":254}}) fibaro.call(QAID_HueMain, "HueCommands", {type='Hue', action='set', deviceID=QAID_HueLight, ParamHue={"on":true,"bri":254,"xy":[0.3651,0.3719]}}) -- setup scenes - sceneID is in value fibaro.call(QAID_HueMain, "HueCommands", {type='Hue', action='setscene', deviceID=QAID_HueLight, value='TVmugOA8rVWCGGj'}) -- setup color loop efect - start fibaro.call(QAID_HueMain, "HueCommands", {type='Hue', action='colorloopstart', deviceID=QAID_HueLight}) -- setup color loop efect - stop fibaro.call(QAID_HueMain, "HueCommands", {type='Hue', action='colorloopstop', deviceID=QAID_HueLight}) -- set hue scene for lights fibaro.call(QAID_HueMain, "HueCommands", {type='Hue', action='setscene', deviceID=QAID_HueLight, value=hueSceneID, transitiontime=0}) fibaro.call(QAID_HueMain, "HueCommands", {type='Hue', action='setscene', deviceID=QAID_HueLight, value='TVmugOA8rAACGGj', transitiontime=0}) -- enabling of motion sensor fibaro.call(QAID_HueMain, "HueCommands", {type='Hue', action='configon', deviceID=QAID_HueMotionSensor}) -- disabling of motion sensor fibaro.call(QAID_HueMain, "HueCommands", {type='Hue', action='configoff', deviceID=QAID_HueMotionSensor}) -- alerts fibaro.call(QAID_HueMain, "HueCommands", {type='Hue', action='alerttoggle', deviceID=QAID_HueLight}) fibaro.call(QAID_HueMain, "HueCommands", {type='Hue', action='alertstart', deviceID=QAID_HueLight}) fibaro.call(QAID_HueMain, "HueCommands", {type='Hue', action='alertstop', deviceID=QAID_HueLight}) fibaro.call(QAID_HueMain, "HueCommands", {type='Hue', action='alertstart2colors', deviceID=QAID_HueLight, color='"sat":254, "bri":254, "hue":65535', color2='"sat":254, "bri":254, "hue":46530'}) fibaro.call(QAID_HueMain, "HueCommands", {type='Hue', action='alertstart', deviceID=QAID_HueLight, color='"sat":254, "bri":254, "hue":0'}) fibaro.call(QAID_HueMain, "HueCommands", {type='Hue', action='alertstart', deviceID=QAID_HueLight, color='"sat":254, "bri":254, "hue":46530'}) --]] How to add icons where is not direct QA support for icon selection - for example for QA Hue Switches: There is not possible to change icon for switch via user interface but you can do it via my QA: 1. you have to upload icons for hue switch: In HueMain - tab General - add Icon Select your user icons and save it. You don't need to change icon for your HueMain 2. You need to get icon number - user icon has number with 4 digits (I hope that you don't have more 9999 icons currently ) right click on icon in your browser and select save picture - there will be - ie. User1007.png - your icon number is 1007 (in some of icons ie. for lights you can see longer number ie. User1018100.png, always use only first 4 digits - 1018 3. In HueMain - tab Variables - add your icons number to IconSwZLLxxx (default icon is 0) or IconSwZGPxxx based on your hue switch type - btw. you can set also default icons for all your hue devices 4. Save your variables and HueMain will be restarted and your HueQAs will have new nice icons
  24. Is there a way to get a notification into a QuickApp whenever given devices changes? I.e. register for changes from device ID xyz using callback in "init" method of QuickApp and then when the value changes the callback method will be called. I know I can poll the device every now and then, but polling seems to be waste of resources given a simple callback style programming would solve it nicely.
  25. Locally I can place the current class (self) in a variable and call an Object in this class. This code is working (localy): function QuickApp:onInit() local sender = {value='Yes', class=self} sender.class:localPrintValue(sender.value) end function QuickApp:localPrintValue(value) if value == nil then value = 'No' end self:debug('Can I print this : '..value) end [15.09.2020] [13:22:42] [DEBUG] [QUICKAPP105]: Can I print this : Yes If I send this variable to another class using fibaro.call(id, 'action', variable) , the call disappears into the darkness. Calling the Object in the other class(QuickApp) results in calling the nil value? !!! This next code is (because of the class=self) not working: fibaro.call(qaID,"updateMyProperty", {value=newValue, class=self}) function QuickApp:updateMyProperty (sender) local value = 0 if type(sender) == 'table' then -- Call comes from elsewhere.. value = sender.value self:debug('Device updated from: '..tostring(sender.class.id)..'.'..tostring(sender.class.name)..' with value: '..tostring(value)) else value = sender self:debug('local call, with value: '..tostring(value)) end end This is a pity because I would like to indicate in the called class where the call was coming from. Now I solve this by sending a table with : sender = {id=self.id, name=self.name, value=newValue}. Do I do something wrong? or has Fibaro disabled the oop function for sending object classes?
×
×
  • Create New...