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


  • 0

How to get HUE to trigger scene?


P Jonak

Question

Hi

I am playing around with HUE together with my Fibaro system and so far it works fairly well. I am able to get my wall switch (with a dimmer 1 behind it) "control" the HUE indirectly via scenes. So I am able to switch the HUE on or off just by pressing S1 on the dimmer. However, if I use the HUE remote the dimmer won't know about it and comes out of sync. 

 

Working example:

- press S1 on dimmer kicks of a LUA script that sends a "on" signal to the HUE light.

- press S1 on dimme again sends an "off" signal to the HUE

 

Not working example:

- Hue started via the LUA script as mentioned above. If I then kill the light via the HUE remote the dimmer of course won't get a notification of that and still thinks it is "on". To "resync" the two devices I have to press S1 two times again. This of course works but, I would like to get another LUA script to pick up the status of the HUE and set the fibaro dimmer accordingly.

 

I can see that the HUE light status (on/off) is picked up by my controller if I press the remote so my idea was to use the following code to pick it up and set the dimmer in the same state.

 

--[[
%% properties

145 HUE light

164 Fibaro dimmer
%% globals
--]]

 

local startSource = fibaro:getSourceTrigger();

if (fibaro:getValue(145, "ui.onOff.value") == '1') 
then
    fibaro:call(164, 'turnOn')
  else
    fibaro:call(164, 'turnOff')
end
 

But problem is that the script never executes. it is set to automatically start and I can execute it manually to verify it works but I still cannot get it to execute automatically (possible that it does not recognize the on/off trigger on the HUE).

Any suggestion of how this could be done?

 

And just to clarify, I am not using the dimmer to control the HUE lights directly. I am only using it to trigger the HUE via scripts.

 

//Peter

 

 

Edited by P Jonak
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

with this scene it works!!!

645 is a hue device, 580 a fibaro switch

 

 

--[[
%% autostart
%% properties
645 on
%% events
%% globals
--]]

 
local sourceTrigger = fibaro:getSourceTrigger();
    if (
      fibaro:getValue(645, "on")=="1"
        )
    then
      fibaro:call(580, "turnOn");
  else
        fibaro:call(580, "turnOff");
    end

Link to comment
Share on other sites

Join the conversation

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

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...