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


  • 0

Newbie - Scene for December


Question

Posted

I have taken the plunge and started my move to Z-Wave from X10

I have an HC2

Could do with some elementary help re programming a scene

What do I want to do

I have a plug module lets call it “Plug 1”

Resides in “Kitchen”

I need this module to

switch on at 06.00am

switch off at dawn -10mins (dawn will be between 08.00 and 08.15)

but only 1st December thru to 6th January

 

then switch on at dusk +15mins (Dusk will be between 15.55 and 16.15)

switch off at 23.59 (same day)

but only 1st December thru to 6th January

 

I was hoping to be able to do this using Magic scenes or Graphic Blocks

 

Any help would be much appreciated

5 answers to this question

Recommended Posts

  • 0
Posted

The topic has been moved from "

Please login or register to see this link.

" to "

Please login or register to see this link.

".

 

Temat został przeniesiony z "

Please login or register to see this link.

" do "

Please login or register to see this link.

".

  • 0
  • Inquirer
  • Posted

    Good morning,

    I have looked really hard to try and understand how to do this.

     

    Found this in

    topic 27867

    -- Check current month

    local currentmonth = tonumber(os.date("%m"))   

      if ( currentmonth == 1 ) then

          fibaro:setGlobal("Month", "Januari");

        elseif ( currentmonth == 2 ) then

          fibaro:setGlobal("Month", "Februari");

    it continues to December

     

    topic 23510

    local month               = "Month";

    local monthMapping        = {January  ="January",

                                 February ="February",

                                 March    ="March",

    it continues to December

     

    what I am unsure of is

    A)     What to do with it

    B)     How to use it in order to implement a scene based on a month.

     

    Sorry if this is really obvious but “if you don’t know 1 + 1 = 2 then its difficult to work out 2 + 2= ?”

     

    Really hope that there is an easy solution.

     

    Cheers and a Happy New Year

    • 0
    Posted
    On 26-12-2017 at 2:50 PM, karaokek said:

    I have taken the plunge and started my move to Z-Wave from X10

     

    I have an HC2

     

    Could do with some elementary help re programming a scene

     

    What do I want to do

     

    I have a plug module lets call it “Plug 1”

     

    Resides in “Kitchen”

     

    I need this module to

     

    switch on at 06.00am

     

    switch off at dawn -10mins (dawn will be between 08.00 and 08.15)

     

    but only 1st December thru to 6th January

     

     

     

    then switch on at dusk +15mins (Dusk will be between 15.55 and 16.15)

     

    switch off at 23.59 (same day)

     

    but only 1st December thru to 6th January

     

     

     

    I was hoping to be able to do this using Magic scenes or Graphic Blocks

     

     

     

    Any help would be much appreciated

     

    I think Easiest way to do this is make a variable called, for instance, "Yearend" and give it two possible values: "Yes" or "No".

    You make a scene that changes the variable to Yes on the 1st december and No on the 6th of january.

    In a second scene you make an extra condition checking the status of the variable and then doing what it is meant to do.

    Alternatively you can keep out the variable out of the second scene and even not use a variable at all but make two scenes that do something at dusk and the second at dawn an then you enable (fibaro:setSceneEnabled(x, true) where x s the first scene meant to run on december 1ste and disenable the scenes (fibaro:setSceneEnabled(x, false)) on january 6th.

    • 0
    Posted

    1 varaible  "yearend" 0 or 1 (0 is off, 1 is on"

    blockscene 1

    on 1-12-(year) at 01:00 hour change var yearend to 1

    blockscene 2

    on 6-1-(year) at 01:00 hour change var yearend to 0

     

    blockscene 3

    if time is 06:00 and var yearend = 1 then switch plug1 on

    blockscene 4

    if time = sundawn and var yearend is etc etc etc

     

     

    • 0
  • Inquirer
  • Posted

    Thanks for your replies – much appreciated

     

    I think I may have found a solution using various LUA codes found on this forum – again, much appreciated.

     

    So

    I made a Variable called  - Month

    12 values – January, February ~ …. December

    Then a scene, Month, using this code

    --[[

    %% autostart

    %% properties

    %% weather

    %% events

    %% globals

    --]]

     

    -- Check current month

    local currentmonth = tonumber(os.date("%m"))   

      if ( currentmonth == 1 ) then

          fibaro:setGlobal("Month", "January");

        elseif ( currentmonth == 2 ) then

          fibaro:setGlobal("Month", "February");

        elseif ( currentmonth == 3 ) then

          fibaro:setGlobal("Month", "March");

        elseif ( currentmonth == 4 ) then

          fibaro:setGlobal("Month", "April");

        elseif ( currentmonth == 5 ) then

          fibaro:setGlobal("Month", "May");

        elseif ( currentmonth == 6 ) then

          fibaro:setGlobal("Month", "June");

        elseif ( currentmonth == 7 ) then

          fibaro:setGlobal("Month", "July");

        elseif ( currentmonth == 8 ) then

          fibaro:setGlobal("Month", "August");

        elseif ( currentmonth == 9 ) then

          fibaro:setGlobal("Month", "September");

        elseif ( currentmonth == 10 ) then

          fibaro:setGlobal("Month", "October");

        elseif ( currentmonth == 11 ) then

          fibaro:setGlobal("Month", "November");

        elseif ( currentmonth == 12 ) then

          fibaro:setGlobal("Month", "December");

        end

     

    Then another scene, Run Month, to run the above scene on 1st of each month at 00.05am

     

    This seems to work – would appreciate any comments if the above is flawed.

    Regards

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Answer this question...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...