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

  • 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. Version 1.0.0

    520 downloads

    File: ikony_sceny.zip Modified icons for most common HC3 scenes - blinds, lights, blinds + lights. Size 128x128px, PNG, transparent background. ikony_sceny.zip
  2. How to create a scene (graphic blocks/ lua) by following below, I need to turn on a light if the door opened(triggering the door sensor) "between" 6.pm to 6.am. ___if the door opened between 6.pm - 6.am, then light on___ thanks.....
  3. I Cannot get the alarm system to send notifications when there is a breach in the sensors. i create a scene if for example the motion sensor is armed and breached then ..... (see photo) The phone show in the users page but do not show up here. Can someone help me please.
  4. I have a question regarding setting up my alarm with help of the scenes in the HCL. I have a scene where the alarm siren is triggered 60 seconds after the motion sensors are armed and breached. During this time (60sec) I have the time to disarm the motion sensors. But this does not stop the alarm siren to turn on as the disarming the motion sensors does not interfere with the scene. Once the motion sensors are breached it depends only on the time to trigger the alarm siren. So I would like to stop the alarm siren after the motion sensors are breached. I think I could achieve this if I could stop the scene after the motion sensors are breached. How can I stop or interfere with the scene in HCL? In scenes I can only start a scene and not stop. Are there any other solutions. Thank you very much.
  5. Hello together, I just wanna give you some insights to my Rollo Shutter scene control by using global Predefined variable Guestmodus. The intention was, to update my Rollo shutter scene that the Rollo blinds will be stay closed in the morning for guest room, if guests are stay over night. 1 Step: I crated a global Predefined variable with called "Guestmodus" with the states "On" and "Off". 2. Step: I created a VD to set the Status if guests are going to stay tonight. Button ON fibaro:setGlobal("Gaestemodus", "On") Button OFF fibaro:setGlobal("Gaestemodus", "Off") Primary loop: selfId = fibaro:getSelfId() guestmodus = fibaro:getGlobal("Gaestemodus") fibaro:call(selfId, "setProperty", "ui.guestmodus.value", guestmodus) 3. Step: I updated my Rollo shutter scene with the a Inner-If-Loop: local var = fibaro:getGlobal("Gaestemodus") if ( var=="Off" ) then fibaro:call(309, "open"); -- Gästezimmer Fenster end Result: If I set the Guestmode to "On" the Rollo Blinds will not move up in the guest room and my Guests can sleep w/o to be disturbed. Greetings Footnote to the icons I used: icon set from @Cannon_82 modified by @master_jo1
  6. Good day all, I am new with Fibaro and domotic. Last week I setup a Jeedom controller and it work fine with a Heat Controller, a light and door sensor. I ordered a KeyFob devise and I success setup the round key to switch on/off the light. However, I have difficultly to understand how to program for a little bit more complex application. I pain to find help with the documentation, as well. I would appreciate of you could give some tips and hints, a tutorial to better understand or if you could help to reach my goal. (I have a jeedom Z-wave controller) The idea is to setup "a menu" with the round key and the square keys. When I pressed once the square key: I would like to increase or decrease the heat with the + and - key After 5 sec, the + and - key are inactive When I pressed once the round key: I would like to increase or decrease the light of my room with the + and - key After 5 sec, the + and - key are inactive When I pressed once the cross key: my flat change to the "bye bye" mode (out the flat) (Heat=> 5°C, lights OFF) When I pressed once the triangle key my flat goes to "Welcome" mode (heat=> 21°C) For now, my main interest, is how to setup the round and square key, to "say" to the + and - keys, on with devise (heat controller or light) they have to make an action. I would like to avoid pressing to keys, as for example, the round and the -, to decrease the light. I guess it would be not possible, as the round and - keys, are to go to the KeyFob menu. Many many many thnak for your help and suggestion. I wish you a nice day. Cheers
  7. Hey! I just recently bought FIBARO Home Center 2 and some smart z-wave products. Still have a lot to learn! I've created 2 easy scenes: 1) when motion sensor detects motion then my kitchen's lamp goes ON; 2) when it does not detect motion for 30 sec then the lamp goes OFF. It works fine, but my question is how can I make this happening ONLY between 5.00-6.00?
  8. Hi, I've got a graphic block scene that check the lux levels, motion and colour of RGBW lights. Screenshot attached However every so often I'm getting this error:- If I convert the graphic block to LUA this is what it looks like, do I need to handle nil values when tonumber does not work? --[[ %% properties 333 value 335 value 114 value 186 color %% weather %% events %% globals --]] local startSource = fibaro:getSourceTrigger(); if ( ( tonumber(fibaro:getValue(333, "value")) > 0 and tonumber(fibaro:getValue(335, "value")) <= 14 and fibaro:getValue(186, "color") ~= "100,0,0,0" and tonumber(fibaro:getValue(114, "value")) == 0 ) or startSource["type"] == "other" ) then fibaro:call(186, "setValue", "20"); end Thanks for any help whatsoever, Paul
  9. Buongiorno, come si può leggere con una chiamata http il contenuto del pannello eventi? lo chiedo perchè vorrei fare delle considerazioni complesse con gli eventi accaduti in un certo lasso di tempo (es.: 24 ore). Saluti. Lorenzo
  10. Version 1.0.0

    3,580 downloads

    Some of the icons I use for different scenes (e.g., TimeBasedEvent by Sankotronic or a scene for the sun protection in summer time) - - - - - 21.08.2018 - adding some new icons for a "battery check" and a "ambient light" scene - - - - - - - - - - 29.08.2018 - adding some new icons for a "check door/window" scene - - - - - - - - - - 14.09.2018 - adding one new icon for the roller shutter control and some different colored icon to create a variable - - - - - - - - - - 10.12.2019 - adding two new icon for the sleep state and the sleep child state - - - - - RollerShutter Control SunProtection HeatingPlan, TimeBasedEvents, CalcBankHoliday and other DimLight, NightLight, ColorLight AllOff, BabyMood, BatterieCheck, WindowCheck, InventoryCheck Create Variable (in different colors)
  11. Ciao a tutti, sto cominciando in questi giorni ad utilizzare HC2 con il sensore di movimento. Dopo aver effettuato un ripristino, per poter ripartire da una situazione pulita, non riesco più a far funzionare una semplice scena a blocchi grafici, che a fronte di un cambio di stato del sensore di movimento a "violato" deve inviare una email traamie una notifica. C'è qualcosa che devo aggiungere dopo il ripristino? altro? Saluti. Lorenzo
  12. Hello, At the moment, I have a basic scene that turns a light on when a sensor sees motion, then turns off when the sensor has seen no motion for 5 minutes. No problem. What I need is; if the lights turn on and I don't want them on, I hit the light switch on the wall, the lights turn off and they remain off for 5 minutes. Currently when I hit the switch, the lights turn off but the motion sensor picks me up and turns them straight back on again. So I'm wondering if I can have a scene that says something along the lines of, "If the lights are on, and Switch 1 Key is pressed, then turn off lights, and..." either disable the scene that uses the motion sensor to turn on the lights for 5 minutes, or disable the lights from being able to be turned on for 5 minutes. I've also thought about trying to use variables but so far am struggling to figure out what feels like should be a simple solution. Any help would be appreciated! Thanks
  13. Hello Anyone that can help me? Have a fibaro hclite and want to light a lamp at sunset or if the light is less than 20 lux then it should be off between 00.30 and 06.00 I did not succeed because when I turn off at night it gets dark and the light comes on again. Then I do not find where to set between 00.30 and 06.00 I am a little beginner with fibarone have had telldus before. Grateful for help!
  14. A simple, rather basic question: I would like to control several devices through one control. The control could be on/off or "set to chosen common value"/off. "Set to common value" could be a dim level for dimmers, or a temperature for thermostats, where the value is not preset but determined as the control is used. I see several ways to do this, each with its own advantages and disadvantages: 1. Make two separate scenes, one to turn the device set on and one to turn them off. Advantage: Very simple to implement for on/off control. Activated only when needed. Disadvantage: Clutters the system with too many scenes. Tricky to achieve value control (but can be done by setting a global variable) 2. Make one scene which performs both desired actions. To dictate whether to turn on or off, either check the current status of the unit or have a global variable which toggles between On and Off each time the scene is run. Advantage: Fewer scenes than option 1. Activated only when needed. Disadvantage: Still messy to perform value control 3. Make a virtual device, with push buttons for on/off or a slider for value control. Advantage: Very intuitive and simple interface Disadvantage: The VD is run every 3 seconds, which is unnecessary as there is no data harvesting involved. I lean towards doing this as a VD, and could include a long fibaro:sleep command in the LUA code to avoid the code (which would essentially be empty) being run every three seconds. Question: Will a sleeping VD respond immediately to buttons or sliders being used, or only after the sleep period ends? Or more generally: How do you prefer to manually control a set of devices, through scenes or VDs?
  15. I use the Imperihome as front end for my HC2 and the other devices I have. Imperihome is mostly fine but the amount of custom text able to display is limited to one line. But, Imperhome can show a web page. Therefore, can I make a global variable where I concatenate HC2-values/information and embed HTML-codes. I then call the variable from my Imperihome and a tiny webpage with e.g. four lines of text is generated. Does this sound possible?
  16. Hello, i am controlling my garden lights with 2 scenes, one for sunset and one for sunrise. And it’s working perfectly I usually have lights dimmed at 30%. I would like to know if it’s possible to add a scene where, if there is a motion it will increase the lights by 30% or to put it to max level for 3 minutes and then back to the previous condition. Another scene could also work, if there is a motion lights up to 100%, and when if there is no motion for 3 minutes lights to 30%. in both cases I would like this scene to work only between 22:00 and 07:00. is it possible to make such a scene ? Thanks in advance !
  17. Universal alarm v1.0 Hello everyone! Here is one simple scene that can be used for FIRE, FLOOD or OTHER ALARM purpose. When triggered by sensor it will send you popup, push and e-mail notification. It can also activate additional alarm sounders. You can also add additional actions to turn On lights, lower blinds or whatever action you like to happen when alarm is breached and also when sensor get back to safe state. There is no global variables needed! If you use HomeTable then you can just uncomment line where this table is read to the scene. SCENE SETUP First you need to decide for what you will use this scene. You can use it for FIRE ALARM or for FLOOD ALARM or for any other purpose that you can think off. Just for setup example I will show here how to set it up for FIRE alarm. Same setup can be done for FLOOD alarm. First you need to add all your smoke detectors to scene header so that it is triggered when any of this sensors detects fire and get breached: --[[ %% properties 96 value 128 value 605 value %% globals --]] Then you can setup devices to which you want this scene to send push notifications. As already mentioned in my other threads, to find ID of your mobile devices you can enter this link in your browser: http://<YOUR_HC_IP>/docs/#!/iosDevices/getIosDevices and then press on button TRY IT! You will get ID numbers of all mobile devices that you can enter here: -- PUSH MESSAGES AND MOBILE DEVICE SETUP --------------------------------- -- define mobile devices to send push messages. Enter devices inside -- braces separated by comma local iosDeviceID = {206, 321}; Then you can setup messages text, translate it to your language: -- PUSH MESSAGES SETUP ------------------------------------------------------ -- enter push message text for breached alarm notification local pushMessage = "WARNING! FIRE/FLOOD/OTHER ALARM BREACHED!"; -- POPUP MESSAGES SETUP ----------------------------------------------------- -- enter popup message text and button caption for breached alarm local popupMainTitle = "FIRE/FLOOD/OTHER ALARM"; local popupTimeFormat = "%H:%M:%S | %d.%m.%Y."; local popupContentTitle = "ALARM breached!"; local popupImgUrl = ""; local popupButtonCaption = "OK"; Here you can setup users that will receive e-mail message. Same as for mobile devices, you can find users ID by entering following link in your browser: http://<YOUR_PC_IP/docs/#!/users/getUserss and then press button TRY IT!. You will get ID numbers of all users that you can enter here: -- E-MAIL MESSAGE SETUP ----------------------------------------------------- -- define users for which you want to receive e-mail warning. Enter users -- inside braces separated by comma local userID = {}; -- Translate this e-mail message text that will be sent to you. On this -- part scene will add which sensor was breached. local emailMessage = "Breached FIRE/FLLOD/OTHER sensor:" In above settings you can also setup first part of the e-mail message. Scene will on that part add room and name of the sensor that is breached! If you want to activate additional sounders because fire and flood sensor sounder is not enough then you can setup here additional sounders to be activated when alarm is activated: -- EXTRA SOUNDER SETUP ------------------------------------------------------ -- define alarm sounder ID inside braces. You can define more than one just -- separate them with comma. local sounderID = {128, 210}; And for the end, if this is not enough for you and you want more action to be executed when alarm is breached, like close water valves, close blinds or turn on some lighting then you can add that code yourself. There are three functions where you can add code: -- EXTRA FUNCTIONS WHERE YOU CAN ADD YOUR CODE ---------------------------- -- use this function to add code that will be executed before all other -- code when sensor is breached function extraUserCodeBreachFirst() -- your code goes here end -- use this function to add code that will be executed after all other -- code when sensor is breached function extraUserCodeBreachLast() -- your code goes here end -- use this function to add code that will be executed when sensor is -- back to safe state function extraUserCodeSafe() -- your code goes here end If you want some action before notifications are send and sounders activated then you add code to function extraUserCodeBreachFirst(). If you want some action to be executed after notifications are sent and sounders activated then you add code to function extraUserCodeBreachLast(). When sensor goes back to safe state scene is activated again. It will not send any messages but will stop sounders and if you want some more action then you can add code to function extraUserCodeSafe(). So, one copy of this scene you can setup for FIRE ALARM. Another copy you can setup for FLOOD ALARM, and if you have something else then you can setup third copy for that OTHER ALARM. NOTE! This scene is tested on my HC2 with software 4.110 by breaching FIRE & FLOOD sensors and found to work flawlessly. If you encounter any problems then please first check your settings and look for typos. If you are still unable to make it work then please send me copy of complete scene code and screenshot of debugging window to my private message and I will help you to make it work! Please, I will appreciate very much any feedback and requests for additional features!! Example of debug window when scene is activated: ICONS DOWNLOAD Icons for this scene you can find here: SCENE DOWNLOAD FILE Please click bellow to download: [SCENE] Universal alarm scene {v1.0} as TXT file --------------------> Universal Alarm scene v1.0.txt [SCENE] Universal alarm scene {v1.0} as LUA file --------------------> Universal Alarm scene v1.0.lua NOTE LUA version of scene code is saved by ZeroBrane Studio v1.50. You can download it at this link: https://studio.zerobrane.com
  18. Today i updated to v. 4.02 for my Fibaro HC2. The update log recommended a reinstallation of the Logitech Harmony Plugin. When i installed the Plugin again via the very smart code-authentication it says on the plugin info: As I understand from the text above it should be possible to make a Scene in HC2 and include a Logitech Harmony Activity? As an example, I have a scene in HC2 called "Leaving Home", and when I press it the lights shuts down and in that scene I also want to shut down my Tv using the Harmony Acitivity. But when i trying to add a scene i can't choose the Activity from my Logitech even tough the activity (Acitivity Digital-Tv in the image attached) is visible in the HC2 panel in the web interface. Does anybody know how to add an Logitech Harmony Acitivity in a HC2 Scene? Thanks in advance! C.
  19. How to create a BUTTON ON/OFF in HLC to start a scene (turn on/off all lamps, turn on/off alarm) from vidget? Is there some example?
  20. Hello friends, I would like to control my sonos devices via scenes. It seems not possible to do that with common ways. So maybe someone in this forum already did that via http methods, rest apis etc. Would be great help if someone has any idea about that. Thanks in advance.
  21. I created several scenes where the timer functions to start the scene is being used. But none of them works. Any idea where should be the problem? See the pictures attached. Thanx for any adwise. HC2, FW 4.056,
  22. I use my HC2 as an alarm system, with 12 door sensors, 5 motion sensors, 2 smoke sensors and 2 flood sensors. Although using Sankotronix scene for detecting empty batteries, I was faced twice in the last month with “dead nodes”, due to empty battery. I would like to run a script (either daily or when I switch on the alarm), that notifies me on any dead nodes. Is there a Fibaro function that I can use for this? The information should be in the system, as the web interface does give the dead node information.
  23. Hi, I have an ACTRONAIR at Home with Wireless Controller. I have done extensive research to understand how the AC is controlled. It turns out that the AC wireless controller get it's instruction from a Web Service in the cloud. I have intercepted the Web Service Call and this is what get passed on to the cloud: PUT https://actron.ninja.is/rest/v0/device/ACONNECTXXXXXXXXXXXX_0_2_5?user_access_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx HTTP/1.1 Accept: application/json Content-Type: application/json Referer: https://actronair.com.au/aconnect/ Accept-Language: en-AU,en;q=0.8,ar-LB;q=0.5,ar;q=0.3 Origin: https://actronair.com.au Accept-Encoding: gzip, deflate User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393 Host: actron.ninja.is Content-Length: 24 Connection: Keep-Alive {"DA":[0,1,1,0,0,0,0,0]} I need help with creating a Scene that sends instructions to the same cloud service. So far I tried the following without any sucess. Appreciate any guidance please! --[[ %% properties %% events %% globals --]] -- Callback at success local function successCallback(resp) fibaro:debug('connection success, status: ' .. resp.status) end -- Callback at error local function errorCallback(resp) fibaro:debug('connection no success, error: ' .. resp) end -- http-request Scene : senden über AutoRemote Tasker WiFi Service enabled in Tasker Action local function getDirect() local http = net.HTTPClient() payload = '"DA":[1,1,1,1,1,0,0,0]' fibaro:debug('this is the payload: ' .. payload .. '.') http:request('https://actron.ninja.is/rest/v0/device/ACONNECTXXXXXXXXXXX_0_2_4?user_access_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', { options = payload, success = successCallback, error = errorCallback } ) end -- Do the request getDirect()
  24. Check status of doors and windows v1.0 This simple scene will send push message every time when door or window is opened if global Variable DoorWinCheck is set to "Yes". Usage, we are sitting in garden on the opposite side of our house main entrance door. Turning this scene on and we will be informed every time when somebody opens main door If scene is started manually with RUN button or by other scene or VD then it will check all doors and windows (or just those we put in the list) and will send popup message with the list of opened doors and windows. The rest is up to you. Here is scene code: --[[ %% properties 125 value 159 value %% globals --]] --[[ --------------------------------------------- -- CHECK DOOR/WINDOWS FOR OPEN/CLOSE STATE -- --------------------------------------------- Copyright © 2016 by Zoran Sankovic - Sankotronic Version 1.0 This scene will be triggered when any door or window is opened or closed if its ID is added above in scene header %% properties section and will send you push notification which one. If it is run manually or started with RUN button or called by VD or other scene then it will check all doors and windows that are added in winDoorID table variable and send you a popup message with the list of all doors and windows openned. This scene requires following global variables: DoorWinCheck - values: "Yes", "No" - set by VD You can enter name of your variable for that purpouse and even map your values to work properly. --]] -- PART OF CODE FOR USERS TO EDIT AND SETUP --------------------------------- -- GLOBAL VARIABLES -- enter names and value mapping of your global variables -- or leave as it is and add to variables panel -- enter name of your global variable and map values local doorWinCheck = "DoorWinCheck"; local doorWinMapping = {Yes="Yes", No="No"}; -- SENSORS, USERS, NOTIFICATIONS setup -------------------------------------- -- enter in this table IDs of all window and door sensors separated by comma -- that you want to be checked when scene is started manually or by another -- scene or VD local winDoorID = {125, 159}; -- define users to send push messages, replace with your user ID local userID = {10, 204, 210}; -- flag for each user; if 1 then send notifications else if 0 do not send notifications local userFlag = {1, 1, 1}; -- setup local variables for notifications -- popup notification title local popupTitle = "Door/Window status"; -- opoup notification subtitle usually contain time when is sent local popupSubtitle = "%H:%M:%S | %d.%m.%Y."; -- message if found any door or window opened local foundOpenedMessage = "Following doors/windows are open:"; -- message if found all doors/windows closed local foundAllClosedMessage = "All doors/windows are closed!"; -- text for button to close popup notification local buttonCaption = "OK"; -- url path to icon to show on popup message local imgUrl = "" -- DEBUGGING VARIABLES --------------------------------------------------- -- setup debugging, true is turned on, false turned off. local deBug = true; -- DEFINE FLAGS - in this section add code to change users flags ----------------- -- END OF CODE PART FOR USERS TO EDIT AND SETUP -------------------------- -- BELLOW CODE NO NEED TO MODIFY BY USER --------------------------------- local OpenWinDoor = ""; local opened = false; local sourceTrigger = fibaro:getSourceTrigger(); local doorWin = fibaro:getGlobalValue(doorWinCheck); -- send push notifications! function sendPush(message) if #userID > 0 then for i = 1, #userID do if userFlag[i] == 1 then fibaro:call(userID[i], "sendPush", message); -- Send message to flagged users end end end end function sendPopup(open, Info) if open then typeInfo = "Warning"; titleInfo = foundOpenedMessage; else typeInfo = "Success"; titleInfo = foundAllClosedMessage; end ------------------------------------- POPUP MESSAGE HomeCenter.PopupService.publish({ -- title (required) title = popupTitle, -- subtitle(optional), e.g. time and date of the pop-up call subtitle = os.date(popupSubtitle), -- content header (optional) contentTitle = titleInfo, -- content (required) contentBody = Info, -- notification image (assigned from the variable) img = "", -- type of the pop-up type = typeInfo, -- buttons definition buttons = { { caption = buttonCaption, sceneId = 0 } } }) end if (sourceTrigger["type"] == "property") then if (doorWin == doorWinMapping.Yes) then local WinDoorID = tonumber(sourceTrigger['deviceID']) local status = tonumber(fibaro:getValue(WinDoorID, "value")) if (status == 1) then local room = fibaro:getRoomNameByDeviceID(WinDoorID); local deviceName = fibaro:getName(WinDoorID); if deBug then fibaro:debug(room..' ' .. deviceName .. ' is opened.') end local pushMessage = room..' ' .. deviceName .. ' is opened.' sendPush(pushMessage); else local deviceName = fibaro:getName(WinDoorID); local room = fibaro:getRoomNameByDeviceID(WinDoorID); if deBug then fibaro:debug(room..' ' .. deviceName .. ' is closed.') end end end elseif (sourceTrigger["type"] == "other") then for i = 1, #winDoorID do if tonumber(fibaro:getValue(winDoorID[i], "value")) == 1 then opened = true; OpenWinDoor = OpenWinDoor .. fibaro:getRoomNameByDeviceID(winDoorID[i]) .." ".. fibaro:getName(winDoorID[i]) .. "\n"; if deBug then fibaro:debug("It is open: "..fibaro:getRoomNameByDeviceID(winDoorID[i]) .." ".. fibaro:getName(winDoorID[i])) end end end if not opened then OpenWinDoor = "All Closed!" end; sendPopup(opened, OpenWinDoor); end fibaro:abort(); global variable DoorWinCheck can be changed by virtual device which have one label and one button. Here is code that goes to button: local selfId = fibaro:getSelfId() -- enter name of your global variable and map values local doorWinCheck = "DoorWinCheck"; local doorWinMapping = {Yes="Yes", No="No"}; if fibaro:getGlobalValue(doorWinCheck) == doorWinMapping.Yes then fibaro:setGlobal(doorWinCheck, doorWinMapping.No) fibaro:call(selfId, "setProperty", "ui.lblDoorWinCheck.value", "No") fibaro:call(selfId, "setProperty", "currentIcon", 402); -- import icon to HC and check ID else fibaro:setGlobal(doorWinCheck, doorWinMapping.Yes) fibaro:call(selfId, "setProperty", "ui.lblDoorWinCheck.value", "Yes") fibaro:call(selfId, "setProperty", "currentIcon", 401); -- import icon to HC and check ID end And if you want you can add this code to Main loop: local selfId = fibaro:getSelfId() -- enter name of your global variable and map values local doorWinCheck = "DoorWinCheck"; local doorWinMapping = {Yes="Yes", No="No"}; if fibaro:getGlobalValue(doorWinCheck) == doorWinMapping.Yes then fibaro:call(selfId, "setProperty", "ui.lblDoorWinCheck.value", "Yes") fibaro:call(selfId, "setProperty", "currentIcon", 401); else fibaro:call(selfId, "setProperty", "ui.lblDoorWinCheck.value", "No") fibaro:call(selfId, "setProperty", "currentIcon", 402); end fibaro:sleep(3000); Don't forget to change name for label from label1 to lblDoorWinCheck or vice-versa. Here is also picture of DV and icons to use for scene and VD: EDIT : New version 1.0 with some changes for users to easier setup. Now you can use existing variable and values you just need to enter name of your variable and map your values to Yes and No for checking and sending push notification when door or window is opened. Also changed push notifications so that users are defined in table variable userID. userFlag defines if user will get notification set by 1, or not set with 0. You can add your part of code to change flags, see example: -- DEFINE FLAGS - in this section add code to change users flags ----------------- local momAway = "MomAway"; local momAwayMapping = {Yes="Yes", No="No"}; if momAway ~= "" then if fibaro:getGlobalValue(momAway) == momAwayMapping.Yes then userFlag[3] = 0; userFlag[4] = 0; end end -- END OF CODE PART FOR USERS TO EDIT AND SETUP -------------------------- Enjoy coding!
  25. Hello guys, before the 4.520 update I used to have a scene which used to restart the HC2 but with the new update it doesn't work anymore and I cant figure this out. I could use some help from you guys. Thank you! Below is the code of the script. --[[ %% properties %% events %% globals --]] -- specify user and passwort in clear text local user = '' local password = '' function encbase64(data) local b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; return ((data:gsub('.', function(x) local r,b='',x:byte() for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end return r; end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) if (#x < 6) then return '' end local c=0 for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end return b:sub(c+1,c+1) end)..({ '', '==', '=' })[#data%3+1]) end local http = net.HTTPClient(); http:request('http://127.0.0.1/services/system/reboot.php',{ options = { method = 'GET', headers = { ["Authorization"] = 'Basic '.. encbase64(user .. ':' .. password) } }, success = function(response) end, error = function(err) fibaro:debug("Error: " .. err) end })
×
×
  • Create New...