We have moved at community.getvera.com

Author Topic: Fibaro dimmer and S2 button as scene controller  (Read 22363 times)

Offline Da_JoJo

  • Hero Member
  • *****
  • Posts: 1380
  • Karma: +16/-78
  • If something aint work, we can allways try n make
Re: Fibaro dimmer and S2 button as scene controller
« Reply #15 on: November 04, 2013, 11:55:22 pm »
i had this too but somehow this scenecontroller dissapeared over time and i have no clue what happend with it. have you tried setting the parameter on the device and after it set exclude the device and include it again ? if i recall it was something screwing up the scenecontroller so they removed the feature in latest firmware for vera also breaking scenefunctions of other remotes. hopefully they come up with a solution as these universal sensors from fibaro could be great and cheap for using as a scene-controller.
Vera lite (1.5.622), 2x an-158/2, dead usb pl2302 rs-232, 2x greenwave 6 port, 4x Fibaro FGD211 v1.6, FGBS001, few FGS - 221, etc. AuthomationHD 3 for android :-)
Dutch & German translator http://wiki.micasaverde.com/index.php/Special:AllPages http://support.micasaverde.com http://domotica-shop.nl

Offline chixxi

  • Hero Member
  • *****
  • Posts: 1036
  • Karma: +37/-14
Re: Fibaro dimmer and S2 button as scene controller
« Reply #16 on: November 07, 2013, 01:42:52 am »
This looks really really interessting: http://forum.micasaverde.com/index.php/topic,17409.0.html

Gonna try right when I am home.
Developer of Plugins: Virtual Switch, Variable Container, Popcorn Hour Remote, Vacation Ghost. => PLUGINS HAVE BEEN UNPUBLISHED BY ME.

Offline chixxi

  • Hero Member
  • *****
  • Posts: 1036
  • Karma: +37/-14
Re: Fibaro dimmer and S2 button as scene controller
« Reply #17 on: November 08, 2013, 01:07:45 am »
It is now working! See the link above.
Developer of Plugins: Virtual Switch, Variable Container, Popcorn Hour Remote, Vacation Ghost. => PLUGINS HAVE BEEN UNPUBLISHED BY ME.

Offline DragonVera

  • Sr. Newbie
  • *
  • Posts: 25
  • Karma: +0/-0
Re: Fibaro dimmer and S2 button as scene controller
« Reply #18 on: November 08, 2013, 08:15:33 pm »
I got hold of a dimmer with v2.2 firmware. On this one I set parameter 41 to 1, but no new scene controller device appeared. Did v2.2 firmware remove this functionality?

It is exciting that people are having some success. I am confused about the solution in the link though. Is the solution to get a switch to activate a scene via s2 or does it activate a scene by double clicking on s1? And what is the significance of scenes 24 and 26?
« Last Edit: November 08, 2013, 09:07:17 pm by DragonVera »

Offline DragonVera

  • Sr. Newbie
  • *
  • Posts: 25
  • Karma: +0/-0
Re: Fibaro dimmer and S2 button as scene controller
« Reply #19 on: November 09, 2013, 01:52:00 am »
Update:  I've just set up a PLEG as per the instructions and s2 on the dimmer is now able to active different scenes either via single or double press. Thank heaps!  :)

Offline pls90

  • Sr. Member
  • ****
  • Posts: 314
  • Karma: +2/-0
Re: Fibaro dimmer and S2 button as scene controller
« Reply #20 on: November 09, 2013, 03:20:01 am »
Update:  I've just set up a PLEG as per the instructions and s2 on the dimmer is now able to active different scenes either via single or double press. Thank heaps!  :)
@DragonVera which device property are you using in PLEG? sl_SceneActivated?

Offline DragonVera

  • Sr. Newbie
  • *
  • Posts: 25
  • Karma: +0/-0
Re: Fibaro dimmer and S2 button as scene controller
« Reply #21 on: November 09, 2013, 03:25:19 am »
Yes

