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

  • 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





Found 20 results

  1. Hi, I am aware that the easy integration with motion detection is to trigger a light upon motion detection and then simply set a timer to turn it off again after X seconds. Like so, typically: hub.call(358, 'turnOn') hub.setTimeout(300000, function() hub.call(358, 'turnOff') end) This of course is not the best use case for a house. It would be much more elegant to let a user move around in the house, turn on the light where motion is detected and then turn it off again when there is no motion for X minutes. You may ask, how is this any different? Here is why: I walk into a room, the code above triggers, and I have 300 seconds to do what i need, and then the light WILL TURN OFF. If I push the actual wall button to get the light on permanently, it does not matter, because the motion trigger will override the wall button, and TURN OFF the light as scheduled (300 seconds), EVEN IF I pushed the wall button. So this requires something more elegant. Does anyone have something to do this? Here is what I want to achieve: 1. Motion trigger: turn on the light in that room/zone 2. Wall button pressed affecting the same light: behave like a button (toggle light). Dont let the motion trigger turn it on again if I just turned it off. 3. When no movement after X minutes, turn off the lights. (even if wall button pressed) In my other favorite coding language (Which is not LUA, yet, I admit!!), I would do the following: 1. Keep a table of all triggers of all motions, with the ID of the triggered sensor and the last time triggered, and the lights (IDS) turned on upon that trigger 2. Check the table every X seconds and if the last trigger time is now X minutes old, turn the associated lights off 3. Advanced functionaltiy: If a wall button is pressed affecting the same lights from #1, dont let the motion turn it on again for X minutes. ("Respect the Button"). Extend the time to turn it off in #2 by Y minutes but it will still be turned off upon no motion in X+Y time. I have literally no idea how to achieve this in LUA and in particular the LUA that Home Center 3 uses. Anyone have pointers on this? Best regards
  2. Version 1.0.3


    UHAS v1.0.3 (Universal Home Automation System) for HC2 UHAS INTRODUCTION UHAS is a set of scenes and Virtual Devices (VD) that provide the following capabilities: Auto translation of all scenes, VD's, predefined global variables, and messages to 31 different languages (19 directly supported by HC2) (NOTE – not all languages are translated, and users are very welcomed to help with translations that are not yet done) Scheduled and repeating events based on time of day, week, month, and season including Scene FTBE which provides repeating and scheduled actions Advanced Notification Center (ANC) brings centralized notifications with support for most popular services like Pushover, Telegram, GroupMe, WhatsApp and Signal, Sonos TTS and LaMetric TIME smart clock notifications Advanced Lighting Control (ALC) with integration for Philips HUE, Nanoleaf, LIFX and Blebox devices (will be provided in separate package) Very Smart Blinds (VSB) automation Presence monitoring and control with geofencing and Netatmo presence Weather state and forecast with notifications and integration for Netatmo weather station and WeatherFlow and Tempest weather stations Home consumption monitoring and recording Appliance monitoring - with notifications Safety alarms fire and flood Security alarm integration ready with provided global variables Irrigation control based on FIBARO devices Scenes ready to use with Fibaro dimmer 2, Fibaro keyFob, Fibaro Swipe, Fibaro Button and Remotec ZRC-90 central scene activation with built in support for ANC HC2 system status notifications, automatic backups and many more... UHAS OVERVIEW UHAS has been developed for the Fibaro Home Centre 2 (HC2) home automation controller, as a series of modules, which are responsible for one particular action or job, and the user can interact with them as a group, or on their own. UHAS provides an advanced Home Automation (HA) set of features, ready to be used out of the box with minimum user effort to set up and run. Running code is provided as part of the system, doing most of the settings for the user or a systems installer. UHAS is primarily intended to be used by users of the Fibaro HC2 system who wish to have fully featured HA without the need to learn LUA programming and spending a lot of time with coding Virtual Devices and scenes. UHAS can also become a part of a mature Fibaro system installation which has developed with many modules to cover more advanced HA and more devices. UHAS Virtual Devices and scenes use proprietary code developed by author. This code is developed to minimise users involvement in installation and setting of the system. Most of the necessary setting is done by the UHAS components and other settings are simplified and minimised as much as possible. This was also possible because all UHAS VD's and scenes use role system that is used to find necessary components for actions to be performed. UHAS Virtual devices category is set automatically during translation or changing of the main icon. This means that most of the VD's should show in proper category in new mobile app as lights, blinds, gates, ambience, climate, safety, security, multimedia, remotes and other. The same goes for scenes, when scenes save their settings after first manual run then also category is set. UHAS PREREQUISITES Fibaro Home Center 2 (HC2) with firmware version 4.120 or higher (recommended but not necessary expanded RAM memory to at least 2Gb) Configured and installed z-wave devices – I.e., light switches, motion sensors, lux detectors etc. INSTALLATION AND UPGRADE NEW USERS - Please download provided UHAS v1.0.3 Installation package and UHAS Installation and User Manual v1.0.3 EN EXISTING USERS - if your UHAS is: Not yet started with installation then please download full package UHAS v1.0.3 Installation package and install. Still on v1.0 or V1.0.1 then please first download UHAS v1.02. upgrade package and install. Lastly download and install UHAS v1.03. upgrade package Installed v1.0.2 then please download UHAS v1.03. upgrade package and install. NOTE - Upgrade instructions are provided in UHAS Installation and User Manual v1.0.3 EN ADDITIONAL NOTE - In UHAS Installation and User Manual v1.0.3 EN instructions for ALC scene upgrade say: UPGRADE INSTRUCTIONS – This upgrade is recommended. To upgrade and keep your ALC Scene settings please copy new code from ALC Scene v1.3.3.lua from line: -- NEW v1.3.3 - copy code from here to the end of scene code to keep your settings above this line to the end of code. The mentioned line I forget to add to the code before making upgrade package, therefore please copy new code from line: -- THE CODE BELOW DOES NOT REQUIRE MODIFICATION BY THE USER to the end of code. Thanks goes to @MiZ for pointing that out 🙏 IMPORTANT NOTE UHAS uses its own unique global code variables. This means that UHAS will NOT influence the current system scenes, scripts, or virtual devices in any way, even if any of Sankotronic’s earlier UHAS beta versions and standalone scenes or VD's (Virtual Devices) are being used. There is no need for any changes to be made to the existing code before the installation of UHAS. The UHAS global variables are created and controlled automatically by the system so that you do not need to maintain them manually. UHAS INSTALLATION PACKAGE CONTENT (29.1Mb) 92 Virtual Devices 53 scenes Icon sets for all the above VD's and scenes THANK YOU! ❤️ I want to BIG thank to @clowg for helping me with translations and writing manual these last days speeding up publishing UHAS. BIG thank to @gucio1234 and his son Cyprian for making logo for UHAS and 3D printed with real gears! I just love it ❤️ I also want to thank many of you who helped during testing of UHAS beta versions and with translations! @clowg, @speedoxx007 ,@Bodyart, @jimicr, @gucio1234, @jompa68, @Sjekke, @robw, @rbhun, @lennypenny, @FunkFib, @MarcoT, @Orgli, @MarcoTorino71 and many others. Your help is greatly appreciated. Apologies to all other not mentioned nice people who contributed in making UHAS. I also want to thank gurus of this forum @petergebruers, @jgab, @cag014, @SmartHomeEddy and others for help with coding in LUA. And of course a BIG thank to Fibaro for providing Home Center 2 and Home Center 3 for developing purposes! BIG THANKS! also to all UHAS users for their donations! Your support is greatly appreciated! 🙏 TERMS AND CONDITIONS Permission to use, copy, modify and distribute this software and its documentation for educational, research, personal use and non-profit purposes, without fee and without a signed licensing agreement is hereby granted, provided that the copyright notice, with "Terms and conditions" and "Disclaimer" appear in all copies, modifications and distributions. It is strictly forbidden to sell, rent, lease and/or lend this software for profit without prior consent from the Author. DISCLAIMER This software is provided by copyright owner "as is" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the author and distributor be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage. Fibar Group S.A. and their employees are not responsible for support of the UHAS. Please contact the author Sankotronic, on the Fibaro Forum, for any questions or support required.
  3. I purchased some downlights that work with Hue. I added them to hue and ensured they work. then I added them to fibaro using the plugin with no issues. I set the color to what I want in the app (in this case I want bright white). I run a scene to figure out the value, brightness and saturation. I then put it in a VD as a saved color. once I press the saved color in fibaro the light changes to an off blue color instead of bright white. I can get the light back to a bright white by going to the hue app and adjusting the color so I know its not the light itself. Does anyone know if Hue changed a setting that does not allow the light to change to the correct color? in the app they have 2 different selections for colors and White not sure if this makes a difference on fibaro now. HC2 latest OS @T.Konopka
  4. (I'm a n00b. Using a Home Center 2) I have a space where I want any one of three (motion) sensors to be able to switch lights on, and when not more activity has been sense for some time, switch them off. I'd like to extend it such that the lights only come on between sunset and sunrise. I have created 4x scenes, 3x Turn On, 1x Turn Off. The logic I am using is: I created a Global Variable (called LastOnTime) to track the last activation/on time. All of the motion sensors trigger a scene that turn the lights on; and set the LastOnTime to os.time() - I have three copies of that scene. I created one more scene that is triggered off a timer; then if [os.time() - LastOnTime] > 600 turn the lights off. The scripts are below. Questions I have are: is this a good way of doing it? is there a better way? the timer is not working (the scenes are not triggered). I found this 'hack' somewhere in this forum. how do I put something here to check os.time() > [sunset] ? ---------- The On scenes look like: --[[ %% properties 58 value %% weather %% events %% globals --]] local minLight = 100 local motionSensorName = 'F438944-Motion' local motionSensorId = 58 local luxSensorId = 60 fibaro:debug('Lights On - ' .. motionSensorName .. ' (' .. motionSensorId .. ')') local startSource = fibaro:getSourceTrigger() local currentTime = os.time() local deviceStatus = tonumber(fibaro:getValue(motionSensorId, "value")) local currentLux = tonumber(fibaro:getValue(luxSensorId, "value")) fibaro:debug('Device Status: ' .. deviceStatus ) fibaro:debug('currentTime: ' .. currentTime ) fibaro:debug('Lux: ' .. currentLux ) if ( (deviceStatus >= 0) and (currentLux < minLight) ) then fibaro:debug('Turn On Lights') fibaro:call(20, "turnOn") fibaro:call(24, "turnOn") fibaro:debug('Set Global Variable (LightsOnTime) to ' .. currentTime) fibaro:setGlobal("LightsOnTime", currentTime) end fibaro:debug('Complete') The Off script looks like: --[[ %% properties %% events %% globals %% time log *00:01 zoneAlights --]] local currentTime = os.time() fibaro:debug('currentTime: ' .. currentTime ) local lastOnTime = fibaro:getGlobal("LightsOnTime") fibaro:debug('lastOnTime: ' .. lastOnTime ) local delta = tonumber(currentTime) - tonumber(lastOnTime) fibaro:debug('delta: ' .. delta ) if delta > 600 then fibaro:debug('Turn Off Lights') fibaro:call(20, "turnOff") fibaro:call(24, "turnOff") end
  5. Version 1.0.0


    Classic indoor E27 bulb for dimmers. Includes icons for off state and 10 to 100% brightness.
  6. Version 1.0


    Twinkly Light VD v1.0 (standalone version) IMPORTANT NOTIFICATION! If you plan to continue use this VD with your Twinkly LED then DO NOT update them to latest firmware 2.7.1 because it will stop working! Some companies just refuse to understand importance of HA integration and it is just up to some geeks to publish unofficial API and make integration possible. INTRODUCTION Twinkly lights brings amazing effects and most stunning light animations to users fingertips. This beautiful Christmas lights can now be controlled by our Fibaro gateways. PREREQUISITES Fibaro Home Center 2 with firmware 4.120 or higher At least one Twinkly light (1st or 2nd generation) connected to home WiFi network with static IP address setting. VD is tested with 190 RGB LED icicle and 250 RGB LED strings of 2nd generation and also strings of 1st generation at the time of publishing FEATURES User can install multiple instances of VD for as many Twinkly lights he/she might have. Only one scene is needed to be installed for any number of Twinkly Light VD’s Uses local WiFi network connection for control. Provides turning on/off and changing brightness of the Twinkly light. Provides control from other code and scenes by using global variable and Update button. Multi language support with 27 languages. VD will be automatically translated to HC selected language or user can select any other available language. Easy setup for VD icons with automatic setup of icons for buttons and sliders too. (UHAS™ compatible version has even more easier icon setup) Self adding and checking of global variable data integrity. Automatic repair of global variables without user intervention INSTALLATION Please check provided User Manual where all steps are explained in detail and video kindly provided by @MarcoTorino71: PACKAGE CONTENT Twinkly Light VD v1.0 (standalone) 2 icon sets for VD (icicle and strings) Twinkly Light Scene with icon User manual v1.0 EN CREDITS The Author wishes to acknowledge the help received from the Fibar Group S.A. in that they have kindly supplied the use of a HC2 for development purposes, free of charge. The Author also wishes to thanks to Pavol Babinčák for providing unofficial API reference documentation for Twinkly – Smart decoration LED lights for Christmas. Big thanks to @MarcoTorino71 for video! TERMS AND CONDITIONS Permission to use, copy, modify, and distribute this software and its documentation for educational, research, personal use and non-profit purposes, without fee and without a signed licensing agreement, is hereby granted, provided that the copyright notice, with "Terms and Conditions" and "Disclaimer" appear in all copies, modifications, and distributions. It is strictly forbidden to sell, rent, lease and/or lend this software for profit without prior consent from the Author. DISCLAIMER This software is provided by copyright owner "as is" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the author and distributor be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage. Fibar Group S.A. and their employees are not responsible for support of the Twinkly Light VD. Please contact the author Sankotronic, on the Fibaro Forum, for any questions or support required. LEGAL NOTICE Twinkly is registered trademark of LEDWORKS SRL registered in Italy and other countries. VERSION HISTORY 1.0 - First release of standalone version build on VD code for UHAS™ Here is look of the Twinkly Light VD: Enjoy coding and your new Twinkly Light virtual device! Sankotronic
  7. While working from home for eight months now I had the need to toggle a light or run a scene from my Windows 10 laptop. After some Google I didn't find an app so I decided to learn basic C# and create a Windows tray application myself. The application loads your configured rooms, devices and scenes from your HC2/HC3 and puts them in a menu in the system tray. Now you can run a scene or toggle a light switch without reaching for a wall switch or your phone. ? The program looks like this: I Iearn and get a lot from the Fibaro community, therefore I made the code open source on GitHub. You can download the application from the releases page. You only need the .exe file. I don't own a HC3. If it also works on the HC3 please inform me. Than I add it to the documentation.
  8. Version 1.0.0


    File: ikony_sceny.zip Modified icons for most common HC3 scenes - blinds, lights, blinds + lights. Size 128x128px, PNG, transparent background. ikony_sceny.zip
  9. My aeotec RBG bulb will turn off physically but the switch on the UI will remain "on". this is causing my scenes to not run correctly. Sometime when I turn it on it turns on then I will turn it off and it will flip the switch back to on even though the light is off. Has anyone seen this before?
  10. Hi, I'm no fan of the build-in alarm in HC2 so I'd like to create my own scenes/VD's for this. . @Sankotronic is working on a very promising UHAS system but his plans are pushed out (no offence, he released real nice things already, I'm fan) so I decided to move on, writing some code myself with hopefully some help of you ;-)! What do I use in my alarm; > Lights (selected regular lights in the house to switch to 100% when alarm is breached) > Door/window sensors > PIRs > Sirenes (for acoustic alarm) > flashlight (for visual alarm) > RGBW led indicator (at the entrances to notify alarm is; just armed (leave the house indicator), armed (not safe to enter indicator), disarmed(safe to enter indicator) What do I want; > Fibaro remote keychains available to manually arm/disarm the alarm > All users have a IFTTT account on their phones to trigger a scene when entering/leaving home (geofence). This will set my global "guestmode". (bad exerience with Fibaro GPS) > When nobody is at home, the global "alarmmode" should set to "FullAlarm". At "FullAlarm" all PIRs and D/W's sensors are set to armed. (report error when not in safe state when arming). > When at night (Darkness) all users are at home and all PIR and D/W are safe for X time, "sleepstate" to be set "sleep" else "awake". > when at sleep, the "alarmmode" will switch to RingOnly. Only the D/W sensors will be armed (not PIR). When a PIR is breached the alarmmode will be set to disarmed state. When sleep state is reached again the alarmmode will switch back to RingOnly. > if armed and breached, the alarm is triggered. The sirenes and flashlight will start to run and all lights will be set to 100%. If all D/W and PIR are safe for X time, alarm to back to armed state and lights off. > if armed and breached, the timestamp of alarm will be logged. If alarm is disarmed after it was breached the notification LED will warn for this. > If I disarm the alarm, put all lights/DW in safe state. > Notifications via Pushover or even better, use the message hub of @autofrank with Fibaro PopUps and Push services. Unfortunately I currently have errors with the message hub. What is my current status. All code based on simple if/then LUA coding, no fancy loops. DONE: scene to check all PIRs Scene will set global variable DONE: scene to check D/W sensors. Scene will set global variable DONE: One scene to take care of the global sleepstate DONE: One scene to take care of the global guestmode DONE: a VD to manually set alarmstate and alarmmode. DONE: a VD to manually set guestmode todo: a mainalarm scene to arm/disarm the alarm (based on above algorithm) todo: an alarm scene to trigger the alarm when breached (or merge this in the mainalarm scene) todo: scene(s) for RGBW led indicators todo: scene(s) for the push notifications (Alarm breached, error (Eg door/window open when arming the alarm) I noticed that I get stuck with the remaining scenes. I'm no programmer, so I use mainly simple if/then LUA code. With a lot of scenes in the alarm you easily get lost. In an attempt to keep my coding cleaner/more condensed I want to use tables/json. I already use the Hometable but that's just a simple copy the instructions of @AutoFrank. Questions; For the remaining alarm scenes I have difficulties how to store a table in a global and even more how to use from a table. The tutorials on this topic are not clear to me yet. For example, when the alarm is breached, how to switch all lights to 100% for the device IDs in a global(table). I have seen examples of code like k,v in (i)pairs but I don't get it yet. Can somebody help me with some code examples? Any other suggestions on my ideas for an alarm? Thanks! Regards, Jules
  11. Hi! I have been using HC2 for 2 years now. I have 3 scenes, in which i use when i leave the house or come home. 1. Nobody home - Turns off all lights, and turns the heating down on multiple devices. WORKS 2. Gone Away - The same as nr 1 but more extensive heat management. WORKS 3. Came Home - This has the problem. I use this to turn on the heat again, and to turn off some general lighting. The heating works like it should, no problem, everything get the SetTemperature that it should. The problem is the lighting. You can see them turn on in the Interface for a second, then they all fall to off again. If i run the scene multiple times, it may eventually turn them on. I have tried the following: - Changed the triggers to and from a device's state, to a variable. No change, and why should it? The scene never fails to trigger, just to work properly. - Changed the scene from using my premade "general lights" scene and instead, configuring all the lights by themselves. Even if i Trigger my general lights scene with the come home scene, or have them all configured in the come home scene individually, i get the same result. I can see them turn on in interface, the falls off again. I have built the scene with blocks, but changed it to lua for easy reading. Scene 104 at the end is just my General lighting scene, which works just fine outside this scene. --[[ %% properties 84 value %% weather %% events %% globals --]] local startSource = fibaro:getSourceTrigger(); if ( ( tonumber(fibaro:getValue(84, "value")) > 0 or tonumber(fibaro:getValue(84, "value")) == 0 ) or startSource["type"] == "other" ) then fibaro:call(339, "setThermostatSetpoint", "1", "23"); fibaro:call(348, "setThermostatSetpoint", "1", "25"); fibaro:call(324, "setThermostatSetpoint", "1", "20"); fibaro:call(71, "setThermostatSetpoint", "1", "20"); fibaro:call(79, "setThermostatSetpoint", "1", "24"); fibaro:setGlobal("HjemmeBorte", "Hjemme"); fibaro:startScene(104); end Anybody seen this? Best regards
  12. Hey guys, I thought it would be a nice idea to share some of the new scenes which people are using. This way it could potentially give people inspiration on what the system can do while also helping people with similar scenes to perfect them of use them in a more efficient way. So I suppose I will start... Today I have put together a lighting scene, it took quite a while because it's two scenes per room. I started by adding 3 variables called time: Day, Dusk & Night. I have set a scene to trigger the variable depending on the time, so Daytime starts at 8am, Dusk becomes active at dusk (set by Fibaro's time clock) and finally night becomes active at 10pm. The break down is: Day - No lights Dusk - Lights at 100% brightness Night - Lights at 10% brightness I have attached the block scenes below. I can't wait to see what you have all been up to with your HC.
  13. Hi everyone, It appears my hue lights are not responding to any scenes after the HC2 and hue hub had a power outage. is there an easy way to reset this? I dont want to create new bulbs with new device ID's because then i will ave to change all my scenes Thanks in advance!
  14. Hi, I currently use the script (Scene) below to turn off all lights when going to sleep. The problem is sometimes my adult children are still awake upstairs. How would I modify scene to turn off only downstairs lights? HC2 - Running latest version I thought of using the description field in devices and evaluating but can't work out the code. Help! --[[ %% properties %% events %% globals --]] local ids = fibaro:getDevicesId( { interfaces = { "light", }, properties = { dead = false, }, enabled = true, visible = true, -- optional --userDescription ~= "", -- attempt to evaluate if user description in device is not nil. } ); -- loop through light ids for i, id in ipairs(ids) do fibaro:debug("Turning off " .. fibaro:getName(id)); -- turn light off fibaro:call(id, "turnOff"); end Thanks Jason
  15. I have a simple Lua script that after no motion (between 2 motion sensors) has been detected for 20 minutes then lights turn off. my script is not working properly the lights keep turning off after a few seconds of the last motion sensor becoming safe. Can someone see what I have done wrong in the script. Thanks! --[[ %% autostart %% properties 51 value 86 value %% weather %% events %% globals Day_night --]] local startSource = fibaro:getSourceTrigger(); if ( ( fibaro:getGlobalValue("Day_night") == "Day") and ( tonumber(fibaro:getValue(51, "value")) == 0 and tonumber(fibaro:getValue(86, "value")) == 0 ) or startSource["type"] == "other" ) then setTimeout(function() fibaro:call(76, "turnOff"); fibaro:call(78, "turnOff"); end, 1200) end
  16. Hi guys, I would please need help with my scene. My aim is to turn automatically light off after specific time. This works until this happens: 1) user turns the light on 2) user turns the light off before 10 minutes 3) another user comes and turns the light on 4) the previous scene is still running and turns the light off when it finished 10 minutes What I would like is: 1) turn manually light on and start counting 10 minutes 2) if the light was not turned off manually within 10 minutes, turn the light off 3) if the light was turned off manually within 10 minutes and another user turned the light on again (within the first run), start new sleep for 10 minutes and so on Here is what I have: --[[ %% properties 45 value %% events %% globals --]] if (fibaro:countScenes() > 1) then fibaro:abort() end; local myState = tonumber(fibaro:getValue(45, "value")) if (myState > 0) then fibaro:sleep(10*60*1000); fibaro:call(45, "turnOff"); end Thank you for any help, tampiss
  17. Hi all, After a long time, i got it finally working. (my knowlegde go LUA is almost 0) I would like that the lights only getting on when the house is in evening or night status. Or maybe even better when also/or the LUX is getting below 60.. This code for updating my house state: [ %% properties %% autostart %% globals --]] -- Scene : Time of Day -- Version : 6.0.3 -- Release Date : 14 January 2016 -- Compatibility : Home Center 2, v4.030 to v4.063 Beta -- Purpose : Check time of day and Set global variable -- Trigger : None -- Contributors : Fibaro Forum - petergebruers, boerremk and many others who have shared bits of scripts in the forum -------------------- Configuration - Scene Info sceneName = "Time of Day"; sceneVersion = "6.0.3"; -------------------- Configuration - Time Offsets -- Set the offset time in minutes -- Set positive offset value for after Sun-rise/set, negative value for before Sun-rise/set, zero for no offset offsetSunrise = 0; offsetSunset = -50; -------------------- Configuration - Debug Parameters local dispExtDebug = false; -------------------- Script Functions -------------------- Function: Fibaro Debug Message with Color function fDebug(color, message) fibaro:debug(string.format('<%s style="color:%s;">%s</%s>', "span", color, message, "span")); end -------------------- Function: Fibaro Wait Time function fSleep(stime) fibaro:sleep(stime); end -------------------- Function: toTimestamp local function toTimestamp(time, offset) currDate = os.date("*t"); hours, minutes = time:match("^(%d+)%d+)"); return os.date("%H:%M", os.time({ year=currDate.year, month=currDate.month, day=currDate.day, hour=hours, min=minutes, sec=seconds }) + (offset*60)) end -------------------- Validate Source Trigger local sourceTrigger = fibaro:getSourceTrigger() fDebug("green", "Script started because of: " .. sourceTrigger["type"]); -------------------- Validate Number of Scene Instance fSleep(50); if (fibaro:countScenes()>1) then if (dispExtDebug) then fDebug("yellow", "Scene, " .. sceneName .. " is already running with " .. fibre:countScenes() .. " instances!"); fDebug("yellow", "Aborting additional instance(s)!"); end fibaro:abort(); end -------------------- Start of Scene Execution if (sourceTrigger["type"] == "autostart") then while true do local currDate = os.date("*t"); local currTime = os.date("%H:%M"); ---------------- Time-string Manipulation ---------------- %02u means unsigned int, 2 wide, leading zero currTimeAsString = string.format("%02u",currDate.hour) .. ":" .. string.format("%02u", currDate.min) varTimeOfDay = fibaro:getGlobalValue("TimeOfDay") if (dispExtDebug) then fDebug("Time of Sunrise: " .. fibaro:getValue(1, "sunriseHour")); fDebug("green", "Time of Sunset: " .. fibaro:getValue(1, "sunsetHour")); end fDebug("green", "Current Time: " .. currTimeAsString); if (dispExtDebug) then fDebug("green", "Current Time of Day: " .. varTimeOfDay); end if ---------------- Morning currTime == toTimestamp((fibaro:getValue(1, "sunriseHour")), offsetSunrise) then if (dispExtDebug) then fDebug("grey", "Time of Offset Sunrise: " .. toTimestamp((fibaro:getValue(1, "sunriseHour")), offsetSunrise)); end fDebug("grey", "Setting Time of Day as Morning"); fibaro:setGlobal("TimeOfDay", "Morning"); elseif ---------------- Afternoon currTime == "11:00" then fDebug("grey", "Setting Time of Day as Day"); fibaro:setGlobal("TimeOfDay", "Day"); elseif ---------------- Evening currTime == toTimestamp((fibaro:getValue(1, "sunsetHour")), offsetSunset) then if (dispExtDebug) then fDebug("grey", "Time of Offset Sunset: " .. toTimestamp((fibaro:getValue(1, "sunsetHour")), offsetSunset)); end fDebug("grey", "Setting Time of Day as Evening"); fibaro:setGlobal("TimeOfDay", "Evening"); elseif ---------------- Night currTime == "23:00" then fDebug("grey", "Setting Time of Day as Night"); fibaro:setGlobal("TimeOfDay", "Night"); elseif ---------------- Dawn currTime == "06:00" then fDebug("grey", "Setting Time of Day as Morning"); fibaro:setGlobal("TimeOfDay", "Morning"); else ---------------- No Match fDebug("orange", "Current time does not match any scenario."); end ------------------ Once Per 55 Seconds Wake-up fSleep(55*1000); end ---------------- End of Infinite While-loop fDebug("Scene not started, this is autostart-only!") end ------------------ End of sourceTrigger["type"] == "autostart"
  18. What's the best way to use the new Magic Scenes capability to turn on a light at 10pm and turn it off again at 1am ? At present i'm creating 2 magic scenes per light device which seems clumsy. In the magic scenes options i can see options for "turn off after X minutes" and "toggle state" etc. I also just noticed once magic scene can be conditional from another magic scene. I've not seen much talk about this type of scene on the forum yet -- who's using it and how ?
  19. I understand that the plugin in HC2 is only to enable manual control of lights from the HC2 and from the Fibaro App. Are there any other ways I could include one or more hue lights into scenes? Any coding? Anything else before I have to throw a large investment I made in hue lights or instead the Fibaro one? Many thanks for your support.
  20. I have a Home center Lite. My motion sensor to turn on my lights if it is between a certain lux in the room and if motion it detected. I have it set to not turn on the lights if it detects 0 lux in the room. This can be good for sleeping but what if it gets dark at 6pm with 0 lux in the room but I'm not ready for bed and want the lights to trigger with motion. Does anyone know of a solution to only run my scene i created between a certain range of times during the day? thanks for the help
  • Create New...