kw123 / Hue-Lights-Indigo-plugin

Philips Hue control from Indigo
MIT License
7 stars 11 forks source link

Adding device after adding one group #1

Closed craigulliott closed 7 years ago

craigulliott commented 9 years ago

I created groups of bulbs on my bridge, a group for each room (I have 40 bulbs in 7 different rooms on one bridge).

When I add a new group to my device list in indigo, everything works properly. However, if I try to add a second hue device (bulb, or group) then indigo hangs at the point where it is trying to display for me the list of hue devices to choose from.

I can add multiple bulbs no problem, but as soon as I add a group it stops working.

The errors i see in the console are...

  Error                           device "new device" state key onOffState not defined
  Error                           device "new device" state key onOffState not defined
  Error                           device "new device" state key brightnessLevel not defined
  Error                           device "new device" state key brightnessLevel not defined
  Error (client)                  timeout waiting for plugin response from com.nathansheldon.indigoplugin.HueLights for request UiGetValues2
  Error (client)                  timeout waiting for plugin response from com.nathansheldon.indigoplugin.HueLights for request CallPluginFunc
  Error (client)                  runDialogForDevice() caught exception: NSInvalidArgumentException -- *** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]
  Error                           device "new device" state key onOffState not defined
  Error                           device "new device" state key onOffState not defined
  Error                           device "new device" state key brightnessLevel not defined
  Error                           device "new device" state key brightnessLevel not defined

If you have a good idea of what this might be, then I'd be happy to dig into and send a pull request.

Thanks!

craigulliott commented 9 years ago

I turned on your debug level logging, when a group is present this message is thrown onto the log repeatedly. It seems to be stuck in a loop, this message is sent to the log many (I think over 30) times per second for me.

  Hue Lights Debug                Get group status for group 1.
  Hue Lights Debug                Sending URL request: http://10.0.1.8/api/mykey/groups/1
  Hue Lights Debug                Data from hub: {"name":"i.Bedroom","lights":["3","40","27","38","11","19"],"type":"LightGroup","action": {"on":true,"bri":26,"hue":34515,"sat":236,"effect":"none","xy":[0.3138,0.3238],"ct":153,"colormode":"xy"}}
  Hue Lights Debug                didDeviceCommPropertyChange called.
  Hue Lights Debug                didDeviceCommPropertyChange called.
  Hue Lights Debug                didDeviceCommPropertyChange called.
  Hue Lights Debug                Stopping device: new device
  Hue Lights Debug                Starting device: new device
  Hue Lights Debug                Hue Group device definition:
address : 10.0.1.8 (GID 1)
batteryLevel : None
brightness : 10
buttonGroupCount : 0
configured : True
defaultBrightness : 100
description : 
deviceTypeId : hueGroup
displayStateId : brightnessLevel
displayStateImageSel : DimmerOn
displayStateValRaw : 10
displayStateValUi : 10
enabled : True
energyAccumBaseTime : None
energyAccumTimeDelta : None
energyAccumTotal : None
energyCurLevel : None
errorState : 
folderId : 126587052
globalProps : MetaProps : (dict)
     com.nathansheldon.indigoplugin.HueLights : (dict)
          address : 10.0.1.8 (GID 1) (string)
          defaultBrightness : 100 (string)
          groupId : 1 (string)
          modelId :  (string)
          nameOnHub :  (string)
          rate : 0 (string)
          savedBrightness :  (string)
id : 1468366679
lastChanged : 2015-02-27 00:41:13
ledStates : []
model : Hue Group (Experimental)
name : new device
onBrightensToDefaultToggle : False
onBrightensToLast : False
onState : True
pluginId : com.nathansheldon.indigoplugin.HueLights
pluginProps : com.nathansheldon.indigoplugin.HueLights : (dict)
     address : 10.0.1.8 (GID 1) (string)
     defaultBrightness : 100 (string)
     groupId : 1 (string)
     modelId :  (string)
     nameOnHub :  (string)
     rate : 0 (string)
     savedBrightness :  (string)
protocol : Plugin
remoteDisplay : True
states : States : (dict)
     alertMode :  (string)
     brightnessLevel : 10 (integer)
     colorBlue : 26 (integer)
     colorGreen : 22 (integer)
     colorMode : xy (string)
     colorRed : 2 (integer)
     colorTemp : 6536 (integer)
     colorX : 0.3138 (real)
     colorY : 0.3238 (real)
     effect : none (string)
     groupMemberIDs : 3, 40, 27, 38, 11, 19 (string)
     hue : 190 (integer)
     onOffState : on (on/off bool)
     saturation : 93 (integer)
subModel : 
supportsAllLightsOnOff : False
supportsAllOff : False
supportsStatusRequest : True
version : 0
nsheldon commented 7 years ago

Sorry I never responded. This was fixed in another release. Please upgrade to version 1.3.30 (for Indigo 5 and 6) or 1.4.6b1 for Indigo 7. These versions will fix that problem.