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


Philips HUE AIO VD standalone 3.1

   (6 reviews)

1 Screenshot

About This File

Philips HUE AIO VD v3.1

(standalone version)

With Philips HUE preview VD v1.1 - brings easier setup and support for multiple Philips HUE bridges

 

 

INTRODUCTION

Philips HUE lighting brings colorful way of lighting experience. More about this lights you can find here https://www2.meethue.com/en-us Philips HUE AIO VD is All In One solution for HC2 owners to control Philips HUE lighting with support for all types of HUE lamps made by Philips and some other manufacturers.

 

PREREQUISITES

  • Fibaro Home Center 2 with firmware 4.120 or greater (tested up to 4.540)
  • Philips HUE bridge V1 (round) with firmware up to 01041302 (released 05 February 2018) or
  • Philips HUE bridge V2 (square) with firmware up to 1901181309 (released 07 February 2019)

 

FEATURES

  • Consists of two VD's: Philips HUE Preview VD which connects to Philips HUE bridge and downloads information of all lights and groups of lights and greatly simplifies installation of Philips HUE AIO VD that controls individual HUE bulbs or group of bulbs. Also added unreachable icon for Philips HUE bridge v1.
  • Philips HUE Preview VD has button for generating authorization username and for easy connection to Philips HUE bridge
  • Support for multiple HUE bridges and most of the Philips HUE bulbs including bulbs from other manufacturers that can be connected to HUE bridge.
  • HUE AIO VD recognizes different types of bulbs like multicolor, white ambience and dimmable and enables proper controls
  • Can control brightness, hue, saturation, color temperature and transition speed that can be set from instant to 10 seconds duration
  • Buttons to activate colorloop efect and Alerts
  • Multilanguage support with 27 languages included. VD's can use HC2 selected language or user can select any other available language. VD will be automatically translated to the selected language (visible after refreshing page on browser or refreshing network data on Fibaro mobile application)
  • Easy setup for VD icons that will also setup icons for all buttons and sliders of the VD. (on UHASTM compatible version is even more easier to setup VD icons with Icon Preview VD)
  • On HUE AIO VD user can setup separated on and off button or have on/off toggle button
  • Self adding of global variables needed and global variable data integrity checking
  • Automatic repair of global variables without user intervention
  • New approach to programming other code to control this VD enables future upgrades without needing to change that code. (See more about that in User Manual provided)

 

INSTALLATION

Please check provided User Manual where all steps are explained in detail and this video made by @MarcoTorino71:

 

PACKAGE CONTENT

  • Philips HUE Preview VD v1.1 standalone
  • Philips HUE AIO VD v3.1 standalone
  • Icon pack Philips HUE E27 bulb indoor
  • Icon pack Philips HUE E27 bulb outdoor
  • Icon pack Philips HUE GU10 bulb indoor
  • Icon pack Philips HUE GU10 bulb outdoor
  • Icon pack Philips HUE LED strip indoor
  • User Manual v1.1 EN

 

CREDITS

Many thanks to BodyArt, gucio1234 and many other Fibaro forum users for help with testing, translations and user manual.

 

TERMS AND CONDITIONS

Permission to use, copy, modify and distribute this software and its documentation for educational, research, personal use and non-profit purposes, without fee and without a signed licensing agreement is hereby granted, provided that the copyright notice, with "Terms and conditions" and "Disclaimer" appear in all copies, modifications and distributions.

It is strictly forbidden to sell, rent, lease and/or lend this software for profit without prior consent from the Author.

 

DISCLAIMER

This software is provided by copyright owner "as is" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the author and distributor be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.

Fibar Group S.A. and their employees are not responsible for support of the Philips HUE AIO VD. Please contact the author Sankotronic, on the Fibaro Forum, for any questions or support required.

 

LEGAL NOTICE

HUE is registered trademark of Philips Lighting Holding B.V. registered internationally.

 

LATEST NEWS

1 April 2019

Philips HUE bridge firmware new version 1901181309 is out. If you upgrade to this latest firmware Philips HUE AIO VD will continue function properly.

 

VERSION HISTORY

3.1 - Corrected bug that was causing HUE AIO VD main loop to stop with error if user set light or group ID that does not exists on HUE bridge. Also corrected bug that was not updating list correctly after first scan if user removed or added light or group on HUE bridge.

3.0 - All In One solution, one VD for all types of bulbs and for control of individual light or group of lights with supporting Philips HUE Preview VD.

2.1 - added Philips HUE White dimmable VD of same version as color version.

