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


The category contains scenes submitted by users.
Downloading and submission terms have to be accepted.

Types of scenes: magic, block, LUA.
Types of files accepted: PDF, JPG, JPEG, PNG, LUA, TXT.
Scenes have to be described properly, screen shots are optional.
Support topics are created automatically here Scenes

Report topics and files that are no longer supported by authors.
All the files submitted have to be approved by administrators.

42 files

  1. Z-wave monitor

    This scene monitors and catches Z-wave commands traffic between controller and devices. The data displayed to user as a table which includes total commands and their properties per device, in addition same data displayed at graphical chart and shows system activities over the time. Since Z-wave protocol is not a fastest one  (in many case it's just freeze) this code helps to analyze the data and to take necessary actions to reduce overall Z-wave traffic and system load.
    Scene functionality
    1. This is not an auto started scene. You need to start it manually. While the scene is running, you can switch views  between table/chart and  monitor (follow instructions on screen).
    2. User configurable parameters are:
    gVar = true-- Create and use global predefined variable. The scene could work with local table as well, but by using global parameter you can keep history of the traffic. It very helpful when you're updating the system to new release, to compare Z-wave performance. In case you have decided to use global variable, copy the data to other variable to keep the history. To view data of saved variable please download and use Z-wave Viewer scene.  Z-wave Viewer could be executed in parallel to Z-wave Monitor as well (when using global variable only)
    logRate = 5     -- Time rate in minutes to log Z-wave activity. Used as axis X scale in charts view. Reasonable value 5 to15 minutes for 24 hours of monitoring. In case to achieve better resolution the value could be decreased down to 1 minute.
    time2monitor = 6   -- Time-slot in hours to monitor z-wave traffic, after that time, table and chart will be displayed on debug window and scene will stopped. Value of  0 hours disables auto ending. User needs to stop the monitoring. If less than hour monitoring required please use decimal fraction. For example to set monitor time to 15 minutes set, time2monitor = .25
     markId = "|0|0|", " Cyan" -- Devices (IDs) list and text color to display specific devices in defined color at monitor view for follow up purpose. In few cases you need to monitor specific device, so fill-in the device ID and it will be highlighted by different color from other devices.
    deadOnTop = {true, "maroon"}  -- Display DEAD devices on top of the monitor view list in defined text color. Since we're not always looking on the screen, so in case the system will identify dead device it will continuously display the device (in red) on debug window.
     
    All variables below are the same for Z-wave Monitor  and  Z-wave Viewer
    chartHeight = 100        -- Chart height in percents (%). Chart's default height fits debug window.  The variable changes height of all charts (devices.scenes and events)
    chartWidth = 100         -- Chart width in percents (%). Chart's default width expands according to number of samples.  User could expand the width  to get better detail view or to stretch to visualize the load on time axis or to take snap shot of entire time line. The variable changes width of all charts (devices.scenes and events)
     
    topDev2disp = 6          -- Number of most active devices to display on devices chart.  If set to zero chart won't be displayed.
    topScene2disp= 10        -- Number of most active scenes to display on scenes chart. If set to zero chart won't be displayed.
    darkSkinMode = true      -- Charts display skin mode. Set false for light (white) skin.
    dev2review={false,"|470|804"} -- Generate chart for every device in list of actual device readings over the monitoring time. For devices with two results (like power and energy) both reading will be displayed. On left and right sides of the chart  applicable scale displayed. Please note, no chart is generated for devices like motion, door and any other sensors, which provide values of true/false.
    userDev={false,"|504|_531|"} -- User defined devices and scenes IDs to generate specific combined chart. Please write underscore before scene ID |_531| 
    stackedChart=true        --  A stacked line chart is an line chart in which lines do not overlap because they are cumulative at each point. Set to false to view standard line char. All charts except ZKG chart (events,CPU and RAM) will be displayed according to this variable.
     
     
     
    Brief explanation what is displayed:
    1. Monitor view
    This snap shot includes top and dead devices marked in different color from other devices.
    Two main sections in this view:
    Header
                 1:08:07/ 6:00:00               1824 events/77 devices            event/2.3s               (Click Start for )
        Elapsed Time/Monitoring time             Number of Z-wave events/devices          Z-wave traffic rate        Click to switch to table/chart view
                   
    Devices list
    Every device displayed at follow format -
     #2/34TV509@Salon(216.7 power) 
    #2/34 -First number is number of events during logRate slot. Second number is total number for events so far.
    TV509@Salon - device name, ID and room name
    (216.7 power) - actual reading and reading property
     
     
    2. Table view
    total # - number of total Z-wave events on device
    total %  - Percentage of device's events of total system Z-wave events.
    All yellow marked headers are received Z-wave properties, except two properties, dead and deadReason which are marked in red. For each device displayed the total number of this specific properties. Red marked ID, means that device was or is "dead" 
    By hovering mouse over device IDs, device and room names will be display (tool-tip) at popup box.
    At the end displayed few extra summaries 
     Elapsed time and Start-End timestamps
    Sample log rate as defined by user. Total samples during monitoring time
    Total Z-wave events and total number of active devices
    Average Z-wave traffic rate
    Z-traffic range. Shows the highest and lowest z-wave activities during monitoring time.
    If dead devices have found, list of them is displayed
     
    3. Most active devices chart
    This chart shows events number of most active devices ( up to number of all active devices allowed by setting topDevNum variable ) on monitoring time-line. On the right-upper corner displayed ID, name and room of the device. By hovering mouse on diagrams or legend, selected item will emphasized in bold to make the item more visible.
     
    4. Most active scenes chart
    This chart shows triggers number of most active scenes ( up to number of all triggered scenes allowed by setting topDevNum variable ) on monitoring time-line. On the right-upper corner displayed ID, name and room of the scenes. By hovering mouse on diagrams or legend, selected item will emphasized in bold to make the item more visible.
    5. Review device's actual readings - (dev2review)
    For devices with two results (like power and energy) both reading will be displayed. On left and right sides of the chart  applicable scale displayed.
    This chart most useful to identify  if device configured to send reports interval at high rate and " differ in readings to send report" set to very low value.
    By hovering mouse over the chart, will scale down the diagram to make visible entire range. In case the horizontal scrollbar is not in the middle of the chart , the diagram will flicker.
      
     
     
    6. User defined combined chart
    In some cases we  need to inspect behavior of some devices and scene that triggered by the device. This chart shows user defined devices and scenes on monitoring time-line. On the right-upper corner displayed ID, name and room of the scenes and/or device. By hovering mouse on diagrams or legend, selected item will emphasized in bold to make the item more visible.
     
     
     
    7. ZKG Chart View
    Chart view shows Z-wave traffic and system load on time line (based on logRate value). You actually could see your smart home beating heart (like EKG). I have named as ZKG (Z-wave cardiogram). Now it's possible to see the "rush" and "quiet" hours of the system.
    Chart view includes 5 diagrams displayed over time-line of monitoring period. The diagrams are:
    Z-wave events Triggered scenes CPU1  percentage CPU2  percentage RAM  percentage At top-right corner of the screen, displayed legend of the diagrams and colors.
    Events total number in same color as a diagram line.
    CPU1 min  > avg < max in same color as a diagram line.
    CPU2 min  > avg < max in same color as a diagram line.
    RAM min  > avg < max  in same color as a diagram line.
    Triggered scenes total in same color as a diagram line.
    Most triggered scene ID  and scene's name in same color as a triggered scenes
    In case dead devices have found during the monitoring period, the time stamp where it happened will colored red and at the top of the screen, directly above the time stamp, dead device(s) ID displayed.
    Axis Y has two scales. Left scale  represents occurrence numbers of Z-wave events and triggered scenes. Right scale is a percentage and it related to CPU1, CPU2 and RAM measured values.
    By hovering mouse on diagrams or legend, selected item will emphasized in bold to make the item more visible.
    I'm strongly advising to use global variable and to view the data using Z-wave Viewer in parallel to Z-wave Monitor
    The idea behind, that you can change parameters to view different devices/scenes on the fly.
    By changing user configurable parameters in Z-wave Monitor you'll need to start the scene all over again.
    Note:
    The debug text of these scenes is very big, so If you're using Clear Debug scene, please remove these scenes from the list.
     
    Please let me know if extra info is required.
    Please report if any bug occurred.

    3,555 downloads

       (13 reviews)

    110 comments

    Updated

  2. Z-Range analyzer

    First of all, I would like to express my sincere appreciation to @10der  @Alex @petergebruers  @robmac  @amilanov @Bodyart @drboss and others for their time and help to improve / debug the code.
    The scene “analyzes” mesh network configuration in the system and displays the location efficiency of the devices in table format. Table sorted by the rooms according to average location efficiency of the devices in the room (in ascending  order - from lowest to highest efficiency). More like "Z-wave mapping" in your residence.
    In addition scene analyzes location efficiency of HC2 location.
    To achieve precise data, please make sure your devices' physical location correctly associated with room names.
    For example:
    in-wall switch located in kitchen, but controls lights in garden, should be assigned to kitchen and not garden.  (the device name should be assigned as  garden lights)
    Usually inclusion of the device done close to HC2 therefore the route table is incorrect. To achieve reliable data, perform inclusion when device located in designated place/spot in residence or perform Mesh Reconfiguration to device after inclusion near to HC2.
    User configurable parameters,:
    showDevices=false          if set tot true,not sorted table of all devices will be displayed also). fontSize=100     font size percentage (80% - 150%). Big Note: 
    If you've removed device which is part of mesh route to others, the route table doesn't get updated !
    Controller continues to maintain undated route table! Mesh table must be reconfigured. (Z-Range Analyzer identifies these devices.)
    Warning: Battery powered devices cannot forward packets and cannot be used in route for others.  
    To observe data in graphic, use @10der's visualizer.
     
    Run the scene and here some details on what will be displayed:
    When or if corrupted/deleted devices have found in your system, data details will be printed before table appearance.
     
    Table header:   
    ·       Number of master (physical) and slave devices in the system. By hovering mouse over controller name, table color index and Z-Capacity are shown
    ·       Date range of displayed data (if any changes done like adding, relocating devices after this date, mesh reconfiguration requires)
    ·       HC and devices location efficiency.  If devices lack mesh route data (colored by red) present in the system, two efficiency numbers displayed. (50%/60%).
    including devices with no routes and neighbors data excluding these devices. Table columns:

     
    1.    # 
    Script's total serial number / Script's serial number in room
    2.    Room Name  %
    Room name and average location efficiency of the devices in room
    3.    Parent ID: Name
    Parent (master) device ID, name and room. Devices lack mesh route data colored by red. By hovering mouse over, child (slave) devices list is shown (and number of last 24 hours z-wave events of each slave)
    4.   %
    Percentage of location efficiency of each device in the room.
    5.     iSee
    Total number of neighbors (adjacent) devices that it can communicate with (seen by device). By hovering mouse over, devices details are shown. Great view on how device located by seeing who neighbors are.
        The data shown in two colors:
                        I.            green - Device can communicate directly to controller. Shades of green according to number of adjacent neighbors. greener, more neighbors)
                      II.            red - Device doesn’t communicate directly to controller.  Shades of red according to number of adjacent neighbors. (redder, less neighbors)
    If tilde sign appears before  the number - means the list includes device(s) that not in the system (deleted device). I devices details menu this device marked grey.
     
    4.     Last Route
     List of devices that participate in route communication to controller. By hovering mouse over list of devices details is shown.
    3.     iRoute
    Total number of devices where this device is part of communication route. By hovering mouse over, devices details are shown.
    5.     Status
    Last working route status. (OK, pending, in progress, error)
    6.     Time Stamp
    Time stamp of last working route reported to the controller.         
    7.     24History
    Master's last 24 hours events number and percentage of total events. By hovering mouse over parent in Parent ID: Description column, number of z-wave events for each slave is shown. Please notice 24 hours history based on saved logs in event panel. If you have devices that excluded from saving logs,  theirs events are not available.
     
    Points for improvement
    Location efficiency calculated relatively to your best device in system, therefore red and yellow marked devices don't necessary indicates that your system is broken.
    Special attention requires when changing/removing physical place of devices in location with low efficiency level, it could cause loss of communication or delays.
     
            I.            Parent ID: Description - Device marked red indicates lack of route data. Perform mesh reconfiguration for this device. If reconfiguration failed, recommended to exclude/include the device (Painful process and occasionally updates in code are required).
          II.            Last Route - More devices in route increase probability of communication delay and indicates that device is in distance from controller.  Since in Z-Wave each device calculates the shortest route to the destination (up to 4 hops), therefore if route includes more than three devices recommended
    Check/verify devices in route as well. Mesh reconfiguration recommended. Device is far away from HC2 or Z-wave signal interrupted.     III.            iSee - If number is in shade of red and relatively low, means the device located far away from controller and low number of adjacent neighbors in that area or device located where physical barriers such as metal panels, concrete walls and etc. are blocking Z-Wave signal. (or located in-wall socket and Z-wave signal interrupted) Increased probability of packets loss rate, delay expected.
        IV.            iRoute - As much as number is higher, means increased workload for this device (needs to track messages from this number of neighbors). Increased probability of delays from device and routed devices.  Recommended number less than five devices.
          V.            Route tables do not get automatically updated by adding a new device or device relocation. Mesh reconfiguration (in Z-Wave Panel) requires.
    Do not reconfigure mesh network when devices are not in designated spot.

    845 downloads

       (6 reviews)

    81 comments

    Updated

  3. Scene timer

    This is a scene that runs in the background and schedules your scenes that have a '%% timer' included
    (the original thread for this scene is <here>)
     
    Scenes can trigger on devices changing status (%% properties), when globals change values (%% globals) and events (%% events) etc.
    However, there is no trigger for time or timers - to allow a scene to be started at a specified time.
    Well, here is a fix for that... and it makes it very easy to start scenes at specified times of day including sunrise/sunset, at regular intervals, at specified weekdays, and at specified months...
     
    The scene below watches other scenes and allows them to declare "%% time" headers that they will be triggered on
     
    When the Timer.lua scene is installed and started (no configuration needed) we should be able to forget about it and turn our attention to scenes that we want to be triggered at given times.
    It's a perfect "tool" to have running on the HC2 as it makes it really easy to add a scene and schedule it to run at a given time. A simple added header to the scene is all that is needed:
    --[[ %% properties %% events %% globals %% time 15:00 --]] print("Scene started at 15:00") This scene will be run at 15:00 every day. To stop it from being scheduled, just remove the "%% time" lines from the header and save the scene again.
     
    A more extensive example with a scene declaring multiple triggers and retrieving the trigger when the scene gets invoked;
    --[[ %% properties %% events %% globals %% time log 15:00 bar -- scene triggered at 15:00 every day *00:15 test -- scene triggered every 15min throughout the day --]] print("Scene started") -- Redefine fibaro:getSourceTrigger do local a,b=fibaro;b=a.getSourceTrigger;function a:getSourceTrigger()local c=b(a)local d=a:args()if type(d)=='table'and d[1]and type(d[1])=='table'then if d[1].type~= nil then return d[1]end end;return c end end local st=fibaro:getSourceTrigger() if st.type=='time' and st.time then -- do something when we get a time trigger... fibaro:debug(string.format("Triggered:%s, tag:'%s'",st.time,st.tag)) end if st.type=='time' and st.tag=='log' then -- write out log messages from the time scene fibaro:debug("Time log:") fibaro:debug(st.log) end if st.type=='time' and st.tag=='error' then -- write out error messages from the time scene fibaro:debug("Time error:"..st.log) end In the scene we also redefine fibaro:getSourceTrigger() to return our timer as an "standard" source trigger. It's not strictly necessary as time triggers are of type 'other' with the arguments coming from fibaro:args(). However, this makes it more streamlined and plays well with standard fibaro source triggers. The timer scene is "drift free" so if you declare a timer on the hour you will be called exactly on the hour, and not slowly start to drift as is very common in many home made Lua timer loops.
    Standard 'time' triggers look like
    {type='time', tag=<tag>, time=<str>} tag=<tag> is the (optional) word provided last in the time rule and helps us to identify what time rule triggered our scene.
    time=<str> is the time the rule is invoked (in HH:MM format)
     
    Here we also add the keyword 'log' under "%% time" to instruct the time scene to send us log statements.
    Log statements come in two versions
    {type='time', tag='log', log=<msg>} Standard log messages are sent at startup and at midnight with the log msg containing information about the time rules scheduled. It's usually nice to get some feedback that the Timer scene has scheduled our scene and for what times.
    {type='time', tag='error', log=<msg>} Error messages are always sent (even without the 'log' keyword). Usually due to time rules being faulty.
     
    When you enable log messages your scene will also be triggered by log messages and not only timers. You need to tell them apart. A good way to test for a time trigger that is not a log message is to test if there is a .time field in the source trigger
    if sourceTrigger.type=='time' and sourceTrigger.time then --- do whatever end IN that case we know that it is a proper time trigger and not a log message, as they lack the .time field.
     
    Ok, the time rules in the example are
    15:00 bar This means that the scene is called 15:00 every day, with the identifier tag "bar"
    In the scene we get an sourceTrigger at 15:00 of type
    {type='time', time='15:00', tag='bar'} In the above example we just print out the tag.
    *00:15 test creates a repeating timer that triggers the scene every 15 minutes, and with the tag "test". We get a sourceTrigger of type
    {type='time', time='*00:15', tag='test'}  
    The generic version of a time description looks like
    %% time <time list> <conditions> <tag> : <time list> <conditions> <tag> Examples
    15:00,17:00 test
    creates two timers at 15 and 17 with the same tag "test". sunrise test
    'sunrise' is a valid time descriptor and evaluates to todays sunrise hour.  'sunset', "dawn", and "dusk" are available too. sunrise-00:10 test
    We can do simple arithmetic on times (+/-) to create offsets. 15:00 wednesday test
    timers at 15 but only on wednesday, tag "test". 15:00 wed test
    days can be shortened 15:00 wed,fri test
    or listed. 15:00 wed..fri test
    or intervals. 15:00 1..7 test
    interval with first to seventh day of the month 15:00 lastday test
    Only on the last day of the month 15:00 lastweek test
    only in the last week of the month (number_of_days_in_month-6..number_of_days_in_month) 15:00 monday lastweek test
    conditions can be combined. True for Monday of the last week 15:00 monday lastweek may..aug test
    month conditions also available. *00:15 test
    interval, every 15min starting immediately (when the script starts). Ex. 12:08:33, 12:23:33, 12:38:33 ... +00:15 test
    interval, every 15min, starting on next even 15min interval. Ex. 12:15:00, 12:30:00, 12:45:00 ... +00:15 weekends 10:00..15:00 test
    combined with weekend test (sat..sun) and time interval (10:00 to 15:00) +01:00 sunrise..sunset may..sep water
    every hour between sunrise and sunset and between May and September call scene with tag 'water' 20:30 2020/05/28,2021/05/27,2022/05/26 earth_hour
    "long date" format +01:00 oct/28/10:00..dec/30/07:00 tag
    Long date intervals. Year can be excluded and month can be the name of the month, and time can optionally be added at the end (not sunrise/sunset)  
    The <time list> should be seen as the times we want to schedule and the <conditions> as filters, excluding some times from the <time list>
    The other way to look at the list of <conditions> is that the spaces are ANDs and commas are ORs. Ex."10:00 thu,sat lasweek tag" is "10:00 ((thu OR sat) AND lastweek), tag"
     
    The complete set of conditions are:
    <time>..<time>, time interval in HH:MM or HH:MM:SS (but also 'sunset' and 'sunrise') <week day>..<week day>, day interval. mon..wed,  Thursday..Saturday <day number>..<day number> - 1..7, first to second day in current month <month>..<month>, month interval <time>,<time> -- One or more time specifiers. Ex. 10:00,11:00 <week day>,<week day> -- One or more day specifiers. Ex. monday <day number>,<day number> -- Ex. 1,8,15,22 <month>,<month> -- One or more month specifiers. Ex. june,july,august <long date>..<long date> - YYYY/MM/DD/HH:MM. Year cane be left out and time part is optional <long date>,<long date> - 2020/may/11/10:00, may/11/10:00, may/11 alldays - same as mon..sun weekends - same as sat..sun weekdays - same as mon..sun lastday - true if last day of the month lastweek - true if last week in the month true - always return true. See example below using fibaro global to disable rules false - always return false. Effectively disabling the rule. ...and they can be combined.
     
    It's allowed to end a time rule with a comment '--'. It's just removed before parsing the rule. (Wouldn't it be nice to be able to add comments to all headers?)
    Ex.
    15:00 monday test -- Trigger scene every Monday at 3 PM  
    A simple example turning on a lamp (with deviceID 55) at sunset-10min and turning off the lamp at sunrise+10min on weekdays
    --[[ %% time log sunset-00:10 weekdays turnOn sunrise+00:10 weekdays turnOff --]] print("Scene started") -- Redefine fibaro:getSourceTrigger do local a,b=fibaro;b=a.getSourceTrigger;function a:getSourceTrigger()local c=b(a)local d=a:args()if type(d)=='table'and d[1]and type(d[1])=='table'then if d[1].type~=nil then return d[1]end end;return c end end local st=fibaro:getSourceTrigger() if st.type=='time' and st.tag='turnOn' then fibaro:call(55,"turnOn") end if st.type=='time' and st.tag='turnOff' then fibaro:call(55,"turnOff") end --[[ -- Another solution if st.type=='time' and st.time then fibaro:call(55,st.tag) end --]]  
    The tag is useful to identify what timer you get so you don't have to test against time again (or you can use it as in the example above, as an argument to a function, fibaro:call in the above case).
    We can also let the tag be the name of a function called in our scene at that time. .
    --[[ %% properties %% events %% globals %% time log 15:00 bar *00:15 test %% autostart --]] print("Scene started") -- Redefine fibaro:getSourceTrigger do local a,b=fibaro;b=a.getSourceTrigger;function a:getSourceTrigger()local c=b(a)local d=a:args()if type(d)=='table'and d[1]and type(d[1])=='table'then if d[1].type~=nil then return d[1]end end;return c end end local st=fibaro:getSourceTrigger() function bar() print("Bar called") end function test() print("Test called") end if st.type=='time' and st.time then fibaro:debug(string.format("Triggered:%s, tag:'%s'",st.time,st.tag)) if _ENV[st.tag] then _ENV[st.tag]() end end  
    A more advanced feature is that time rules allows for substituting in values from fibaro globals.
    Ex.
    <myTime> monday test This will fetch the value from the the fibaro global "myTime" and insert whatever value it has instead of <myTest>. If the value was "10:00" the rule would be
    10:00 monday test The substitution can be anywhere in the rule and contain anything so be careful.
    We also watch if the value of "myTime" changes and if it does it will update the timers for the scene.
    One way to use this is to have a global, ex "Stop" that is set to "true" or "false". If we include that in a rule
    10:00 monday <Stop> test We can easily enable/disable the rule depending on what we set "Stop" to.

    241 downloads

       (5 reviews)

    0 comments

    Updated

  4. Very Smart Lights scene

    Very Smart Lights™ v1.4.3
     
     
    Hello everyone!
     
    I am so excited! Very Smart Lights™ scene just get smarter!!! Thanks to all of you for valuable feedback and requests! We are listening and acting! So here it is, completely rewritten, smarter, better scene to control your home lighting!  
     
    NEW UPDATE v1.4.3 (09 Apr 2019)
    This update brings support for Philips HUE AIO VD v3.0 standalone! I have updated instructions for setting up HUE AIO VD in scene code and also I have optimized a bit code. This scene can still work with HUE VD old versions but I humbly recommend upgrading HUE VD to the latest version.
     
    UPDATE HISTORY
    1.4.2 (11 Jan 18)
    Two updates in one day! In v1.4.2 corrected code for HUE plugin lights. Problem was that scene was turning on HUE plugin lights at brightness 1 even brightness was set to 0 to keep them Off. Thanks to @shingoo for pointing out this bug!
    1.4.1 (11 Jan18) - Corrected bug that was causing scene to stop working if RGBW lights are controlled and useIndoorLights and indoorLightsDim where set to Yes. Many thanks to @AndrewB82 for reporting this bug!
    1.4.0 (20. Jan 17) -
    What is new: 
    Darkness is not used anymore for turning On lights and dim low levels. Only TimeOfDay is now used for that purpose. Added support for different types of Philips HUE light VD. Scene now supports HUE color ambience, HUE white ambience and HUE white dimmable only bulbs and VDs. Also added support for customized HUE VD. Support for HUE plugin remain same. It is now possible to mix different types of HUE VD since now you have to define VD type for each HUE light. Ambient color settings can now be stored also for White ambience bulbs. Also added default color setting for this bulbs!
    Added two new global variables for Cooking and for Mealtime that can be used  to define different brightness levels and to keep lights On as long as this variables are set to Yes if added to extraGlobalName.
    Corrected dimming of RGBW lights when useRGBWcolor is set to Yes. Also RGBW lights will now turn on when dim low is set on defined settings.
    Corrected duration timer compensation with PIRwindowTime. Now is properly calculated and warning displayed if duration setting is lower than PIRwindowTime. Now lights will always turn on for the duration of motion sensor breach time.
    Corrected scene behavior when PresentState and SleepState are changed. When PresentState is changed to Home or Holiday scene will turn on lights when motion is detected or dim low if set for that part of day. Same is when SleepState change from Sleep to Awake. When PresentState is set to Holiday scene can be controlled by global variable triggers
    Global variable SleepState added to scene header global triggers so now scene will turn Off or dim low lights when SleepState is set to Sleep or turn on or dim low lights when set to Awake! It is not needed any more to manually run VLS scene to do that!
    Completely rewritten code for turning On/Off lights and added error handling so now you will know if there is some mistake in settings for quick correction. If you don't use special condition for HolidayLights then you don't need to setup flags anymore. If any of special conditions is not used like IndoorLightsDim and use is set to No then you don't even need to add this global variable to variable panel!
    Added debugging for lights handling so if there is any problems you can turn lightdebug to true and see how each light is controlled and what brightness setting is used for each defined light.
    Refined other debugging messages and added more colors for easier reading and fault finding.
     
    1.3.5 (09. Jan 17) - Corrected that scene turn off switch lights if user set valSWT to 0. Corrected that scene turn off RGBW lights if program is running or color is enabled if dimRGB is set to 0. Added ProjectorState global variable that can be used to additionally setup lighting for movie time with projector. So now you can have two different setup to watch movies! Don't forget to put CinemaState and ProjectorState to extraGlobalName to keep lights at predefined values!
     
    1.3.4 (09. Jan 17) - resolved bug for keepDimSleep setting that logic was reversed. Now if set to true will keep lights dimmed and false will turn them off when SleepState is set to sleep. Rectified situation when scene not turning lights on at all if not using light sensors. Corrected dimOff logic to properly dim or turn off lights depending on settings. Cleaned code of some other bugs found during testing. Also removed ™ and © symbols from code because some users reported trouble with these on Windows 10.
     
    1.3.3 (06. Jan 17) - resolved bug that was preventing extra timer using jompa68 Alarm clock from proper functioning. Extended dimOff function so now lights can be dimmed low during all day and also all night regardless of SleepState depending on your settings. Corrected scene behavior when sleepingName and PresentState global variables value changes and added debugging messages.
     
    1.3.2 (30. Dec 16) - Added support for latest version of jompa68 Alarm clock 3.0.0. Added possibility to define two different dimming levels for Evening and Night time if there is no movement in room and lights are set to dim instead switch off. Corrected bug for turning on RGBW lights if program and color set to No. Added some basic checking of user settings if HolidayLights flag, Brightness and dimOff values are missing. Corrected how scene handles ambilight settings. dim and off ambilight changed to one setting dimOffAmbilight and it must be set to Yes to use settings. keepAmbilight is just setting if you want to keep color when motion detected or use defalut colors. Even if you do not keep colors while in room they will still revert to color when no movement detected.
     
    1.3.1 (25. Dec 16)- Corrected usage of dimAmbilight and offAmbilight so that only color and saturation is remembered while brightness is set by scene setting corrected Alarm clock timer to check if it is turned Off to not keep lights on.
     
    1.3  (First public release) - Added ambilight selection so that scene remembers previous status of the HUE lamps to dim back when no motion in the room, or even leave settings after turning them off. It is also possible to select if HUE lamps will raise brightness in ambilight colors or to default settings when there is motion in the room. Now every lamp can be set to different light level for every used situation like (hoilday lights, guests, cinema, etc.) and for every part of the day.
     
    SCENE DESCRIPTION
    You need one copy of this scene for each room or space. One room can have two scenes if needed to control two different groups of lights, but one scene is not supposed to control lighting in more than one room! Here is short description (new 09. Jan 17, thanks to @clowg): 
     
    How it works:
    This scene uses Darkness and TimeOfDay global variables to change brightness of the lights when there is motion in the room and same times to dim lights when there is no motion if that option is turned on. TimeOfDay can have four different values Morning, Day, Evening and Night. Darkness can have two values Light and Dark. They both change values according to sunrise and sunset times and are very important for proper functioning of VSL scene. I recommend installing Main scene for time based events control with Sunrise & Sunset virtual device to ensure proper handling of this two important global variables. More info about Main scene you can find on provided link.
    You do not need to change the LightStatus, nor times when Morning, Day, Evening and Night starts.  Once these values are set, the Main scene will move those times according to the sunrise and sunset times.  Day duration is changing throughout the whole year and the Main scene and Sunrise & Sunset VD will make sure that everything else is following these times!
     
    SCENE SPECIFICATION 
    SCENE IS CONTROLLED BY ANY NUMBER OF MOTION, LIGHT AND DOOR/WINDOW SENSORS AND GLOBAL VARIABLES
    - With this scene lights can be controlled by any number of motion sensors, light sensors, door/window sensors and global variables that can be mirror of the motion sensors from other alarm systems or used to mimic lights while you enjoy your vacation.
    - Light level (lux) is calculated if used more than one light sensor.
    - If lights are turned On but lux level reaches turning Off threshold then lights will turn off no matter what other condition keeps them on (motion, extra devices or globals, extra timers).
     
    LIGHT DEVICES THAT CAN BE CONTROLLED
    Tested and can control any number and any combination of this types of light control devices:
        1) Philips HUE virtual device  - pls check --> Philips HUE Color & White ambience VD
        2) Philips HUE plugin
        3) FIBARO Dimmer 2
        4) FIBARO single/double switch
        5) FIBARO RGBW module including programs, color RGB/RGBW and white only
        6) FIBARO smart plug
    Not tested but can possibly control devices from other manufacturers. (need your feedback!)
    For FIBARO RGBW module you can define seven different programs for each day of the week and time of day when you want program to be run.
     
    LIGHT BRIGHTNESS AND DURATION CONTROL
    Light brightness for each individual light can be set and duration (ONLY ONE FOR ALL LIGHTS!) can be defined by these conditions:
        1) Guests time
        2) Cooking time
        3) Mealtime
        4) Projector movie time (NEW v1.3.5)
        5) Cinema time   
        6) Holiday time
        7) Indoor lights time
        ? Sleep/Awake
        9) Time of day
    All this states can be fully configured or just switched off and use only Time of day condition.
     
    EXTRA DEVICE AND/OR GLOBAL VARIABLE CONDITION CHECK
    Extra device value or/and power consumption and global variable check gives you ability to disable switching off lights for as long as status of device and/or global variable meets defined value. For example:
        1) If working table smart plug consumption is greater than 10W then keep lights on
        2) if bathroom door is closed then keep lights on
        4) if TV is on can be checked by global variable status or smart plug then keep lights in living room on and dimmed.
        5) if outside is day but overcast and/or raining then set global variable and keep lights in kitchen always on
     
    EXTRA TIMERS
    User can define extra timer that will keep lights on for predefined time. For example you can keep light on for defined time eg. 1 hour after alarm clock wakes you up. Control is done by using alarm clock global variable setting.
     
    TIMER TO TURN ON ANY DEVICE/SCENE/CHANGE VALUE TO GLOBAL VARIABLE AFTER PREDEFINED TIME
    Scene has timer that can start up any number of devices and/or scenes and/or change global variables value if it is running longer than predefined time. For example if you stay longer in bathroom so scene is running longer than 5 minutes then it can start up extraction fan and also start scene that will stop fan after predefined time and also after 10 minutes in bathroom change global variable value which will in return send push notification to your loved one that you are currently really busy  

    INSTALLATION GUIDE
    Please check this video made by @MarcoTorino71:
     
     
    Since I did a lot of comments and instructions in scene itself what and how to setup I will just use some examples here to give some more information. But first of all there are some global variables that must be added to global variable panel before scene can run correctly so here they are:
     
    GLOBAL VARIABLES DEFINITION
    All following global variables are predefined global variables to be added in lower part of variable panel! Possible values can be set in your language and then mapped to values in english used in scene code!
    1) TimeOfDay -  possible values "Morning", "Day", "Evening", "Night". This global variable value is controlled by Main scene for time based events control. TimeOfDay condition will be override by all conditions bellow. If useTimeOfDay is set to "No" then you need to setup Awake brightness settings.
     
    2) PresentState - possible values "Home", "Away", "Holiday". This global variable value is controlled on my HC2 with scenes that are run when we leave or come back home. Those scenes are actually responsible for more actions than just change value of this global variable but about them some other time. You need to take care to change value of this global variable.
     
    3) LightState - possible values "Auto" and "Manual". This variable value is set by virtual device. If value is set to Auto then Very Smart Lights™ scenes are enabled and will control lighting as needed. If value is set to Manual then Very Smart Light™ scenes will be disabled and light can be controlled old fashion way with wall switches only. You need to make simple VD to change value of this variable.
     
    4) GuestState - possible values "Yes" and "No". Value is changed either with VD or scene that is run when guests arrive. If set to Yes then lights will be set to predefined brightness level and can also be kept On during guests visit. This condition also has highest priority and will override all other conditions if set yo Yes.
     
    5) CookingState - possible values "Yes" and "No". Value is changed either with VD or scene that is run when you are busy in the kitchen. When set to Yes it will override other conditions bellow.
     
    6) MealState - possible values "Yes" and "No". Value is changed either with VD or scene that is run when you are having launch or dinner.  When set to Yes it will override other conditions bellow.
     
    7) ProjectorState -  possible values "Yes" and "No". Variable value is set by VD or scene that controls movie projector and other devices connected. As above variable if ProjectorState is set to Yes then scene will adjust light brightness to desirable levels. When set to Yes it will override other conditions bellow.
     
    ? CinemaState - possible values "Yes" and "No". Variable value is set by VD or scene that controls TV and other devices connected to TV. As above variables if CinemaState is set to Yes then scene will adjust light brightness to desirable levels. When set to Yes it will override other conditions bellow.
     
    9) HolidayLights - possible values "On" and "Off". Variable value is set by VD Holiday Lights v1.0. If value is set to On then lights will be dimmed to predefined brightness. Also scene will stop control selected lights which holidayFlag is set to 1 so that they can be controlled by some other scene or VD like HUE lamps changing colors. When set to Yes it will override other conditions bellow. If it is set to Off then other conditions will apply and scene will take over control of all lights even holidayFlag is set to 1. With all those Christmas lights blinking in color we don't want to spoil that atmosphere with main light turned on to maximum brightness so you can set special brightness level of dimmer lights and select not to turn on some of the switch lights, also you can choose some of the HUE lamps or any other lamp not to be controlled any more with Very Smart Light™ scene but use another scene to control their color or brightness change or even some of the nice mobile applications! Here you can download Holiday Lights VD that will change value of this global variable and turn on/off holiday (Christmas) lights:  [VD] Holiday Lights [Christmas Lights],
     
    10) IndoorLightsDim - possible values "Yes" and "No". This variable can be set by VD or scene. I used it to dim indoor lights during summer time to keep insects that are provoked by lights to enter our house through open windows and doors. So if set to Yes then lights in the house will stay dimmed to sleep brightness levels. This condition will be override by all conditions above.
     
    11) SleepState - possible values "Awake" and "Sleep" . This global variable value is controlled on my HC2 with two scenes. One is "Good morning" and is activated either by Alarm clock ACWUT (AlarmClock + WakeUpTime) - version 3.0.0 made by @jompa68 or manually with swipe or dimmer switch. Other one is "Good night" scene that is activated either by swipe or dimmer switch. This global is used only to change light brightness during sleep time. If you want to disable lights turning on then see bellow global variable SleepXxxxx!
     
    12) SleepXxxxx - possible values "Yes" and "No". In name of this variable use room name instead of Xxxxx. You can define this variable for bedrooms and living room if you use it sometimes as bedroom like SleepLiving, SleepMaster, SleepRoom1, etc. You need to add name of this global variable to local variable sleepingName. In comparison to "SleepState" which puts to sleep entire house or apartment this one is used to put to sleep only one room. So it can be used to turn living room into bedroom, or to disable lights in children rooms so they can go sleep earlier and we don't have to put entire house to sleep. If value is set to "Yes" then it disables smart light and immediately turns lights of. If set to "No" enables smart light and also turn on lights immediately if there was motion in the room. In our children bedrooms I setup dimmer 2 switch 2 to start scene on 1 click which then press button on VD to change state of this variable from "No" to "Yes" and vice versa so they can switch off lighting themselves. Put also this global variable under the scene header section %% globals! If you don't need it then just leave empty quotes.Value of this global variables can be changed to Yes or Sleep by simple VD with one label that will show status and one button to change status:
     

     
    All following global variables are global variables to be added in upper part of variable panel!
    12) Darkness - global variable (upper part of variable panel) with possible values 0 for day time (Light) and 1 for night time (Dark). Value is changed at adjusted time for sunrise and sunset time. This variable is also controlled by Main scene for time based events control
     
    Now when all needed global variables are defined in variable panel it is time to copy paste code to new scene and configure it. So let see through examples how to set this scene to control our lighting.
    Here is part of code where you can setup global variables names and make mapping of your values with corresponding values in code. Also you can define which of the extra conditions for light brightness levels you like to use by setting use variable either to Yes to use condition or No to not use. 
     
    Using this above global variables for different conditions allow us to automate change of lights status and it happens automatically without needing us to intervene. That's what home automation is about! Bellow is example of global variables setup for living room that can be also transformed to bed room:
     

    3,688 downloads

       (3 reviews)

    6 comments

    Updated

  5. Device list and status

    Several times I've got lost in my system to identify specific device.
    I believe many of us have old devices/scenes that have been hidden or disabled. After a while, finding them again is quite a headache and not an easy task.
    I have written a scene that shows all existing devices, scenes, users and mobile devices with some extra data of properties.
     
    The scene output has two formats:
    a list of devices by rooms a plain list of all components in acceding order of IDs  
    In order to choose between two formats please change as following:
    local plainList =false (for list by rooms) local plainList=true (for plain list in acceding order) Since the latest upgrade 4.503 there is a new type of warning "API: not found".
    So during the execution you might see a lot of messages:
    [DEBUG] 00:19:26: Gathering system information.....
    [DEBUG] 00:19:26: [1;31m2018-07-03 00:19:26.358874 [ error] API: Not found
    [DEBUG] 00:19:26: [1;31m2018-07-03 00:19:26.528578 [ error] API: Not found
    [DEBUG] 00:19:26: [1;31m2018-07-03 00:19:26.669187 [ error] API: Not found
    [DEBUG] 00:19:26: [1;31m2018-07-03 00:19:26.826398 [ error] API: Not found
    ....................................................
    Please ignore the messages and wait...
    I hope Fibaro team will fix it on stable release.

    1,294 downloads

       (3 reviews)

    17 comments

    Updated

  6. HC-WebEye

    This is JavaScript code, which displays debug information (in parallel to code development) at full screen on desktop (supports HC2 and HC3 controllers)
    Main purpose is to support scenes where debug information is in HTML format, like  All-in-One Scene, Z-wave monitor/viewer, Z-Range analyzer . All other formats will be displayed in same format as in debugger window.
    Since HTML format is not supported by HC3 and debugger window is too small, it could be a helpful alternative for better view and debug your code.
    In many cases variables values include a lot of information (like jSON table) and it couldn't be reviewed by HC interface, this application offers to display Global variables (including QuickApp variables) on "big" screen.
    Follow information and features are supported:
    Display debug information of selected scene. (HC2) Display scenes debug information filtered by messages tags including levels (trace, warning,error). (HC3).  Note: Currently all scenes print info in same debugger. Issue reported to Fibaro Group - in Progress. Start scene. (HC2/3) VD main and buttons' debug information. (HC2) Select and Press VD button. (HC2) Display current value of selected global variable. (HC2/3) QuickApp debug information. (HC3) . Note: Currently when debug info is loaded it clears debug info from HC3 debugger window. Display current value of selected QuickApp variable. (HC3) Turn On/Off (toggle method) QuickApp (HC3) Select and Press QuickApp button. (HC3) Note: Since HC3 doesn't support HTML format anymore, this is the only option to view and analyze information on upcoming All-in-One Scene and Z-wave monitor applications.
    After downloading the file  please remove .txt extension.
    Currently supported browser are  Firefox, Chrome or IE browsers.
    Recently Java Scripts are blocked by Cross-Origin Resource Sharing (CORS) mechanism, please download Disable CORS file  for further instructions how to disable CORS.
     
    How it works:
    Before execution, open the file to define HC IP-address and HC3 transfer protocol at User Configurable Parameters
    // ============= USER CONFIGURABLE PARAMETERS ================ var hcip={"HC3":"192.68.0.10","HC2":"10.0.0.69"} var protocol={"HC3":"https"} On first run, login information will be required. (To keep your credentials secured, login data is not stored in file )
    Application interface is very simple and self-guided.
    Select controller: HC2 or HC3
    Select item : Scene, V Device, Variable, QuicpApp...
    Select item of previous selected section.
    Press "Reload" button to load debug information.
    By checking debug checkbox, API executed commands are shown.
    1. If scene selected "Start" button appears.
     
    2. If V Device  selected list of available buttons shown and "Press"  button appears.
     
    3. If QuickAppDevice selected, list of available buttons shown.
    "Press" and "Toggle" buttons appear. By pressing "Toggle" button, QuickApp will turned ON or OFF in sequential order.
     
    4. If Variables selected,list of available variables shown. By selecting the variable, his current value displayed.

    675 downloads

       (3 reviews)

    15 comments

    Updated

  7. All-in-One Scene

    This script is designated to control and monitor your home system. Script automatically identifies the type of elements in the system. (Z-wave device, virtual device, scene, automatic scene (Block, Magic or Lua). Any valid Z-wave device property and his value could be monitored, controlled and execute commands accordingly.
    If you don’t want or need to use this script, but have issues with your system (like delays, z-wave devices don’t respond always, scene receives no triggers), it helpful to run this scene as is (without any changes) just to monitor and to identify z-wave “dead” and/or NACK occurrences in your system. You’ll receive on-line notifications about it.
     
    The first time you use All-in-One Scene, you will need to define jM {} hash table. Each line in table has two mandatory and two optional fields.
    jM={ {      15,         "137|630",{timeSlot={“12:00~18:00”},state="value=true",     trueAct={“|230|”, “turnOn”,””}}}   }
                 time span      IDs list                                         Criteria & Rules                            Action tables
    a)      time span   a period of time (in minutes) within which some activity must be performed by device or scene. Additional two option could be defined:
    I.        time span = 0   defines the line as activity only.
    II.      time span = ‘negative number’   line is suspended (remarked)
    b)      IDs list   given list of devices/scenes/VD/global/keywords. Use under score for scene IDs. (“_45”).
    a)      global variable – add an ampersand sign & to global variable name: &varName
    b)      keyword – add a dollar sign $ to keyword variable: $name
    Note: To use & and $ characters for other purpose , add % after the character.
    c)      Criteria & Rules     (optional) property, state, time slot, vacation mode…
    d)      Action tables      (optional) tables of commands to be executed.
    By defining String-to-number table which converts device name to ID            jS2n= {boiler=137, dryer=630}
     jM{} above table will look like, device name must be included within back apostrophe sign.
    jM={ { 15,  "`boiler`|`dryer`",{timeSlot={“12:00~18:00”},state="value=true",     trueAct={“|230|”, “turnOn”,””}}}   }
     
    1. Monitor option
    There are so many times that scenes or Virtual devices are stuck w/o any understandable reason. Some devices suddenly stop to send reports or don’t change state. In most of the cases we don’t aware about the problem till something goes very wrong.  The monitor option will send an alert in case of defined states are timed out.
    Note:  In order to monitor virtual devices, fibaro:log() command must be included in main loop or in button’s code.  For example, just add fibaro:log(“done”) at end of your main loop and VD could be monitored.
    Example to set watchdog timer for devices, scenes, virtual devices, global variables and keywords
    jM={      {8, "_17|_545",{timeSlot=”10:00~22:00”}},  -- within every 8 min.  between 10am to 10pm, scenes 17, 545 must be active. If not alert sent.
    {3,"134|618|_556|_588"},  -- within  every 3 min. devices 134,618 and scenes 556,588 must be active. If not auto-alert sent.
    {10,”132|145”,{property=”power”}}, -- within every 10 min. devices in list must report new power value. If not auto-alert sent.
    {5,”112”,{state=”value=true”}}, -- if device’s value is true over 5 minutes, auto-alert sent. (e.g. device stuck in breached state)
    {30,”470”,{state=”power>10”}}, -- if device’s power greater than 10 over 30 minutes, auto-alert sent.
    {20,”&HomeStatus|$iDoor”}} -- if global variable HomeStatus or keyword iDoor didn’t change within 20 min., auto-alert sent.
     
    2. Control option
    This part of the script enables execution of actions based on device state or value changes. Script supports many options, calculations, time modifications, if statement and other features to do almost everything that you need to control your home just with one scene (which even doesn’t trigger by the system). 
    Six action tables could be defined: (See AOS Advanced User’s Guide for more information.)
    trueAct{} - executed when state status is true. Please do not confused between state and value. If state defined as “value=false”, state status is true when value of device is false.
    falseAct{} - executed when state status is false. Please do not confused between state and value. If state defined as “value=false”, state status is false when value of device is true.
    trigAct{} - executed on every value change at any mode, true or false
    timeoutAct{} - Disables auto-alert notification and executed when elapsed time exceeds time span. Time span counting restarted after state status back to true.
    timeLoopAct{} - Disables auto-alert notification and executed when elapsed time exceeds time span. Time counting restarted immediately even if status remains true (no back to true change required).
    InitAct{} - Set of specific actions to be executed on startup only.
    Here is an example  of most common wanted scenario, to turn on light when motion sensor breached and turn off light when sensor back to safe after few minutes (3 min. in this example)
    jM={0,”`mSensor`”,{state=”value=true”,trueAct={“`lightSw`”,”turnOn”,””},falseAct={“`lightSw`”,”turnOff”,”180”}}}
    Since no need to turn on light during the day, timeslot could be defined
    jM={0,”`mSensor`”,{state=”value=true”,timeslot=”18:00~07:00”,trueAct={“`lightSw`”,”turnOn”,””},falseAct={“`lightSw`”,”turnOff”,”180”}}}
    But now could be an issue to turn off the light, if sensor breached few seconds before end of timeslot and back to safe out of time slot, falseAct{} table won’t be executed. In this case, turning light off should be part of trueAct{} table
    jM={0,"`mSensor`”,{state=”value=true”,timeslot=”18:00~07:00”,trueAct={{“`lightSw`”,”turnOn”,””},{“`lightSw`”,”turnOff”,”180”}}}
    Same Z-wave device, global variable and keyword could be defined at several lines (no limit). Scene and Virtual devices could be defined one time only.
    Please download
    1.      AOS Advanced User’s Guide - complete instructions and information
    2.      AOS Quick Guide – syntax format reference and examples
    3.      AOS HC-WebEye Viewer Guide   - AOS browser viewer guide
    4.      timeDrift – If you considering to use time drift correction, please download this scene and follow instructions at header.
     Script Advantages:
    No Lua or any software knowledge required. Supports time drift correction. (download timeDrift scene) Supports vacation and power outage modes. Provides excellent view of all devices, global and keyword variables at a glance, including: status, current value, up to 20 last values & executed commands. (Defined by dataRecord variable) Each command to be executed with current variable values is shown All items displayed by their names, including VD buttons in human readable format (not just IDs) At the bottom of the table up to 50 last commands in execution order are displayed (defined by cnnLine variable) Commands executed much faster than using system’s standard triggering mechanism (Lua, Block or Magic) No limits of scene’s “Max. running instances” Complex operation could be executed by newbie users (like experts). Anti-ripple delay could be applied. (change status after specific delay according to latest value) Actions could be executed by/from Scenes and VDs. Add/Change/Suspend any action in few seconds of work. Z-Wave traffic always monitored and summary of the traffic displayed.  Dead and NACK occurrences of entire system immediately reported, recorded and notification sent to user. Repeated commands and device’s reports (RPT) of entire system are recorded and displayed. Global variables names, elapsed time from last change and their current values are shown. (Variables used in table) Details of all actions and commands are displayed in popup menus. Keeps Z-wave traffic low as possible by verifying device state before sending command. If device ID changed (excluded/included), user needs to update device ID in one place only! No extra jSON tables. Keeps your RAM load low All data displayed  as a table where all configured devices and their related data displayed in human readable format. Extra button 'Refresh' will appear and covers 'Clear' button. Press ‘Refresh’ or ‘Start’ buttons to refresh table data.
     
    Table's header includes:
    startup time stamp, script current version, scene Name, LED as displayed at HC2 front panel, sunrise/set hours.
    System name – by hovering mouse over, system inventory shown
    Current home mode (@home or @vacation)
    system status - by hovering mouse over,  last system's activities is shown
    Elapsed time
    Total Z-wave events - by hovering mouse over summary of all activities shown
    Min, average and max Z-traffic, by hovering mouse over CPU elapsed time shown
    By hovering mouse over column headers, quick guide is shown. Quick guide displayed during 5 minutes from startup. On every manual refresh, the guide displayed for next 5 minutes.
     
    Table columns are:
    Type – device type (Z.Device, G. Variable, V.Device, luaScene, blockScene, magicScene, Auto-luaScene, Auto-blockScene, Auto-magicScene). By hovering mouse over Z.dev type column, top active devices are shown. User configurable by setting topActive global variable. (0-30) default 15
    ID: Description – room name: device ID: device name. Z-wave devices sorted by rooms, then by device ID.
    Battery capable device have green background according to current battery level. If device armed, alarm icon appears.By hovering mouse over, inventory of devices in jM{} table are shown.
    Value – items current value. By hovering mouse over, latest values, trigger value and command executed are shown.
    Criteria – state of evaluation to determine true or false status. If formula included, the state displayed in Italic fonts and by hovering mouse over, popup menu shows the formula and calculations
    Last seen – elapsed time since last status change.
    Alert – by default this column isn’t shown. If any devices have been alerted the column will be shown. Please notice that in some cases the device could be alerted, but after while it could back to normal activity. For example, if motion sensor is breached over specified time-span, alert notification will be sent. But after a while the sensor back to safe and alert is canceled, “back to normal” notification will be sent.  At header of alert column shown current number of alerts
     
    Time Span – time span to monitor state of items. By hovering mouse over, maximum reached span time shown.
    If time span set to 0, then this line acts as activity, no timeout alerts reported.
    If time span set to negative number, this line is suspended and no actions executed.
    Time Slot – Active time slot range to execute related actions. Timestamp to execute specific action at specific time.
    trueAct – list of actions to execute when state is true.
    falseAct – list of actions to execute when state is true.
    trigAct – list of actions when value changes
    timeoutAct – list of actions to execute when time-span reached.  Timer will be restarted when device state changed again to true.
    timeLoopAct – list of actions to execute when time-span reached.  Timer restarted if state still true (no state changes required)
    initAct – list of actions to execute when scene started. 
        By hovering mouse on actions cells, action’s details are shown
    In shown example for trueAct{} actions:
    a) time span of irrigation system calculated on line according to ambient temperature. min(max(floor(@47>value)-25,0)+10,18)
    b) TTS message announced (Garden Dripper has started)
    c) Irrigation is turned ON.
    The entire execution process is shown including all calculations, so user could see what exactly will happened.
    VacMode – vacation mode.  In vacation mode by default timeSpan ignored and all Z-wave devices are converted to Activities, Scenes and VDs are not monitored.  Non default vacation state could be defined in each line (vacation=”normal” or “stop”).
     
    Device index in jM{} hash table  – shows device location in jM{} hash table. By hovering mouse over cells, device description, manufacturer, zwave version and JM{} line shown.
    At the bottom of the table list of up to 60 last executed actions (in order of execution) is displayed. (like CNN news line). If the device has same state as required by command, command isn’t executed and colored pink.
     
    Table color code:
    1. Value, Criteria and Last seen columns
     green – state is true
     pink – state is false
     yellow – out of defined time slot, no actions or monitoring done.
      gray – line suspended. To suspend the line, set time-span to negative value.
     red -  in alert-state, means this line exceeds time-span and auto-alert sent.
     
    2. Time Slot
    black background and Suspended/Disabled label in gray means this line is inactive.
    Gray background and Activity label in green means the device assigned to control only. (Time span  is zero).
       green background and red progress bar, device is monitored. On timeout auto-alert sent.
    blue background and purple progress bar, device is monitored and on timeout actions executed. (No alerts)
    If global variable in use, following table will be displayed
    Type – two types are available, Local and Global variable. Local means ‘global’ variable in use within the script (if global4local defined, those values are saved). Global is actual global variable of the system.
    Name – variable name
    Value – current variable value
    Modified – elapsed time since last change
    In case dead or nAck communication occurred following table will be displayed
        ID - device ID and his description is shown.
    nAck – number of “transfer failed” events occurred.
    Dead – number of “dead” reports received
    Is dead – current device dead status (true or false)
    Events history – last nACk and/or Dead events received and time-stamp of each event.
     
    Table of top active devices in your system is shown and could be used to analyze and reduce your Z-traffic. Up to 30 devices could be displayed by  user configurable variable topZwave . Default is 15
    ID - Since most of the devices has number of slaves, master device ID and his description is shown. By hovering on the line,  slave devices and his number of events will be displayed.
    # – number of events occurred.
    % – Percentage of total events.
     
    In case reminders are active following table displayed:
    Rate – time interval to execute reminder
    RunTerms – triggers list to active reminder
    Note – send message as notification
    Reminder – reminder message
    By hovering mouse over “Run Terms” header, condition details displayed.
    Following actions are built-in :
    addRmd, logRmd, setRmd, delRmd, delAllRmd  - reminders control  
    disableScene, enableScene, startScene, killScene – scene control
    forceArm, setArmed – alarm control
    pressButton , setSlider, setProperty– virtual device control
    reboot, shutdown – system actions
    sendEmail, sendPush, sendiPush, sendPopup, sendNote, sendSms*, tts* – notification control
    setColor, setValue, turnOn, turnOff – Z-wave devices control
    setTimeSpan, setTimeSlot, setTimeDrift, timeSpanOn - time control
    setState, setStateValue, setStateDelay, setStateFormula  -- parameters control
    vacOn, vacOff, powerOutage–  special modes
    *not supported by the script. User defined functions.
    All valid actions or properties of any Zwave, Plugin or VD devices are fully supported also. 
    By insert a new action in the tables, the action will be verified by the code and if it's valid will be in use.
     
    Special features
    If an error occurs during run time, it will be displayed on fixed type men. Scene will continue to run. By manual refreshing the table three times error is no longer displayed.
    When power outage mode activated, fixed menu displayed
    When vacation mode activated, fixed menu displayed
    As mentioned at the beginning, scene stuck without any reason and it’s true for this scene as well.
    To make sure that user will be notify if the scene is failed, weather triggers at the header of the script have been defined (these triggers exists by default at all systems and always work). When trigger received and the scene is failed, notification including last debug/error message sent to user. If autoRestart set to true, scene restarted automatically. Usually it takes awhile to receive weather trigger, so to speed up failure detection, recommended to add additional trigger (like motion sensor or any other device which is active often at your home)
    Please do not remove weather triggers… during normal operation all triggers are ignored.
    --[[
    %% autostart
    %% properties
    %% weather
    Temperature
    Humidity
    Wind
    WeatherCondition
    --]]
    Using this script, I’m able to control over 95% percent of my needs, including irrigation system, heating system, bathrooms fans, all motion and door sensors, air conditioners and more.  In my system then number of scenes reduced from 48 to 4 and virtual devices from 11 to 2. In addition my RAM consumption reduced from ~80% to 30%.
    The script has many options and features, so any action could be executed in several ways therefore please feel free to ask about implementation.
    The code is over 1,000 lines, but only ~15% of the code is actually running. Rest of the code is to display, initialize and to validate hash table data on startup. Code covers ~80 hash table syntax errors. Please read carefully displayed errors and follow instructions.
     
     

    3,995 downloads

       (2 reviews)

    58 comments

    Updated

  8. Universal Alarm Scene

    Universal alarm v1.0
     

     
    Hello everyone!
     
    Here is one simple scene that can be used for FIRE, FLOOD or OTHER ALARM purpose. When triggered by sensor it will send you popup, push and e-mail notification. It can also activate additional alarm sounders. You can also add additional actions to turn On lights, lower blinds or whatever action you like to happen when alarm is breached and also when sensor get back to safe state.
     
    There is no global variables needed! If you use HomeTable then you can just uncomment line where this table is read to the scene.
     
    SCENE SETUP
    First you need to decide for what you will use this scene. You can use it for FIRE ALARM or for FLOOD ALARM or for any other purpose that you can think off. Just for setup example I will show here how to set it up for FIRE alarm. Same setup can be done for FLOOD alarm.
     
    First you need to add all your smoke detectors to scene header so that it is triggered when any of this sensors detects fire and get breached:
    --[[ %% properties 96 value 128 value 605 value %% globals --]] Then you can setup devices to which you want this scene to send push notifications. As already mentioned in my other threads, to find ID of your mobile devices you can enter this link in your browser:
     
    http://<YOUR_HC_IP>/docs/#!/iosDevices/getIosDevices
     
    and then press on button TRY IT! You will get ID numbers of all mobile devices that you can enter here:
    -- PUSH MESSAGES AND MOBILE DEVICE SETUP --------------------------------- -- define mobile devices to send push messages. Enter devices inside -- braces separated by comma local iosDeviceID = {206, 321};  
    Then you can setup messages text, translate it to your language:
    -- PUSH MESSAGES SETUP ------------------------------------------------------ -- enter push message text for breached alarm notification local pushMessage = "WARNING! FIRE/FLOOD/OTHER ALARM BREACHED!"; -- POPUP MESSAGES SETUP ----------------------------------------------------- -- enter popup message text and button caption for breached alarm local popupMainTitle = "FIRE/FLOOD/OTHER ALARM"; local popupTimeFormat = "%H:%M:%S | %d.%m.%Y."; local popupContentTitle = "ALARM breached!"; local popupImgUrl = ""; local popupButtonCaption = "OK"; Here you can setup users that will receive e-mail message. Same as for mobile devices, you can find users ID by entering following link in your browser:
     
    http://<YOUR_PC_IP/docs/#!/users/getUserss
     
    and then press button TRY IT!. You will get ID numbers of all users that you can enter here:
    -- E-MAIL MESSAGE SETUP ----------------------------------------------------- -- define users for which you want to receive e-mail warning. Enter users -- inside braces separated by comma local userID = {}; -- Translate this e-mail message text that will be sent to you. On this -- part scene will add which sensor was breached. local emailMessage = "Breached FIRE/FLLOD/OTHER sensor:" In above settings you can also setup first part of the e-mail message. Scene will on that part add room and name of the sensor that is breached!
     
    If you want to activate additional sounders because fire and flood sensor sounder is not enough then you can setup here additional sounders to be activated when alarm is activated:
    -- EXTRA SOUNDER SETUP ------------------------------------------------------ -- define alarm sounder ID inside braces. You can define more than one just -- separate them with comma. local sounderID = {128, 210}; And for the end, if this is not enough for you and you want more action to be executed when alarm is breached, like close water valves, close blinds or turn on some lighting then you can add that code yourself. There are three functions where you can add code:
    -- EXTRA FUNCTIONS WHERE YOU CAN ADD YOUR CODE ---------------------------- -- use this function to add code that will be executed before all other -- code when sensor is breached function extraUserCodeBreachFirst() -- your code goes here end -- use this function to add code that will be executed after all other -- code when sensor is breached function extraUserCodeBreachLast() -- your code goes here end -- use this function to add code that will be executed when sensor is -- back to safe state function extraUserCodeSafe() -- your code goes here end If you want some action before notifications are send and sounders activated then you add code to function extraUserCodeBreachFirst(). If you want some action to be executed after notifications are sent and sounders activated then you add code to function extraUserCodeBreachLast(). When sensor goes back to safe state scene is activated again. It will not send any messages but will stop sounders and if you want some more action then you can add code to function extraUserCodeSafe().
     
    So, one copy of this scene you can setup for FIRE ALARM. Another copy you can setup for FLOOD ALARM, and if you have something else then you can setup third copy for that OTHER ALARM.
     
    Also please check this video by Mr Apple @MarcoTorino71:
     
     
    NOTE!
    This scene is tested on my HC2 with software 4.110 up to 4.510 by breaching FIRE & FLOOD sensors and found to work flawlessly. If you encounter any problems then please first check your settings and look for typos. If you are still unable to make it work then please send me copy of complete scene code and screenshot of debugging window to my private message and I will help you to make it work!

    1,033 downloads

       (2 reviews)

    3 comments

    Updated

  9. Location Tracker

    Many users are trying to use GPS feature, but the functionality and use of HC2 location data are very confusing and most of the time don't work correctly.
    The major advance of this scene that there is no use of HC2 defined locations and localization.
    The scene triggered by location change, which received by HC2 and tracks users' presence according to predefined places. The scene sends notification (and could announce on user location in case TTS system has been defined and set) in three conditions:
    User arrived to one of the predefined places. User approaching to one of the predefined places. User leaves one of the predefined places. You can define as many favorite places as you need. For example: Shopping Mall, School and etc. to track your family members. It helps to know if your kids are actually at school, and your wife at work and not at shopping mall.
    Please note that in most of the time there is a gap of few minutes between user's actually location (physical) to location received by the system. Unfortunately in some cases no update received at all. I'm using this scene for few years and still don't have full understanding how the GPS mechanism works... when, how and why the location is updated by Fibaro mobile application and I believe  if the application closed on your mobile, no updates sent at all.
    Based on above facts, I do not suggest to execute any actions based on user location (like to open gate, lights), but I do suggest to turn on heating system (gap of few minutes better than nothing, or you already at home and your system anyway is ON)
    --=========================== USER CONFIGURABLE PARAMETERS ===============================
    eMailId   = {2}   -- user IDs to send email. To include more users use: eMailId={2,5,20}
    eMail     = true  -- if true, email will send
    popupNote = true  -- if true, popup notification will send to all users.
    pushNote  = true  -- if true, interactive push notification will send to users, which can receive Push notifications as defined at "Access Control" panel at "Mobile devices list" section.
    _TTS      = false -- text to speech message. Please before setting to true, make sure to update locationTts() function with your TTS setup.  Default code in function based on Text to Speech - Android phone/Tablet scene and could be downloaded from https://forum.fibaro.com/files/file/180-text-to-speech-android-phonetablet/
    --list of users ID and names (the reason to include names, is because the name could be email address in the system). Set scene %%properties accordingly to IDs in list. Please update according to your system
    GPSuser = {{2,"Alex"},{190, "Tammy"},{457,"Leon"}}              
    --list of points of interest to follow users' arrival, approaching or leave. Please update/add according to your favorite locations. Make sure that place coordinates are few times more accurate than locAcc variable below.
    GPSplace = {{"Home","62.1747177;64.8820022"},{"Work","62.244312;64.842668"}}
    ignoreGps = 1     -- Amount of hours to consider the location is too old and ignored. Default to ignore over one hour old user location.
    locAcc = 300      -- Defined GPSplace area in meters, to assume presence in place.
               distGap=150       -- Distance between current and previous locations to avoid messages in case same location received several times.
     
    By executing the scene manually, table with users' last location and their distance from predefined places will be displayed.
    Please use this feature to verify that the users' location data is receiving and updating by HC2.  hasGPS column shows if user has GPS (means if location has been ever sent from this user) and how frequently GPS position is collected.  
    When the scene is triggered, follow information on debug window displayed:
    User name, his previous and current location and timestamps. Current distance of the user from all predefined places
     
    I hope it will do the job for you.

    598 downloads

       (2 reviews)

    2 comments

    Updated

  10. Energy report

    1,242 downloads

       (1 review)

    12 comments

    Updated

  11. ALL-IN-ONE Message Scene

    --[[ ----------------------------------------------------------------------------- -- ALLINONE MESSAGE SCENE -- TELEGRAM/PUSH/POPUP/API.POST ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- 0.0.9 Started with Telegram and push function 1.0.0 Added popup and api.post functions 1.0.1 Added support for TTS to your MUSAIC player. You need to set right language for you TTS string. 1.0.2 TelegramMessage function does now support if you resend same message many times another scene. 1.0.3 Added support for Sonos remote VD -- SCENE DESCRIPTION -------------------------------------------------------- This scene will send message to your smartphone, which function that will run depends on what string you send and to which variable. Example: -- TELEGRAM ----------------------------------------------------------------- Drop your message to TelegramMessage variable and this scene will send it to you Demands a telegram token and chatid -- fibaro:setGlobal("TelegramMessage", "YOUR MESSAGE") -- -- PUSHSMARTPHONE ----------------------------------------------------------- Drop your message to SmartPhoneMessage variable and this scene will send it to your smarthphone as push -- fibaro:setGlobal("SmartPhoneMessage", "YOUR MESSAGE") -- -- SENDPOPUP ---------------------------------------------------------------- Will send an popup message to fibaro app in your smartphone -- fibaro:setGlobal("popUpMessage", "Info:Test:From fibaro HC2:Test of string") -- String translate : (typeInfo, windowTitle, header, contentInfo) typeInfo = available types: ('Info', 'Success','Warning','Critical') windowTitle = pop-up window title header = pop-up content title contentInfo = pop-up content text -- API.POST ----------------------------------------------------------------- If you want to send an api.post message to your smartphone with the possibillity to start a scene you send this example string to apiPostMessage variable. -- fibaro:setGlobal("apiPostMessage","Activate alarm?:Nobody at home:RUN_CANCEL:283") -- String translate: (message, title, category, data) message = the message title = the title category = the value for what to do, can be RUN_CANCEL or YES_NO data = sceneID to run -- SONOS TTS ---------------------------------------------------------------- Drop your message to sonosTTS variable and this scene will send it to your Sonos player as TTS -- fibaro:setGlobal("sonosTTS", "YOUR MESSAGE") -- --]]

    186 downloads

       (1 review)

    0 comments

    Updated

  12. WakeUpAndPolling

    Support topic for this scene:
     
     
     
    Script to summarize "Wake up interval" and "Polling time interval" off all physical (master) devices.
    Version 1.2, 2016-06-23.
        * Improved detection: FLiRS & non-Zwave devices.
        * Isolate "display" logic into table "printing", so
          the detection logic (code) becomes clearer.
        * Replace "*" with "-" because, well, I like that
        * Handle more exceptional cases (missing data).
        * Handle html special characters (ampersand, comparison).
        * Implement tests (on my laptop only...). Version 1.1. 2015-06-27 Fix for: LUA error: /opt/fibaro/scenes/390.lua:70:attempt to perform arithmetic on local 'timeSec' (a nil value). Version 1.0. 2015-06-14. Initial version. Tested on HC2 V4.049. Description of the report
     
    This is a example. The ID is clickable when you run the script. It takes you to the settings of the device in a new tab or window.
     ID   T(s) T(h:m:s)  Type Info  299     -        -    X  333 7200 02:00:00 W  382     *        *   G  383   125 00:02:05   P  804   600 00:10:00 W For battery devices the script will say:
     
    W = Wakeup Interval (device is battery powered). or
    F = FLiRS (frequently listening routing slave).  FLiRS are battery operated that can respond in 1 second to commands (unlike normal battery powered devices). Typically found on door locks. Battery is checked every 24h (non-configurable).
     
    Polling comes in three flavors. The sentences used here are the same as in the HC2 device GUI. They are shown on the "Advanced" page of a device). The possibilities are:
     
    G = Device uses global polling queue. P = Device will be polled at periodic intervals. X = Device excluded from polling. Global polling uses the settings of polling on the "Configuration, Z-Wave Network" tab.
     
    So in the example: device 299 e'X'cluded from polling, 330 'W'akes every 2h, 382 has 'G'lobal polling, 383 has 'P'eriodic ('P'er device) polling set at 125 s.
     
    * Background *
     
    Wake up interval
     
    This setting applies to battery devices. This is the time between wake up and "wake up" means the device exits "deep sleep" and sends a specific signal to controller. That WAKEUP-NOTIFICATION tells the controller that it is ready to exchange configuration information. The device stays awake for some time (timing is device dependent) to exchange data. Wake up is not to be confused with polling. Also, I'd like to note that a wake up can be forced through some specific button press sequence, but not by "using" a device. For example, breaching a motion sensor, or opening a door with a door sensor does not wake up the device. Such an event merely makes the device send a status change to the controller. After that, it immediately goes to sleep. This is necessary to minimize power consumption. When does this all matter? Suppose you have changed a device parameter. That request will be queued until the device wakes up. Suppose it's a Smoke Sensor, high up there against the wall and you can't push the button. In that case, you'll have to wait until the next "wake up interval" passes. And if you own a radiator thermostat? That kind of device will pick up the set point from the controller at wake up. And for a key fob: you probably wouldn't want it to wake up at all, because there's no interesting data to exchange.
     
    Polling interval
     
    This is the time between "polls" and a poll is the controller asking for the device to send information. Only mains powered devices have their radio switched on at all times, so they can respond to this request whenever the controller asks. But what with a battery device? If the controller ask something while the device sleeps (and that's almost always), it can't receive the poll. I don't know how Fibaro implemented it, but there are 2 possibilities: either the poll is queued or it is discarded. There is a hint how it's done: have you looked at the interface lately? Then you have noticed that a battery device does not have the "polling" settings. In my own opinion, polling indeed doesn't apply to battery powered devices.
     
    What should we do with polling? Is polling necessary? First of all, I remember cases of users that where unhappy without polling, as it was disabled in the earlier 4.X versions. I once owned a device myself, that did not report status to the controller: a simple switch. No polling means: the controller doesn't know the state of the switch when operated locally. But if you have a look at the technical documentation of your device, you're likely to find a "reporting group". And if it's Z-Wave plus, having such a group is part of the standard. That means the device sends data to the controller, when something interesting happens.
     
    What's the issue with polling? Polling causes network traffic. And that may introduce delays from and to your devices. It depends on network size, network design, code and device types. I have 37 mains powered devices (43 battery), and I can tell the difference between polling on and off. The polling traffic is very likely unnecessary traffic. I would disable polling. If HC2 is wrong about the status of a device, verify if "1" is in the reporting group (see device manual). To my knowledge, none of the Fibaro devices need polling.
     
    One more thing. The "polling" and "wake up" interval can be put on the same report, in the same column, because they cannot occur together. If it's a battery powered device, it can't be polled because the device switches off its radio when it's sleeping. And when it's a mains powered device, its radio is always on, so "wake up" doesn't apply.
     
    * FLiRS *
     
    FLiRS are battery operated, but still can receive commands. Because they are "Frequently Listening Routing Slaves" meaning they briefly wake up once per second to check if the controller sends a special command. The Fibaro Heat Controller FGT-001 is such a device. You can also build your own FLiRS based on a Z-Uno. Technically they can be polled, but I think the HC interface does not allow you to do so (not on FW 4.150 anyway). FLiRS "do not wake up as a normal battery device" so there is no such configuration parameter.

    * About the code *
     
    Special thanks to forum users krikroff an A. Socha (Fibaro) for pointing me in the right direction for the API. Bits and pieces were gathered on this forum. Some parts were discovered by trial and error (by me). And an invaluable source of information is the book "Z-Wave Basics" by Dr. Christian Paetz.
     
    One small warning: parts of the code uses features that are not (yet) documented. They were discovered by reverse engineering. I may be wrong. Or the code may break if Fibaro changes things in future firmware releases. Maybe the script barks at you. Please let me know if it does so, I'll try to learn from it. I last checked the code on my system, running FW 4.153 jan 2018 and it was still fine.
     
    The code is available as an attachment to this post.
     
    Please let me know what you think of it!
     
    Thanks for reading this long post. And as always: have fun with Home Automation!

    426 downloads

       (1 review)

    0 comments

    Updated

  13. Multi-room Call for Heat

    I have a number of Danfoss LC-13 valves around the house, together with a Secure SSR302 to turn the boiler on and off.  The Danfoss valves are controlled by the Heating Panels, and I also have a Fibaro multi-sensor in each room.  I've noticed from a number of posts on the forum that there are other people with the same or similar setup, and need a scene to control the boiler switch.  The idea being that if any room needs heat, then the boiler will be turned on, and once all the rooms have reached the required temperature, then the boiler will be turned off.
     
    Setup required:
     
    Modify the device id for the Secure SSR302 (or whatever device is used to control the boiler) here:
    local boilerSwitch = 84 You might also want to tweak this value:
    local threshold = 0.3 This is used to build in some hysteresis into the system to prevent the boiler from being switched on and off too frequently.  The boiler won't switch on until the temperature has dropped below the target temperature by this value or more.
     
    The scene is triggered by a global 'timer' variable to run every 5 minutes.  There are a number of timer scenes on the forum, but this is the scene that I use.
     
    You should also change your Danfoss valves so that the Wake Up Interval is 300 seconds.  I find that this doesn't have a detrimental effect on the battery but allows the devices to respond more quickly to the temperature change requests.
     
    The scene works off the temperature sensor and thermostat that have been defined in your Room settings, so ensure that these are correct:
     

     
    Note that this method of controlling the boiler assumes that your temperature sensors are working to the same temperatures as your Danfoss valves - ie: the Danfoss valves turn off once they've reached the target temperature, and that the temperature sensors are also reading this same value.  You may need to tweak the temperature offset for the temperature sensors so that the two devices are in sync with each other.  If in doubt then set the temperature offset so that the sensors read a slightly higher temperature.  That way, the scene will think that the room has reached the desired temperature and turn off the boiler.  Otherwise you may find that the boiler is not switching off because the room has reached the target temperature, but the Danfoss valve has already turned itself off.
     
    Other types of boiler switch might not use the 'mode' property to determine whether they are on or off.  Consequently, the following line may need to be changed, for example to use the 'value' property instead of 'mode':
    local boilerOn = (fibaro:getValue(boilerSwitch, "mode") == "1")  
    Side topic:
     
    Note that there is a school of thought that boilers should be left on all the time even if there aren't any rooms that require the heat, and that the boiler's control logic will detect this and modulate the water temperature accordingly.  I don't necessarily uphold this view, but then I'm not a heating engineer either, so I'm happy to be persuaded either way.  In my case, I believe that my condensing boiler operates most efficiently when there is a 20C difference between the output and input water temperatures, and as a result it needs the radiators to be drawing heat from the system.  I also have radiators that aren't controlled by Danfoss valves (bathrooms and other small rooms), and I don't want to be heating them all the time, wasting energy.  After all, the whole point of the Danfoss valves is to avoid having to heat rooms that you're not using, and thereby save some money.  Maybe the more intelligent boilers that can regulate the water temperature according to the system's needs and outside temperature operate differently, and as a result more efficiently, and can be left on all the time.  The general opinion, in the UK at least, appears to be that the heating should be turned off if not needed.  Just my tuppence worth, but I know that views like this can be contentious so please don't shoot me down in flames. 
     
    As another side topic, it looks as though the new Fibaro TRVs are far superior to the Danfoss TRVs with the built in algorithms and the ability to cooperate with another sensor in the room.  They should certainly avoid a lot of the problems that we get with the Danfoss valves.  Pity I can't justify replacing them.
     
     

    373 downloads

       (1 review)

    12 comments

    Updated

  14. Battery Check Scene

    [SCENE] Battery Check scene v1.2.4
     
    Hello all,
     
    Here it is, scene that will check battery level on all your battery operated devices and inform you on time when replacement is needed. I wish to thank very much to @petergebruers and @szmyk for code that searches and sorts all battery devices included to HC! THANK YOU!

    VERSION HISTORY:
    28/09/2017 - v1.1       - first release 29/09/2017 - v1.1.1   - added translations for Dutch and Slovak 29/09/2017 - v1.2      - added possibility to define excluded and rechargeable devices. Added 3 new messages and added translations for German, Czech, Swedish, Danish and French, but need translation for new 3 messages. Also added emoji symbols to e-mail notification. 30/09/2017 - v1.2.1   - Corrected level for devices that report level 255 since Sensative strips  can report battery level higher than 100%. Corrected translations for Polish, German, Dutch, Slovak, Croatian, Serbian, Bosnian, Slovenian,  Chinese, Italian languages. Removed testing code that was accidentally left for checking devices with rechargeable batteries in v1.2 01/10/2017 - v1.2.1    - added Romanian translation 01/10/2017 - v1.2.2    - If HC reported battery level is 255 then it is shown as 0 % just to avoid any misunderstandings. 02/10/2017 - v1.2.2    - added missing Danish translation 10/10/2017 - v1.2.3    - added translations for Norwegian, French, Romanian, Russian and  Ukrainian languages. 17/03/2018 - v1.2.4    - Corrected translation for Czech language.  
    SCENE DESCRIPTION:
    This scene is searching for all battery powered devices included in your HC2 and then checks their battery levels. It will send one e-mail to users with list of all devices which battery level is as follows:
     
    battery level 15% or lower will send WARNING to replace battery immediately battery level between 15% and 25% will send REMINDER that battery should be replaced soon battery level between 25% and 35% will send INFO to prepare or buy new battery for replacement rechargeable devices if battery level is 20% or less then will remind you to RECHARGE if all device batteries found with level above 35% then no e-mail will be sent  
    Above levels are set according to those used in most devices. Usually, battery is shown in red when device battery level drops to 35%, but there is still no e-mails sent by HC. Reminder 25% level is set according to my experience when it is last moment to order batteries if there are none in the drawer left. Replacement level of 15% is set because some devices can just stop working if level drops bellow. Since all battery operated devices most of the time sleep, it can happen that they might not be able to report back to the gateway due to rapid depletion of the battery at its end of life. Also, thanks to @I.Srodka to confirm that this levels are used by HC.
     
    This scene supports multiple languages as in the list bellow:
    HC included languages and for this you do not need to do setup English = "en" OK Polski = "pl" OK Deutsch = "de" OK Svenska = "sv" Portugues = "pt" Italiano = "it" OK Francais = "fr" OK Nederlands = "nl" OK Roman = "ro" OK Brazilian Portuguese = "br" Estonian = "et" Latvian = "lv" Chinese = "cn" OK Russian = "ru" OK Denmark = "dk" OK Finland = "fi" Czech Republic = "cz" US English = "us" OK Spanish = "es" Additional languages supported by this version: Set it up for local lng two letterrs between quotes Slovak = "sk" OK Croatian = "hr" OK Bosnian = "ba" OK Serbian = "rs" OK Slovenian = "si" OK Norwegian = "no" OK Ukrainian (NEW) = "ua" OK It is difficult for me to properly translate to all above languages so for now languages with OK are translated and the rest are still to be translated. I will really appreciate your help with translation for the rest of the languages. Please if you do translation of bellow messages you can post it here so that other know that it is already translated. I will also add OK for every language I receive translation and of course update scene code! THANK YOU!
     
    Thanks to @gucio1234 for Polish translation!
    Thanks to @Bodyart for Slovak German and Dutch translations!
    Thanks to @MaTi for Dutch translation!
    Thanks to @jakub.jezek for Czech translation!
    Thanks to @sonnyboy for Swedish translation!
    Thanks to @TurboWannaBe for Danish translation!
    Thanks to @speedoxx007 for French translation!
    Thanks to @Momos for Romanian translation!
    Thanks to @olekenneth for Norwegian translation!
    Thanks to @Momos for Romanian translation!
    Thanks to @jack.daniels for Russian and Ukrainian translations!
     
    NEW v1.2  (added 3 new messages marked with arrows) This are messages for translation in English. %s are insertion points for device names and battery levels:
    ["en"] = { title = "Battery check", subTitle = "Following devices need your attention:", info = "INFO! id: %s - %s %s battery is on %s %%", remind = "REMINDER! id: %s - %s %s battery is on %s %%", warning = "WARNING! id: %s - %s %s battery is on %s %%", ---> excluded = "EXCLUDED! id: %s - %s %s battery is on %s %%", ---> recharge = "RECHARGE! id: %s - %s %s battery is on %s %%", found = "Found %s battery operated devices", tobuy = "INFO! Please order replacement battery", soon = "REMINDER! Need to be replaced soon!", replace = "WARNING! Please replace battery as soon as possible", ---> charge = "RECHARGE! Please recharge battery!", lang = "English" },  
    SCENE SETUP:
    This scene is very simple to setup. First select Scenes on main menu in HC web GUI and then add new scene. Select LUA scene. Download BC scene and open with PLAIN TEXT EDITOR (please do not use MS Word or similar programs because they will add formatting that will make scene inoperable). After you paste it to upper code window then you can check and set it up as follows:
     
    LANGUAGE:
    If your language is on the bellow list:
    Slovak "sk" Croatian "hr" Bosnian "ba" Serbian "rs" Slovenian "si" Norwegian "no" Ukrainian "ua" You need to setup local lng with two letter abbreviation for your language:
    local lng = "hr" but leave it empty of your language is set on HC.
     
    USERS TO RECEIVE E-MAIL:
    Scene by default is set to send e-mail to superuser ID=2, but you can add or replace it with other users. Users ID you can find with this link to your HC docs:
    http://YOUR_HC_IP/docs/#!/users Just add users ID inside curled brackets separated by comma as in bellow example:
    local userID = {2, 55, 128}  
    EXCLUDED DEVICES NEW v1.2
    Now you can define devices to be ignored or excluded from report. Just add their ID numbers between curled brackets separated by coma:
    local ignoreDevicesId = {100, 345} or leave brackets empty to check all devices.
     
    DEVICES WITH RECHARGEABLE BATTERIES NEW v1.2
    You can also define devices with rechargeable batteries by their type, like for example new Fibaro Thermostat which is by default already added in the scene:
    local rechargeDevicesType = {"com.fibaro.FGT001"} You don't need to remove it even if you still don't have that thermostat. Scene is Fibaro thermostat ready!  
     
    RUNNING SCENE:
    Scene is not set to automatically run so you need to setup whatever scheduling scene you use to start this scene once per day. If you use 
    then you can make following settings in Main scene FTBE:
    -- SCHEDULED SCENES SETUP ------------------------------------------------ local runSceneSchedName = {"Battery check"} local runSceneSchedID = {Batt_check_sceneID}; local runSceneSchedHour = {{"10:00"}}; local runSceneSchedWeek = {{1, 1, 1, 1, 1, 1, 1}}; local runSceneSchedPushFlag = {0}; local runSceneSchedPushMessage = {""}; Of course, replace Batt_check_sceneID with ID number of this scene that will show up on General tab once scene is saved. And that's it! Enjoy!  
     
    HOW TO UPGRADE
    From 1.1.1 or previous to 1.2 or higher: Just paste new code over previous one and setup as needed. 
    From 1.2.2 to 1.2.3: Upgrade only if you need one of the added translations. You can copy only part of the language you need or from line 120 to the end of code to preserve your settings.
    From 1.2.2 to 1.2.Battery Check scene v1.2.4.lua4: Upgrade only if you need corrected Czech translation.
    NOTE
    LUA format of scene code is saved by ZeroBrane Studio v1.50. You can download it at this link: https://studio.zerobrane.com
    TXT version please open with TextEdit on Mac or Notepad on Windows.
     
    ICONS DOWNLOAD:
    For battery icons please go here to download:
     
     
    NOTE:
    After installing this scene and make it running once per day you can remove battery low e-mail notification from all battery operated devices. Just remove tick for "Notify when battery low via e-mail" on Advanced tab and press save:
     

     
     
     
    Battery Check scene v1.2.3.lua
    Battery Check scene v1.2.3.txt

    1,559 downloads

       (1 review)

    4 comments

    Updated

  15. Netatmo Plugin - Restart Scene

    Due to the netatmo plugin  often stop work without any info the attached scene reboot it. Please add the scene to any another  time based scene (ex for 2 time call by day)
    Explication of scene. After check mail.lua in plugin source:
    if (netatmo:updateProperty('polling_time', config.polling_time) or netatmo:updateProperty('username', config.username) or netatmo:updateProperty('password', config.password) or netatmo:updateProperty('client_id', config.client_id) or netatmo:updateProperty('client_secret', config.client_secret)) then plugin.restart() end to force plugin restart the scene change pooling_time variable. It add to pooling time of netatmo plugin 5s or subtract 5s, alternately and after this check any change in plugin. Result of this is restart of netatmo plugin.
     

    97 downloads

       (1 review)

    2 comments

    Updated

  16. Clear Debug & Catching Errors

    I have noticed that sometime scenes or virtual devices stuck without any visible error. Another observation, that when it happens I cannot see debug information/messages of the scene/VD. In addition the Chrome browser crushes - Ah, Snap.
    The idea behind this scene is to monitor debug text of all scenes and virtual devices (including all buttons, sliders and etc.) in the system. In case the length of all messages over 40.000 characters, the scene clears the buffer. Since the code already reads debug messages, it checks the last message and if there is an error message (scene or virtual device) the code sends email to administrator with an error description. Note: In case of error the messages are not deleted! The purpose of that is to keep the error for user review and debugging. Currently this scene runs every 300 sec. (5 minutes) . In order to set different time, please change sleepTime variable. (sleepTime = xxx) By default scene clears debug buffer over 40.000 characters. In order to set different default length, please change txtLen variable. (txtLen = xxxxxx) In addition you have an option to set max. debug buffer length to any size for any scene or virtual device and its buttons. To do so please update  txtLenTbl table as follow: Since the system could use same ID for VD and scene,  this table has two elements of arrays,  VD (vdLen)  and scene (sceneLen)        local txtLenTbl = { vdLen = {{30000,"|618|615b12|515b3|"}, {35000,"|134|163b13|"} }, sceneLen = {{35000,"|25|"},{30000,"|17|545|"} }, } --[[ Vitual Device table elemnt: 1st param. 30000 is the desired buffer length size. 2nd param. "|618|615b12|515b3|" is the list of VD ids and button number separated by "|". For main loop use device ID only, for VD's button use button number same as in fibaro:call(VDid, "pressButton", button_num) function. For example: 618 - means Virtual device id 618 main loop. 615b12 - means Virtual device id 615 button number 12. Scene table element: 1st paraam. 35000 is the desired buffer length size. 2nd param. "|34|25|" is the list of scene ids separated by "|". You can defined as many arrays as needed. --]]  
    The scene designed to run automatically, so please set "Max. running instances:"  to 3 and "Run scene:" to automatic.  . When the buffer cleared, the name of that scene/VD  will be displayed at scene's debug window. This code should find all scenes and Virtual devices (including all buttons, sliders and etc.) at the system. To make sure that everything has found at your system, please press "Start" button to run second instance of scene. This "one-time" instance  will be executed without loop. Means only one instance of automatic loop could be exist. After second instance execution you should see on scene's debug window printout of every scene/VD/VD button. its current buffer length size and max. allowed buffer size. Since this code runs in my system I didn't get any stuck issues and has successfully caught few unexpected errors in the scenes and VDs. I don't know if it somehow related to system freeze problem, but since this code runs I don't have system freeze or any CPU overloads. Hope it helps...  

    603 downloads

       (1 review)

    22 comments

    Updated

  17. CPU & RAM monitor

    The purpose of this scene is to monitor CPU and RAM performances. In case the performance decreased it will notify the user before the system becomes unresponsive  and/or stuck. During introduction of last few releases many users have an issue with CPU overloaded and system stuck, so the idea is to catch and try to solve the problem before the system doesn't respond.
    The program execution has two options:
    1. Stand alone using local json table
    2. Using global variable for json table
    Using second option you can acces to current min, max, average values of CPU and current RAM load from any other sense or virtual device.
    --================= User configurable parameters ============================
    gVarName       = ""                  ---------------------- Global Predefined Variable name.
    eMail                = true                -------------------- send eMail notification to admin only
    pushNote        = true                 -------------------- send push notification to users in push list
    popupNote      = true                -------------------- send popup notification to all mobiles
    sleepTime        = 60                ---------------------- time between samples in seconds.
    batchNum        = 2                 ----------------------- batches/readings number per sample.
    batchDelay      = 10                 ---------------------- time between batches in seconds.
    ramHi               = 75                  ---------------------- RAM high limit.
    highLim1         = 50; highLim2        = 50    ---- CPU 1,2 highest load limit.
    normLim1       = 20; normLim2       = 20    ---- CPU 1,2 normal load limit.
    sample2avg1 = 20; sample2avg2 = 20     ---- CPU 1,2 number of samples to average.
    --============================================================================
    How it works?: (based on default values of user configurable parameters)
    The program checks if any global variable defined, if not local table in use.
    Every 60 seconds (sleepTime) the program will get two readings (batchNum) within   10 seconds (batchDelay) of CPU 1 and 2 load. 
    After 20 samples (sample2avg1/sample2avg2) average load of each CPU and RAM is calculating and in case the CPU load is over 50% (highLim1/highLim2) and/or RAM is higher than 75% (ramHi) notification will be send out by eMail, push notification and popup mobile notification. Please note that popup notification will be received by all mobiles in list of the system. If after overload the CPU average load drops below 20% (normLim1/normLim2) and/or RAM drops below 75%, user will be notified as well.
    Change default values according to your needs, but please pay attention if you reduce the sleepTime and number of samples (sample2avg1/sample2avg2) , the scene could catch momentary peak of load which is not necessarily represents system performances.
     
     

    230 downloads

       (1 review)

    0 comments

    Updated

  18. Door and window monitoring

    Scene description:
    The script reads the temperature of an outdoor sensor to extend or shorten the message interval.
    The status of windows and doors is checked every minute. The shortest reporting interval ist 5 minutes.
    It's also possible to use the temperature of a plugin like Yahoo or Yr Weather. In this case, the variable has to look like this:

    773 downloads

       (1 review)

    4 comments

    Updated

  19. Text to Speech - Android phone/tablet

    First of all the entire credit goes to @davanha who has written this text to speech (and alarm control)  APK for android and continues to maintain the code.  Outstanding job.
    Now, to my opinion, everyone should use this very simple and straight forward implementation. This is a great opportunity to give a voice to your home. I'm using TTS for years (UBI and EMIC solutions), but to have it on my phone at any place at home !!! sounds much better. Of course if you have tablet which runs Fibaro application and now you can make it speak... great feature for all your family, finally they can hear what you're doing. In my case the smart home is part of the family.
    I know that many users use other solutions like SONOS, Google, but not one of them has this nice and convenience way to speak directly to you or any other member of your family at any place at home.
    Please follow next installation steps:
    1. Create TTS scene and copy the code (TTS scene v1.0-lua.txt) on your HC2.
    2. Download zenitgatekeeper_0.1.651.txt to your phone or tablet. Change file extension to .apk and install the application.
    3. Go to setting (initial password 1234) Application settings -> [check  'Autostart application after reboot' box] -> Http services [check all boxes on this page]  see fifth screenshot-> go back till you see "Text-To-Speech mode" window (as displayed on third screenshot)
    4. Usually we're cleaning our phones by killing background applications, so please lock this application on your phone.
    5. To verify proper installation run on web browser follow line http://<ipadress of android device>:8080/tts=testing Your android device should now play the speech
    6. You can add to play intro announcement before the message.. like "ding dong" or any other. To do so please click "Settings" button (default password to settings menu is "1234")  -> Application Settings -> Http services ->  Play speech on device.
    7. New releases of the app are available at https://github.com/davandev/AlarmController/releases
    8. Now if the setup is OK... open any code on your HC2 and execute
    fibaro:startScene('ttsSceneID',{"testing my text to speech setup","<IP address of android device:8080"}) fibaro:startScene('ttsSceneID',{"testing my text to speech setup","<IP address of android device>:8080",<volume level>})            Usual volume level range is 1-15.  Please notice that the volume level of your phone or tablet will be changed accordingly.
    9. Another great feature of zenitgatekeeper application, it can receive "wakeup" command and it will turn on the  android device screen. I've found this very useful for my tablet in living room. Till now the display was constantly on, now since I have motion sensor in the room, I'm able to turn on the display only if someone in the room. It extends my tablet display life cycle. To use wakeup just start TTS scene as shown below:
    fibaro:startScene('ttsSceneID',{"wakeup","<IP address of android device:8080"}) For more information please visit this topic:  https://forum.fibaro.com/topic/25004-using-an-android-device-as-a-text-to-speech-engine/
     
    Notes:
    This solution works on your local LAN- home network  only. When your device is out of range, no message will be received. But when you back to your area the device connects automatically and starts to "speak". My suggestion is to assign fixed IP address to your device on your home network. Otherwise the IP address could be changed and you'll need to change it in the code. You will hear the messages even if your phone is on mute. To stop to hear the messages you need to reduce the volume or to kill the application.  
    Some ideas of messages could be seen on first screenshot. In addition you can install the apk application on other members of the family and you can redirect relevant messages of smart home directly to them only.
     

    452 downloads

       (1 review)

    10 comments

    Updated

  20. Simple Timer / Scheduling Scene

    Sankotronic's scene for scheduling time based events (Topic 23510) is a shining example of LUA coding and impeccably documented. It's very powerful and caters for just about every scheduling requirement that you could think of, as well as adding a lot of useful variables that can be used to check whether a scene is running at different periods in the day, week, month, year etc.  However, with that power comes a little added complexity, and it's possible that your requirements are much simpler.  If you're one of those people and haven't already implemented your own scheduling scene, then that's where this scene may help.
     
    SIMPLE TIMER SCENE
    This scene will simply update global variables, either on a periodic basis, or at selected times of the day.  These global variables can then be used to trigger other scenes by adding them to the %% globals section in the header, eg:
    --[[ %% globals fiveMinuteTimer --]] It will automatically create the global variables, so you don't need to worry about doing this manually.
     
    At the beginning of the scene is a table that contains the timers that you want to create, and you should modify this table according to your requirements.  For each timer, as well as the timer name, you also specify either:
     
    The frequency in seconds that the timer will be triggered, or The set time(s) that the timer will be triggered, in HH:MM format.  
    Two special values for 'sunrise' and 'sunset' can be used to trigger scenes to run at these times.
     
    This is the table that you should update:
    local timers = { timer1 = {name="oneMinuteTimer", frequency=60}, timer2 = {name="fiveMinuteTimer", frequency=300}, timer3 = {name="fifteenMinuteTimer", frequency=900}, timer4 = {name="twelveHourTimer", frequency=43200}, timer5 = {name="garageDoorCheckTimer", setTimes={"20:00", "21:00", "22:00"}}, timer6 = {name="sunriseTimer", setTimes={"sunrise"}}, timer7 = {name="sunsetTimer", setTimes={"sunset"}} }  
    It is recommended that you set on the 'Do not allow alarm to stop scene while alarm is running'.  If not, then whenever Fibaro's alarm is triggered, then all your scenes that depend on these timers will stop.

    337 downloads

       (0 reviews)

    1 comment

    Submitted

  21. Appliance monitoring scene

    Holidays are almost here! So here is one more gift for you! Just maybe you will find it useful and it looks like this in HC webGUI:

     
    SCENE DESCRIPTION
    This scene can monitor any appliance for power consumption and send push and/or popup notification when appliance start working and/or when it is finished. You can also select to switch it off when is done or leave it under power. There are more and more smart appliances on the market but still suffering from "baby" problems. We also buy Candy washing machine with WiFi and smart app but it just refuses to connect, or if I manage to connect it disconnects itself after one wash. No need to mention that manufacturers of such appliances like to hide API. Because of that we are still using benefits of smart plugs and relay modules to monitor our appliances. So this is how this scene works. It is triggered by power consumption from smart plug or relay module to which appliance is connected. It is possible to set minimum power in watt and duration for how long will scene run until recognizes that appliance is finished. There are only two global variables to be defined. One is already known "HomeTable" and another one with name up to you which is set while appliance is working and reset when is finished as explained bellow:
     
    GLOBAL VARIABLES SETUP
    "HomeTable"       - predefined global variable table with device and scene IDs. Recommended to use since z-wave devices can change their ID with re-inclusion and then is necessary  to edit only scene which make this table and only device ID in scene headers. Much less time and effort is needed than without that option! But if you don't use this feature then you MUST delete following lines from scene:
    -- get the table from global if not using then delete this line!!! local jT = json.decode(fibaro:getGlobalValue("HomeTable")) "applianceStatus"   - you can use any name like "WashingMachine" or "DishWasher" depending on appliance you plan to monitor. There are two values "On" and "Off" that you can map with your values and then setup in scene code like this:
    -- enter name of your global variable for monitoring state of appliance and -- map your values for "On" and "Off" local applianceStatus = "WashingMachine"; local applianceStatusMapping = {On="On", Off="Off"}; DEVICE, NOTIFICATION AND USERS SETUP
    After setting up global variables you still need to setup several things like deviceID (ID number of smart plug or relay module), deviceMinPower which defines under what power in watt device stopped working and is in standby, some text for push and popup notifications and you can start using this scene to monitor your appliance. See bellow setup example for washing machine:
    -- APPLIANCE CONTROL DEVICE SETUP ------------------------------------------- -- enter device ID which is used to control appliance and measure power -- consumption. Do not forget to put this ID in scene header under -- %% properties -- 100 power local deviceID = 100; -- enter minimum power in Watt bellow which appliance is stopped or in -- standby mode local deviceMinPower = 2; -- enter time in minutes after which scene will send message that appliance -- is done and stopped. This time delay is necessary for many modern washing -- machines due to electronic drive controls local deviceStopDuration = 3; -- enter here "Yes" if you want to switch off appliance when is done and -- stopped or "No" if you want to leave it on local deviceTurnOff = "No"; -- USERS, PUSH AND POPUP NOTIFICATION SETUP --------------------------------- -- define users to send push messages local userID = {jT.ios.wife, jT.ios.mistress}; -- flag for each user; if 1 then send notifications else if 0 do not -- send notifications. You can add code in function extraUserCodeFirst() -- where you can change user flags depending on some global variable. local userFlag = {1, 1}; -- PUSH MESSAGES SETUP ------------------------------------------------------ -- enter push message text for the appliance start and stop event local pushMessage = {start = "Washing machine is started", stop = "Washing machine is stopped"}; -- enter "Yes" if you want to receive push notification that appliance -- started working else put "No" local pushStart = "No"; -- enter "Yes" if you want to receive push notification that appliance -- finished working else put "No" local pushStop = "Yes"; -- POPUP MESSAGES SETUP ----------------------------------------------------- -- enter popup message text and button caption for the appliance start and -- stop local popupMainTitle = "WASHING MACHINE"; local popupTimeFormat = "%H:%M:%S | %d.%m.%Y."; local popupContentTitleStart = "Washing machine is started"; local popupContentTitleStop = "Washing machine finished"; local popupContentBodyStart = "Washing machine is working"; local popupContentBodyOn = "Washing machine is not turned Off"; local popupContentBodyOff = "Washing machine is turned Off"; local popupImgUrl = ""; local popupButtonCaption = "OK"; -- enter "Yes" if you want to receive popup notification that appliance -- started working else put "No" local popupStart = "No"; -- enter "Yes" if you want to receive popup notification that appliance -- finished working else put "No" local popupStop = "No"; It seems a lot but it is actually more of my comments and explanations than real code to setup  . Just to mention that scene has two functions where you can add your own code to do something. Function extraUserCodeFirst() is executed before sending push/popup notification that appliance is started and function extraUserCodeLast() is executed just before sending push/popup notification that appliance is finished and stopping scene. I use them too   For example I alway add code to change flags to whom push messages will be sent in function extraUserCodeFirst(). First I add two global variables under -- EXTRA GLOBAL VARIABLE SETUP --------- section of the code:
    -- EXTRA GLOBAL VARIABLES --------------------------------------------------- -- here you can add your extra global variables to enhance features of this -- scene: -- for all those daddies and momies who work away from home to lower number of -- notifications while at work possible values: "Yes", "No" local dadAway = "DadAway"; local dadAwayMapping = {Yes="Yes", No="No"}; local momAway = "MomAway"; local momAwayMapping = {Yes="Yes", No="No"}; And then I add simple code to change userFlags in function extraUserCodeFirst() if we are at work and don't want to be disturbed by push messages from our Angelina:
    -- EXTRA FUNCTION WHERE YOU CAN ADD YOUR CODE ---------------------------- -- use this function to add code that will be executed before loop is -- started and push adn popup notifications are sent function extraUserCodeFirst() -- your code goes here if dadAway ~= "" then if fibaro:getGlobalValue(dadAway) == dadAwayMapping.Yes then userFlag[1] = 0; end end if momAway ~= "" then if fibaro:getGlobalValue(momAway) == momAwayMapping.Yes then userFlag[2] = 0; end end if deBug then logbug("yellow", "User extra code before loop executed") end; end  
    Please, also check video from @MarcoTorino71:
     
     
     

    314 downloads

       (0 reviews)

    8 comments

    Updated

  22. Presence Detector

    Want to share my Geolocation and Presence Detector scene i use in my Fibaro setup 
    In wife's and my own smartphone i use both geofency app and wifi presence to check if we are home. A VD runs scheduled and will update a global variable with value "0" or "1" depends if smartphone is active or not.
    Geofency app is the most reliable and correct app i use myself because the smartphones wifi turns into "sleep" mode often to save battery.. You could of course only run Geofency if you want.
     
    Instructions for Geolocation setup
    https://forum.fibaro.com/index.php?/topic/18383-tutorial-geofency-geo-location-based-fibaro-triggering-ioswindows-pc
     
    This scene can be setup and scheduled in Sankotronics "Main scene timebased events"
    https://forum.fibaro.com/index.php?/topic/23510-scene-main-scene-for-time-based-events-control-v-124/
     
    Settings that can be changed by user:
    -- USER SETTINGS --------------------------------------------------------- -- "PresentState" is predefined global value that determines if you are at home -- away or on holidays. This variable value is set by other scene or VD. -- Enter name of your global variable between "" or leave as it is local presentState = "PresentState"; local presentStateMapping = {Home="Hemma", Away="Borta", Holiday="Holiday"}; -- GuestState is predefined global variable with possible values: "Yes", "No". local guestState = "GuestState"; local guestStateMapping = {Yes="Yes", No="No"}; -- Geo is predefined global variable with possible values: "1", "0" -- and name of users. This variable value is set by other scene or VD. -- variable example setup: --> "Geo_Jonny_Home" local geoState = "Geo_"; local geoUserMapping = {User1="Jonny", User2="Mona"}; local usegeoState = true; -- Smartphone is predefined global variable with possible values: "1", "0" -- and name of users. This variable value is set by other scene or VD. -- variable example setup: --> "Phone_JL_Present" local wifiState = "Phone_"; local wifiUserMapping = {User1="JL", User2="ML",User3="SL", User4="SW",User5="MW", User6="DD"}; local useWifiState = true; -- Telegram settings local varTelegram = "Telegram"; local useTelegram = true;  

     
     

    184 downloads

       (0 reviews)

    0 comments

    Submitted

  23. Consumption Monitoring Scene

    Consumption monitoring™ v3.0.4
     
    CHANGES 2018-02-18 Added support for send push every hour. Added more emoijs to VD 2017-04-04 Corrected day, line 115 2017-04-13 Corrected selfRun function. Added 2 more labels with info. Added emoijs.  
    Monitor your energy consumption and if wanted it will send a daily push and month report with consumed energy
    Supports AEON Labs energy meter (and more...?) Supports Autofrank's Smart Message Hub

     
     
     
    Create an empty vd(virtual device) with 7 labels. ID of the label should be Label1 to Label5. Name you can set what you want. 
    Update - 2017-04-13 - To show the new info in VD then add 2 more labels. Label1 to Label7  Create an empty LUA scene and copy the LUA code into that scene. Change line 22 to your AEON LABS HEM id local energyMeterID = 319 Change line 26 to your vd id that you just created local vdID = 464 Change line 30 to false (local selfRun = true) if you want to run the scene from other scene like @Sankotronic Time Based Events Control Supports @AutoFrank SmartMessageHub, set line 38 to false if you want to use standard push (local SMsgH = true) set id of the SMsgH scene at line 40 local SMsgHid  = 262 Does also support @AutoFrank HomeTable setup if you set  local SMsgH = false remember to fill in id of the smartphones you want to have the push local pushUsersHC2 = {"449"} Separated with comma change line 59 to false if you don't want to have an daily report pushed. local sendPushDaily = true change line 62 to false if you don't want to have an monthly report pushed local sendPushMonthly = true change line 64 to wanted time you want to have the report to be sent local sendPushTime  = "06:30"  
    EXTRA INFO
    Can support more then just AEON HEM but that depends if Fibaro have the power info from the device. You can check that if you run this in your browser http://HC2_IP/api/energy/now-86400/now/single/devices/power/ID_OF_DEVICE. Result should be like the below picture So for example if you just want to have info about the dishwasher, fridge, washing machine etc it should be supported.  
     
     

    Consumption_Dashboard.vfib

    366 downloads

       (0 reviews)

    0 comments

    Updated

  24. Room Thermostat Override

    Overview:
    I have a Secure SRT321 room thermostat in my living room, and up until now the only function that it has performed is as a temperature sensor.  Changing the temperature on the thermostat has had no effect.  I haven't associated it with my boiler switch, as I've implemented a multi-room system.  In theory, I should be able to associate the thermostat with the Danfoss LC-13 radiator valves in that room, but that doesn't seem to work.  However, what I really wanted to do is to override the Heating Panel for that room.  That way, any overrides will also be visible in my Heating Override Virtual Device.
     
    This scene should work with any thermostat device (including the radiator valves), but is primarily designed to work with room thermostats.  When the set point temperature on the thermostat is changed, then the corresponding Heating Panel for the room that the thermostat is located in will also be updated.  If the temperature that is selected is not the same as the current scheduled temperature for that room, then it will put the Heating Panel in manual mode.  If it's the same as the scheduled temperature, then the Heating Panel will revert to scheduled mode.  By having it update the Heating Panel, then the radiator valves in the room will also be updated.
     
    Setup required:
    You will need to change the list of devices ids in the Scene Header, for each of the room thermostats:
    --[[ %% properties 123 targetLevel 234 targetLevel --]] Ensure that you enter the device id for the thermostat and not the associated temperature sensor on the device, if there is one.
     
    You can specify a fixed override duration (the number of minutes that the Heating Panel will be overridden) by changing this variable:
    local overrideDurationMins = 0 -- Set to zero to override until next scheduled change However, if you leave this variable as zero, then it will override the Heating Panel until the time that the panel is next due to change, or for the Minimum Duration.  The Minimum Duration can be specified here:
    local minimumOverrideMins = 60 -- If the duration until the next scheduled change is less than this, then use this value Set the Minimum Duration to zero if you don't want use this feature.
     
    You might need to increase the number of scenes that can run concurrently by changing the Max Running Instances in the scene properties.  Changing the thermostat could trigger several occurrences of this scene.  If there is a limit on the number of scenes that can run, then it's possible that the final setting of the thermostat will be ignored.
     

     
    Code:
    Download it from here: Room Thermostat Override 1.0.lua
     
     

    90 downloads

       (0 reviews)

    0 comments

    Submitted

  25. idlock_Notification.lua

    Get a notification/push when IDLock is unlocked by code or RFID
     
    Other possibilites
    Instead of having default value for name (example ->> "name":"User 60") you can 
    easily change from User 60 to a real name instead.
    In a new scene add this lines and Press Start to set the name
    local ID = 1067 -- IDLock ID
    fibaro:call(ID, "setUserName",60, "Jonny") 
    60 is the slotID you want to change.
     
     

    57 downloads

       (0 reviews)

    0 comments

    Submitted


×
×
  • Create New...