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 Lights notworking in scenes


Question

Posted

I see my 20 hue lights in the HC2 of fibaro, but I can't use them in scenes. I read a lot about it, but I don't get it working.

I installed a virtual device file, after that I see under advanced this kind of code:

Do I have to do something with the "IP adress" and the " TCP Port"

Do I have to fill in my own figures?

 

Please login or register to see this attachment.

Somebody else told me this kind of code:

--[[
%% properties
%% events
%% globals
--]]
local hueID = 60 --ID60 is hue groep Gang
fibaro:call(hueID, "changeHue", 15547) -- changeHue = Kleur Bereik 0-65535
fibaro:call(hueID, "changeSaturation", 109) -- changeSaturation bereik 0-255
fibaro:call(hueID, "changeBrightness", 122) -- changeBrightness bereik 0-255
fibaro:call(hueID, "turnOn"); -- lamp Hue aan

 

I tried this withe the right hueID but it is not working for me.  I copied this text in a scene by using LUA, but it's not working. Do I also need  virtual device then of Philips Hue?

 

I checked the Hue ID at the Philips hue site, and and noticed the ID's I am using are 1 to 20.

But I don't understand why I have to use in the first code I mention above(regarding the virtual device I am using) a IP address etc,,and somebody else is talking about local hue ID. Anyway it costs me some hours but I still don't understand much about it.

 

5 answers to this question

Recommended Posts

  • 0
Posted

Hi @Robert66,

 

if you use HUE plugin then you can control it from LUA scene using following functions:

Please login or register to see this code.

In above code pluginID you need to replace with ID number of the HUE plugin that is added to system for specific HUE light. value you need to replace with numbers that you already know.

 

If you need to get status or setting of the HUE light from plugin then you can use this functions:

Please login or register to see this code.

For example if you want to check if HUE light is turned On then you can use this code:

Please login or register to see this code.

Above code checks if light is turned off (function returns zero "0") and if it is then it turns light On. Since all above functions that gets value returns them in string format to compare them with numbers you need to convert them to numbers with tonumber function. Above code will also function properly if it is coded like this:

Please login or register to see this code.

Strings are delimited with quotes like "turnOn" or "0", so for HC2 "0" and 0 are not same because first is string that contains one character 0, while second is number 0.

 

If you decide to use Philips HUE virtual device then details how to do that you can find here:

 

Hope this will help you integrate Philips HUE to HC2.

 

  • Like 1
  • 0
  • Inquirer
  • Posted

    Thanks for your answer and support!

    Meanwhile I got some other code working. The code is ok, but when I put it in another scene is is not working It does not start.

    Don't see why. I just one to start the scene at by example tonight at 8 pm.

    The scene is on automatic, but nothing happens.

    About the code the question... what's better to use the code with the local figures or the one you told me about with the Hue plugin?

    .

     

     

    Please login or register to see this attachment.

    Please login or register to see this attachment.

    • 0
    Posted (edited)

    Hi @Robert66,

     

    You haven't defined a scene trigger in your scene...

     

    also there should be added in the header %%autostart

     

    Edited by Bodyart
    • 0
  • Inquirer
  • Posted
    1 hour ago, Bodyart said:

    Hi @Robert66,

     

    You haven't defined a scene trigger in your scene...

     

    also there should be added in the header %%autostart

     

    I changed it, see the attached screen, but still not working

    Please login or register to see this attachment.

     

    the scene trigger is local hueID = 227 etc.. (line 9)

    It worked yesterday, but now still not working:-(

    • 0
    Posted

    Hi @Robert66,

     

    Please remove comment "--  ID of your Hue device" from scene header.

     

    On 05/09/2017 at 6:02 PM, Robert66 said:

    About the code the question... what's better to use the code with the local figures or the one you told me about with the Hue plugin?

     

    This question I don't understand. What do you mean by "local figures"? If you refer to Philips HUE virtual device (VD) to which I posted link above then answer is that I use Philips HUE VD and like it more than HUE plugin. I also used version 2.1b with refresh button. At the moment I'm testing Philips HUE VD version 3.0 that will be much easier to install/configure for users that are new to this system and will not require any LUA knowledge.

     

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