Name   Device Name   Device Variable   Last Change   Value
SceneActivated   Upstairs Hallway Lights   sl_SceneActivated   2013-11-09 18:07:26.689   0
LastSceneID   Upstairs Hallway Lights   LastSceneID   2013-11-09 18:07:26.731   26
LastSceneTime   Upstairs Hallway Lights   LastSceneTime   2013-11-09 18:07:26.774   1383980846

Strangely though, I've just tried to do exactly the same setup with another fibaro dimmer (with same firmware Version 3,3,52,2,2 ), and on this dimmer I can't seem to find the device variables sl_SceneActivated, LastSceneID or LastSceneTime when I look for them in the PLEG.  ???

Offline RexBeckett

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3891
  • Karma: +483/-12
Re: Fibaro dimmer and S2 button as scene controller
« Reply #22 on: November 09, 2013, 04:14:35 am »
Quote
Strangely though, I've just tried to do exactly the same setup with another fibaro dimmer (with same firmware Version 3,3,52,2,2 ), and on this dimmer I can't seem to find the device variables sl_SceneActivated, LastSceneID or LastSceneTime when I look for them in the PLEG.  ???
I think the scene variables only get created after you have set variable 41 to 1 and restarted Vera.

Quote
And what is the significance of scenes 24 and 26?
These are explained in the instruction sheet for FGD211 - under Parameter 41. They indicate which switch and action initiated the scene:

14 = S1 double-click
15 = S1 triple-click
16 = S1 single click
24 = S2 double-click
25 = S2 triple-click
26 = S2 single click




« Last Edit: November 09, 2013, 04:30:43 am by RexBeckett »

Offline chixxi

  • Hero Member
  • *****
  • Posts: 1036
  • Karma: +37/-14
Re: Fibaro dimmer and S2 button as scene controller
« Reply #23 on: November 09, 2013, 05:05:41 am »
Quote
I think the scene variables only get created after you have set variable 41 to 1 and restarted Vera.

In my case the variables got created after I set Parameter 41 to 1, then did a double click on the switch, and then reloaded the UI in the browser.
Developer of Plugins: Virtual Switch, Variable Container, Popcorn Hour Remote, Vacation Ghost. => PLUGINS HAVE BEEN UNPUBLISHED BY ME.

Offline Da_JoJo

  • Hero Member
  • *****
  • Posts: 1380
  • Karma: +16/-78
  • If something aint work, we can allways try n make
Re: Fibaro dimmer and S2 button as scene controller
« Reply #24 on: November 11, 2013, 12:17:03 am »
nice ! got it working with fibaro universal sensor thnx to filifjonkan instructions for PLEG .. 2 scene buttons now ^^
Vera lite (1.5.622), 2x an-158/2, dead usb pl2302 rs-232, 2x greenwave 6 port, 4x Fibaro FGD211 v1.6, FGBS001, few FGS - 221, etc. AuthomationHD 3 for android :-)
Dutch & German translator http://wiki.micasaverde.com/index.php/Special:AllPages http://support.micasaverde.com http://domotica-shop.nl

Offline conchordian

  • Sr. Member
  • ****
  • Posts: 326
  • Karma: +4/-1
Re: Fibaro dimmer and S2 button as scene controller
« Reply #25 on: October 30, 2014, 10:26:14 pm »
Is it possible to use either button, on a dimmer with 2.2 firmware, as a scene controller, without PLEG?

Yes, it is, thanks to @RexBeckett  http://forum.micasaverde.com/index.php/topic,18679.msg217315.html#msg217315

Here's how an example of how to run a scene when a button (s1) is double-clicked, on 2 different Fibaro modules.

Note parameter 15 (the one that when double-clicked gives you 100% brightness) has to be set to the default of "1", or the double click variable doesn't seem to show up. 

Startup Lua:
Code: [Select]
-- Set up variable-watch for device 306 (Kitchen Downlights)
luup.variable_watch("doChange306","urn:micasaverde-com:serviceId:SceneController1", "LastSceneID",306)

-- Set up variable-watch for device 308 (Middle Deck Light)
luup.variable_watch("doChange308","urn:micasaverde-com:serviceId:SceneController1", "LastSceneID",308)


