For the Philips Hue lovers there is cheap Osram Lightify Smart Plug, which can be easily added to Philips Hue bridge in order to make non Hue lamps controlled by Hue bridge.
I made a simple small VD based on @Sankotronic's Hue devices.
-----------------------------------------------------------------------------
-- Osram Smart Plug On/Off
-----------------------------------------------------------------------------
--[[
-----------------------------------------------------------------------------
Version 1.0
Original VD written by CHRISSXCROSS © 2015
VD modified and upgraded by Sankotronic © 2016
-----------------------------------------------------------------------------
--]]
local _f = fibaro
local hueID = 40;
-- get name of the user from global value
local hueUser = _f:getGlobal('HueUser');
local iconOff = 1226;
local iconOn = 1227;
local iconUnreachable = 1012;
local iconError = 1013;
-- END OF CODE PART FOR USERS TO EDIT AND SETUP --------------------------
Id = _f:getSelfId()
Ip = _f:get(Id, "IPAddress")
Port = _f:get(Id, "TCPPort")
-- connect to the Hue bridge
Hue = Net.FHttp(Ip, Port)
-- Now do light, get previous settings and send new
-- HTTP GET to get all the info from the light(s)
resp ,stat , err = Hue:GET('/api/'..hueUser..'/lights/'..hueID);
-- continue if HTTP status code is 200
if (tonumber(stat) == 200) then
jT = json.decode(resp)
-- get the on state
hueOn = jT.state.on
_f:debug("hueOn = " .. tostring(hueOn));
hueReachable = jT.state.reachable
_f:debug("hueReachable = " .. tostring(hueReachable));
-- if light is reachable then check if it is ON or OFF to toggle it
if (hueReachable == true) then
if (hueOn == false) then
hueOn = true;
ic = iconOn;
else
hueOn = false;
ic = iconOff;
end
-- HTTP PUT to set the new values
resp, stat, err = Hue:PUT('/api/'..hueUser..'/lights/'..hueID..'/state', '{"on":'..tostring(hueOn)..'}');
_f:call(Id, "setProperty", "currentIcon", ic);
else
_f:log("Hue: Unit not reachable");
-- change the icon to unreachable
_f:call(Id, "setProperty", "currentIcon", iconUnreachable);
end
else
_f:log("Hue: Bridge not reachable");
_f:call(Id, "setProperty", "currentIcon", iconError);
end
I hope someone will have use for it