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

Philips HUE usage in scenes


Maintains
 Share

Question

I recently added the Philips HUE plugin (one controller with 3 lamps) to the domotica environment. As this is one standard plug-in I expected it to work like a charm. And although i'm able to turn the lights on/off and change the color, i'm unable to control them using the scene's. I've got absolutely no clue as to why this is, but it seems that it's the case with both the easy scene creation option as well as the LUA option. I've removed them and reinstalled them but with the exact same result. 

 

Anyone else got the same issue using the Hue Plugin? And if so, what other alternatives do I have in controlling them. Having to start up two apps to control the lights isn't really my idea of home automation. 

Please login or register to see this image.

/emoticons/default_icon_biggrin.gif" alt=":-D" />

Link to comment
Share on other sites

15 answers to this question

Recommended Posts

  • 0

Hello,

 

i have a simple scene to turn on and off all lights in the house including HUE with the standart HUE plugin by Fibaro.

The commands can be seen when you are in LUA and move cursor to the left side in the Module list, navigate to your HUE and you should see the commands.

This is for example for turning on all HUE lights where 103 is the HUE Hub ID:

 

local HUE = 103
fibaro:call(HUE, "turnOn")
 
what exactly you want to do with HUE ?
Link to comment
Share on other sites

  • 0

Hi!

 

This is my first week with Fibaro. I am trying to buind a scene with Hue.

 

Is an easy one, turn all the Hue lights 30 mins before sunset.

 

I tryied on the grafical interface without success.

 

This is the equivalent LUA code generated:

Please login or register to see this code.

Thank you,

Manuel

Link to comment
Share on other sites

  • 0

 

Hello,

 

i have a simple scene to turn on and off all lights in the house including HUE with the standart HUE plugin by Fibaro.

The commands can be seen when you are in LUA and move cursor to the left side in the Module list, navigate to your HUE and you should see the commands.

This is for example for turning on all HUE lights where 103 is the HUE Hub ID:

 

local HUE = 103
fibaro:call(HUE, "turnOn")
 
what exactly you want to do with HUE ?

 

 

m-joy, nice, didn't know how to do scenes with my Hue lamps, don't want to add VD, just using the plugin.

 

Just one question, do you know where I can find the rest available commands like "turnOn"? If I want so set brightness level or color... if thats possible.

 

Thanks.

Link to comment
Share on other sites

  • 0

this is not possible with the hue plugin. Full hue control can only be done with the VD. And that works just fine.

 

cheers

emiel

Link to comment
Share on other sites

  • 0

I have the same issue. Standard plug in for Hue is not available in scenes?

I wanted to use the Fibaro Sensor as a on/off device for the Philips Hue. Cant do it using scenes

Ill follow the advice above with VD..but I expected like the person who started this thread, for it to work with the plug-in. Just sayn....

Link to comment
Share on other sites

  • 0

The Standard Hue Plugin in version 1.0 doesn't support scenes. I described it  in

Please login or register to see this link.

.

 

  • Currently, it is not possible to control the properties brightness, hue (color), saturation in a LUA script scene. Please add the main properties at the action panel to make it available for lua scenes. To illustrate take a look on the picture. Thanks in advance.

 

You can make an VD or you make http request directly to the hue bridge. Described in

Please login or register to see this link.

.

Link to comment
Share on other sites

  • 0

I'm probably just old school, but the way to make it work is by using VDs. I have loads of Hue bulbs interacting perfectly with the Fibaro through VDs.

 

Here is a link to my VDs:

Please login or register to see this link.

 

Then you just make the scene push a button on the VD according to the function you want (i.e. "fibaro:call(id_of_vd, "pushButton", id_of_button_to_push). You can also set sliders from the scene.

 

Without being negative, biased or anything, the Hue plugin is really poor and a typical example of FIbaro rushing something through without making it work properly.

Link to comment
Share on other sites

  • 0

I have taken a few thoughts on how to solve the problem to use Philips Hue in a scene without a virtual device.

Now I have created the following code. This works for me.

 

Quick description: The code switches at a certain time the Hue bulb to night light. (In this example, it is preset = 1)

Please login or register to see this code.

Link to comment
Share on other sites

  • 0

Hi Mickler

 

it works, nice work, even in my scene

 

But I was thinking is it possible to make it more simpel, I want to use our code in some scenes i made, so i can set the bri, hue and sat

Please login or register to see this image.

/emoticons/default_wink.png" alt=";)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />

Link to comment
Share on other sites

  • 0

Hi,

I'm studying the script - I want to build a scene that changes the color of the bulb depending on the time of the day, whenever the light is turned on. So I have made a normal scene triggered whenever the light is on that triggers this scene

 

<code>

--[[

%% properties
%% globals
--]]
 
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- LOCAL VARIABLE
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
local debugging = true -- TOGGLE DEBUGGING (true|false)
 
-- Hue connection
local hueIP = "10.16.3.251"
local huePort = "80"
local hueUser = "newdeveloper"
local hueLightID = 2    -- Hue lamp
 
-- Hue presets
local preset = 1    -- preset selection
local presets = {   -- customize the presets if you want
     '{ "bri":255, "hue":50000, "sat":255 }',    -- preset 1; Purple
     '{ "bri":255, "hue":15331, "sat":121 }',    -- preset 2; Reading
     '{ "bri":255, "hue":34495, "sat":232 }',    -- preset 3; Energy
     '{ "effect":"colorloop" }',                 -- preset 4; Colorloop
}
local HuePreset = presets[preset]
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- DEBUG
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
-- basic function: Debug("red", "text")
Debug = function(color, message)
    if (debugging) then
        fibaro:debug(string.format('<%s style="color:%s;">%s', "span", color, message, "span"))
    end
end
 
-- start only one scene
if (fibaro:countScenes() > 2) then
    fibaro:abort()
end
 
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- SCRIPT
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function getMethod(requestUrl, successCallback, errorCallback)
 
  local http = net.HTTPClient()
 
  http:request(requestUrl, {
      options = {
        method = 'GET'
      },
      success = successCallback,
      error = errorCallback
  })
end
 
function putMethod(requestUrl, data, successCallback, errorCallback)
 
  local http = net.HTTPClient()  
  http:request(requestUrl, {
      options = {
        method = 'PUT',
        --data = json.encode(data)
        data = data
      },
      success = successCallback,
      error = errorCallback
  })
end
 
function colorlight()    -- turn light
    -- set the Hue bridge properties (HuePreset)
    --

Please login or register to see this link.


    local url = 'http://'..hueIP..':'..huePort..'/api/'..hueUser..'/lights/'..hueLightID
    local urlput = 'http://'..hueIP..':'..huePort..'/api/'..hueUser..'/lights/'..hueLightID..'/state'
 
    getMethod(url, function(resp)
        if resp.status == 200 then
          Debug("white","Connection to Hue successfully, status " .. resp.status);
          local panel = json.decode(resp.data);
          
            if ((tostring(panel.state.reachable) == "true") and (tostring(panel.state.on) == "true")) then
                --set parameter in hue
                Debug("gray","Set parameter in hue.")
                                                
                --PUT beginning        
                putMethod(urlput, HuePreset, function(resp)
                    if resp.status == 200 then
                      Debug("white","Changes successfully - Hue.")
                    end
                end,
                  
                function(err)
                  Debug("white","error " .. err)
                end
                ) -- PUT ending
            end    
        else
          Debug("white","Connection failed to Hue, status " .. resp.status)
        end    
    end,
    function(err)
        Debug("white","error" .. err);
    end
    )
end
 
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- SCENE TRIGGER
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
local startSource = fibaro:getSourceTrigger();

if (startSource["type"] == "other") then
    Debug("gray","Scene manually called.")
    colorlight()
end    


</code>

 

When I run the script with debug I only see

[DEBUG] 19:41:00: Scene manually called.
[DEBUG] 19:41:00: Connection to Hue successfully, status 200

 

but nothing happens, light stays white.

 

Any idea of what I'm doing wrong?

 

Thanks a lot,

R

Link to comment
Share on other sites

  • 0

Hi,

a small change should solve your problem. I have adapted the script on top.

Please login or register to see this code.

Link to comment
Share on other sites

  • 0

Hi all,

I am looking for an RGB bulb.

form what I understand there are no good options...

Zipato Bulb...

AEON LED Bulb

Philips Hue

 

are all 3 not 100% working correctly. but from what I read, the Hue is the best option...

 

can you please tell me if I need the hue bridge to use a hue bulb with my HC2?

Link to comment
Share on other sites

  • 0

Check out the following post. There is a very simple solution, which I've been looking for.

 

Please login or register to see this link.

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.

 Share

×
×
  • Create New...