Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


Search the Community

Showing results for tags 'cag014'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • FIBARO Community
    • FIBARO Portal and Forum policy
    • FIBARO
    • Say hello!
    • Off-topics
  • FIBARO Update
    • FIBARO System Update
    • FIBARO Mobile Update
  • FIBARO Community Support
    • Scenes and Interface
    • FIBARO Products
    • FIBARO Mobile
    • FIBARO HomeKit
    • FIBARO Assistant Integrations
    • Other Devices / Third-party devices
    • Tutorials and Guides
    • Home Automation
    • Suggestions
  • FIBARO Społeczność
    • FIBARO
    • Przywitaj się!
    • Off-topic
  • FIBARO Aktualizacja
    • FIBARO System Aktualizacja
    • FIBARO Mobile Aktualizacja
  • FIBARO Wsparcie Społeczności
    • Sceny i Interfejs
    • FIBARO Urządzenia
    • FIBARO Mobilnie
    • FIBARO HomeKit
    • Integracja z Amazon Alexa i Google Home
    • Urządzenia Firm Trzecich
    • Poradniki
    • Automatyka Domowa
    • Sugestie

Categories

  • Scenes
  • Virtual Devices
  • Quick Apps
  • Icons

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Facebook


Google+


Skype


Website URL


WhatsApp


Country


Gateway/s


