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 'centralsceneevent'.
-
I have been trying to create the following scene in LUA: When i double click the light switch (Fibaro Switch 2), i want to turn all the room lights on. I have set the switch's parameters 28 and 29 to enable 2x click. I have also set the parameter 20 to the correct switch type. This is my object IDs: This is my LUA scene code (I have used this code as a template, since i don't know much about lua https://forum.fibaro.com/topic/23423-switch-2-trigger-scene/😞 --[[ %% properties %% events 109.0 CentralSceneEvent %% globals --]] local pressSource = fibaro:getSourceTrigger()["event"]["data"] --fibaro:debug(json.encode(pressSource)) if (tostring(pressSource["keyAttribute"]) == "Pressed2") then fibaro:debug('Pressed 2 times') if fibaro:getGlobalValue("Home") ~= "1" then fibaro:setGlobal("Home", "1") fibaro:debug(" Global Home set to "..fibaro:getGlobalValue("Home")) fibaro:startScene(68) else fibaro:setGlobal("Home", "0") fibaro:debug(" Global Home set to "..fibaro:getGlobalValue("Home")) fibaro:startScene(69) end end So the idea would be: if key is pressed 2x, the variable "Home" gets 1 (and trigger sceneID 68 - turn all on) or 0 (and trigger sceneID 69 - turn all off) The issue is that i don't know which "CentralSceneEvent" ID to use, i tried 109.0.1 (remote controller) but it didn't work. How does these IDs work exactly for this type of event call? What should i point the id to? Another thing i would like to know: Here i use a single ID that would call to both S1 and S2 of one switch. Can i insert more CentralSceneEvent IDs into this code, so that more switches can trigger the same scene, or i should copy this scene and create a new one for each switch? EDIT: So i figured i was not using the correct ID's to trigger the scene. The 109.0 is actually 110, which made the scene work. Now i just have to figure if i can use more than one ID in the same scene, or if I have to duplicate the scene and switch the ID to the other switch that needs to trigger too. Does anyone know that?
-
Hi, I have two central scene event 'scenes' that represent two different button press actions on one device (Remotec ZRC90) --[[ %% properties %% events 1425 CentralSceneEvent 4 Pressed %% globals --]] local MorningSceneID = 463 local startSource = fibaro:getSourceTrigger(); if ( ( true ) or startSource["type"] == "other" ) then fibaro:startScene(MorningSceneID); -- morning scene end and --[[ %% properties %% events 1425 CentralSceneEvent 3 Pressed2 %% globals --]] local HomeSceneID = 488 local startSource = fibaro:getSourceTrigger(); if ( ( true ) or startSource["type"] == "other" ) then fibaro:startScene(HomeSceneID); -- home scene end Does anybody know how to combine into one scene as this device has 8 buttons/4 options per button (32 events) and I'm trying not to end up with 32 separate scenes the api device dump is as follows... {"id":1425,"name":"Hall Scene Controlle","roomID":5,"type":"com.fibaro.remoteController","baseType":"com.fibaro.actor","enabled":true,"visible":true,"isPlugin":false,"parentId":1424,"remoteGatewayId":0,"interfaces":["battery","zwave","zwaveCentralScene","zwaveWakeup"],"properties":{"parameters":[],"zwaveCompany":"Remotec","zwaveInfo":"2,4,5","zwaveVersion":"1.1","wakeUpTime":0,"pollingTimeSec":0,"batteryLevel":"96","batteryLowNotification":"true","centralSceneSupport":"[{\"keyAttributes\":[\"Pressed\",\"Released\",\"HeldDown\",\"Pressed2\"],\"keyId\":1},{\"keyAttributes\":[\"Pressed\",\"Released\",\"HeldDown\",\"Pressed2\"],\"keyId\":2},{\"keyAttributes\":[\"Pressed\",\"Released\",\"HeldDown\",\"Pressed2\"],\"keyId\":3},{\"keyAttributes\":[\"Pressed\",\"Released\",\"HeldDown\",\"Pressed2\"],\"keyId\":4},{\"keyAttributes\":[\"Pressed\",\"Released\",\"HeldDown\",\"Pressed2\"],\"keyId\":5},{\"keyAttributes\":[\"Pressed\",\"Released\",\"HeldDown\",\"Pressed2\"],\"keyId\":6},{\"keyAttributes\":[\"Pressed\",\"Released\",\"HeldDown\",\"Pressed2\"],\"keyId\":7},{\"keyAttributes\":[\"Pressed\",\"Released\",\"HeldDown\",\"Pressed2\"],\"keyId\":8}]","configured":"true","dead":"false","defInterval":"0","deviceControlType":"0","deviceIcon":"103","emailNotificationID":"0","emailNotificationType":"0","endPointId":"0","liliOffCommand":"","liliOnCommand":"","log":"","logTemp":"","manufacturer":"","markAsDead":"true","maxInterval":"0","minInterval":"0","model":"","nodeId":"196","parametersTemplate":"0","productInfo":"82,84,0,1,133,16,1,1","pushNotificationID":"0","pushNotificationType":"0","remoteGatewayId":"0","saveLogs":"true","serialNumber":"","smsNotificationID":"0","smsNotificationType":"0","stepInterval":"0","useTemplate":"false","userDescription":""},"actions":{"reconfigure":0,"setInterval":1},"created":1468671788,"modified":1468671788,"sortOrder":414} Thanks -Frank SOLUTION local pressSource = fibaro:getSourceTrigger()["event"]["data"] --get data what was pressed --fibaro:debug(json.encode(pressSource)) -- Button 1 to 8 when button is PRESSED once if (tostring(pressSource["keyAttribute"]) == "Pressed") then if (tostring(pressSource["keyId"]) == "1") then fibaro:debug('Key 1 pressed once') -- replace with scene you want executed elseif (tostring(pressSource["keyId"]) == "2") then fibaro:debug('Key #2 pressed once') -- replace with scene you want executed elseif (tostring(pressSource["keyId"]) == "3") then fibaro:debug('Key #3 pressed once') -- replace with scene you want executed elseif (tostring(pressSource["keyId"]) == "4") then fibaro:debug('Key #4 pressed once') -- replace with scene you want executed elseif (tostring(pressSource["keyId"]) == "5") then fibaro:debug('Key #5 pressed once') -- replace with scene you want executed elseif (tostring(pressSource["keyId"]) == "6") then fibaro:debug('Key #6 pressed once') -- replace with scene you want executed elseif (tostring(pressSource["keyId"]) == "7") then fibaro:debug('Key #7 pressed once') -- replace with scene you want executed elseif (tostring(pressSource["keyId"]) == "8") then fibaro:debug('Key 8 pressed once') -- replace with scene you want executed end end Please see post http://forum.fibaro.com/index.php?/topic/21905-at-last-a-wall-mounted-scene-controller-that-works-scene-code-included/ for full scene that works with ZRC90
- 5 replies
-
- lua
- centralsceneevent
-
(and 1 more)
Tagged with: