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

  • 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. Hello, I have installed a multi-zone heating on my HC2 Fibaro. 2 rooms have the danfoss LC13 radiator heads with the Danfoss room sensor. 2 roomas have the Danfoss LC13 radiator head with the Secure room thermostat SRT321. I did et-up heating panels for al the 4 rooms and they work fine. Both type of room thermostat haven the posibility to adjust the tempratur in the room. Aswell the Danfoss room thermostat as the Secure thermostat this wont work. Any idea why? Thx,
  2. HC2 all lights on.can not log in.how to solve I did these tests: 1:When the HC2 without recovery disk in most cases can be normal boot, occasionally will not open properly2: after with the own recovery disk, can't normal boot3: with other HC2"s recovery disk, occasionally can normal boot, not once in a while, and can creat new backup after normal boot4: the problem recovery disk drive into the other HC2, can normal boot, can creat new backup
  3. I messed up some code tags so re-posting... Hi Here is my small tutorial on the alarm system code i use to complement the rfid keypad system. Firstly you need to create an 'ALARM' variable with at least 2 values. one variable will be OFF second variable will be FULL (or whatever name you want to give) you could if you wanted create many more variables for different zone eg i have a 3rd called DOWN you then programme the keypads (or any other scene) to change the variable to the alarm mode you want --[[ %% properties 145 value 146 value 159 value 160 value %% events %% globals --]] local alarm = fibaro:getGlobal("alarm") local kpof = fibaro:getValue(145, 'value') local kpon = fibaro:getValue(146, "value") local bkon = fibaro:getValue(159, "value") local bkof = fibaro:getValue(160, "value") if ( ((kpon == '1') or ( bkon == '1')) and (alarm == 'off') ) then fibaro:setGlobal("alarm", "down") end if ( ((kpon == '1') or (bkon == '1')) and (alarm == 'down') ) then fibaro:setGlobal("alarm", "full") end if ( (bkof == '1') or (kpof == '1') ) then fibaro:setGlobal("alarm", "off") end From above i have 2 keypads. I have put triggers under the properties for both ON and OFF when i press the 'ON' button once it changes the VARIABLE to PART, if i then press again it changes the VARIABLE to FULL. If you wanted you could continue this for more zones but it can get a bit complicated...... Finally if either of the OFF buttons are pressed the VARIABLE is set to OFF. Next part is the actual setting of the alarm.. --[[ %% properties %% events %% globals alarm --]] if (fibaro:countScenes() > 1) then fibaro:debug('NO!') fibaro:abort() end fibaro:sleep(12*1000) -- set delay time here mine is 12 seconds local alarm = fibaro:getGlobal("alarm") local downArmIds = {} -- set ID's for DOWN mode local fullArmIds = {} -- set ID's for FULL mode local deviceIds = {} -- leave blank as it will auto fill -- single 'alarm' variable with multiple arguments -- in one place (lists above) if (alarm == 'full') then deviceIds = fullArmIds elseif (alarm == 'down') then deviceIds = downArmIds elseif (alarm == 'off') then fibaro:abort() end local unsafeDevices = {} -- will add unsafe devices to this empty list local statusMessage = "" -- will get changed to push message depending on outcome below -- below loops through all devices to check device values are safe, i.e. '0' -- otherwise adds the devices to unsafe list in preparation for push message local armStatus = 'safe' for i, id in ipairs(deviceIds) do if (fibaro:getValue(id, "value") == '0') then deviceStatus = 'safe' else deviceStatus = 'unsafe' table.insert(unsafeDevices, id) armStatus = 'unsafe' end print("Id: " .. id .. " " .. fibaro:getName(id) .. " is " .. deviceStatus) end print("\nArm status is " .. armStatus) -- if unsafe, then formulates the push message, otherwise sets the device to arm if (armStatus == 'unsafe') then -- loops each device in unsafeDevices list to specify the all the names of device to be -- included in push message for i, id in ipairs(unsafeDevices) do statusMessage = statusMessage .. fibaro:getName(id) .. " ; " end statusMessage = statusMessage .. " unsafe to arm.\nAlarm not set" fibaro:setGlobal("alarm", "off") --[[ Example message... "Front Door; Living Room Motion; Studio Door Lock; unsafe to arm. Alarm not set" ]]-- else -- loops devices to set them to arm status for i, id in ipairs(deviceIds) do fibaro:call(id, "setArmed", "1") end statusMessage = "Alarm set to " .. fibaro:getGlobal("alarm") --[[ Example message... "Alarm set to full" or "Alarm set to part" ]]-- end fibaro:call(319, 'sendPush', statusMessage) -- push message to me change 319 accordingley -- add any other code here that you want to run eg turn lights off or heating off etc print(statusMessage) -- prints in debug window this looks big but you only need to add the device ID's of your FULL mode, DOWN mode and any other message once the alarm has been set. Remember to separate your ID numbers with a comma The code is triggered by a change in the global variable called 'alarm'. This then starts the scene. The time delay gives you time to press again for different modes and also to leave the house and make sure that all sensors become safe. (i have set my motion sensors to show as being safe after 5 secs, the default is around 15 secs). After the time delay it checks which variable is set, then it only checks those sensors to make sure they are all SAFE. If they are SAFE then it proceeds to ARM those sensors and then sends you a push message that the alarm has been set and will run any additional code you have added eg turn off the lights, heating etc If they are UNSAFE then it aborts the arming procedure and sends you a message that 'a named sensor is unsafe to arm', you can then investigate and make sure it is safe before starting again. examples include if a door was left ajar or window is left open etc Next part is the ACTIVATION code: --[[ %% properties 25 value 85 value 95 value 148 value 90 value 171 value 176 value 166 value 32 value 45 value %% events %% globals --]] function activation() local trigger = fibaro:getSourceTrigger() --fibaro:debug(trigger) local device = fibaro:getName(trigger['deviceID']) fibaro:debug(device) local subject = 'alarm activated' local message = 'alarm activated ' fibaro:call(2,'sendEmail',subject,message..device) -- ID of user '2' is always admin fibaro:call(319,'sendPush',message..device) -- ID of my phone end local alarm = fibaro:getGlobal("alarm") local downArmIds = {} local fullArmIds = {} local deviceIds = {} if (alarm == 'full') then deviceIds = fullArmIds elseif (alarm == 'down') then deviceIds = downArmIds elseif (alarm == 'off') then fibaro:abort() end for i, id in ipairs(deviceIds) do if ( (fibaro:getValue(id, "value") == '1') and (fibaro:getValue(id, "armed") == '1') and (alarm ~= 'off') ) then activation() -- this is function above fibaro:call(123, "turnOn") -- code for turning siren on fibaro:sleep(10*60*1000) -- 10 min delay change to what you want fibaro:call(123, "turnOff") -- code for turning siren off -- plus any other code you want to add end end firstly you need to enter the ID numbers of all your sensors in the properties section as triggers except the entry zonesalso the fullArmIds and downArmIds need to match the previous arming code except for the entry doors we have a separate entry code to give us a time delayed entry1st block is the function activation(), this basically tells me via push message and email which sensor triggered my alarm2nd block checks to see which mode the alarm is in and therefore will only monitor those specific ID's3rd block will cause the alarm to trigger if our 'armed' devices are breached and run the activation code Entry code is below this as name suggests gives us a defined time to enter property and switch off alarm before it activates: --[[ %% properties 82 value 83 value %% events %% globals --]] local fda = fibaro:getValue(82,'armed') -- front door armed local fdv = fibaro:getValue(82,'value') -- front door value local bda = fibaro:getValue(83,'armed') -- back door armed local bdv = fibaro:getValue(83,'value') -- back door value local alarm = fibaro:getGlobalValue("alarm") function activation() local trigger = fibaro:getSourceTrigger() --fibaro:debug(trigger) local device = fibaro:getName(trigger['deviceID']) fibaro:debug(device) local subject = 'alarm activated' local message = 'alarm activated ' fibaro:call(2,'sendEmail',subject,message.. device) fibaro:call(319,'sendPush',message.. device) end if ( ( (fda == '1') and (fdv == '1') and (alarm~='off') ) or ( (bdv == '1') and (bda == '1') and (alarm~='off') ) ) then fibaro:sleep(30*1000) -- 30 sec delay local alarm = fibaro:getGlobalValue("alarm") if (alarm == 'off') then fibaro:abort() else activation() fibaro:call(123, "turnOn") fibaro:sleep(10*60*1000) fibaro:call(123, "turnOff") end end to start with set the ID of your entry zones under properties, and update the ID 82 and 83 with your own. If you have just 1 then delete accordingley and more than 2 then just add the extra as needed the function is same as before the final block checks if the doors have been opened if they are armed and the alarm is NOT set to off it then starts a 30 sec timer. Just amend 30 to whatever time you need. once the timer has counted down it will check the variable again and if you have turned alarm off then code aborted. if alarm not switched off then activation procedure starts just as before and sends push message, email and siren activates for 10 mins. Final part is turning the alarm off --[[ %% properties %% events %% globals alarm --]] local alarm = fibaro:getGlobal("alarm") local deviceIds = {} if ( alarm == 'off' ) then fibaro:call(319, "sendPush", "Alarm Off") -- my phone fibaro:call(123, "turnOff") -- siren -- any other code for i, id in ipairs(deviceIds) do fibaro:call(id, "setArmed", "0") end end fill the deviceIds with the values of ALL YOUR SENSORS - incl entry sensors the trigger for this is the global variable alarm if its in the 'off' setting then it will send me a push message and send an 'off' command to siren (just in case it was activated) it will then go through the sensors 1 by 1 and disarm them all I hope this helps all of you and any questions and feedback and comments please feel free to leave them thanks
  4. Hello Everyone, I got a 8 channel IP relay, that i would like to control with the HC2. I grabbed the network data that's being send out when i use the buttons in the original control webpage of the relay. It looks like this: curl 'http://10.0.1.93/relay_en.cgi' \ -XPOST \ -H 'Content-Type: application/x-www-form-urlencoded' \ -H 'Referer: http://10.0.1.93/relay_en.cgi' \ -H 'Upgrade-Insecure-Requests: 1' \ -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' \ -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Safari/602.1.50' \ -H 'Origin: http://10.0.1.93' \ --data 'saida1on=on' How could i get the HC2 to trigger this via LUA? Can it be done? I also found this.. Maybe someone can help me find out.. This triggers Relay 1 for an Pulse of 1 second, "saida1on=on" sets the relay on and "saida1off=off" sets relay 1 to off. curl --user admin:password --data "saida1pluse=pluse" http://10.0.1.93/relay_en.cgi If i can explain anything more, please ask.. I'm struggling with this for a few days now, and can't get this to work.
  5. Hello, My HC2 is running on version 4.101 I installed 3 sonos devices over the weekend. 2 play5 and 1 play-bar. All off them has a IP adres on the internal network. When i create a virutual device i can command the sonos devices. Mhen i install the sonos plugin he want discover the sonos devices. When i put in the IP adress in the plugin same problem. Any ideas what could be the problem with the plugin? Regards,
  6. Hello, My HC2 is running on version 4.101 I installed 3 sonos devices over the weekend. 2 play5 and 1 play-bar. All off them has a IP adres on the internal network. When i create a virutual device i can command the sonos devices. Mhen i install the sonos plugin he want discover the sonos devices. When i put in the IP adress in the plugin same problem. Any ideas what could be the problem with the plugin? Regards,
  7. Hello I have problem. I use Fibaro HC2 with 15pcs of philio pan06. After power off, some of philio modules become "not configured" and by "Wake up", they do not come to z-wave network. How can I solve this problem ? What is problem for ? Thank for who replies
  8. Hello all, I have a HC2 with several modules, i recently purchased 5 pcs FGSD-002 smoke sensors to include in the setup. Last week i have added 1 sensor in the Garage, without any problems, everything working fine. Now i wanted to add the ones for the kitchen and for the living room. I followed the procedure as described in the manual. During the adding device proces, the devices are added. But when I go to unassigned devices, it shows the smoke sensor is a motion sensor. I grabbed the second smoke sensor, followed the procedure again, but with same result. Both end up as motion sensor and not as smoke sensor. In addition to that, it shows that the battery level is low. I have tried: - rebooting the HC2, both through reboot button in the software, as well as a hard reboot by unplugging the power. - I have resetted the smoke sensors - I have tried to keep pressing the b button while the device is added - I have changed the device in the software to smoke sensor, but temperature readings remain 0 and the battery level states low. When added, the devices are recognised as Fibaro device (manufacturer), but the part number remains empty. The sensors are both brand new, I took them straight from the sealed box to the include process. Setup: 1 x HC2 3 x zwave.me dimmer 3 x zwave.me wall switch 1 x fibaro smoke sensor 3 x zwave.me shutter switch 5 x fibaro v2 roller shutter (4 x fibaro smoke sensor) The HC2 is connected to a router, the router is not connected to internet. Does anyone have an idea what i can do to include these smoke sensors properly?
  9. entire

    Broken Aerial

    Hi All i have managed to break the aerial on my hc2 can anyone recommend a replacement, I have googled but come up with nothing so far cheers Mike
  10. Has anyone integration their dishwasher with Fibaro HC2? I would like to be able to schedule the dishwaser to run...
  11. OversætDeaktiver øjeblikkelig oversættelse The HC2 does not restart automatically after a power outage. Restart can only be activated by pressing the reset button on the back of HC2. Fibaro please fix the issues.
  12. Hi guys. What Satel products work with HC2? Is there an official guide somewhere? I have searched and found nothing i can use. And - how does it work in everyday life? Can you turn on/off the alarm from inside Fibaro? Im looking to buy a new alarm system and i want it integrated with Fibaro. Thanks!
  13. Hi All, I have Fibaro HC2 controller. All fibaro devices are working well with this controller but i am facing problem with other z-wave supported device in HC2. 1. I add a device (Aeotech siren Gen 5) in HC2, Device added successfully and received all it's parameters but When i go to the Advance tab of it, parameters are in undefined mode. i can't able to set it's parameters to control device features. (Image is attached) 2. I add a device (Vitrum Curtain control Wireless Switch) in HC2, Device added successfully but i couldn't found this device parameters nor it's template in HC2 browser interface. There is a notification that this device has no template please download and send query to Fibaro Support center. I tried but received a mail daemon error in email response. (Image is attached). Please help me if you have faced this problem as i have to complete my task of home automation. Thanks in advance.
  14. I've got the IDLock working normally for some time, then decided to install the Z-Wave module to integrate it to my HC2. The device is recognized, but there's no template, and limited functionality should be expected. However, the lock doesn't respond at all to any attempt to lock or unlock. Any ideas? And Hopefully Fibaro will provide a template for this module some time soon. Thomas
  15. Hi! I recently changed my router (it was not working) connected to HC2. After that it just doesnt reflect on Fibaro Finder or Advance IP Scanner. All the other devices on the network wireless or wired are reflecting on the systems except for the HC2. Router is kept on the same gateway so as all the other devices, but the HC2 cannot be viewed on the browser. If i Plug my old router back and hard wire my HC2 it does open back there. But on the new Router it just doesnt work. Best, Kunal
  16. I have : - wall switches and dimmers from TKB HOME. They are TZ65D and TZ 66D. - sockets switches and sockets dimmers from TKB HOME. They are TZ67F and TZ69F. All of them are connected to HC2 with software 4.100 but I observed my problem with earlier software versions as well. If I operate my switches/dimmers from HC2 they are working OK and the HC2 reflects the state of the devices. If I operate my switches manually they are working OK but most of the cases they do no report the current state to HC2. Eg . If I manually switch ON the light, the light is switched ON but HC2 shows it is OFF. That gives me problem with some scenes which should be triggered regarding if the certain light is on or off. I tried to reconfigure z-wave mesh network for some devices but it did not help. Any hint / idea on this ... What is your experience of using TKB Home devices with FIBARO HC2 ?
  17. When you have multiple HCLs as a slave and HC2 as a master for covering whole project, it's needed to import some devices. Sometimes imported devices in HC2 has a different value, from those in HCL. Please Fibaro, can you make additional command to REST API that represent button "Synchonize" located in "Gateway connections". It's realy pain, to make virtual device for such synchonization.
  18. Hello Fibaro. Just another issue which I wanted to ask for: So far it is not possible to get an overview of the system state including central logging of scene/VD output. If I want to know whether a scene is running or not, I have to go into the scene to check output. Very annoying with many scenes and not really comfortable. Same is with output (debug messages, messages) from scenes. I have to go through all scenes to check the outputs. I would like to have one place where all such internal states are displayed. One Dashboard where I can see which scene/VD is actually running, which not. Where I have the outputs of all scenes in chronological order with an automated mechanism to identify the individual scene messages - i.e. "timestamp - scene name - message". I think it would make the HC2 much more comfortable to handle. User can see with a glance if there are problems with a scene or can get an quick overview if system is working normal. In addition it would be good to have certain states presented there as well. Like whether the HC2 is in armed or disarmed mode, last breach, last alarm etc. Actually I am trying to build that myself out of the REST API with some python scripts but I think it would be great to have this provided as a Fibaro feature. The actual functions for this are too scattered between screens. Like there is already one central event page but I think in the acutal form with all the small symbols and text and sorting it is not very "readable" and it is not including the scene messages. I see which motion sensor was breached but only in the devices view where I not have any chronological sorting. I just see all the motion sensors and have to find out myself, which one was breached when. Would be happy if others jump in or present their ideas or solutions for this. Regards.
  19. Hi guys! I have problem with Login to android tablet application. It says that hc2 cannot be find ! But, in adding, all the IP and others are okey. I thas been checked with fibaro finder. After trying new user, It connects but after 3 times closing the app, It wont work again. Where is the problem ? thanks in advance
  20. Hi after trawling through a few sites and you tube videos i managed to get Amazon Echo to work with HC2. so i decided to write a small-ish tutorial to make life easier for anyone else that wants to do the same. Download the instructions from http://www.yorkshireautomation.co.uk/echo i have put the Raspberry Pi image file and a pdf of instructions there and it takes about 20-30mins and you are up and running..... Video Below: Thanks all and Enjoy!!!!
  21. I brought HC2 last year in December. Because of my work I had just little bit more than four months to play with it in all this time. HC2 came with 4.056 firmware and as soon as I took it out of the box and connected to it, it was offering upgrade to 4.070 so I did it. Despite some problems, system was growing pretty fast, but programming was (and still is) quite challenging. Thanks to many members of this forum on their work and help that I manage to do something useful. I use jompa68's Alarm Clock, and Boomx's script to collect data for Netatmo wind and rain gauges. I also use cag014 solution for devices and scenes ID to be stored in global variable, and krikroff's Sonos remote and many many other solution given here by members petergebruers, chaicka and many others. Thank you, thank all of you for all good ideas, solutions, code and help! So, here it is in one picture, and it wouldn't be possible without your help on this forum. It is now on 4.100 with 72 modules included and the rest is in my signature I promised some members here that I will share what I have done and I will keep my promise, but just not yet. I have to go to my work again and I have to leave my "Angelina" to wait for me to come home to clear some bugs in code that I made and to give her more abilities. Luckily for me my wife is very supportive so I get list of her wishes and improvements that I can make every time when I came home. Thank you all and see you soon! Here is updated layout of my Angelina on 28th March 2017: To see it in all it's beauty click on picture, then on "Full size" in lower left corner.
  22. Hi all, I am looking to build out my understanding of the HC2 Rest API. Specifically its capacity to execute a lot of calls (as opposed to what functions are available) and what else leverages the API and battles for capacity. I have two reasons for posting the topic - (a) I may be having an issue and am trying to debug and (b) increasing my systems knowledge. My understand is that the API is used the following... If an http request is made to the HC2 from an external system If a http request is made from a browser to the HC2 .. but is it used for ... The android app I run on my tablets/phones ( yes ? ) The iOS app running on some ipads/phones ( yes ? ) If the HC2 scene makes a http request to an external system ( assume no ? ) Does the HC2 FW itself leverage the API in anyway ( assume not ?) If a scene executes a http request to localhost / 127.0.0.1 (assume yes ?) .. what else uses it ? now if I send a lot of API calls.. What would people expect to be a resonable number before thresholds are hit (100 per second, 400 per second, 1000 per second ?) ----- assuming the are basic calls, (ie return a sensor state, true-false, return, global variable value,etc What starts to happen to system resources ? ---- Do I start to run out of memory ----- Do I see my CPU utilisation start to peak close to 100% ------ or does the system stay stable and the eveything start to slow down ? Thanks Frank
  23. Hello, I do not know if somebody posted it here. Fibaro, can you add label from virtual device to a condition into block scenes? It could save us many trouble with compare some desired values with label in VDs. I know, i can make it into Global variables, but they are unreliable (mine opinion only), because i think parameter "invokeScenes" is set to false by default. Many times happened to me that scene did not run, even if Global variable had desired value.
  24. Hi, I have 3 FGD212 Dimmers (with Bypass 2) which, from time to time, are turning off the light for no clear reason (no scene to trigger this) and after a couple of minutes turn on back the lights. All three of them are doing this, but not at the same time and not with same frequency. All of them are working with calibrate settings and all were updated from 3.3 to 3.4 firmware. On a couple of cases I noticed some messages related to voltage in log box (between HC2 logo and weather panel), but disappeared quickly. All of them are in the main electrical circuit, so I think that if indeed was a voltage problem all three should turn off at exactly the same time - but this does not happen.. My HC2 have 4.090 firmware. There is an API or something to see historical messages from that log box? Can somebody give me a hint what to look for next? How can I make them stop turning off and on by themselves... Thanks, Andrei
  25. Hi there, I just started to explore LUA. Last week i bought a NoDon WallSwitch (4 buttons, 4 functions per button: SinglePress, DoublePress, Hold, Release). I needed to program it to start separate scenes (this was the easy part) and also be able to use the Hold/Release option to set 2 dimmers separately to a specific level. I could not find any samples, so i decided to write my own (actually by first own LUA script). Please have a look (reuse it for your own is much appreciated). Any comments or feedback is appreciated. --[[ %% properties 166 sceneActivation %% globals --]] -- Change the value below to match the ID of the wall switch of your choice local WallSwitch = 166 -- NOTE : Change the value also in the header to match the ID of the wallswitch -- LUA code for NoDON WallSwitch (4 buttons, 4 triggers each : SinlgePress, DoublePress, HoldPress, HoldRelease) -- Hans Somers , v0.6 , 14AUG2016 -- v0.1 Button 1,2,3,4 are programmed to start a separate scene with Single or Double press -- v0.3 Button 2 and 4 are programmed for PressHold to set a dimmer to desired level -- Button layout (this is for NoDon Wall Switch) -- Button SP DP HP HR -- Button 1 10 13 12 11 -- Button 2 20 23 22 21 -- Button 3 30 33 32 31 -- Button 4 40 43 42 41 local ButtonPressed = tonumber(fibaro:getValue(WallSwitch, 'sceneActivation')) -- Declare button values (change this for other switches) local Button1_SP = 10 local Button1_DP = 13 local Button1_HP = 12 local Button1_HR = 11 local Button2_SP = 20 local Button2_DP = 23 local Button2_HP = 22 local Button2_HR = 21 local Button3_SP = 30 local Button3_DP = 33 local Button3_HP = 32 local Button3_HR = 31 local Button4_SP = 40 local Button4_DP = 43 local Button4_HP = 42 local Button4_HR = 41 -- Scene IDs for scenes to trigger with Single Press or Double Press local SC_Scene01 = 9 local SC_Scene02 = 10 local SC_Scene03 = 17 local SC_Scene04 = 19 local SC_Scene05 = 12 local SC_Scene06 = 11 local SC_Scene07 = 20 local SC_Scene08 = 21 -- Dimmer 1 to be set using HoldPress, change this to your Dimmer device local ID_Dimmer01 = 157 -- Start level for dimmer 1 local LV_Dimmer01 = 0 -- Increment value for dimmer 1 local IN_Dimmer01 = 5 -- Max value for dimmer 1 local MX_Dimmer01 = 100 -- Dimmer 2 to be set using HoldPress, change this to your Dimmer device local ID_Dimmer02 = 161 -- Start level for dimmer local LV_Dimmer02 = 0 -- Increment value for dimmer local IN_Dimmer02 = 5 -- Max value for dimmer local MX_Dimmer02 = 100 if ButtonPressed == Button1_SP then -- Start scene for Single Press Button 1 fibaro:startScene(SC_Scene01) elseif ButtonPressed == Button1_DP then -- Start scene for Double Press Button 1 fibaro:startScene(SC_Scene02) elseif ButtonPressed == Button2_SP then -- Start scene for Single Press Button 2 fibaro:startScene(SC_Scene03) elseif ButtonPressed == Button2_HP then -- Press and Hold Button 2 to set the Dimmer level -- Turn Lamp on at current dimm level fibaro:call(ID_Dimmer01,'turnOn') while ButtonPressed == Button2_HP do -- if Max level reached reset to 0 if LV_Dimmer01 >= MX_Dimmer01 then LV_Dimmer01 = 0 end -- Set lamp to desired level fibaro:call(ID_Dimmer01,'setValue',LV_Dimmer01) -- Increase LampLevel with IN_Dimmer01 % LV_Dimmer01 = LV_Dimmer01 + IN_Dimmer01 -- wait 0,5 sec fibaro:sleep(300) -- Check again for Button Pressed ButtonPressed = tonumber(fibaro:getValue(WallSwitch, 'sceneActivation')) end elseif ButtonPressed == Button2_HR then -- Do Nothing elseif ButtonPressed == Button2_DP then -- Start scene for Double Press Button 2 fibaro:startScene(SC_Scene04) elseif ButtonPressed == Button3_SP then -- Start scene for Single Press Button 3 fibaro:startScene(SC_Scene05) elseif ButtonPressed == Button3_DP then -- Start scene for Double Press Button 3 fibaro:startScene(SC_Scene06) elseif ButtonPressed == Button4_SP then -- Start scene for Single Press Button 4 fibaro:startScene(SC_Scene07) elseif ButtonPressed == Button4_HP then -- Section for Press and hold Button 4 to set dimmer to specified level by holding the button -- Turn Lamp on fibaro:call(ID_Dimmer02,'turnOn') while ButtonPressed == Button4_HP do -- if Max level reached reset to 0 if LV_Dimmer02 == MX_Dimmer02 then LV_Dimmer02 = 0 end -- Set lamp to desired level fibaro:call(ID_Dimmer02,'setValue',LV_Dimmer02) -- Increase LampLevel with IN_Dimmer01 % LV_Dimmer02 = LV_Dimmer02 + IN_Dimmer02 -- wait 0,5 sec fibaro:sleep(300) ButtonPressed = tonumber(fibaro:getValue(WallSwitch, 'sceneActivation')) end elseif ButtonPressed == Button4_HR then -- Do Nothing elseif ButtonPressed == Button4_DP then -- Start scene for Double Press Button 4 fibaro:startScene(SC_Scene08) else fibaro:debug('Error, unknown button pressed:' .. ButtonPressed) if ShowDebug == 1 then fibaro:debug(ButtonPressed) end end
×
×
  • Create New...