Interests

  1. Many users have downloaded All-in-One Scene and I believe there are some questions about usage. The purpose of this topic is to help to get most of All-in-One Scene , to share best ideas/actions and solutions. Please feel free to ask any scene's related question and I'll share my best solution with you.
  2. Is anyone has succeed to use https connection? I did follow Fibaro's procedure to install certification Download the certificate. In the Windows Start menu search for mmc app and open it. In the MMC (Microsoft Management Console) app go to File > Add/Remove Snap-In. Add Certificate Snap-in: Certificates > Select “Computer account” > Next > Next > OK. Now go to Certificates > Trusted Root Certification Authorities and right-click on “Certificates” Import the certificate. Find the certificate downloaded from the FIBARO Home Center 3. Import it. Done. Your connection with the gateway is now secure. but doesn't work on FIrefox. (Expiration date ?) Any extra steps required to install certification? Interesting it does work with Chrome !!??
  3. Version 1.0.0

    346 downloads

    Those QuickApps intend to use as a slave devices on HC3 to emulate original devices on HC2/HCL or secondary HC3. The main purpose is to emulate devices of HC2 controller to create same environment on HC3 before migrating the devices. You can use these devices as standard HC3 devices in Lua, block scenes and QuickApp (triggers and control). After migration you just need to delete slaves and change device IDs in code. To make it easy, recommended to use json Home Table. In addition if you intend to keep HC2 or HCL as part of your Home Automation, these slaves provide an option to run your system on HC3 only. You can expand your HCL usage by using Lua, block scenes and QA on HC3 to control and monitor devices on HCL. Please use slaves according to device functionality. For sensors use SlaveSensor, for dimmers use SlaveDimmer, for RGBW dimmers use SlaveColor or SlaveColorW (option to change white level). It's very important to use correct KeyFob slave (sceneActivation or central Scene) After downloading the QA, open user_data file and enter credentials, IP and device ID. slaveRate value is in milliseconds and determines the time rate to fetch the data from original device. For example if device on HC2 turned ON, within 700 milliseconds the slave device on HC3 will be turned ON also Every slave device has an option to stop/start emulation by pressing toggle button .
  4. Version 7.0

    2,559 downloads

    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.
  5. Version 1.0

    359 downloads

    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.
  6. Version 11.3

    1,444 downloads

    AOQ can control any other Fibaro system HC3, HC2, HCL (master/slave concept) Before migrating your devices to HC3, AOQ could be the solution to make it smooth and simple. If you've found yourself with too many Lua and Block scenes and need more automation, this QA is the right solution for you. The QA is designated to control and monitor your home system. QA automatically identifies the type of elements in the system. (Z-wave device, Nice, QA device, scene, automatic scene (Block and Lua). Any valid Z-wave,Nice and QA devices property and their values could be monitored, controlled and execute commands accordingly AOQ supports custom events, active profile setup and controls alarm zones while every breached zone or sensor in the zone could be identified and execute actions accordingly. The first time you use All-in-One QA, jM {} hash table must be defined. Each line in the 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 Time span a period of time (in minutes) within which some activity must be performed by device or scene. Additional two options could be defined: time span = 0 defines the line as activity only. time span = ‘negative number’ line is suspended (remarked) IDs list given list of devices/scenes/QA/global/keywords. Use under score for scene IDs. (“_45”). global variable – add an ampersand sign & to System, QA and Local variable names: &varName keyword – add a dollar sign $ to keyword variable: $name Note: To use & and $ characters for other purpose , add % after the character. Criteria & Rules (optional) property, state, time slot, active rules… Action tables (optional) tables of commands to be executed. To avoid using device IDs jS2n{} array could be defined. If device ID changed because of re-inclusion it requires to change ID in one place only. for example: jS2n= {boiler=137, dryer=630, light=230} device name must be included within back apostrophe sign in jM{} hash table. Now jM{} hash table above will look like that: jM={ { 15, "`boiler`|`dryer`",{timeSlot={“12:00~18:00”},state="value=true", trueAct={“`light`”, “turnOn”,””}}} } 1. Monitor option Some time the scenes or QA 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. Example to set watchdog timer for devices, scenes, QA 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 to report new power value. If not auto-alert sent. {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 Execute actions based on device state, status or value changes. QA supports option like on-line calculations, time modifications, IF THEN and WHEN THEN statements and other features for fully home automation just with one QA (which even doesn’t trigger by the system). Following action tables are available: trueAct{} - executed when state status is true. falseAct{} - executed when state status is false. 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. InitAct{} - Set of specific actions to be executed on startup only. errAct{} - Set of specific actions to be executed if verification failed. okAct{} - Set of specific actions to be executed if verification succeded. Here is an example of most common 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 is out of defined time slot, falseAct{} won’t be executed. In this case, turning light off action should be part of trueAct{} table jM={0,"`mSensor`”,{state=”value=true”,timeslot=”18:00~07:00”,trueAct={{“`lightSw`”,”turnOn”,””},{“`lightSw`”,”turnOff”,”180”}}} Z-wave devices, global variables and keywords could be defined at several lines (no limit). Scene could be defined one time only. For more details please download AOQ Advanced User’s Guide - complete instructions and information AOQ Quick Guide – syntax format reference and examples AOQ HC-WebEye Viewer – AOQ browser viewer guide QA Advantages: Debug window view: On the first run follow information will be displayed at debugger During normal operation every executed command showed at debugger. following data shown for every command: jM line number: device name: state value and status by color (green - true | pink - false); command executed. The debug information has special tag "AOQ<QA-ID>" and "TRACE" / "WARNING" / "ERROR" type for filtering. AOQ table preview: Table's header includes: startup time stamp, script current version, scene Name, LED as displayed at HC3 front panel, sunrise/set hours. Current home mode (@home or @vacation) System's current profile mode. Elapsed time Total Z-wave events Min, average and max Z-traffic Table columns are: Type – device type (Z.Device, G. Variable, Keyword, QA, luaScene, blockScene). 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 included in alarm circle icon appears before name. green circle - armed, red circle - breached Value – items current value. Criteria – state of evaluation to determine true or false status. If formula included, the state displayed on green background. in State– 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. 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 – Time slot range to execute related actions. Timestamp to execute specific action at specific time. Active (in range) time slot shown in green fonts. trueAct – list of actions to execute when the state is true. falseAct – list of actions to execute when the state is true. trigAct – list of actions when the 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 immediately after actions table executions. initAct – list of actions to execute on QA startup. Active Rules – non default defined rules (initOnStartup, Vacation, timeSpanOn, onClock, lineState, trigAll) jM{#} - line number in jM{} hash table jM{ hash table line} – shows device location in jM{} hash table. At the bottom of the table two execution lines show: list of up to 60 last executed actions (in order of execution) are displayed. (like CNN news line). list of delayed commands to be executed (and time left to execute) All global variables, their values and last modification time shows below the table.
  7. I'm wondering if there anyone wants to test All-in-One (same as HC3) running ON PC to control HCL with an option to write Lua functions also. (Including http requests)
  8. Version 2.0

    197 downloads

    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.
  9. Version 1.3

    574 downloads

    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.
  10. cag014

    All about icons

    Version 3.1

    11,169 downloads

    Did some rework on Fibaro and Aeon sensors icons and few others The stand alone sensor icon actually has a little human figure stand still (white color) to use as part of inactive motion icon. Added linear icons
  11. cag014

    HC-WebEye

    Version 3.0

    486 downloads

    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.
  12. Alarm Control HC3 new alarm concept could be used very efficiently by AOQ: For example: Assuming we have defined "nightSleep" which includes 1 doors and 2 window sensors. The zone is activated during the night (23:00~06:30). When the zone has breached we can send notification and/or send notification for breached device. When sensor has breached it will stay in breach mode and not monitored by alarm anymore, so additional breach is not identified. In order to monitor all sensors again, entire zone must be re-armed. Here is an example how to do it: jS2n={door=300, wSense1=410,wSense2=420, rgb=500} jM={ {0,"$blank",{timeSlot="06:30~23:00,23:00~,~06:30",initAct={"nightSleep","disarmAlarm",""}, trueAct={"nightSleep","armAlarm",""},falseAct={"nightSleep","disarmAlarm",""}}}, {0,"`door`|`wSense1`|`wSense2`",{state="alarm=breached",trueAct={{"Night Sleep Zone breached","sendEmail","$name at $room has breached"}}}}, {0,"$nightSleep",{state="value=breached",trueAct={{"nightSleep","disarmAlarm",""},{"nightSleep","armAlarm","5"}}}}, If you need visual indication of alarm status, we can add trigAct{} to set RGB Bulb according to alarm state by change last line as following: jS2n={door=300, wSense1=410,wSense2=420, rgb=500} jM={ {0,"$blank",{timeSlot="06:30~23:00,23:00~,~06:30",initAct={"nightSleep","disarmAlarm",""}, trueAct={"nightSleep","armAlarm",""},falseAct={"nightSleep","disarmAlarm",""}}}, {0,"`door`|`wSense1`|`wSense2`",{state="alarm=breached",trueAct={{"Night Sleep Zone breached","sendEmail","$name at $room has breached"}}}}, {0,"$nightSleep",{state="value=breached",trueAct={{"nightSleep","disarmAlarm",""},{"nightSleep","armAlarm","5"}}, trigAct={{"`rgb`","setColor,255,0,0,0","","{$nightSleep:value=breached}"},{"`rgb`","setColor,0,255,0,0","","{$nightSleep:value=armed}"},{"`rgb`","setValue,0","","{$nightSleep:value=disarmed}"}}}, You can use sendEmail, sendPush or sendiPush notification. Note: Using sendiPush you can define to execute scene or an action on any device (and any command) in the system. By pressing "RUN" button on iPush notification you can do follow: {"Night Sleep Zone breached","sendiPush,run_30","$name at $room has breached"} run scene 30 {"Night Sleep Zone breached","sendiPush,run85{turnOn}","$name at $room has breached"} turn ON device 85 {"Night Sleep Zone breached","sendiPush,run90{setColor,255,0,0,0}","$name at $room has breached"} set red color on device 90
  13. Version 2.0

    527 downloads

    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...
  14. cag014

    Z-wave monitor

    Version 3.0

    2,914 downloads

    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/[email protected](216.7 power) #2/34 -First number is number of events during logRate slot. Second number is total number for events so far. [email protected] - 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.
  15. There are a lot of excellent ideas and solutions across the forum, the problem is to find them. The purpose of this topic is to gather all best solution and ideas for smart home that your family loves and you're willing to share with others. Any idea or solution is welcome, even non-significant idea for you could make a huge different and contribution to others. I don't know if this topic will be popular among users, but let's try. Please do not post code or debug/fix the code in this topic. It should be posted in appropriate forum's topic and link posted here. All you need, just one click away: Home Appliance Climate & Weather Lighting Control Security & Safety Z-Wave diagnostic Advanced Power tools Tips & Tricks If you have an idea, please send it to @cag014 by private message and I'll add to topic. (credit will kept to owner)
  16. Version 1.0

    497 downloads

    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.
  17. Hi all, I see that some users have downloaded Z-wave monitor script and I think it could be a good idea to share our data and know-how to optimize our Z-wave performance. In my case I have manage to reduce Z-wave traffic from average of event per 1.7 sec. to 4.8 sec (24 hours monitoring, 78 physical devices, 382 IDs), but I don't know if this is a good number. It will be interesting if anyone could share an average of his system. That way we can compare and might be to achieve the right number and stable performance which may be could prevent Z-wave freeze in the future. I think average of Z-wave traffic somehow depends on number of the devices in the system and again I believe we need team work to find correct formula for that. Few users have shared with me that they have found devices, which "bombarding" the traffic with unnecessary reports and they fixed the issue. It could be very helpful to all of us to share our solutions and fixes... we all can learn from others If you think it could violate your privacy, please ignore this message... Thank you
  18. Version 2.0

    1,109 downloads

    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.
  19. Version 1.0

    31 downloads

    First of all, this is not scene or script. Just a function to use in scripts to avoid unnecessary Zwave traffic. In many cases we send commands to devices without verifying the devices status, this function verifies device current status before sending command and in case the status of the device is not as required, command send. This function supports "turnOn" and "turnOff" commands for switches and dimmers. How to use? Copy this function to your script and change all fibaro:call(...) to fibaro_call(...). Just replace the colon " : " by underscore " _ " Function always returns Boolean variable true or false. Two options to use the function: fibaro_call ( devID, "trunOn" ) or fibaro_call ( devID, "turnOff" ) - verify device status and send "turnOn" if neccessary. fibaro_call ( devID, "?turnOn" ) or fibaro_call ( devID, "?turnOff" ) - checks device status only. Returns true or false according to status. No command sent. For example: Original scene which includes few scenarios of sending turnOff/turnOn . --[[ %% properties 823 value 792 value --]] local devID = fibaro:getSourceTrigger()["deviceID"] if devID == 823 then -- no status verification at all fibaro:call(540,"turnOff") end if devID == 792 then -- including verification if tonumber(fibaro:getValue(540,"value"))==0 then fibaro:call(540,"turnOn") end end if tonumber(fibaro:getValue(540,"value"))==1 then -- checkin device status fibaro:setGlobal("test","lightOn") else fibaro:setGlobal("test","lightOff") end Now we add the function --[[ %% properties 823 value 792 value --]] function fibaro_call(devId,param) local fStatus,act=true,{["turnOn"]=1,["turnOff"]=0,["?turnOn"]=1,["?turnOff"]=0} if not act[param] then fibaro:debug("fibaro_call.lua:\'<font color=firebrick><font size=2> "..param.." </font></font>\' not supported."); return false end if math.min(1,tonumber(fibaro:getValue(devId,"value"))) ~= act[param] then fStatus=false end if param:find("?") then return fStatus end if not fStatus then fibaro:call(devId,param);fStatus=true end return fStatus end local devID = fibaro:getSourceTrigger()["deviceID"] if devID == 823 then --verification done by fibaro_call() fibaro_call(540,"turnOff") end if devID == 792 then -- no need extra lines for verification fibaro_call(540,"turnOn") end if fibaro_call(540,"?turnOn") then -- checking device status by fibaro_call(). fibaro:setGlobal("test","lightOn") else fibaro:setGlobal("test","lightOff") end That's all. Please use this function as a template and change it according to your needs. In order to observe how much your Zwave traffic is loaded by repeated commands, please download Zwave monitor version 3.0
  20. Version 1.2

    240 downloads

    Due to lack of global functions, we're adding more and more global variables. In some cases after a while we find a way to do it differently, but the global variables are still there. Usually we quite afraid to delete the variable because we're not sure if the variable is not in use somewhere in code. So, this code scans scenes and virtual devices and finds where the variable is in use. Scenes displayed (blue color) by name and scene ID. Virtual devices displayed (wheat color) by name, button name, device ID and button ID. The program execution has four options: 1. Scan for all variables and display scenes and virtual devices where every variable is in use. (make sure findVar=nil and findString=nil) 2. Find where specific variable is in use by defining findVar. 3. Find where specific string (phrase) is in use by defining findString. Some characters, called magic characters, have special meanings when used in a pattern. The magic characters are ( ) . % + - * ? [ ^ $ The character `%´ works as an escape for those magic characters. So, '%.' matches a dot; '%%' matches the character `%´ itself. You can use the escape `%´ also for all other non-alphanumeric characters. When in doubt, play safe and put an escape. For example if you're searching for string "match(" you should use "match%(". 4. To find not in use variables only. Press "start" twice within 1 second. --================= User configurable parameters ============================ findVar = nil --------- Name of specific variable to search. findString = nil ------ Any string to search. --============================================================================ Notes: In case findVar and findString are both defined, the code will scan for findString. Make sure when findVar and findString are not in use to set to nil As usual hope it helps...
  21. Finally I have found a way to nicely format the label on virtual device. It works perfectly on HC2 UI, but it totally distorted on mobile devices (Android and iOS). Here how it looks on UI: On mobile you can see nothing, just the beginning of the format Fibaro team or anyone any idea why it works this way? Any workaround?
  22. hi, This tutorial is based on an idea that i believe originated to @cag014 some time back and has been adopted by many. So well deserved kudos to @cag014 and others that helped originate and develop the concept. I am merely a scribe that has benefited from this. I decided to write a quick tutorial for two reasons... I implemented this over christmas and and found it very useful and much easier than I thought It would appear that we have some new forum members that got HC2 devices from Santa The core of this approach is to store all the reference ID's to your devices, virtual devices, scenes, etc in a json encoded table. The references like jT.kitchen.light are used in the scene or vd and device ID can easily be changed in the table. One important benefit is that it you need to exclude/include a device the device ID will change. With this approach you simple change the reference in the Home table and your done. Without this approach you wll need to go through your code and change the device ID where appropriate. ** This doesn't get over the need to enter ID as triggers in the scene headers as fibaro doesn't allow variable in the header ** The solution has two parts to it. The home table itself where the data is stored. - this is held in a predefined variable (lower part of variables panel) The references in your scenes and virtual devices use this table HOME TABLE This can be created and maintained through either a scene or a virtual device. I chose a VD but there is no advantage I can thing of using one way or the other. Go to Panel, Variables Panel and create a new predefined variable (lower part of panel) called HomeTable. When you create a predefined variable it has two values. Name the variable and save. Edit the variable and simply delete the second value. Using either a scene or a vd create your table and store it. This is lua from my VD. I create one button and enter the code below. The top part shows the format of the table. I opted to place each element I am looking to store into rooms and/or other natural groupings but you can choose any way to structure. I'll attached a copy of my full table at the end of this to show what I use it for. The next part encodes and stores the data The last part is where I read back one entry to show the table stored okay. -- HOME TABLE FOR ALL DEVICES, SCENES ETC. jsonHome = { hall = { Lights=88,Lamp=1421,Temp=1,Motion=1,Humidity=1,Lux=1,ZRC90=1447,SmallBathLight=147,SmallBathMotion=1, SmallBathTemp=1,SmallBathLux=1,TTS_message="",TTS_volume=10,RadFav=3,IsPlaying=1,nowPlaying="",vol=1,clip="" }, kitchen = { Pendant=176,Table=174,Spotlights=90,Temp=1549,Motion=1548,Humidity=1551,Lux=1550,UV=1552,XmasLight=1531, WineFridgeTemp=1,Dishwasher=1,rcTV=1490,rcSonos=1561,TTS_message="",TTS_volume=10,RadFav=3,IsPlaying=1,nowPlaying="",vol=1,clip="" }, } jHomeTable = json.encode(jsonHome) -- ENCODES THE DATA IN JSON FORMAT BEFORE STORING fibaro:setGlobal("HomeTable", jHomeTable) -- THIS STORES THE DATA IN THE VARIABLE fibaro:debug("global jTable created") -- STANDARD DEBUG LINE TO DISPLAY A MESSAGE -- I then like to read back a entry from the table to show that the table didnt get corrupt in the process. local jT = json.decode(fibaro:getGlobalValue("HomeTable")) -- REFERENCE TO DECODE TABLE fibaro:debug(jT.kitchen.Motion) -- DISPLAY ONE VARIALE the output of this when I click the button (or run the scene is as follows) It is reading back the ID (1548) stored for Motion under the kitchen grouping I would recommend using an external editor like Notepad++ or Zerobrane to edit/manage the code in the vd and then copy back to the vd when ready to update as the HC2 lua editor is very small At this stage you now have your table REFERENCING THE TABLE CONTENTS IN YOUR SCENES AND VIRTUAL DEVICES For this you need to place the following line of code in each scene or vd local jT = json.decode(fibaro:getGlobalValue("HomeTable")) and then use references instead of device ID's in the scene code. The easiest way to explain this is with an example. This scene switches on a light in my kitchen if it is dark, motion is detected and no light is on already --[[ %% properties 1548 value %% events %% global --]] local jT = json.decode(fibaro:getGlobalValue("HomeTable")) -- KITCHEN AUTOLIGHTS if (tonumber(fibaro:getGlobalValue("Darkness")) == 1 ) and (tonumber(fibaro:getValue(jT.kitchen.Motion, "value")) > 0 ) and (tonumber(fibaro:getValue(jT.kitchen.Spotlights, "value")) == 0 ) and (tonumber(fibaro:getValue(jT.kitchen.Pendant, "value")) == 0 ) and (tonumber(fibaro:getValue(jT.kitchen.Table, "value")) == 0 ) and (tonumber(fibaro:getValue(jT.sunroom.Light, "value")) == 0 ) and (tonumber(fibaro:getValue(jT.sunroom.Lamp, "value")) == 0 ) then fibaro:call(jT.kitchen.Pendant, "setValue", "40") UpdateEventLog("kitchen lights auto on") end It's easy enough to see how the references are built up if you examine the scene v the table at the top of this post and that it !! Addition: If you need to adjust a single parameter in the table you can use the following. This can be useful if you don't want to adjust one value and then copy the whole table back into the vd and update or more useful if you want to adjust the value in the fly in a script. -- NEW PARAMETER VALUE jT.kitchen.Motion=2000 -- TO SAVE THE CHANGE jSonosTable = json.encode(jT) fibaro:setGlobal("SonosTable", jSonosTable) fibaro:debug("global jTable created") Hopefully this will help some users If you have any suggestions as to how to improve this please let me know and I'll edit -frank ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Copy of my table to show how flexible this approach can be jsonHome = { system = { Sunset_SunRise=1560,houseStatus=1507,alarmStatus=881,HouseTemps=1236,sonosSummary=1407,sonosTTS=1452, sonosSequences=1536,TVSequences=1545,lightingSequences=1534,powerConsump=1484,specialHouseMode=1538 }, hall = { Lights=88,Lamp=1421,Temp=1,Motion=1,Humidity=1,Lux=1,ZRC90=1447,SmallBathLight=147,SmallBathMotion=1, SmallBathTemp=1,SmallBathLux=1,TTS_message="",TTS_volume=10,RadFav=3,IsPlaying=1,nowPlaying="",vol=1,clip="" }, playroom = { Light=84,TVLight=1438,XmasLight=1518,Motion=1595,Temp=1596,rcPlayroomTV=1487,rcSonos=1574,Lux=1597,Humidity=1598,UV=1598,TTS_message="",TTS_volume=10,RadFav=3,IsPlaying=1,nowPlaying="",vol=1,clip="" }, living_room = { Light=231,libraryLight=164,libraryTopSocket=166,Temp=1584,Lamp=1423,Lux=1585,Motion=1583,Humidity=1,UV=1,TVLight=1499,XmasLight=1513,rcSonos=1,rcLivingRoomTV=1506,TTS_message="",TTS_volume=10,RadFav=3,IsPlaying=1,nowPlaying="",vol=1,clip="" }, utility_room = { Light=141,Temp=1194,Motion=1270,Humidity=1,Lux=1,UV=1,FreezerTemp=1,Washer=1,Dryer=1 }, equipment_rack = { RackSummary=1453,Rack1Temp=1192,Rack2Temp=1193,fanUpper1=1432,fanLower2=1434,powerAmpLower=1269, powerAmpUpper=1267,heatingFlowTemp=1199,rcSatBox=1491,SatBoxPresets=1492,rcHdmiMatrix=1489,rcAppleTV=1539, rcAppleTvSystem=1540,rcBluRay=1544,rcDroidBox=1541,networkMonitor=1493,avDeviceMonitor=1494,haDeviceMonitor=1495,hc2Resources=1391 }, kitchen = { Pendant=176,Table=174,Spotlights=90,Temp=1549,Motion=1548,Humidity=1551,Lux=1550,UV=1552,XmasLight=1531, WineFridgeTemp=1,Dishwasher=1,rcTV=1490,rcSonos=1561,TTS_message="",TTS_volume=10,RadFav=3,IsPlaying=1,nowPlaying="",vol=1,clip="" }, sunroom = { Light=172,Lamp=6,projectionScreenPower=1509,rcProjector=1542,rcProjectorScreen=1543 }, dining_room = { Light=25,Lamp=1,Motion=1,Temp=1202,Lux=1,Humidity=1,rcSonos=1,TTS_message="",TTS_volume=10,RadFav=3,IsPlaying=1,nowPlaying="",vol=1,clip="" }, pizza_bbq_area = { CenterLights=253,Spotlight=710,Lanterns=712,HeaterSwitch=255,LEDLights=238,Motion=705,Heaters=250,Temp=1,Lux=1, Humidity=1,rcSonos=1,PizzaBbqCam=761,TTS_message="",TTS_volume=10,RadFav=3,IsPlaying=1,nowPlaying="",vol=1,clip="" }, garage = { Light=895,BenchLight=1,DoorOpener=80,DoorStatus=778,Temp=1578,Humidity=1590,Lux=1589,Motion=1587,UV=1591, GarageControl=1559,rcSonos=1,TTS_message="",TTS_volume=10,RadFav=3,IsPlaying=1,nowPlaying="",vol=1,clip="" }, driveway = { porchLight=68,pillarLights=145,Spotlight=893,Motion=1429,GateTemp=958,GateOpener=94,GateStatus=956,GateControl=1537,DrivewayCam=1556,FrontDoorCam=1557 }, back_garden = { patioLight=64,utilityLight=76,sidePatioLights=60,boundaryLights=62,Spotlight=58,Motion=1427,Humidity=218,Lux=217,Temp=958,XmasLight=1523,BackGardenCam=1558 }, hotpress = { Light=143,DoorStatus=888,Temp=890 }, bathroom = { Light=162,MirrorLight=1468,MirrorDemist=1470,Temp=1170,Humidity=1,Motion=1 }, guest_bedroom = { Light=31,Lamp=718,Temp=1588,Motion=1587,Lux=1589,Humidity=1590,UV=1591,BathLight=1,BathTemp=1,BathMotion=1,BathHumidity=1,BathFan=1,BathMirrorLight=1460,BathMirrorDemist=1462,rcSonos=1,TTS_message="",TTS_volume=10,RadFav=3,IsPlaying=1,nowPlaying="",vol=1,clip="" }, master_bedroom = { Light=56,LampDad=29,LampMum=1,Temp=1,Motion=1247,Lux=1, Humidity=1,BathLight=1,BathTemp=871,BathMotion=870,BathHumidity=1,BathLux=872,BathFan=1,BathMirrorLight=1464,BathMirrorDemist=1466,rcSonos=1,TTS_message="",TTS_volume=10,RadFav=3,IsPlaying=1,nowPlaying="",vol=1,clip="" }, lau_eth_bedroom = { Light=52,Temp=1185,Motion=1253,Lamp=1440,rcSonos=1,TTS_message="",TTS_volume=10,RadFav=3,IsPlaying=1,nowPlaying="",vol=1,clip="" }, frank_bedroom = { Light=54,Temp=1200,Motion=1255,Lamp=1450,rcSonos=1,TTS_message="",TTS_volume=10,RadFav=3,IsPlaying=1,nowPlaying="",vol=1,clip="" }, office = { Light=33,Temp=1186,Motion=1251,Lamp=720,rcSonos=1,TTS_message="",TTS_volume=10,RadFav=3,IsPlaying=1,nowPlaying="",vol=1,clip="" }, Landing_Stairs = { stairsLight=92,landingLight=168,rcSonos=1,TTS_message="",TTS_volume=10,RadFav=3,IsPlaying=1,nowPlaying="",vol=1,clip="" }, scene = { MainScene=614,AlarmControl=598,rebootHC2=593,goodMorning=463,goodNight=331,LeavingHome=483,welcomeHome=488,quietMorning=499,kidsToBed=490,plaroomTvOn=580,firstFloorMusicOn=579,firstFloorAllOff=578, hallSceneControl=519,StairsLight30=556,GateOpen5=526,GateOpenHold=361,GateOpenClose=425,DumpEventLog=565,PlayroomOff=617 }, vd = { AlarmManagement=881,TVPresets=1545,SonosTTS=1452,LightPresets=1534,HouseModeExt=1538,SonosPresets=1536,RackTempMngt=1453,MediaSourcePresets=1567,JhomeTable=1566,GateControl=1537,GarageControl=1559 }, users = { admin=2,frank=1564,sylvia=1565 }, ios = { frankS6=993,sylviaS7=1526,frankipad=1532,sylviaipad=1533 }, IsOnline = { GlobalCache=1,SatBox=1,AppleTV=1,AndroidBox=1,TVPlayroom=1,TVKitchen=1,TVLiving=1,Projector=1,HC2=1,SynNAS=1,AlarmGateway=1,AlarmPanel=1,SonosAPI=1,DrivewayCam=1,GardenCam=1,FrontDoorCam=1,PizzaBBQCam=1,Internet=1,USG=1,HouseAP=1,GarageAP=1 }, }
  23. Guys, I have seen some very cheap Z-wave devices at eBay... Please see link below http://www.ebay.com/sch/aixi-smart-home-security/m.html?item=122479369236&rt=nc&_trksid=p2047675.l2562 Ia anyone has tried these no brand devices? It looks like "original" copy of some famous smart home manufacturers . Would like to hear your opinion on that..... thanks
  24. Hi everyone. I have few devices that don't react properly to simple "turnOn", "turnOff" actions. Might be Z-wave unresponsive at that time or RF interference or they're too far away from controller or they'e dead. Anyhow when executing fibaro:call(devID,"turnOn") the device doesn't always turning ON (same case for OFF). This phenomena very frustrating especially on predefined events that don't act as expected ( like turn on Fan in bathroom when humidity high, close garage if no presence detected at home, turn on/off water heater according to temperature and etc.) Attached scene code is verifying that the device is not dead, command transferred to device and device has changed the state. In case of problem email sent to notify about problem. In addition I have found that this scene is very efficient to identify unresponsive Z-wave situation and I'm using this scene to turn on/off some device every hour just to see if Z-wave is OK. Some basic instructions: 1. Create new LUA scene and copy attached code in it. 2. Scene call syntax: fibaro:startScene(sceneID, {devID, "turnOn"}) - same parameters as original fibaro:call() That's all for basic. In addition there are two options: 1. If you have device that you want to be notify by email at any time that the device state has been changed (in my case garage gate and water heater), please add third Boolean parameter: fibaro:startScene(sceneID, {devID, "turnOn", true}). You will receive an email one every state change of the device. Could be changed into push notification. 2. If you need to receive scene status of the action or debug information, please follow next instructions: Add "predefined global variable" by name jCall. In order to receive correct response you need to make sure that the scene is executed before that, so the suggested scene call is: fibaro:startScene(sceneID,{devID,"turnOff"}) x=os.time(); while (fibaro:countScenes(sceneID)>0 and os.time() - x < 10) do end jFc = json.decode(fibaro:getGlobalValue("jCall")) fibaro:debug(jFc.resp) -- print debug information if (jFc.status == 1) then -- success - write your code else -- action failed write your code end Note: In case the device already at the same state, email sent to notify that the device state is the same and no action performed. Scene Code below and attachment FibaroCall.rtf local jK,jC = {"device","act", "sEmail"} , {device = -1, act = "noAct", sEmail=false} for i, v in ipairs(fibaro:args(1)) do jC[jK[i]] = v end local actState = {"OFF", "ON", "turnOff" , "turnOn"} local sceneStart = os.time() local log, mLine = "", "————————————————————————————" local mStr = fibaro:getRoomNameByDeviceID(jC.device) ..":" .. fibaro:getName(jC.device) local iVal, iValTime = fibaro:getValue(jC.device, "value"), os.time() - fibaro:getModificationTime(jC.device,"value") local jF = {status=-1,resp="in scene"} if (actState[iVal+3] == jC.act ) then jF.status=1 jF.resp = "<font color=lightblue><sub>" .. fibaro:countScenes() .."</font></sub><font color=yellowgreen>" .. jC.device..":</font><font color=wheat>" .. mStr .. " <font color=lightgreen> [ Device state: " .. actState[iVal+1] .. " | Action: " .. jC.act .. " ] </font><font color=lightblue>-> No actions</font><span style=text-align:center>" if (jC.sEmail == true ) then fibaro:call(2, "sendEmail",fibaro:getName(jC.device) .. ":" .. jC.act , "{ " .. mStr .. " } device at same state as requested:\n" .. mLine .. "\n\t\tDevice state: " .. actState[iVal+1] .. "\n\t\tAction: " .. jC.act .. "\n" .. mLine .. "\n\n☛ Fail-safe Call (•‿•) " ) jF.resp = jF.resp .. " <small>(eMail sent)</small>" end fibaro:debug(jF.resp) if (fibaro:getGlobalValue("jCall")) then fibaro:setGlobal("jCall",json.encode(jF)) end fibaro:abort() end for i=1,3 do fibaro:call(jC.device, jC.act) x = os.time(); while (log == "" and (os.time() - x) < 10) do fibaro:sleep(150) -- time to update log (status) log = fibaro:getValue(jC.device, "log") end fibaro:sleep(350) if (log == "" ) then log="Transfer_was_Blank" end jF.resp = "<font color=lightblue><sub>" .. fibaro:countScenes() .. "</font></sub><font color=grey><sup>" .. i .. "</sup></font><font color=yellowgreen>" .. jC.device..":</font><font color=wheat>" .. mStr .. " <font color=lightgreen> [Action: " .. jC.act .. "] [State: " .. iVal .. ">" .. fibaro:getValue(jC.device, "value") .."]</font> [<small>" .. log .. "</small>]</font>" if (string.find(log,"Transfer_was_") == nil) then if (log == "SEND_COMMAND_TO_DEAD_DEVICE") then jF.resp = jF.resp .. "<br><font color=orangered>Trying " .. jC.act .. " on DEAD device [ " .. mStr .. " ]</font>" fibaro:call(1, 'wakeUpAllDevices',jC.device) end elseif (iVal == fibaro:getValue(jC.device, "value") ) then else jF.status = 1 break end fibaro:debug("<font color=yellowgreen>" .. jC.device.."</font> " .. jF.resp .. " <font color=orangered><small>FAILED</font>" .. "<small> Retry in " .. (.5*i) .. " Sec.</small>") fibaro:sleep(500*i) end -- for i=1,3 do if (jF.status == 0) then jF.resp = "<font color=orangered>Z-Error: </font>" .. jF.resp .. " <small>(eMail sent)</small>" fibaro:call(2, "sendEmail","Z-Error:" .. fibaro:getName(jC.device), "\n{ " .. mStr .. " } does not respond properly!\n" .. mLine .. "\n\t" .. jC.device .. ":" .. fibaro:getName(jC.device) .. " [ " .. actState[iVal+1] .. " > " .. actState[tonumber(fibaro:getValue(jC.device, "value"))+1] .. " ] [ " .. log .. " ]\n\t" .. actState[iVal+1] .. " state duration = " .. os.date("!%H:%M:%S",iValTime) .. " Sec.\n" .. mLine .. "\n\n☛ Fail-safe Call ( ◉︵◉ )") elseif (jC.sEmail == true ) then fibaro:call(2, "sendEmail",fibaro:getName(jC.device).. ":" .. jC.act , "\n{ " .. mStr .. " } device state has been successfully changed.\n" .. mLine .. "\n\t" .. jC.device .. ":" .. fibaro:getName(jC.device) .. " [ " .. actState[iVal+1] .. " > " .. actState[tonumber(fibaro:getValue(jC.device, "value"))+1] .. " : " .. log .. " ]\n\t" .. actState[iVal+1] .. " state duration = " .. os.date("!%H:%M:%S",iValTime) .. " Sec.\n" .. mLine .. "\n\n☛ Fail-safe Call (•‿•) ") jF.resp = jF.resp .. " <small>(eMail sent)</small>" end --if (status == 0) fibaro:debug(jF.resp .. "<small> in " .. os.time() - sceneStart .. " sec. </small><span style=text-align:center>") if (fibaro:getGlobalValue("jCall")) then fibaro:setGlobal("jCall",json.encode(jF)) end
  25. Hello everyone ! I'm looking for forum's help on below subject: Sometimes scenes, virtual devices unexpectedly stop running due to bugs or other problems, physical devices stuck (motion sensors, power readings and etc.) and there is no ability to identify it. The only way to realize that something went wrong is when you notify that the system behaves differently. In many cases it takes a while to understand what the problem is. I'm wondering if there is any builtin solution to monitor proper execution of scenes, virtual devices and to identify that physical devices aren't stuck. Something like "watchdog" for all parts and codes. I've wrote scene that uses refreshStates API, but it looks more like workaround. Although the scene works perfectly and sends emails (TTS as well) in case of problems in any part of the system , I prefer to use standard solution if exists. Thank you I believe, I'm not the only one that struggling with this problem. (If anyone is interested to have my solution, I could post it despite my opinion that it is "ugly workaround")
×
×
  • Create New...