2.1 - Corrected error handling when HUE bridge is not reachable.
2.0 - Added On/Off button; two version available: 2.0m with Main loop refresh  or 2.0b with button refresh for systems with more than 15 HUE lamps to improve response and reduce network traffic; changing brightness, color or Saturation sliders now immediately refreshes VD status; code improved so users can easier setup necessary data
1.5 - Added sliders for color (hue) and Saturation, VD is now getting ID & TCP port setting from VD general tab 

1.0 - Changing icons based on the brightness level, Changing icons based on HUE lights state (unreachable/error); Error handling for HUE response data, status information in the bottom bar of the VD; detailed comments in LUA code, main loop refresh code added

 

Here is a new look of Philips HUE AIO VD and companion Philips HUE Preview VD:

 

   28855720_SAPhilipsHUEPreviewv1.1.thumb.png.6265881218e323ce300a09274d214529.png 1237575361_SAPhilipsHUEAIOVDv3.1.thumb.png.4350a30e1fd4412fb92d77ed82c73a25.png     

 

Enjoy coding and your new Philips HUE virtual device!

Sankotronic :P 

 

PS

This solution is only for HC2. If you have HCL then please check @AkilliYuva.com solution here:

 


What's New in Version 3.1   See changelog

Released

  • Moved VD from Fibaro marketplace here to Fibaro forum DOWNLOAD section
  • Corrected bug that was causing HUE AIO VD main loop to stop running if user setup light or group ID that does not exists on HUE bridge
  • Corrected bug that was preventing proper update on HUE Preview VD of lights and groups after user changed setup on HUE bridge
  • Added icon for HUE bridge v1 unreachable

 

UPGRADE

  • From 3.0 to 3.1 - If you are happy with 3.0 then you can skip this version. If you still want to upgrade then delete all previous version VD's and then added global variables and install v3.1 according to user manual.
  • From 2.X to 3.1 - Please delete all old VD's and global variables and follow installation instructions in user manual provided.

 

  • Like 9
  • Thanks 3


User Feedback

Recommended Comments



Thank you for writing this VD - it is so much better than the Fibaro offering!

 

I think there is a small error in the manual.  In section 4.2 where you list the lua commands to read the various values, the "read value from brightness slider" is correct but all the other read values specify fibaro:call(..) which should, I think, be fibaro:getValue(..).

 

Can I ask a question?  Should I be able to alter, for instance, the hue when the light is off (using the AIO VD interface)?  The following sequence does not behave as I was expecting but not sure exactly what you designed it to do under these circumstances:

 

Turn light on

Set brightness slider to 100

Set hue slider to 35

Set saturation slider to 100

light is now showing green

Turn light off

Set hue slider to 0

Turn light on

Light comes on green.  I was expecting red.

 

Similar things happen in lua scenes where changing colour when the light is off has no effect.

 

Regards and thank you again for all your hard work on this.

 

Adrian.

 

 

Link to comment
Share on other sites

Guest Sankotronic

Posted

Hi @[email protected] ,

 

Thank you for reporting errors in manual, will check and correct them in next release.

 

Regarding your question, Philips HUE does not support changing hue, saturation and color temperature if bulb is turned off, so this can be done only after it is turned on. It is HUE 'feature' and doesn't have anything with HUE AIO VD.

 

Still I plan to rewrite HUE AIO VD to further reduce communication between HC2 and HUE bridge and also allow sending commands to bridge even bulb is reported unreachable. Also HUE introduced zones which are at this moment in the beta testing phase, but as soon as they release it as stable version will see how to integrate zones to HUE AIO VD.

 

 

Link to comment
Share on other sites

Hi Sankotronic

 

Thank you for your prompt response.

 

I know this is the perceived wisdom about Hue bulbs and I don't know if it has changed since the early days but I did the following experiment using the CLIP API debugger provided with the Hue bridge:

 

Sending PUT messages to   .../lights/x/state:

 

{"on":true, "sat":254, "bri":254, "hue":10000}   light comes on pale yellow colour

 

{"on":false}   light goes off

 

{"on":true, "sat":254, "bri":254, "hue":0}  light comes on red (no hint of starting in yellow then changing to red)

 

and indeed this is the most useful behaviour especially for scenes where you want to set a particular colour and brightness and have the light come on at that colour and brightness regardless of the state it was in when it was turned off.  I don't think you can do this with AIO currently (unless I have misunderstood something in which case I apologise in advance)

 

Regards

Adrian.

 

 

 

 

 

 

 

 

Link to comment
Share on other sites

Hi

I have just moved my Philips light to your code, and it looks a lot better than the standard Fibaro..

 