-- Process variable-watch callback for device 306. Run scene 161
function doChange306()
luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1", "RunScene", {SceneNum = 161}, 0)
end
-- Process variable-watch callback for device 308. Run scene 160
function doChange308()
luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1", "RunScene", {SceneNum = 160}, 0)
end

Scene (160) Luup:
Code: [Select]
local DoubleClick = luup.variable_get("urn:micasaverde-com:serviceId:SceneController1", "LastSceneID", 308)

if (DoubleClick== "14")
then return true
else return false

end
« Last Edit: February 02, 2015, 12:25:37 am by conchordian »

Offline conchordian

  • Sr. Member
  • ****
  • Posts: 326
  • Karma: +4/-1
Re: Fibaro dimmer and S2 button as scene controller
« Reply #26 on: February 03, 2015, 12:39:45 am »
I've decided to use the sl_SceneActivated variable, instead of the LastSceneID, because if the same button sequence is pressed twice in a row, then the variable doesn't change and the scene won't run.

sl_SceneActivated seems to be changed briefly after every button press, which is what I want as a trigger.

I'm also trying to get the condition for the scene running, (double-clicking), included into the start-up Lua, because if I want to run scene manually from my phone, it will fail to do, so unless the last button press was a double click.

I've inserted a delay of one second because the scene was running sometimes when it shouldn't have been, so I can only assume LastSceneID wasn't being updated quick enough.

I hope this helps somebody, and if anyone can give me tips on a better way to achieve this, or something I'm doing wrong etc. please don't hesitate, because I'm a complete novice just messing around.

Code: [Select]
-- Set up variable-watch for device 308 (Any button press on Middle Deck Light)
luup.variable_watch("ButtonPressed308delay","urn:micasaverde-com:serviceId:SceneController1", "sl_SceneActivated",308)

-- Process variable-watch callback for device 308. Run function after 1 second to give LastSceneID a chance to update.
function ButtonPressed308delay()
luup.call_delay("ButtonPressed308", 1)
end

-- Process variable-watch callback for device 308. Run scene 160, if button double-clicked (ID:14)
function ButtonPressed308()
if (luup.variable_get("urn:micasaverde-com:serviceId:SceneController1", "LastSceneID", 308) == "14") then
luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1", "RunScene", {SceneNum = 160}, 0)
end
end

And here's how to incorporate more than 1 module and look out for triple clicks on S1:

Code: [Select]
-- Set up variable-watch for device 306 (Any button press on Kitchen Downlights)
luup.variable_watch("ButtonPressed306delay","urn:micasaverde-com:serviceId:SceneController1", "sl_SceneActivated",306)

-- Set up variable-watch for device 308 (Any button press on Middle Deck Light)
luup.variable_watch("ButtonPressed308delay","urn:micasaverde-com:serviceId:SceneController1", "sl_SceneActivated",308)

-- Process variable-watch callback for device 306. Run function after 1 second to give LastSceneID a chance to update.
function ButtonPressed306delay()
luup.call_delay("ButtonPressed306", 1)
end

-- Process variable-watch callback for device 306. Run scene 161, if button double-clicked (ID:14), or if triple clicked (ID:15), run scene 178
function ButtonPressed306()
if (luup.variable_get("urn:micasaverde-com:serviceId:SceneController1", "LastSceneID", 306) == "14") then
luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1", "RunScene", {SceneNum = 161}, 0)

    elseif (luup.variable_get("urn:micasaverde-com:serviceId:SceneController1", "LastSceneID", 306) == "15") then
luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1", "RunScene", {SceneNum = 178}, 0)
end
end

-- Process variable-watch callback for device 308. Run function after 1 second to give LastSceneID a chance to update.
function ButtonPressed308delay()
luup.call_delay("ButtonPressed308", 1)
end

-- Process variable-watch callback for device 308. Run scene 160, if button double-clicked (ID:14)
function ButtonPressed308()
if (luup.variable_get("urn:micasaverde-com:serviceId:SceneController1", "LastSceneID", 308) == "14") then
luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1", "RunScene", {SceneNum = 160}, 0)
end
end
« Last Edit: July 01, 2015, 02:04:51 am by conchordian »