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 'hc3'.

  • 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
    • 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


  • 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





  1. 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 - 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
  2. Hi, I have been adding my fibaro dimmers to my new fibaro HC3. When I add my Dimmer1s, they show up on the devices table with a Role of "dimmer 2" and in General it shows the Type as "com.fibaro.FGD212" When I add my Dimmer2s they show up as either "Dimmer 2" like above (what I would expect) or some get added with a Role of "Multilevel switch", and in General it shows the Type as "com.fibaro.multilevelSwitch". Why are the Dimmer2 being added as "Multilevel switch"? Does it matter? Am I adding them wrong? The "Multilevel switch" has only 41 parameters the Dimmer2 has 59. What am I missing? Thanks Rut.
  3. Configuration: - RGBW led strip connected to RGBW 2 controller + monostable (GIRA) wall switch - HC3 - Fibaro iOS mobile app System by default use "white" colour through mixing only RGB channel from RGBW led strip and white (W) chanell is not use (turned off) . If you want to use white colour from your RGBW led strip you have to define white colour ( #000000) by yourself in fibaro web application. All is fine if you are use such a configuration and use only wall switch. When you changed led colour (i.e. yellow, magenta, blue, green or whatever) through mobile application you will not be able turn on/off led light with your wall switch. It doesn't work any reaction from led strip To "fix" this issue you have to login to web application and choose once again earlier defined white colour ( #000000). Have you ever meet such a problem/bug ? Thank you
  4. How do I create a Global Variable from LUA in HC3? I'm trying to create a light dimmer function for Philips HUE using a Logic Group Matrix ZDB5100 switch so when I hold the Button its starts dimming up or down. But to keep track if the button is released and pressed again I need to keep track of the direction from last time it was pressed. So I'm thinking of using an Enumerated global variable "dimDirection" that can be set to Up or Down. I want the code to create the variable if not present. My working code whiteout remembering dimDirection is here https://pastebin.pl/view/d74c93bb In HC2 i used this snippet of code. But how is it in HC3 ? local ProjectorStatus = {On="Tændt", Off="Slukket"}; -- in code you then declare predefined global variable using users mapped values: local varName = { ["Projector"] = { value = ProjectorStatus.On, isEnum = true, isTable = false, enumValue = {ProjectorStatus.On, ProjectorStatus.Off} }, } function checkGlobalVariable(varName) -- Check if variable exist for i , v in pairs(varName) do if fibaro:getGlobalValue(i) == nil then api.post("/globalVariables/", { name = i }); fibaro:sleep(400) api.put("/globalVariables/"..i, { name = i, value = v.value, isEnum = v.isEnum, enumValues = v.enumValue }) if v.isTable then ok, msg = pcall(function() wT = json.decode(fibaro:getGlobalValue(i)) if type(wT) ~= "table" then error() end end ) if not ok then fibaro:debug("ERROR - Creating table was unsuccessful, error code: "..msg) else fibaro:debug("Variable '"..i.."' created successfully."); end else if fibaro:getGlobalValue(i) ~= nil then fibaro:debug("Variable '"..i.."' created successfully."); else fibaro:debug("ERROR - Variable '"..i.."' was NOT created!") end end end -- update all predefined global variables in case user changed default values if v.isEnum then fibaro:debug("Variable '"..i.."' allready exists."); local value = fibaro:getGlobalValue(i) for i,m in pairs(v.enumValue) do if m == value then v.value = value end end if v.value == value then fibaro:debug("For variable '"..i.."' found current value ("..value..") and will keep it") else fibaro:debug("For variable '"..i.."' NOT found current value, will set default value ("..value..")") end api.put("/globalVariables/"..i, { name = i, value = v.value, isEnum = v.isEnum, enumValues = v.enumValue }) fibaro:sleep(400) end end updateVar = true end checkGlobalVariable(varName)
  5. Anybody having success updating motion sensor to 3.4 from 3.3 on HC3? My update is basically forever in this state. Of course I did manual wake up of the device, but still 0%. Any ideas where (some API) to look for more information?
  6. A thread to share some coding techniques for QuickApps? Because QAs 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 QAs. 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 Here is Fibaro's manual for WebSocket 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... what makes them tick? Also a tutorial on using classes in QuickApps here... All functions and variables available in the QuickApp Lua environment 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 QA Toolbox. A modular toolbox of add-on functions to QAs that makes it easier to develop QAs 'basic' - Generic QA functions for loggin, loading modules, and management - used by all other modules. (some documentation) 'childs' - QA functions to easily manage quickAppChild devices. Loading, saving state, getting UI events etc. 'events' - QA functions for defining event handlers and structuring your code accordingly. Makes it easy to setup timers in various ways... 'triggers' QA functions for recieving triggers like Scenes do. The events module will receive triggers if loaded, but own handler can be defined. 'rpc' - QA functions for declaring (synchronous) remote functions from other QAs files - QA functionality for copying files between QAs pubsub - QA functions for event publish/subscribe... ui - QA functions for manipulation the UI elements of a QA lua parser/compiler - QA function for emulating loadstring and evaluating Lua expression from strings profiler - Functions for timing code used in QA Reading label/button/slider values. Sha2.lib crypto libs for HC3 (MD5, HMAC, SHA-1, SHA-224, SHA-256, SHA-512/224, SHA-512/256, SHA-384, SHA-512, SHA3-224, SHA3-256, SHA3-384, SHA3-512, SHAKE128, SHAKE256) @tinman aes crypto lib @tinman List of HC3 device types and interfaces @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...
  7. Hello, I'm trying to "convert" this LUA script in a scene, but my trouble cames from the fact that I don't know how to send an http request in a scene. Here is the script I use in a device (and it works find): local texte = string.format("%s %s", tostring(os.date('%H:%m', os.time() )), "HC3 : This is a test.") local address = string.format("", "black", "white",texte) http:request(address, { options={ method = 'GET' }, success = function(response) print(response.data) end, error = function(error) self:debug('error: ' .. json.encode(error)) end }) The goal, is to send a time stamped notification in a remote web server when a scene is launch, but maybe I'm on a wrong way ? Thanks for your help. Alex.
  8. I want to know how to integrate HC3 with Broadlink RM4 PRO? If anyone created Quick apps for Broadlink devices could you please share with me the details?
  9. Hello, I'm a newbee with Fibaro. I have a Fibaro Home Center 3, and created my Fibaro ID. Once I try to integrate Fibaro into Google home, the link is not created between them 2. I tried several times, I do not have any error message... But Fibaro is not added as a service into Google home (neither as a device...). I searched for tips in the web, but nothing I found gives a solution. Do you have any idea on how to proceed ? Thank you for your help.
  10. Dzień dobry Jak już wszyscy wiemy nawet w najnowszej wersji 5.070.42 integracja z SATEL działa nie najlepiej - centrala odczytuje staw wejść z satela ale wyjścia dla scen są nie widoczne, zmiany ich stanu nie pokazuje również historia HC3. Można natomiast włączyć i wyłączyć wyjście SATELa ręcznie z poziomu HC3. Ciekawostką jest również możliwość przydzielania ikon do wejść gdzie system pozwala na wprowadzenie i zmianę ikony jednak po dokonaniu tej czynności ikona nadal pozostaje systemowa. Natomiast przy wyjściach satela HC3 umożliwia skuteczną zmianę ikony - ? Jesteśmy ponad rok po wyjściu HC3 na rynek gdzie integracja z SATELem była kluczową funkcjonalnością a tu okazuje się że nie działa. Czy można prosić kogoś z Fibaro o komentarz bo wydaje się to ważna funkcjonalność na którą czeka wielu nabywców HC3 szczególnie tych którzy przesiedli się z działającej doskonale z Satelem HC2.
  11. Hi all!! Thank you all for this forum and all nice people that helping eachother out. Now its my turn to ask a question regarding LUA scripting, a script that makes my system to stall within 24h What the script basicaly does is that it checks if doors, windows, motionsencors etc is open or closed and then send it to a QA but also to a global value from a standard LUA scene. I am running the QA on diffrent screens in my home to so i get a nice view of what´s going on. The global value i pick up then i am arming the house and sending it to a a TTS-script. Always nice to hear a voice that tells me that a window is open etc... when i am leaving. But i think something is draining resources, i have tried to only activate the script via Conditions and Triggers, but also via a loop with diffrent sleep times. It does not say in Diagnostics that i am out of recourses se my sample below short version (The script works fine but after aprox 24h HC3 stalls or not working as expected ). How can i do it better ? ::BEGIN:: local var = {}; local debug = 1; ----------------WINDOWS------------ local Windows = ""; local WindowsAlarm = ""; local WindowsLiving = ""; local WindowsLivingAlarm = ""; local WLiving = fibaro.getValue(249, "value"); --...and 6 more sencors ----------------DOORS------------ local Doors = ""; local DoorsAlarm = ""; local Freezer = "" ; local FreezerAlarm = "" ; local DFreezer = fibaro.getValue(355, "value") ; --...and 10 more sencors ----------------MOTION---------- local Motion = ""; local MotionAlarm = ""; local Kitchen = ""; local KitchenAlarm = ""; local MKitchen = fibaro.getValue(21, "value"); --...and 7 more sencors ----------------Switches 1st and 2nd floor---- --...About 30 switches ----------------TEMPS---------------------- --... collecting temps round house ----------------Secure-------------------- local SecureFrontdoor = " " local Parm = " " -- ...Checking if frontdoor is locked and if it is armed etc... ----------------Garage-------------------- -- ... same with garage local Garage = "Garage : " ..IR ..Outlet ..Mainlight ..Port ----------------Setting Variable--------- if WLiving == true then WindowsLiving = "Livingroom" WindowsLivingAlarm = "Vardagsrums fönster, " end; if DFreezer == true then Freezer= "Frys, " FreezerAlarm = "Frysdörr. " end ; if MKitchen == true then Kitchen = "Köket, " KitchenAlarm = "Rörelse i köket, " end; if fibaro.getValue(30, "value") == true then sink = fibaro.getName(30)..", " end; -------------CONSOLIDATE --------------- Windows = "Fönster: " ..WindowsLiving .." " .. Bathroom; -- for screens QA var.WindowsAlarm = WindowsLivingAlarm ..BathroomAlarm; Doors = "Dörrar: " ..Refrigerator .." "..StoreTrash ; -- for screens QA var.DoorsAlarm = RefrigeratorAlarm ..StoreTrashAlarm ; Motion = "Rörelse:" ..Kitchen .." "..Shower ; -- for screens QA var.MotionAlarm = KitchenAlarm ..ShowerAlarm ; -- .. and some more... -------------SEND UPDATES---------------------------------------------------------------------- fibaro.call(103,"updateView","windows","text", Windows); fibaro.call(103,"updateView","doors","text", Doors) fibaro.call(103,"updateView","detectors","text", Motion); fibaro.call(103,"updateView","avgtemp","text", avgtemp) ; fibaro.call(103,"updateView","secure","text", SecureFrontdoor .." " ..Parm ); fibaro.call(103,"updateView","garage","text", Garage) ; fibaro.call(103,"updateView","first","text",first) ; fibaro.call(103,"updateView","second","text",second) ; fibaro.setGlobalVariable('Status',json.encode(var)) -------------DEBUG-------------- ------Loop Me ------------------ fibaro.sleep(5*1000); goto BEGIN
  12. Current version: 1.5.1 Date: 17/12/2021 FUNCTIONS The functions of this Quick App are: Allowing to control Sonos Player from Home Center 3. It does support basic and advanced functions: Basic Transport Control Initiate playback Toogle, Pause or Stop playback Skip to the previous or Next track Basic Rendering Control Get player volume and mute state Set player volume to a specific level and unmute the player if muted Increase or decrease player volume Get or Set or Toggle player mute state (Mute or unmute the player) Get or Set or Toggle player loudness state Device Properties Get or Set group LED state Restart the QA Device Enable Debug Mode See Changelog / Manual for basic and advanced available actions Examples: Set player volume to a specific level and unmute the player if muted. fibaro.call(ID_QUICKAPP, "setVolume", 10, "Master") Increase or decrease player volume. fibaro.call(ID_QUICKAPP, "setRelativeVolume", -5, "Master") Initiate playback. fibaro.call(ID_QUICKAPP, "play") Play a file at volume 10 with snapshot/revert process to restore previous state fibaro.call(ID_QUICKAPP, "playFile", "35HTGV34R7S/CD/Album/song.flac", true, 10) Play a stream at volume 20 & 8s duration with snapshot/revert process to restore previous state fibaro.call(ID_QUICKAPP, "playStream", "https://s3.amazonaws.com/smartapp-media/sonos/bell1.mp3", true, 20, 8000) RELEASE NOTES Version 1.5.1 Tested with Sonos OS: S2 - Version 13.4.1 (number 66423300) Tested with HC3 & HC3Lite v5.091.00 Improved support for Sonos Amp & Sonos One Gen2/SL and communication performance improvement Add new volume limiter feature: an option to prevent damage with unwanted high volume Add support for "Device disabled" option available in quick app advanced panel Add possibility to emits custom event when initiating a playback (playing), paused and stop playback state (just declare event name used in quick app variable panel ex: "event.stopped" or "event.playing" and the events in "General => Events". You can now triggering scenes on events) (https://forum.fibaro.com/topic/55510-create-a-scene-when-sonos-play-it-activate-a-whall-socket/#comment-235990) Fix a problem occured in some cases when zone controller browse device directory and parse items Declaration (DIDL) resulting an out of service for the QuickApp Version 1.4.0 Tested with Sonos Sonos OS: S2 - Version 13 (number 62186220) Tested with HC3 & HC3Lite v5.050.13 -> v5.063.30 Fix for Sonos firmware version 13 Fix for Sonos ARC getPositionInfo and malformed xmlsoap (hope full supoport soon) Add playNextRadio command to navigate the radios Add play mode control from QA button (loop in NORMAL,REPEAT_ALL,REPEAT_ONE,SHUFFLE_NOREPEAT,SHUFFLE,SHUFFLE_REPEAT_ONE) Fix Radio metadata strange behaviors in some situations Version 1.3.8 Tested with Sonos Sonos OS: S2 - Version 12.2.2 (number 61183220) Improved support for albumArt, now work with Sonos Radio, Amazon Music, Spotify, TuneIn, Music library Add option 'protect' to playFile and playStream for disallow to restart a playing Add Crossfade mode support with getCrossfadeMode, setCrossfadeMode and toggleCrossfadeMode commands Add sleepTimer command Add setPlayMode command, support: NORMAL,REPEAT_ALL,REPEAT_ONE,SHUFFLE_NOREPEAT,SHUFFLE,SHUFFLE_REPEAT_ONE Add selectLineIn command Add in variables panel, "notification" variable to enable or disable the "Device notification error", if disabled QA trace the message in QA console only Various improvement Version 1.3.1 RC Tested with Sonos Software Version: 56.0-76060 / Sonos OS: S2 - Version 12.0.5 & 12.1 Add support to use in block scenes (Play, Pause, Stop, Next, Prev, Set Volume, Set mute) Support for album covers when available (cf. music library) Performance improvement when initiating a playback Improved radio playback and track information Increase the number of supported radio stations (with auto configuration up to 9) Support for Sonos playlists (with auto configuration up to 6 saved queues) Add playFile command Add playStream command Add playSavedQueue command Add startQueue command Add clearQueue command Add seek command Add snapshot command Add revert command Add getListSavedQueues command Add addURIToQueue command Add checkForUpdate command Add getTreble and setTreble commands Add getBass and setBass commands Various Bug fixes (Polling when not configured, parsing ...) Version 1.1.1 Support for TuneIn "My radio stations" (with auto configuration up to 6 radios) Deletion of the variable variable "isConfigured" used by internal FTI Configuration Minor bug fixes (No route to host cause wrong configuration status) Tested with Sonos Software Version:55.1-74250 and 56.0-76060 Performance improvement Version 1.0.3 Fix a problem with internal zoneGroups and ZoneGroupMembers parsing (Thanks to jgab, Alan Klepacz and robw) Version 1.0.2 Minor bug fixes (Thanks to Macschimmi, Bodyart, minsad79) Version 1.0.0 Based on my HC2 virtual Device and completely rewriten for HC3 v5.030.45 or highter Very low latency and more robust device (commands execution, processing) Easy installation with auto configuration assist Support standard capabilities (AVTransport, RenderingControl) Displaying information on the currently playing or media loaded Fully controllable from the LUA scenarios (see available command list) You can download it from the Fibaro market: https://marketplace.fibaro.com/items/sonos-zone-controller hope you will be pleased with it ROADMAP Support for multi-devices in group used for triggering in scene and prepare for group-ungroup Support for TV source (if supporteed by device) Support for Group Support for TTS
  13. Hi guys, I was installing Fibaro radiator heads for my customer, when we realized, how inexplicably awkward is the software that is handling this product. The shame is on me, becuase I didn't tested it properly before we accepted the order. Here I want to ask any Fibaro technicians, how could any product developer allow the production of a radiator head, when user is NOT ALLOWED TO CHANGE THE SETPOINT PERMANENTLY from the Yubii app, and also USERS DONT HAVE ACCESS TO CLIMATE PLAN IN YUBII APP... Like this is not a mistake, this is a ridiculous mistake and a huge fault of developers. I just can't explain, how can this happen in a company like Fibaro.. What does that problem mean? My customer (not a PC oriented person) asked me to create a plan for his house..Day 23 celsius, and night 22 celsius (what I did, according to his demand) A few days later he called me, that they are cold , so he wants to put all radiators to 24 celsius permanently for day and night either..just set it to 24 everywhere.. Belive or not, i had to come to the conclusion, that its not possible. User can't set manualy a temperature permanenty..just for certain time period..max 24 hour, than it jumps back to the plan value.. Hold on, this is not the entire story... As the plan is not reachable from mobile APP, i needed to remotely deactivate the plan for him..i thought this way we can find a workaround... No... Even if you don't have a plan, you can't set any value permanently on your radiator.. Example..Lets say, you dont have any cilimate plan, and your radiators are running on 22 celsius.. Later you want to change this permanently to 21 celsius...BUT YOU CANT You can do it only for max 24 hours...than it jumps back to 22 celsius... I was thinking, maybe if we set the time to 00h:00min, it will help... We couln't even try it, becuase in the Yubii app the minimum value is 10 min... So what was I supposed to do? Should I told him, that he needs to manualy set all his 18 radiators every single day to the desired temperature? I would appreciate any suggestions... Thanks
  14. Hello. Im having trubble with my Aeotec WallMote Quad HC3 is reporting the device is not configured, anyone know how to fix this?
  15. Hi, I received an message in my HC3 that there is an device update available for a double switch. (see attached). But there is no button where i can click on to start the update. I can only view the Changelog. (even at the pop-up in the changelog is no update button available). Does anybody know how i can start this update? Things i tried: - Filled checkbox before device (nothing happend) - Reboot HC3 - Reboot (full power of) Double Switch - Googled the problem > no result yet. Thanks!
  16. 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
  17. I'm not sure how important it is, but I jump into this hole "lastWorkingRoute and neighborList shemas are changed from HC2 to HC3 HC2 /api/devices/id produces JSON wtih following: "lastWorkingRoute": "[1,422,59]" HC3 /api/devices/ID produces a bit changed JSON: "lastWorkingRoute": [1,422,59] What is difference - HC2 gives me string representation of array but HC3 gives me array. For developer perspective this is quite big difference (agree - important only for tech apps) Is there SOMEWHERE some kind of DOCUMENTATION of that kind things, changes, schemas Both HC2 /docs and and HC3 swagger lack several important interfaces like /api/energy and /api/temperature why they are hidden or where to find SOME kind of reference
  18. So, I've just recently got the HC3 and so far its been a bit of a battle to get it working any where close to the HC2. Out of the box, the setup script didn't work and it took a couple of iterations before I got through it. In no particular order here's some of the issues I've encountered to date: * The GUI is very slow, sometimes to the point that mouse clicks are missed, and certain portions of the GUI are not rendered. * The time can be out. At one point the clock on the banner was showing 1551, but the history was showing events with the correct time of 1630. * A lot of devices will appear as unavailable - in particular all my Fibaro Motion Sensors and Popp TRVs. I've changed some parameters on the Aeon/Aotech device I have as I suspect the network is busy * The Fibaro motion detectors are not detecting motion, they are reporting temperature, lux and will flash on the device when motion is detected... but not in the web UI. * Fibaro door/window detectors are not detecting doors opening. They appear to be reporting temperatures OK * Secure SRT Thermostat. One of these works, the other is reporting a temperature at least 10C higher than the room * Secure SRT Thermostats & Popp TRVs. There is no ability to set a temperature setpoint on these, and in the climate panel there's a warning that they may not work. They do work using the climate panel * Fibaro RGBW. The on/off button does not function and it doesn''t look like RGBW mode is supported. In fact, when included the RGB panel was hidden and five individual sliders were shown instead. It is impossible to control from any scenes. Setting a colour slider causes multiple entries to be logged in the history - one from user with set colour, then two, three, sometimes more from system with completed incorrect RGB values. * Everspring ST815 Light Sensor. Includes OK, never updates any value and doesn't send a command to the associated devices * Lots of devices without templates That's all for now, but these were all features that just worked in the HC2. In general, its not a good experience and trying to explain to my wife why she can't control the heating and that the lights in the kitchen aren't working is not easy. Other things that I wanted was the promised support of Zigbee and RF433 protocols, but they appear to be a distant dream for now.
  19. Hello everyone, I have just integrated several Simon iO actuators with HC3 and there is an issue with the devices' state which does not change properly neither in the web interface nor Yubii app. This happens for the following actuators: - Simon 100 iO Roller Shutters - Simon 100 iO Dimmers The update of device's state is not automatically reported to web interface/app when pressing manually the roller shutter switch or dimmer. The same happens when the device's control is coming from the app/web interface. For example, you set the shutter to be closed (0%) but the state in the app/web interface still shows opened (100%). I am using Z-Wave 3.0 and the HC3 firmware version is 5.080.20. I tried to force this communication between the devices and the HC3 through associations but with the same result. Apart from this, there are no templates for the Simon 100 iO devices and I can not add/modify any parameter in the web interface (don't have the option in parameters) or poll them. For example, I can not set a basic_report command to the controller when the devices change their states in order to force their updates in the system. Is this due to Z-Wave 3.0 and a HC3 firmware update which has not come yet? Has anybody any suggestions? Thank you in advance. Regards
  20. Hi dear Fibaro people. Anyone know how I can create a button in the app (for HC3) that I can use to enable or disable a scene? (A recipe would have been brilliant )
  21. 5.081.18 Hi friends. Could someone help me. I can't include it to HC3 system correctly. If i use the add-dialog without "s2 checked box' - the SCS C17 appears on the GUI HC3 with succes. But no "antenna" sign on screen of SCSC17. And without any reaction bw HC3 and SCSC17 - no update temperature, setpopoint adn etc. I understand that my SCSC17 doesnt use the S2 security level. and so i can't use 15 pcs of it on new HC3 that i bought instead of HC2...upset
  22. Hi everyone, I'm looking for a Quick app to control a Milight RGBW. I've found the above topic with a script, but the script is for a Virtual Device and in HC3, if I've correctly understood, Virtual Device has been replaced by Quick app. I'm new to the HC3 word and I don't know ho to "translate" VD script to QA. Is there a method ? I don't have any problems with LUA, but the QA scripting is not so far simple for me. Thanks for your help.
  23. fibaroapiHC3.lua (Note: The new version of the emulator has gone through extensive rewrite and is stabilising (0.300). The old version of the emulator is here fibaroapiHC3_classic.lua.) I'm currently working on a new emulator, TQAE, that I recommend you to check out... It's a rewrite with the learnings I have made coding fibaroapiHC3.lua... 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 QuickApps offline and have made a fibaroapi.lua file that can be included to emulate the fibaro calls and call out to the HC3. This means that a whole QA can be developed offline, debugged and verified before deploying to the HC3. Something that significantly reduces the development process. It's an emulation so it's not 100% but it will cater for 99.99% of the needs to catch bugs, get decent error messages when things doesn't work (like timers). Be able to set breakpoints and inspect states etc. It's complete enough to run the most demanding QuickApps that I have found on the forum so far... If it runs in the emulator and it doesn't run on the HC3 or vice versa I will prioritise to fix it. Latest version here fibaroapiHC3.lua (v0.311) The code is updated weekly so please make sure you have the latest... It was inspired by the old fibaroapi for the HC2 in a thread started by @riemers but has evolved with more extensive support to create a better debugging and "offline experience"... in fact, it's really an HC3 emulator now. The video is an earlier version of the emulator but the principles are more or less the same. Note the nice tooltip and autocompletion of fibaro commands we get with the fibaroapiHC3plugin for ZBS. Enable English subtitles to see instructions... 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. Here is a good introduction to Lua (using ZeroBrane) 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. Advanced timer info (setTimeout) warning of late timers and from where the offending function was called if a timer function crashes. Info from where an eronous json.encode was called from in your code so you can easily find the error (instead of seeing a line from deep inside the json encoder) 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. Develop and run multi-file QuickApps, allowing you to build up a library of common code to share between your QAs. 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. Load multiple QAs/Scenes into the emulator at the same time to debug interaction patterns between QAs (or just run all your QAs offline and use the HC3 as a wave GW ) Telnet into the running emulator to capture logs or issue Lua commands like turning on/off devices at runtime to test you QA/Scene. 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. Oh, and an emulated Web GUI for the quickApp so you can try out button/slider clicks without connecting to the HC3. And lastly, it makes it fun to develop code for the HC3 To get going download the fibaroapiHC3.lua and put in in the working directory where you code your QA(s) If you run ZerobraneStudio (recommended) paste this and run if dofile and not hc3_emulator then dofile("fibaroapiHC3.lua") end--hc3 hc3_emulator.downloadPlugin() hc3_emulator.downloadAssets() Please note the 'end--hc3' that ends the 'if dofile and not hc3_emulator then' statement. It requires the '--end' comment so I can recognise it. Also, you need to set the Lua interpreter to version 5.3 (In ZBS, Menu ; Project -> Lua Interpreter -> Lua 5.3) It will install the. ZBS plugin in ~/.zbstudio/packages and some code templates in ~/.zbstudio/hc3emu/ (Restart ZBS for the plugin to. be installed) Create a Lua file and create a header + QA/scene code. An example of a minimal QA can look like if dofile and not hc3_emulator then hc3_emulator = { name = "My QA", poll=1000, -- Poll for triggers from the HC3 every 1s credentials = {ip="192.168.1.X", user="<user>", pwd="<password>"} } dofile("fibaroapiHC3.lua") end--hc3 function QuickApp:onInit() fibaro.call(88,"turnOn") -- turns on device 88 on your HC3 end We wrap the emulator specific stuff inside "if dofile and not hc3_emulator 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. Note the credentials that contains the IP, username and password so that the emulator can access the HC3 box. If you use ZBS and the plugin there is an Edit-HC3 SDK templates-> menu that will insert a standard QA and Scene header + code in the current buffer. 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.300) 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() -- needs extra download net.WebSocketClientTLS() -- needs extra download 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) -- needs extra download <mqttclient>:addEventListener(message,handler) <mqttclient>:subscribe(topic, options) <mqttclient>:unsubscribe(topics, options) <mqttclient>:publish(topic, payload, options) <mqttclient>::disconnect(options) plugin.mainDeviceId plugin.deleteDevice(deviceId) plugin.restart(deviceId) plugin.getProperty(id,prop) plugin.getChildDevices(id) plugin.createChildDevice(prop) class QuickAppBase class QuickApp class QuickAppChild json.encode(expr) json.decode(string) 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='alarm', id=<id>, property='armed', value=<value>} {type='alarm', id=<id>, property='breached', value=<value>} {type='alarm', property='homeArmed', value=<value>} {type='alarm', property='homeBreached', value=<value>} {type='weather', property=<prop>, value=<value>, old=<value>} {type='global-variable', property=<name>, value=<value>, old=<value>} {type='device', id=<id>, property=<property>, value=<value>, old=<value>} {type='device', id=<id>, property='centralSceneEvent', value={keyId=<value>, keyAttribute=<value>}} {type='device', id=<id>, property='accessControlEvent', value=<value>} {type='device', id=<id>, property='sceneActivationEvent', value=<value>} {type='profile', property='activeProfile', value=<value>, old=<value>} {type='location', id=<uid>,property=<locationId>, value=<geofenceAction>, timestamp=<timestamp>} {type='custom-event', name=<name>} {type='UpdateReadyEvent', value=_} {type='onlineEvent', value=<bool>} Some of the parameters that affect the behaviour of the emulator and can be set in the header are: hc3_emulator.name=<string> -- Name of QuickApp, default "QuickApp" hc3_emulator.id=<QuickApp ID> -- ID of QuickApp. Normally let emulator asign ID. (usually 999 for non-proxy QA) hc3_emulator.poll=<poll interval> -- Time in ms to poll the HC3 for triggers. default false hc3_emulator.type=<type> -- default "com.fibaro.binarySwitch" hc3_emulator.speed=<speedtime> -- If not false, time in hours the emulator should speed. default false hc3_emulator.proxy=<boolean> -- If true create HC3 procy. default false hc3_emulator.UI=<UI table> -- Table defining buttons/sliders/labels. default {} hc3_emulator.quickVars=<table> -- Table with values to assign quickAppVariables. default {}, hc3_emulator.offline=<boolean> -- If true run offline with simulated devices. default false hc3_emulator.autocreate=<boolean> -- Autocreate local resources hc3_emulator.apiHTTPS=<boolean> -- If true use https to call HC3 REST apis. default false hc3_emulator.deploy=<boolean>, -- If true deploy code to HC3 instead of running it. default false hc3_emulator.assetDirectory=<string> -- Directory where assets shoud be downloaded (ZBS). Default ~/.zbstudio/hc3emu hc3_emulator.resourceFile=<string> -- When doing a resource download, use this file as default. hc3_emulator.db=<boolean/string>, -- If true load a "resource download" from hc3_emulator.resourceFile or string hc3_emulator.htmlDebug=<boolean> -- Try to convert html tags to ZBS console cmds (i.e. colors) hc3_emulator.terminalPort=<boolean> -- Port used for socket/telnet interface hc3_emulator.webPort=<number> -- Port used for web UI and events from HC3 hc3_emulator.HC3_logmessages=<boolean> -- Defult false. If true will push log messages to the HC3 also. hc3_emulator.supressTrigger -- Make the emulator ignore certain events from the HC3, like = PluginChangedViewEvent hc3_emulator.negativeTimeout=<boolean> -- Allow specification of negative timeout for setTimeout (will fire immediatly) hc3_emulator.strictClass=<boolean> -- Strict class semantics, requiring initializers hc3_emulator.consoleColors=<table> -- Maps fibaro.debug/self:debug etc to color (debug.color enables color debugging) hc3_emulator.sysConsoleColors=<table> -- Maps colors used for system logs hc3_emulator.userdataType=<boolean> -- If true intercepts type(...) to return 'userdata' for our Lua classes. Some apps checks this... Some useful emulator functions: hc3_emulator.setOffline(<boolean>,<boolean>) -- hc3_emulator.getIPaddress() -- Return HC3 IP address hc3_emulator.prettyJsonFormat(<table>) -- Return json formatted string of Lua table hc3_emulator.postTrigger(<event>,[<time ms>]) -- Posts a trigger to the emulator... hc3_emulator.loadScene(...) -- Load scene from file or HC3... hc3_emulator.loadQA(...) -- Load QA from file or HC3... hc3_emulator.downloadPlugin() -- (ZBS). Default ~/.zbstudio/packages hc3_emulator.downloadAssets() -- (ZBS). Default ~/.zbstudio/hc3emu hc3_emulator.downloadResources([<filename>]) -- Downloads a "backup" of HC3 resources hc3_emulator.loadResources([<filename>]) -- ...that can be loaded as "local" resources for the emulator. Some debug flags that can be set with hc3_emulator.debug.<flag>=<value> fibaro=false, -- Logs calls to fibaro api trigger=true, -- Logs incoming triggers from HC3 or internal emulator timers=nil, -- Logs low level info on timers being called, very noisy. refreshloop=false, -- Logs evertime refreshloop receives events mqtt=true, -- Logs mqtt message and callbacks http=false, -- Logs all net.HTTPClient():request. ALso includes the time the request took api=false, -- Logs all api request to the HC3 onAction=true, -- Logs call to onAction (incoming fibaro.calls etc UIEvent=true, -- Logs incoming UIEvents, from GUI elements zbsplug=true, -- Logs call from ZBS plugin calls webServer=false, -- Logs requests to /web/ including headers webServerReq=false, -- Logs requests to /web/ excluding headers files=false, -- Logs files loaded and run color=true, -- Logs in console using ANSI colors (see hc3_emulator.consoleColors for mapping) locl=true, -- Log creation of local devices breakOnInit=<boolean> -- Tries to set breakpoint on QuickApp:onInit (mobdebug) breakOnLoad=<boolean> -- Tries to set breakpoint on first line in loaded file (mobdebug) breakOnError=<boolean> -- Tries to break after error (makes it easier to look at call stack etc) ctx=false, -- Logs Lua context switches timersSched=false, -- Logs when timers are scheduled timersWarn=0.500, -- Logs when timers are called late or setTimeout with time < 0 timersExtra=true, -- Adds extra info to timers, like from where it's called and definition of function (small time penalty) In the example in the beginning, the HC3 credentials are listed in the header. If you don't want that (it's easy to forget it and share the code with your passwords in plain sights<9 you can create a credentials.lua file with your secret stuff and it will be automatically included by the SDK. The format should be return { ip="2912.168.77", user="admin", pwd="admin", mySecret="hgskjfhgjhgkdfh" } It returns a Lua table with the relevant keys. ip, user,and pwd is used to log into the HC3. We have added another key here to 'mySecret'. Assume that you want you QA to have a defined quickAppVariable with the value of mySecret. It could be the password to log into an external services. Then you can do like this if dofile and not hc3_emulator then hc3_emulator = { name="My QA", quickVars = {["password"]="$CREDS.mySecret"}, This define a quickAppVariable with the name 'password' and it fetches the key 'mySecret' from the credentials table and uses that as the value. When you QA starts up you can do self:getVarible('password') and it will return the credential. This is useful as not to litter your code with visible credentials. NOTE. Be aware that if you deploy the real QA with hc3_emulator.deploy=true or using the menu commands with the plugin, the deployed QA will have the quickAppVariable defined and if you upload that for sharing people will see your credential. 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("socket") -- LuaSocket require("socket.url") -- LuaSocket require("socket.headers") -- LuaSocket require("ltn12") -- LuaSocket require("mime") -- LuaSocket require("lfs") -- LuaFileSystem They are pretty standard lua libraries - based on LuaSocket. @10der has managed to run it under Visual Studio on Windows. Here is an updated library/project map to work with the latest version of the emulator vscode_fibaro_bin.zip. Note that you should update the fibaroapiHC3.lua file provided i the archive when new are released as I will not update this archive for every new release. @petergebruers also have some tips. Any improvements are happily received (in code) and credits will be due granted. Links to notable post Here is a description of the various way to use the emulator when developing code (high-level) Some in-depth posts Running "Offline" (TBD) Running in "Mix mode". Mixing real devices and locally emulated devices (TBD) Running with a "Proxy QA" (TBD) Using real QA as "Proxy" (TBD) Downloading HC3 resources to file and emulate them locally (TBD) Running standard Lua with access to HC3 functions (developing management scripts etc) (TBD) Loading multiple QAs/Scenes and run them in parallel in the emulator (also getting QAs/Scenes from the HC3 and install them in emulator on the fly...) (TBD) Running faster than real-time and manipulating start dates (TBD) 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. Creating and debugging multi-file QuickApps The debug flags that can be set are described The new dynamic load functions to run multiple QAs/Scenes in the emulator are described Telneting into the emulator to capture logs and issuing Lua calls <here> (nice way to test your code) Using the Web GUI Debugging setTimeout code and tracking timers. 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. An 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) v 0.99 - Better trigger handling and new way to include SDK in your QA/scene code. No hc3_emulator.start at the end. v 0.100 - Web GUI emulator for QuickApps. New format for using credentials.lua. Bug fixes... v 0.102 - Better handling of children and their quickAppVariables v 0.104 - Rewrite of offline mode. Better web UI support. v 0.105 - Support for new QA file format (proxies work again) v 0.106 - Added support for net.UDPSocket() v 0.109 - UDPSocket bug fix. ( @10der), property() support for class() - much harder than it looks... v 0.110 - Oops, serious bug in 'class' affecting ...everything. Hopefully fixed. v 0.111 - Removed unnecessary os.exit(). urlencode api calls ( @10der) v 0.112 - UDP fixes. ( @10der) v 0.114 - Bug fix (global 'self' escaped) v 0.115 - Bug in url encode for api calls. UDPSocket :bind(ip,port) function added. v 0.116 - :bind(ip,port) really fixed.... v 0.117 - startup fix v 0.119 - "Softer os.exit()" - better compatibility with Visual Studio (thanks @10der) v 0.120 - Debugger friendly QuickApp class (no __index). First version of file/backup v 0.121 - api.get bug fix. Faster proxy/deploy. v 0.123 - QuickApp:setVariable bug (thanks @10der) v 0.124 - fibaro.clearTimeout added, MQTT fixes. v 0.125 - fibaro.alarm() was buggy - fixed. Set self.USERPIN to pincode to allow fibaro.alarm("disarm") to be allowed from emulator. v 0.126 - fix __fibaro_get_device() ( @10der) v 0.128 - fix sort order of triggers. Default room in offline mode ( @10der) v 0.130 - fix UI handling ( @rangee. More UI options. v 0.131 - fix uiCallbacks not always updating when updating proxy v 0.135 - fixes... v 0.137 - TCPSocket fixes v 0.138 - setTimeout for negative times are inserted in the queue.... i.e. will execute as soon as possible. v 0.140 - fixed bug with setInterval (clearInterval within a setInterval function didn't work...) v 0.141 - fix bug in net.TCPClient() v 0.145 - bug in printout of sockets... stricter class constructor requirements v 0.148 - MQTT event format bug ( @jayrock) v 0.150 - Initial websocket support. Need to download wsLua_ER.lua from my github and put in project directory. v 0.152 - support fibaroapiHC3plug.lua v0.4 v 0.155 - bugfixes. v 0.156 - html color bugfix v 0.198 - New version of emulator with better support for everything. Thanks to @petrkl12 that has been a guinea pig and helped in debugging the code. v 0.200 - Fixed bug in speedTime. plugin.restart() now restarts the QA in a correct way. v 0.299 - Major rewrite of the HC3 API - cleaner architecture and prepared for being split into sub-files (I'm approaching 10k lines now). Note 'end--hc3' required to end header. v 0.300 - Bugfixes from v0.299 v 0.301 - Better/simpler class definition - easier to debug/step into classes (avoiding __index unless class uses property() )
  24. [edit] i think i should have placed it in the "Scenes and Interface" section, sorry for that. So, i'm new, newbe, so...dont shoot me I've been reading a lot, on this forum and elsewhere trying to get my Powerview shades connected to a zwave switch. It seems to be much harder to manage then i was hoping for. My head spins around with all the information, code lines and such, Also, none of the info i found seems to be complete. It is all like "do it in LUA", make a QA or a a bunch of code lines. I hope to find some hints, or answers - help with that. So, what i worked out: - The 8 button fysical wall switch works. - The powerview plugin works, and the scene's controlled from the hub work The imported scene's dont work, and need i to make a QA or a LUA scene for that. What i tried: I made a block scene with the switch, and a HUE lamp, converted this to LUA this is the "what if button is pressed" and it works. { conditions = { { id = 21, isTrigger = true, operator = "==", property = "centralSceneEvent", type = "device", value = { keyAttribute = "Pressed", keyId = 1 } } }, operator = "all" } The action part, i made this - but its wrong. local connection = Net.FHttp("", 80); local command = "/api/scenes?sceneid=25173"; local response, status, errorCode = connection.GET(connection, command); It gives this error: 10.07.2021] [07:00:40] [ERROR] [SCENE4]: (load):1: attempt to index a nil value (global 'Net') I know there is a lost of writing about this on the forum but, I am totally lost in what to do, is this sort of the right way to do it ? Should i do it with a QA ?
  25. Hello HC3 owners/guru's, Is there anyone who can tell me what the impact is of a change of the physical location of a HC3 device? Currently I am living in Europe (Belgium). I might have to move to Asia (Philippines) next year and want to bring my HC3 and re-install it there in my new house. I see the following 2 potential problems: Z-wave allowed frequency bands and standards used are the same in these 2 locations, but there might be other restriction I am not aware of. The centralized monitoring/support of all HC3 gateways via the HC3 device ID might be disrupted if you move the device to another world region or country. Note: I experienced a similar problem (issue 2 above) when I moved around with my printer from Thailand to the Philippines a few years ago, as the ink cartridges are not interchangeable between the 2 countries and other regions.. I guess this is a question for Fibaro HC3 guru's or a Fibaro company HC3 specialist. Your help would be appreciated if you can answer my questions or can tell me how to contact a Fibaro HC3 specialist. Thanks Leo I used the below URL for my short survey. URL: https://www.silabs.com/wireless/z-wave/global-regions EU 868.4 MHz, 869.85 MHz - Standard EN 300 220 PH 868.4 MHz, 869.85 MHz - Standard EN 300 220
  • Create New...