But, I'm struggling to work out how to control them using LUA code.. As an example i use the code under to turn off all light in a room.

Can anyone please advice on how this should be updated to also turn off any Philips hue light sin the room?

 

--[[
%% properties
%% events
%% globals
--]]
local ids = fibaro:getDevicesId(
  {
    interfaces = {
      "light",
    },
     roomID = 9,        --Room id for dining room
    properties = {
      dead = false,  
    },
    enabled = true,
    visible = true, -- optional
    --userDescription ~= "", -- attempt to evaluate if user description in device is not nil.
  }
);
-- loop through light ids
for i, id in ipairs(ids) do
    fibaro:debug("Turning off " .. fibaro:getName(id));
    --turn light off
    fibaro:call(id, "turnOff");
      fibaro:sleep(100);
end

 

Link to comment
Share on other sites

This is explained in section 4.1 of the user manual (Philips HUE for HC2 VD User manual v1.1.pdf ) supplied with the Virtual Device.  You need something like this:

 

local hM = json.decode(fibaro:getGlobalValue("HueMain"))  
local hueID = "171"
  
fibaro:call(hueID, "pressButton", hM[hueID].OffButton)

 

replacing 171 with the ID of the virtual device controlling the Hue bulb.

 

HTH

Link to comment
Share on other sites

Hi

Thanks for your feedback.. I go the code from the manual working, I think I was just missing a ")" or another typo..

 

You are right.. the loop i'm using will not include virtuel devices , not even if  the section under is removed..

 

    interfaces = {
      "lights",
    },

If I understand the manual correct the following code should find all VD's in a room, but I cannot get it work.

for id, v in pairs (aM) do
if v.roomID == 7 then 
    hueID = id 
  end 
end

 

Link to comment
Share on other sites

Guest Sankotronic

Posted

Hi All,

 

Thank you for using PHILIPS HUE AIO VD. There is indeed typos in HUE User Manual. Correct code should be:

local hM = json.decode(fibaro:getGlobalValue("HueMain"))
-- only if you use HomeTable solution
local jT = json.decode(fibaro:getGlobalValue("HomeTable"))
local hueID = tostring(jT.livingroom.hue)
-- if not using HomeTable then can use this form where XX is HUE VD ID
local hueID="XX"
-- or can loop through HueMain and look for the HUE VD by eg. room ID
local hueID ={}
function scanHue(roomID)local h,no={},1 for id,v in pairs(hM)do if v.roomID==roomID then h[no]=id no=no+1 end return h end
-- get all HUE AIO VD that are in room with ID = 7
hueID = scanHue(7)
-- Now check if any HUE VD found in room ID=7 and then turn them all off
if #hueID>0 then
  for k,v in pairs(hueID)do fibaro:call(v,"pressButton",hM[v].OffButton)end
end

Curled brackets in hueID={} represents table that can contain more than one values which are sorted by the index. In above example index is number that is position of value inside table. Why table? It simple, there can be more than one HUE AIO VD in one room, so simplest way to get their IDs is to store them in table. Once they are stored in table user can always iterate (loop) through that table and send command to all VD's that are inside that table.

 

 

Link to comment
Share on other sites

Hi

Thank you for posting the code..  But I'm struggling a bit with it..

It seems to be missing one "end"  amusingly at the end of the line starting with  "function scanHue(roomID)local"

 

So after adding the "end" and  setting room id to 9 I end up with the following code:

local hM = json.decode(fibaro:getGlobalValue("HueMain"))
-- only if you use HomeTable solution
--local jT = json.decode(fibaro:getGlobalValue("HomeTable"))
--local hueID = tostring(jT.livingroom.hue)
-- if not using HomeTable then can use this form where XX is HUE VD ID
--local hueID="XX"
-- or can loop through HueMain and look for the HUE VD by eg. room ID
local hueID ={}
function scanHue(roomID)local h,no={},1 
  for id,v in pairs(hM)do if v.roomID==roomID 
      then h[no]=id no=no+1 end return h end end
-- get all HUE AIO VD that are in room with ID = 7
hueID = scanHue(9)
-- Now check if any HUE VD found in room ID=7 and then turn them all off
if #hueID>0 then
  for k,v in pairs(hueID)do fibaro:call(v,"pressButton",hM[v].OffButton)end
end

It randomly turns off only one light when the code is activated (and sometimes none).

Link to comment
Share on other sites

You are returning from the scanHue function after the first time through the loop.  The 3rd line should be

 

      then h[no]=id no=no+1 end end return h end

I usually layout code with one statement per line and indenting like this:

 

