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


All-in-One Scene: How to do it Better


cag014

Recommended Posts

  • Topic Author
  • Sorry, for testing have used new version, my mistake.

    Your version doesn't supports Keywords as part of conditional parameters.

    So for now please replace $timeSpan to 30 in conditional parameter.

    {30,"245",{state="value=true",timeLoopAct={{"Warnung!","sendPush,542","$name in der Toilette ist über $timeSpan Minuten offen","{79:value<15|$id:lastBreached<?30*60+(30/10*60)?}"},{"518","pressButton,1","", "{79:value<15|$id:lastBreached>?30*60+(30/10*60)?}"}}}},

    or

    as part of new release improvement find follow lines (somewhere around line 218 in your scene)

    dState,logTxt=ref..o.." "..doTheMath(rVal,inId,"parse"),logTxt.."  "..findNameRoom(inId,3)
     val=doTheMath(rVal,inId);lStatus=false

    and change inId to dId

    dState,logTxt=ref..o.." "..doTheMath(rVal,dId,"parse"),logTxt.."  "..findNameRoom(inId,3)
           val=doTheMath(rVal,dId);lStatus=false

     

    and it should work with $timeSpan in conditional parameter

    Edited by cag014
    Link to comment
    Share on other sites

    Hello,

     

    some more Info to the push messages:

     

    Please login or register to see this spoiler.

     

    The log shows only one device number. In the Info screen all numbers are right. Or ist it only possible to send a push message to one device? But I see also some eventually critical letters in the device names.

     

    Please login or register to see this link.

     :

    The Push messages will only send to the iPad. Every other mobile phone won't receive the push messages (iPhone or Android). With my other alarm scripts I receive the push massages with every device. Could this possible? 

     

    Perhaps this helps for bugfixing.

    Manuel

    Link to comment
    Share on other sites

  • Topic Author
  • I'm using interactive push notification... in your alarm script what type of push message you're using?

    In new release I'm adding the standard push notification as well.

    Thanks for your helpful info.

    Link to comment
    Share on other sites

    I use following code:

     

    fibaro:call(DEVICEID, "sendPush", "Push text blablabla");    

     

    Now I have move this code with a loop into a VD. Your AIO Scene will press the VD button so I can send the message to all devices.

     

    Please login or register to see this spoiler.

     

    Link to comment
    Share on other sites

  • Topic Author
  • That's what I thought... Fibaro has issue with interactive push, sent to admin only.

    As I said in new release this type of push will be supported.

    Thanks again

    Edited by cag014
    Link to comment
    Share on other sites

  • Topic Author
  • Just to save your time... by using VD and you're not going to use interactive push ( at least till new release)

    find follow line (somewhere line 736)

           if not logInfo then api.post('/mobile/push',{["mobileDevices"]={tonumber(i)},["message"]=body,["title"]=subject,["category"]='RUN_CANCEL',["data"]={["sceneId"]=__fibaroSceneId}}) end end  

     

    and change it to

           if not logInfo then fibaro:call(tonumber(i),"sendPush",subject.."\n"..body) end end  

     

    Let me know if it works for you.

     

    Edited by cag014
    Link to comment
    Share on other sites

    Hello,

     

    thank you for this part of code. I have test All-in-One SceneV1.1 and it now it sends push message to the users phones. 

     

    The reason is like you describe above. In our family all smart phones have an own Fibaro user and the iPad uses the administrator to view the complete smart home. We all uses the "old" App.

     

    Thank you Manuel

    Link to comment
    Share on other sites

  • Topic Author
  • Same configuration in my family also, interesting, looks like we're thinking in same direction.

    Link to comment
    Share on other sites

    • 2 weeks later...
  • Topic Author
  • A new version has been released (v2.0).

    This release supports

    1. All actions and properties  of any device on the market. In addition plugins and virtual devices have full support also.

    2. sceneActivation and centralSceneSupport are available for use:

    i.      sceneActivation - when this property in use the value should be the keyID. (e.g. sceneActivation=3).

    ii.      centralSceneSupport – although the trigger name is CentralSceneEvent, property name is centralSceneSupport. Property’s value is [keyId] [dot] [keyAttribute] (e.g. centralSceneSupport=3.Pressed)

    Implementation options:

                    a. Define line for every keyID or for every combination of keyId.keyAttribute in jM{} hash table.

    Please login or register to see this code.

    b.  Define one line in jM{} and use conditional parameter. Action tables trigAct{} or falseAct{} could be in use.

     

    Please login or register to see this code.

     

    c.  Define one line in jM{} without using  state and use conditional parameter. Only trigAct{} table in use. trigAll rule must be applied.

     

    Please login or register to see this code.

     

    New features

    1. added an option to create a group of devices. (real IDs or alias names)
      • jN2s={armDev="570|`mainDoor`|870", mainDoor=647} use in:
      • trueAct={"`armDev`",forceArm",""}, falseAct={"`armDev`","setArmed,0",""}
    2. display reminder's time left to execute.
    3. log and display delRmd/delLogRmd tts "deletion reason" message
    4. added drop-down menu to display 'translated' text of reminder message in reminder's table
    5. display value that triggered the action in 'actions history' drop-down menu
    6. added state value comparison for string and time ranges {state="value>02:00"} {state="value=a~d"}
    7. added range of value for conditional statements - "{$24clock:value=02:00~08:00}"
    8. added option to define range for months, days and week days. timeSlot="m=1~5;d=10~21;w=3~7"
    9. added option to replace any part of the timeSlot. {"`light`>5","setTimeSlot","08:00~10:00=11:00~12:00"}
    10. added "poll" command  
    11. added sceneActivation functionality
    12. added centralSceneSupport functionality
    13. added keywords:
      •    $mName - current full month name (e.g. September)
      •    $wName - current full week day name (e.g. Monday)
      •    $internet - internet status ("online" / "offline"). internet status verified on table refresh cycle.
      •    $timeLoop - dummy keyword to execute delayed action (like turning off lights, heating, arming alarm and etc.) after certain amount of time.
    14. added ability to define number of top active slave devices in sub-menu. user defined range (0-30) default 10
    15. added top active master devices table. user defined range (0-30) default 10
    16. added HC2 LEDs status display (same as on HC2 front panel)
    17. added trigAll rule (true / false). Execute table commands on every device report. (even if the value is the same)
    18. added internet verification line in jM{} hash table.  
    19. added row to display delayed commands to be executed (In buffer:).
    20. added RAM cleanup.
    21. added time stamp(s)menu of alerts occurrences.
    22. added device and action table names in command's details drop-down menu.
    23. added quick guide drop-down menu for each header in a table. Quick guide and command's details menus will be displayed during 5 minutes only. Every manual table refresh will restart menus display for next 5 minutes.
    24. added popup message if new software upgrade available.
    25. added popup warning message when Z-wave LED is constantly on.
    26. added "Active Rules" column to display non-default activated rules of the line. (Green - rule set to true and Pink - false)
    27. added support for plugins
    28. added "setStateFormula" command. Sets formula for state on-line calculation.
    29. sendPush is now simple push notification, and sendiPush (interactive notification) has been added.
    30. added an option to define scene 'to run' for sendiPush and sendPopup notifications. "sentiPush,run525" (run scene 525).
    31. added open use for any valid action of any device. (Z-wave, PlugIn or Virtual Device)
    32. added "else" option to condition statement.
    33. added full support to virtual devices (setSlider, pressButton, setProperty). Values and last modification time of slider or label could be retrieved and trigger actions..
    34. added drop-down menu of 'monitor view' to the table, by hovering over 'system status'. Stand alone monitor view has been cancelled.
    35. added an option to runAction, to define specific command(s) in array to execute.
    36. "23>2","runtAction,1,3","trueAct". execute commands 1 and 3 in trueAct{} array of device 23 at jM line 2
    37. If an error(s) displayed (red menu on bottom right side), by triple manual table refresh the menu won't be displayed (till next error occurrence)

     

    Bug fix

    1. Using wrong property of device (which isn't part of hash table) in formula causes Lua error.
    2. Display error description, if device in use not found in system
    3. Lua error in VD room name, if VD's button executed during initialization.
    4. Occasionally device marked armed after disarm.
    5. Manual table refresh occasionally doesn't respond.
    6. Error when room or device names have minus '-' sign   (like:    Pool-pump)
    7. Unable to use system's global variable includes under score '_'  (like:    Alarm_status).

     

    Edited by cag014
    Link to comment
    Share on other sites

  • Topic Author
  • Waits for Fibaro's approval

    Link to comment
    Share on other sites

    • 2 weeks later...
  • Topic Author
  • How to define and use global "general purpose" actions

     

    The idea is to create a line with actions that can be executed from any other line in hash table. The major advantage of this feature is easy to use, modify and maintain.

    The following example shows arming, disarming (and TTS message) alarm system and use of device grouping feature.

    by using keyword $homeMode, If your system is in vacation mode, motion sensors will be armed also.

     

    1. First of all we'll define group of door and motion sensors.

    jS2n={gardenDoor=647,mainDoor=575,backDoor=442,kitchenDoor=45, ,grpDoors="`mainDoor`|`gardenDoor`|`backDoor`|`kitchenDoor`",

               mainMS=34, kitchenMS=46,stairwayMS=345, ,grpMS="`mainMS`|`kitchenMS`|`stairwayMS`",

    keyFob=433,swipe=597, actBank="$cmds>1"}

     Since runAction command requires pointer to item and his line number we'll use actBank variable to identify the line of global actions.

     

    2. Now define "dummy" user keyword to keep the line in same state permanently. (based on default downloaded userKeyWord{} array)

    userKeyWord={{"$cmds", "$HC2onLine","$dayTime"},
    {"global", function() return tostring(api.get("/settings/info")["online"]) end,
     function() return  os.date("*t",os_time()).hour<6 and "Good night," or os.date("*t",os_time()).hour<12 and "Good morning," or os.date("*t",os_time()).hour<18 and "Good afternoon," or os.date("*t",os_time()).hour<=23 and "Good evening," end }}

     

    3. Create a line with "bank" of actions.

    {0,"$cmds",{trueAct={{"`grpDoors`","setArmed,0",""},{"`grpMS`","setArmed,0",""},

    {"`grpDoors","forceArm",""},{"`grpMS","forceArm","","{$homeMode:value=Vacation}"},

    {"","tts","Arming $homeMode alarm system"},{"","tts","Disarming $homeMode alarm system."}}}},

     

    4. Use actions above in any line in hash table.

    --[[ for Aeon labs key-fob ]]--

    {0,"`keyFob`",{trigAll=true,

    trigAct={{"`actBank`", "runAction,1,2,5", "trueAct","{`keyFob`:sceneActivation=3}"},  -- Arm alarm and tts-Arming alarm...

    {"`actBank`", "runAction,3,4,6", "trueAct","{`keyFob`:sceneActivation=4}"}}}},  -- Disarm alarm and tts - Disarming alarm...

          

    --[[ for Fibaro Swipe ]]--         

    {0, "`swipe`",{ trigAll=true, trigAct={"`actBank`","runAction,3,4,6","trueAct","{$value:value=3.Pressed}"}}},       -- Arm alarm and tts-Arming alarm...

     

    --[[ Arm at 01:00 and disarm at 06:00 ]]--         

    {0, "$24clock",{timeSlot="01:00~, 06:00~"

    trueAct= { {"`actBank`","runAction,3,4,6","trueAct","{$24clock:value=01:00"},        -- Arm alarm and tts-Arming alarm...

    {"`actBank`","runAction,1,2,5","trueAct","{$24clock:value=06:00"}}}},  -- Disarm alarm and tts-disarming alarm...

    and etc..

     

    Using this method makes maintaining very simple and easy.

    1. If device of main door sensor changed, you need to changed only mainDoor to new ID.
    2. To add/remove sensors, change grpDoors or grpMS only.
    3. If you insert new line in table and global actions line has moved, change actBank variable only. for example a new line now is 3, set actBank="$cmds>3".

    Everything else stays the same.... you don't need to go through all lines and make changes.

    Let me know if you have any further questions.

     

     

    Edited by cag014
    Link to comment
    Share on other sites

    would please help me with this?

    I have a wall plug that i want to be turned on every 2 hours during the daytime for 30 mins. time frame: (8am -8PM)

    Link to comment
    Share on other sites

  • Topic Author
  • @vmation.virgin sorry for late response, was on vacation.

    Here is the configuration for you:

    1. Define your wall-plug ID to make jM line more readable.

    (replace number 424 to your device ID and name to whatever suit you)

    jS2n={wPlug=424}

     

    2. Define/add follow line in you jM hash table:

    Please login or register to see this code.

     

     

    Let me know if it works for you.

    Edited by cag014
    Link to comment
    Share on other sites

    hi CagO14,

     

    i am finally getting time to use your all in one scene and liking it more and more but my programming skills get tripped up here....

    {0,"`loungepir`",{state="value=true",trueAct={"`loungeled`","turnOn",""},falseAct={"`loungeled`","turnOff","1500"}}},

    the line above works fine doing as it should but i want to turn some table lamps on in the lounge using the loungepir but only one hour before sunset or if its dark i have a global TOD which gives me the time of day state and wanted to use that but do not know how to use the global in a line like the one above. ps the lamps i want to turn on are called loungetablelamps

     

    Thanks for your help

     

     

    Link to comment
    Share on other sites

  • Topic Author
  • @magicman

    To use global value just add ampersand & sign. &TOD

    Since I don't know what exactly value of TOD, please replace <state> with required value. I assume loungetablelamps will turned off same time as loungeled.

     

    Please login or register to see this code.

     

     

    To my opinion don't turn OFF lights after fixed time value of 1500. I mean turn OFF light if loungepir back to safe ( no motion) after 1500

     

    Please login or register to see this code.

     

     

    There is an option to use built-in sunset and sunrise hour ( which is always updated according to your location). Follow line will turn lights one hour before sunset till sunrise.

     

    Please login or register to see this code.

     

    If you need to turn all lights (including loungeled) one hour before sunset till sunrise then use line below:

     

    Please login or register to see this code.

     

    Let me know if it works for you or any additional help required?

    Hope no typo mistakes....

    Edited by cag014
    Link to comment
    Share on other sites

    ty Cag014,

    yes it works fine thank you for your quick response, i am getting on well with it now, if you dont mind may i ask how i would send (kitchenled.setW(255)) like i did in the old scene structure?

     

    Len

    Link to comment
    Share on other sites

    i see how important ` is as in your examples `loungepir' has the wrong one . i must be getting better because i spotted it! ;)

    Please login or register to see this code.

    Link to comment
    Share on other sites

  • Topic Author
  • Good one... thanks

    But in my defense I do stated hope no typo mistakes... ?

    Link to comment
    Share on other sites

  • Topic Author
  • 26 minutes ago, magicman said:

    ty Cag014,

    yes it works fine thank you for your quick response, i am getting on well with it now, if you dont mind may i ask how i would send (kitchenled.setW(255)) like i did in the old scene structure?

     

    Len

    Could you send what it is?  Is it dimmer for level setting

    please post screen shot of the command..

    Link to comment
    Share on other sites

    Join the conversation

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

    Guest
    Reply to this topic...

    ×   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...