Talk:Yeelight

From Domoticz
Jump to navigation Jump to search

The White Temperature Control changes the brightness to 75%, because it uses the command scene.

  if CalcValue==nil then CalcValue=0 end
  runcommand = " sudo echo -ne '{\"id\":1, \"method\":\"set_scene\",\"params\":[\"ct\"," .. CalcValue .. ", 75]}\\r\\n' | nc -w1 " ..IP.." " ..PORT.."";
  os.execute(runcommand);
  print(runcommand)
  print("Color Temp= "..CalcValue);

I changed the second line, to only change the white temperatur.

  runcommand = " sudo echo -ne '{\"id\":1,\"method\":\"set_ct_abx\", \"params\":[" .. CalcValue .. ", \"smooth\", 500]}\\r\\n' | nc -w1 " ..IP.." " ..PORT.."";

Yeelight Ceiling Light Calculation

Because the ceiling Light has another Themperature area (2700-6500), the calculation must be different.

  DomValue = otherdevices_svalues[DomDevice];   
  CalcValue = ((DomValue-1) * 38)+2700;