function scanHue(roomID)
    local h,no={},1 
    for id,v in pairs(hM) do 
        if v.roomID==roomID 
        then h[no]=id 
            no=no+1 
        end 
    end
    return h 
end

 

It may take up more vertical space but it is then much easier to spot mistakes in the program flow and missing end statements etc.

Link to comment
Share on other sites

Thank you for your assistance. I now works perfect.

 

It's gonna make it a lot easier to keep the house updated every time my wife decides to move a lamp to another room.

Link to comment
Share on other sites

Hello,  i'am totally new here, but i got my HC2 working fine and now i'am trying to add HUE to my setup, i have one HUE lamp and it is connected to wall socket that is Z-WAVE so is made the Block action, and this works for 99% the only thing that isnt working is that when the light is off and gets triggerd again the brightness is 100.... Can someone help me....

Screenshot 2019-09-02 at 22.25.33.png

Link to comment
Share on other sites

Guest Sankotronic

Posted

On 9/2/2019 at 10:28 PM, inbedrijf said:

Hello,  i'am totally new here, but i got my HC2 working fine and now i'am trying to add HUE to my setup, i have one HUE lamp and it is connected to wall socket that is Z-WAVE so is made the Block action, and this works for 99% the only thing that isnt working is that when the light is off and gets triggerd again the brightness is 100.... Can someone help me....

 

Hi @inbedrijf ,

 

I think that you don't need to use any other devices on HUE lamps. Just remove that wall socket and use it for some other purpose. HUE lights can be remotely turned off and actually to be able to control them remotely they must NOT be switched off by switch. Using HUE plugin or HUE AIO VD is enough to control HUE lamps.

 

Link to comment
Share on other sites

Hi @Sankotronic,

 

First of all, awesome job. The light react much faster than via the Hue integration. I have one problem tough and i dind't find the solution in here or in the manual. I can't get the lights to show up in Fibaro tablet app as Lights so i need to go to rooms, select one and there adjust. Is it even possible to get them to the widgets on the "main page" of the app?

 

Sorry if the solution is somewhere, my coding skills are quite none existing ;)

 

Thanks in advance if you have time to awnser!

Link to comment
Share on other sites

Guest Sankotronic

Posted

Hi @Janarta ,

 

For now virtual devices in old mobile app can be found only in rooms or in Virtual devices section. Fibaro is working on improving that and they already added categorization for virtual devices, but their new Home Center app still need to be improved too.

 

For now what you can do is open each VD for editing and select in which category you like it to show. Category selection can be seen on both tabs General and Advanced and is just bellow TCP port setting. Even if you do that in old mobile app nothing will change, but in new mobile app they should then show in selected category. Oh, just to mention that VD categorization is available from firmware 4.550.

 

 

Link to comment
Share on other sites

Hi Sankotronic,

 

i do something wrong. What if i want alarm with e.g. red color and after alarm ends the previous state color, brightness etc ?

 

local hM = json.decode(fibaro:getGlobalValue("HueMain"))
local hA = json.decode(fibaro:getGlobalValue("HueAlert"))   

local hueID = "XX"

hA.hue.flg = true;
hA.hue.rst = true;

fibaro:call(hueID, "pressButton", hM[hueID].alButton)

Every time i get white color after alarm ends and not the previous one.

Link to comment
Share on other sites

Guest Sankotronic

Posted

Hi @Meinewenigkeit ,

 

I have checked code and there is really problem with returning previous state if color was set with hue and saturation and not with color temperature. Thank you for pointing that out. In next version of Philips HUE VD family I have solved that problem and I will make it available as soon as I write new user manual and do extensive tests.

 

 

Link to comment
Share on other sites

Hi @Sankotronic

 

I have a problem, but I don't know if it's a VD or Alexa problem.


I explain to you.

 

If I turn the lights off and on via HC2, there are no problems: they turn on with 100% brightness.


But if I turn the lights off via HC2 and then ask Alexa to turn them on, they turn on at 10%.


Is there any parameter to set that I haven't seen?

 

Thank you.

Link to comment
Share on other sites

Guest Sankotronic

Posted

Hi @MarcoTorino71 ,

 

I have Alexa, but don't use it at the moment since Croatian is not supported language and to use it in English I have to rename all my rooms and devices to English names. Anyway it sounds to me that it is Alexa thing and it turns HUEs to last set brightness. You might tell it also at what brightness to turn on lights. You just need to say a few more words.

 

Of course I suspect that Alexa is controlling HUE directly and not over Fibaro skill?

 

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
Add a comment...

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