jtburgess / indigo-TP-LInk

Indigo Plugin for TP-Link SmartPlugs, powerStrips, dimmer switches, and dimmable bulbs; (coming someday color bulbs)
The Unlicense
2 stars 4 forks source link

HS220 status reporting #5

Closed jamesholcomb closed 3 years ago

jamesholcomb commented 3 years ago

Hi, thank you for this great plugin. It has saved me real $$ by using Kasa switches instead of crazy overpriced Insteon switches.

I recently installed an HS220 dimmer, which works great when sending on/off commands. However, I can't seem to get it to report status back to Indigo. Is this a known issue?

Feb 27, 2021 at 5:12:30 PM
   TP-Link Devices                 (plugin.py:actionControlDevice:333): called with: TurnOn for Dining Chandelier.
   TP-Link Devices                 (plugin.py:getSubProtocol:169): called with tplink_relayswitch addr: 192.168.0.190
   TP-Link Devices                 (protocol.py:debugLog:193): Sent:  {"system":{"set_relay_state":{"state":1}}} == on
   TP-Link Devices                 (plugin.py:actionControlDevice:375): send(on) result: {u'system': {u'set_relay_state': {u'err_code': 0}}}
   TP-Link Devices                 (tplink_relayswitch_plugin.py:actionControlDevice:52): sent "Dining Chandelier" on
   TP-Link Devices                 (plugin.py:getDeviceStateList:435):  called for: 'Dining Chandelier'.
   TP-Link Devices                 (plugin.py:getDeviceStateList:436): called for dev: address : 192.168.0.190
batteryLevel : None
blueLevel : None
brightness : 0
buttonConfiguredCount : 0
buttonGroupCount : 0
configured : True
defaultBrightness : 100
description : 
deviceTypeId : tplinkSmartSwitch
displayStateId : brightnessLevel
displayStateImageSel : DimmerOff
displayStateValRaw : 0
displayStateValUi : 0
enabled : True
energyAccumBaseTime : None
energyAccumTimeDelta : None
energyAccumTotal : None
energyCurLevel : None
errorState : 
folderId : 0
globalProps : MetaProps : (dict)
     com.JohnBurgess.indigoplugin.TP-Link-Device : (dict)
          address : 192.168.0.190 (string)
          addressSelect : manual (string)
          devPoll : true (bool)
          displayManAddress : true (bool)
          displayManAddressButton : true (bool)
          displayOk : false (bool)
          initialize : false (bool)
          manualAddressResponse : true (bool)
          newDev : false (bool)
          offPoll : 30 (string)
          onPoll : 10 (string)
greenLevel : None
id : 476362342
lastChanged : 2021-02-27 11:18:59
lastSuccessfulComm : 2021-02-27 11:18:59
ledStates : []
model : TP-Link Smart Dimmer Switch
name : Dining Chandelier
onBrightensToDefaultToggle : False
onBrightensToLast : False
onState : False
ownerProps : com.JohnBurgess.indigoplugin.TP-Link-Device : (dict)
     address : 192.168.0.190 (string)
     addressSelect : manual (string)
     devPoll : true (bool)
     displayManAddress : true (bool)
     displayManAddressButton : true (bool)
     displayOk : false (bool)
     initialize : false (bool)
     manualAddressResponse : true (bool)
     newDev : false (bool)
     offPoll : 30 (string)
     onPoll : 10 (string)
pluginId : com.JohnBurgess.indigoplugin.TP-Link-Device
pluginProps : com.JohnBurgess.indigoplugin.TP-Link-Device : (dict)
     address : 192.168.0.190 (string)
     addressSelect : manual (string)
     devPoll : true (bool)
     displayManAddress : true (bool)
     displayManAddressButton : true (bool)
     displayOk : false (bool)
     initialize : false (bool)
     manualAddressResponse : true (bool)
     newDev : false (bool)
     offPoll : 30 (string)
     onPoll : 10 (string)
protocol : Plugin
redLevel : None
remoteDisplay : True
states : States : (dict)
     alias :  (string)
     brightnessLevel : 0 (integer)
     doubleClick : 0 (integer)
     fadeOffTime : 0 (integer)
     fadeOnTime : 0 (integer)
     gentleOffTime : 0 (integer)
     gentleOnTime : 0 (integer)
     hardOn : 0 (integer)
     longPress : 0 (integer)
     minThreshold : 0 (integer)
     onOffState : on (on/off bool)
     rampRate : 0 (integer)
     rssi : 0 (integer)
     softOn : 0 (integer)
subModel : 
supportsAllLightsOnOff : False
supportsAllOff : False
supportsColor : False
supportsRGB : False
supportsRGBandWhiteSimultaneously : False
supportsStatusRequest : True
supportsTwoWhiteLevels : False
supportsTwoWhiteLevelsSimultaneously : False
supportsWhite : False
supportsWhiteTemperature : False
version : None
whiteLevel : None
whiteLevel2 : None
whiteTemperature : None.
   TP-Link Devices                 (tplink_relayswitch_plugin.py:getDeviceStateList:84):  called for: States : (list)
     Item : (dict)
          Disabled : false (bool)
          Key : rssi (string)
          StateLabel : rssi (string)
          TriggerLabel : rssi (string)
          Type : 100 (integer)
     Item : (dict)
          Disabled : false (bool)
          Key : alias (string)
          StateLabel : alias (string)
          TriggerLabel : alias (string)
          Type : 150 (integer).
   TP-Link Devices Error           Error in plugin execution ExecuteAction:

Traceback (most recent call last):
  File "plugin.py", line 398, in actionControlDevice
KeyError: (u'192.168.0.190',)

Indigo 7.3.1 Indigo-TP-Link 0.9.3

jtburgess commented 3 years ago

Did you see a message like this : ... connection failed with ('NoneType' object has no attribute 'debug')

There was a bug setting up the polling thread. The error I see in your email (... KeyError: (u'192.168.0.190',)) Is because the thread wasn’t set up. That is fixed in the latest version in GitHub (0.9.3.5, although the comment says it’s 0.9.3.4) I haven’t packaged it as a tag for indigo, yet.

The status call right now just says it is up and connected. I think I will improve it to also log the IP address, on/off, and brightness, where appropriate. ANything else you’d like to see?

-- John

On Feb 27, 2021, at 6:14 PM, James Holcomb notifications@github.com wrote:  ☺️☺️☺️🙂☺️🙂Hi, thank you for this great plugin. It has saved me real $$ by using Kasa switches instead of crazy overpriced Insteon switches.

I recently installed an HS220 dimmer, which works great when sending on/off commands. However, I can't seem to get it to report status back to Indigo. Is this a known issue?

Feb 27, 2021 at 5:12:30 PM TP-Link Devices (plugin.py:actionControlDevice:333): called with: TurnOn for Dining Chandelier. TP-Link Devices (plugin.py:getSubProtocol:169): called with tplink_relayswitch addr: 192.168.0.190 TP-Link Devices (protocol.py:debugLog:193): Sent: {"system":{"set_relay_state":{"state":1}}} == on TP-Link Devices (plugin.py:actionControlDevice:375): send(on) result: {u'system': {u'set_relay_state': {u'err_code': 0}}} TP-Link Devices (tplink_relayswitch_plugin.py:actionControlDevice:52): sent "Dining Chandelier" on TP-Link Devices (plugin.py:getDeviceStateList:435): called for: 'Dining Chandelier'. TP-Link Devices (plugin.py:getDeviceStateList:436): called for dev: address : 192.168.0.190 batteryLevel : None blueLevel : None brightness : 0 buttonConfiguredCount : 0 buttonGroupCount : 0 configured : True defaultBrightness : 100 description : deviceTypeId : tplinkSmartSwitch displayStateId : brightnessLevel displayStateImageSel : DimmerOff displayStateValRaw : 0 displayStateValUi : 0 enabled : True energyAccumBaseTime : None energyAccumTimeDelta : None energyAccumTotal : None energyCurLevel : None errorState : folderId : 0 globalProps : MetaProps : (dict) com.JohnBurgess.indigoplugin.TP-Link-Device : (dict) address : 192.168.0.190 (string) addressSelect : manual (string) devPoll : true (bool) displayManAddress : true (bool) displayManAddressButton : true (bool) displayOk : false (bool) initialize : false (bool) manualAddressResponse : true (bool) newDev : false (bool) offPoll : 30 (string) onPoll : 10 (string) greenLevel : None id : 476362342 lastChanged : 2021-02-27 11:18:59 lastSuccessfulComm : 2021-02-27 11:18:59 ledStates : [] model : TP-Link Smart Dimmer Switch name : Dining Chandelier onBrightensToDefaultToggle : False onBrightensToLast : False onState : False ownerProps : com.JohnBurgess.indigoplugin.TP-Link-Device : (dict) address : 192.168.0.190 (string) addressSelect : manual (string) devPoll : true (bool) displayManAddress : true (bool) displayManAddressButton : true (bool) displayOk : false (bool) initialize : false (bool) manualAddressResponse : true (bool) newDev : false (bool) offPoll : 30 (string) onPoll : 10 (string) pluginId : com.JohnBurgess.indigoplugin.TP-Link-Device pluginProps : com.JohnBurgess.indigoplugin.TP-Link-Device : (dict) address : 192.168.0.190 (string) addressSelect : manual (string) devPoll : true (bool) displayManAddress : true (bool) displayManAddressButton : true (bool) displayOk : false (bool) initialize : false (bool) manualAddressResponse : true (bool) newDev : false (bool) offPoll : 30 (string) onPoll : 10 (string) protocol : Plugin redLevel : None remoteDisplay : True states : States : (dict) alias : (string) brightnessLevel : 0 (integer) doubleClick : 0 (integer) fadeOffTime : 0 (integer) fadeOnTime : 0 (integer) gentleOffTime : 0 (integer) gentleOnTime : 0 (integer) hardOn : 0 (integer) longPress : 0 (integer) minThreshold : 0 (integer) onOffState : on (on/off bool) rampRate : 0 (integer) rssi : 0 (integer) softOn : 0 (integer) subModel : supportsAllLightsOnOff : False supportsAllOff : False supportsColor : False supportsRGB : False supportsRGBandWhiteSimultaneously : False supportsStatusRequest : True supportsTwoWhiteLevels : False supportsTwoWhiteLevelsSimultaneously : False supportsWhite : False supportsWhiteTemperature : False version : None whiteLevel : None whiteLevel2 : None whiteTemperature : None. TP-Link Devices (tplink_relayswitch_plugin.py:getDeviceStateList:84): called for: States : (list) Item : (dict) Disabled : false (bool) Key : rssi (string) StateLabel : rssi (string) TriggerLabel : rssi (string) Type : 100 (integer) Item : (dict) Disabled : false (bool) Key : alias (string) StateLabel : alias (string) TriggerLabel : alias (string) Type : 150 (integer). TP-Link Devices Error Error in plugin execution ExecuteAction:

Traceback (most recent call last): File "plugin.py", line 398, in actionControlDevice KeyError: (u'192.168.0.190',)

Indigo 7.3.1 Indigo-TP-Link 0.9.3

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

jamesholcomb commented 3 years ago

I did not see a connection failed message in the log.

When I set brightness to 30, it completes OK and reports back that brightness=30. Subsequently setting to off completes OK and reports back with state=off. But if just Turn On from Indigo, it completes OK but does not update the status.

Here is the output from requesting status:

   TP-Link Devices                 (plugin.py:actionControlUniversal:420): Action: RequestStatus for device: Dining Chandelier.
   TP-Link Devices                 (plugin.py:getInfo:403): Called for: Dining Chandelier.
   TP-Link Devices Error           (plugin.py:getInfo:410): Dining Chandelier: Device not reachable and states could not be updated. u'192.168.0.190'
jtburgess commented 3 years ago

Hmmm, the 1st problem is only when turning ON, and only for device type tplinkSmartSwitch. I don’t have one of those, so I tried to keep the code the same as the code another user sent me. Obviously I missed something 🙁 To clarify,

it completes OK but does not update the status.

Meaning the the bulb DOES turn on, but the GUI isn’t properly updated?

I also improved the status logging. See if that’s working, now. If you pull the latest code from GitHub, it will be version 0.9.3.9.

-- John

On Feb 28, 2021, at 12:39 PM, James Holcomb notifications@github.com wrote:  I did not see a connection failed message in the log.

When I set brightness to 30, it completes OK and reports back that brightness=30. Subsequently setting to off completes OK and reports back with state=off. But if just Turn On from Indigo, it completes OK but does not update the status.

Here is the output from requesting status:

TP-Link Devices (plugin.py:actionControlUniversal:420): Action: RequestStatus for device: Dining Chandelier. TP-Link Devices (plugin.py:getInfo:403): Called for: Dining Chandelier. TP-Link Devices Error (plugin.py:getInfo:410): Dining Chandelier: Device not reachable and states could not be updated. u'192.168.0.190' — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

jtburgess commented 3 years ago

James: did 0939 resolve your issues? I.e., is no news good news. I’d like to close this and cut 0.9.4. Thanks, John

jamesholcomb commented 3 years ago

I was waiting on a new release but I suppose I could try to figure out how to run from source.

jtburgess commented 3 years ago

It’s trivial. Just download the project. It includes an exact indigoPlugin image. Just double click to install.

Then check out what wasn’t working to see if it works now (I hope). Let me know one way or the other. Thanks.

-- John

On Mar 1, 2021, at 11:24 AM, James Holcomb notifications@github.com wrote:

 I was waiting on a new release but I suppose I could try to figure out how to run from source.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

jamesholcomb commented 3 years ago

0.9.3.9 installed with direct download (verified in Plugins menu)

Reload plugin manually

   TP-Link Devices Error           (plugin_base.py:_deviceEnumAndStartComm:1096): exception in deviceStartComm(Dining Chandelier): 'key model not found in dict'

Turn On


Mar 2, 2021 at 4:21:25 PM
   TP-Link Devices                 (plugin.py:actionControlDevice:334): called with: TurnOn for Dining Chandelier.
   TP-Link Devices                 (plugin.py:getSubProtocol:169): called with tplink_relayswitch addr: 192.168.0.190
   TP-Link Devices                 (protocol.py:debugLog:197): Sent:  {"system":{"set_relay_state":{"state":1}}} == on
   TP-Link Devices                 (plugin.py:actionControlDevice:378): send(on) result: {u'system': {u'set_relay_state': {u'err_code': 0}}}
   TP-Link Devices                 (tplink_relayswitch_plugin.py:actionControlDevice:52): sent "Dining Chandelier" on
   TP-Link Devices                 Dining Chandelier set to on
   TP-Link Devices                 Dining Chandelier brightness set to 0
   TP-Link Devices                 (plugin.py:getDeviceStateList:450):  called for: 'Dining Chandelier'.
   TP-Link Devices                 (plugin.py:getDeviceStateList:451): called for dev: address : 192.168.0.190
batteryLevel : None
blueLevel : None
brightness : 0
buttonConfiguredCount : 0
buttonGroupCount : 0
configured : True
defaultBrightness : 100
description : 
deviceTypeId : tplinkSmartSwitch
displayStateId : brightnessLevel
displayStateImageSel : DimmerOff
displayStateValRaw : 0
displayStateValUi : 0
enabled : True
energyAccumBaseTime : None
energyAccumTimeDelta : None
energyAccumTotal : None
energyCurLevel : None
errorState : 
folderId : 0
globalProps : MetaProps : (dict)
     com.JohnBurgess.indigoplugin.TP-Link-Device : (dict)
          address : 192.168.0.190 (string)
          addressSelect : manual (string)
          devPoll : true (bool)
          displayManAddress : true (bool)
          displayManAddressButton : true (bool)
          displayOk : false (bool)
          initialize : false (bool)
          manualAddressResponse : true (bool)
          newDev : false (bool)
          offPoll : 30 (string)
          onPoll : 10 (string)
greenLevel : None
id : 476362342
lastChanged : 2021-03-02 16:20:27
lastSuccessfulComm : 2021-03-02 16:20:27
ledStates : []
model : TP-Link Smart Dimmer Switch
name : Dining Chandelier
onBrightensToDefaultToggle : False
onBrightensToLast : False
onState : False
ownerProps : com.JohnBurgess.indigoplugin.TP-Link-Device : (dict)
     address : 192.168.0.190 (string)
     addressSelect : manual (string)
     devPoll : true (bool)
     displayManAddress : true (bool)
     displayManAddressButton : true (bool)
     displayOk : false (bool)
     initialize : false (bool)
     manualAddressResponse : true (bool)
     newDev : false (bool)
     offPoll : 30 (string)
     onPoll : 10 (string)
pluginId : com.JohnBurgess.indigoplugin.TP-Link-Device
pluginProps : com.JohnBurgess.indigoplugin.TP-Link-Device : (dict)
     address : 192.168.0.190 (string)
     addressSelect : manual (string)
     devPoll : true (bool)
     displayManAddress : true (bool)
     displayManAddressButton : true (bool)
     displayOk : false (bool)
     initialize : false (bool)
     manualAddressResponse : true (bool)
     newDev : false (bool)
     offPoll : 30 (string)
     onPoll : 10 (string)
protocol : Plugin
redLevel : None
remoteDisplay : True
states : States : (dict)
     alias :  (string)
     brightnessLevel : 0 (integer)
     doubleClick : 0 (integer)
     fadeOffTime : 0 (integer)
     fadeOnTime : 0 (integer)
     gentleOffTime : 0 (integer)
     gentleOnTime : 0 (integer)
     hardOn : 0 (integer)
     longPress : 0 (integer)
     minThreshold : 0 (integer)
     onOffState : on (on/off bool)
     rampRate : 0 (integer)
     rssi : 0 (integer)
     softOn : 0 (integer)
subModel : 
supportsAllLightsOnOff : False
supportsAllOff : False
supportsColor : False
supportsRGB : False
supportsRGBandWhiteSimultaneously : False
supportsStatusRequest : True
supportsTwoWhiteLevels : False
supportsTwoWhiteLevelsSimultaneously : False
supportsWhite : False
supportsWhiteTemperature : False
version : None
whiteLevel : None
whiteLevel2 : None
whiteTemperature : None.
   TP-Link Devices                 (tplink_relayswitch_plugin.py:getDeviceStateList:85):  called for: States : (list)
     Item : (dict)
          Disabled : false (bool)
          Key : rssi (string)
          StateLabel : rssi (string)
          TriggerLabel : rssi (string)
          Type : 100 (integer)
     Item : (dict)
          Disabled : false (bool)
          Key : alias (string)
          StateLabel : alias (string)
          TriggerLabel : alias (string)
          Type : 150 (integer).
   TP-Link Devices Error           Error in plugin execution ExecuteAction:

Traceback (most recent call last):
  File "plugin.py", line 401, in actionControlDevice
KeyError: (u'192.168.0.190',)
jtburgess commented 3 years ago

I see you created the device manually. I think that is a problem. It looks like “model” is NOT being added to the pluginProps list using that method (which I’ll fix). You can see it's missing, below. [ Thanks for the detail log, BTW. ]

And because model isn’t defined, the deviceStartComm function failed, and didn’t create a polling thread, and because of that, the actionControlDevice function failed because it couldn’t find the thread!

Could you try re-creating the device using discovery. That should solve everything.

-- John

On Mar 2, 2021, at 5:29 PM, James Holcomb notifications@github.com wrote:

0.9.3.9 installed with direct download (verified in Plugins menu)

Reload plugin manually

TP-Link Devices Error (plugin_base.py:_deviceEnumAndStartComm:1096): exception in deviceStartComm(Dining Chandelier): 'key model not found in dict' Turn On

Mar 2, 2021 at 4:21:25 PM TP-Link Devices (plugin.py:actionControlDevice:334): called with: TurnOn for Dining Chandelier. TP-Link Devices (plugin.py:getSubProtocol:169): called with tplink_relayswitch addr: 192.168.0.190 TP-Link Devices (protocol.py:debugLog:197): Sent: {"system":{"set_relay_state":{"state":1}}} == on TP-Link Devices (plugin.py:actionControlDevice:378): send(on) result: {u'system': {u'set_relay_state': {u'err_code': 0}}} TP-Link Devices (tplink_relayswitch_plugin.py:actionControlDevice:52): sent "Dining Chandelier" on TP-Link Devices Dining Chandelier set to on TP-Link Devices Dining Chandelier brightness set to 0 TP-Link Devices (plugin.py:getDeviceStateList:450): called for: 'Dining Chandelier'. TP-Link Devices (plugin.py:getDeviceStateList:451): called for dev: address : 192.168.0.190 batteryLevel : None blueLevel : None brightness : 0 buttonConfiguredCount : 0 buttonGroupCount : 0 configured : True defaultBrightness : 100 description : deviceTypeId : tplinkSmartSwitch displayStateId : brightnessLevel displayStateImageSel : DimmerOff displayStateValRaw : 0 displayStateValUi : 0 enabled : True energyAccumBaseTime : None energyAccumTimeDelta : None energyAccumTotal : None energyCurLevel : None errorState : folderId : 0 globalProps : MetaProps : (dict) com.JohnBurgess.indigoplugin.TP-Link-Device : (dict) address : 192.168.0.190 (string) addressSelect : manual (string) devPoll : true (bool) displayManAddress : true (bool) displayManAddressButton : true (bool) displayOk : false (bool) initialize : false (bool) manualAddressResponse : true (bool) newDev : false (bool) offPoll : 30 (string) onPoll : 10 (string) greenLevel : None id : 476362342 lastChanged : 2021-03-02 16:20:27 lastSuccessfulComm : 2021-03-02 16:20:27 ledStates : [] model : TP-Link Smart Dimmer Switch name : Dining Chandelier onBrightensToDefaultToggle : False onBrightensToLast : False onState : False ownerProps : com.JohnBurgess.indigoplugin.TP-Link-Device : (dict) address : 192.168.0.190 (string) addressSelect : manual (string) devPoll : true (bool) displayManAddress : true (bool) displayManAddressButton : true (bool) displayOk : false (bool) initialize : false (bool) manualAddressResponse : true (bool) newDev : false (bool) offPoll : 30 (string) onPoll : 10 (string) pluginId : com.JohnBurgess.indigoplugin.TP-Link-Device pluginProps : com.JohnBurgess.indigoplugin.TP-Link-Device : (dict) address : 192.168.0.190 (string) addressSelect : manual (string) devPoll : true (bool) displayManAddress : true (bool) displayManAddressButton : true (bool) displayOk : false (bool) initialize : false (bool) manualAddressResponse : true (bool) newDev : false (bool) offPoll : 30 (string) onPoll : 10 (string) protocol : Plugin redLevel : None remoteDisplay : True states : States : (dict) alias : (string) brightnessLevel : 0 (integer) doubleClick : 0 (integer) fadeOffTime : 0 (integer) fadeOnTime : 0 (integer) gentleOffTime : 0 (integer) gentleOnTime : 0 (integer) hardOn : 0 (integer) longPress : 0 (integer) minThreshold : 0 (integer) onOffState : on (on/off bool) rampRate : 0 (integer) rssi : 0 (integer) softOn : 0 (integer) subModel : supportsAllLightsOnOff : False supportsAllOff : False supportsColor : False supportsRGB : False supportsRGBandWhiteSimultaneously : False supportsStatusRequest : True supportsTwoWhiteLevels : False supportsTwoWhiteLevelsSimultaneously : False supportsWhite : False supportsWhiteTemperature : False version : None whiteLevel : None whiteLevel2 : None whiteTemperature : None. TP-Link Devices (tplink_relayswitch_plugin.py:getDeviceStateList:85): called for: States : (list) Item : (dict) Disabled : false (bool) Key : rssi (string) StateLabel : rssi (string) TriggerLabel : rssi (string) Type : 100 (integer) Item : (dict) Disabled : false (bool) Key : alias (string) StateLabel : alias (string) TriggerLabel : alias (string) Type : 150 (integer). TP-Link Devices Error Error in plugin execution ExecuteAction:

Traceback (most recent call last): File "plugin.py", line 401, in actionControlDevice KeyError: (u'192.168.0.190',)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jtburgess/indigo-TP-LInk/issues/5#issuecomment-789266789, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHAHALK4J7MC5GYYQAUAXOTTBVRFTANCNFSM4YKNBWCQ.

jamesholcomb commented 3 years ago

Mar 3, 2021 at 9:32:38 AM
   Reloading plugin "TP-Link Devices 0.9.3.9"
   Stopping plugin "TP-Link Devices 0.9.3.9" (pid 20955)
   TP-Link Devices                 (plugin.py:deviceStopComm:292): deviceStopComn entered new device, 192.168.0.190
   TP-Link Devices                 (plugin.py:shutdown:189): shutdown called
   Stopped plugin "TP-Link Devices 0.9.3.9"
   Starting plugin "TP-Link Devices 0.9.3.9" (pid 20958)
   TP-Link Devices                 Log level set to debug
   Started plugin "TP-Link Devices 0.9.3.9"
   TP-Link Devices                 (plugin.py:startup:185): startup called
   TP-Link Devices                 (plugin.py:deviceStartComm:231): called for: new device@192.168.0.190.
   TP-Link Devices                 (plugin.py:getDeviceStateList:450):  called for: 'new device'.
   TP-Link Devices                 (plugin.py:getDeviceStateList:451): called for dev: address : 192.168.0.190
batteryLevel : None
blueLevel : None
brightness : 0
buttonConfiguredCount : 0
buttonGroupCount : 0
configured : True
defaultBrightness : 100
description : 
deviceTypeId : tplinkSmartSwitch
displayStateId : brightnessLevel
displayStateImageSel : DimmerOff
displayStateValRaw : 0
displayStateValUi : 0
enabled : True
energyAccumBaseTime : None
energyAccumTimeDelta : None
energyAccumTotal : None
energyCurLevel : None
errorState : 
folderId : 0
globalProps : MetaProps : (dict)
     com.JohnBurgess.indigoplugin.TP-Link-Device : (dict)
          address : 192.168.0.190 (string)
          addressSelect : 192.168.0.190 (string)
          childId :  (string)
          devPoll : true (bool)
          deviceId : 80066D31000C04C293A02A1507B5430E1B66A551 (string)
          displayManAddress : true (bool)
          displayManAddressButton : false (bool)
          displayOk : true (bool)
          initialize : false (bool)
          mac : 68:FF:7B:78:60:1D (string)
          manualAddressResponse : false (bool)
          model : HS220(US) (string)
          newDev : false (bool)
          offPoll : 10 (string)
          onPoll : 10 (string)
greenLevel : None
id : 560012798
lastChanged : 2021-03-03 09:31:20
lastSuccessfulComm : 2021-03-03 09:31:20
ledStates : []
model : TP-Link Smart Dimmer Switch
name : new device
onBrightensToDefaultToggle : False
onBrightensToLast : False
onState : False
ownerProps : com.JohnBurgess.indigoplugin.TP-Link-Device : (dict)
     address : 192.168.0.190 (string)
     addressSelect : 192.168.0.190 (string)
     childId :  (string)
     devPoll : true (bool)
     deviceId : 80066D31000C04C293A02A1507B5430E1B66A551 (string)
     displayManAddress : true (bool)
     displayManAddressButton : false (bool)
     displayOk : true (bool)
     initialize : false (bool)
     mac : 68:FF:7B:78:60:1D (string)
     manualAddressResponse : false (bool)
     model : HS220(US) (string)
     newDev : false (bool)
     offPoll : 10 (string)
     onPoll : 10 (string)
pluginId : com.JohnBurgess.indigoplugin.TP-Link-Device
pluginProps : com.JohnBurgess.indigoplugin.TP-Link-Device : (dict)
     address : 192.168.0.190 (string)
     addressSelect : 192.168.0.190 (string)
     childId :  (string)
     devPoll : true (bool)
     deviceId : 80066D31000C04C293A02A1507B5430E1B66A551 (string)
     displayManAddress : true (bool)
     displayManAddressButton : false (bool)
     displayOk : true (bool)
     initialize : false (bool)
     mac : 68:FF:7B:78:60:1D (string)
     manualAddressResponse : false (bool)
     model : HS220(US) (string)
     newDev : false (bool)
     offPoll : 10 (string)
     onPoll : 10 (string)
protocol : Plugin
redLevel : None
remoteDisplay : True
states : States : (dict)
     alias :  (string)
     brightnessLevel : 0 (integer)
     doubleClick : 0 (integer)
     fadeOffTime : 0 (integer)
     fadeOnTime : 0 (integer)
     gentleOffTime : 0 (integer)
     gentleOnTime : 0 (integer)
     hardOn : 0 (integer)
     longPress : 0 (integer)
     minThreshold : 0 (integer)
     onOffState : off (on/off bool)
     rampRate : 0 (integer)
     rssi : 0 (integer)
     softOn : 0 (integer)
subModel : 
supportsAllLightsOnOff : False
supportsAllOff : False
supportsColor : False
supportsRGB : False
supportsRGBandWhiteSimultaneously : False
supportsStatusRequest : True
supportsTwoWhiteLevels : False
supportsTwoWhiteLevelsSimultaneously : False
supportsWhite : False
supportsWhiteTemperature : False
version : None
whiteLevel : None
whiteLevel2 : None
whiteTemperature : None.
   TP-Link Devices                 (tplink_relayswitch_plugin.py:getDeviceStateList:85):  called for: States : (list)
     Item : (dict)
          Disabled : false (bool)
          Key : rssi (string)
          StateLabel : rssi (string)
          TriggerLabel : rssi (string)
          Type : 100 (integer)
     Item : (dict)
          Disabled : false (bool)
          Key : alias (string)
          StateLabel : alias (string)
          TriggerLabel : alias (string)
          Type : 150 (integer).
   TP-Link Devices Error           (plugin_base.py:_deviceEnumAndStartComm:1096): exception in deviceStartComm(new device): global name 'description' is not defined

Mar 3, 2021 at 9:35:00 AM
   TP-Link Devices                 (plugin.py:actionControlDevice:334): called with: TurnOn for new device.
   TP-Link Devices                 (plugin.py:getSubProtocol:169): called with tplink_relayswitch addr: 192.168.0.190
   TP-Link Devices                 (protocol.py:debugLog:197): Sent:  {"system":{"set_relay_state":{"state":1}}} == on
   TP-Link Devices                 (plugin.py:actionControlDevice:378): send(on) result: {u'system': {u'set_relay_state': {u'err_code': 0}}}
   TP-Link Devices                 (tplink_relayswitch_plugin.py:actionControlDevice:52): sent "new device" on
   TP-Link Devices                 new device set to on
   TP-Link Devices                 new device brightness set to 0
   TP-Link Devices                 (plugin.py:getDeviceStateList:450):  called for: 'new device'.
   TP-Link Devices                 (plugin.py:getDeviceStateList:451): called for dev: address : 192.168.0.190
batteryLevel : None
blueLevel : None
brightness : 0
buttonConfiguredCount : 0
buttonGroupCount : 0
configured : True
defaultBrightness : 100
description : 
deviceTypeId : tplinkSmartSwitch
displayStateId : brightnessLevel
displayStateImageSel : DimmerOff
displayStateValRaw : 0
displayStateValUi : 0
enabled : True
energyAccumBaseTime : None
energyAccumTimeDelta : None
energyAccumTotal : None
energyCurLevel : None
errorState : 
folderId : 0
globalProps : MetaProps : (dict)
     com.JohnBurgess.indigoplugin.TP-Link-Device : (dict)
          address : 192.168.0.190 (string)
          addressSelect : 192.168.0.190 (string)
          childId :  (string)
          devPoll : true (bool)
          deviceId : 80066D31000C04C293A02A1507B5430E1B66A551 (string)
          displayManAddress : true (bool)
          displayManAddressButton : false (bool)
          displayOk : true (bool)
          initialize : false (bool)
          mac : 68:FF:7B:78:60:1D (string)
          manualAddressResponse : false (bool)
          model : HS220(US) (string)
          newDev : false (bool)
          offPoll : 10 (string)
          onPoll : 10 (string)
greenLevel : None
id : 560012798
lastChanged : 2021-03-03 09:31:20
lastSuccessfulComm : 2021-03-03 09:31:20
ledStates : []
model : TP-Link Smart Dimmer Switch
name : new device
onBrightensToDefaultToggle : False
onBrightensToLast : False
onState : False
ownerProps : com.JohnBurgess.indigoplugin.TP-Link-Device : (dict)
     address : 192.168.0.190 (string)
     addressSelect : 192.168.0.190 (string)
     childId :  (string)
     devPoll : true (bool)
     deviceId : 80066D31000C04C293A02A1507B5430E1B66A551 (string)
     displayManAddress : true (bool)
     displayManAddressButton : false (bool)
     displayOk : true (bool)
     initialize : false (bool)
     mac : 68:FF:7B:78:60:1D (string)
     manualAddressResponse : false (bool)
     model : HS220(US) (string)
     newDev : false (bool)
     offPoll : 10 (string)
     onPoll : 10 (string)
pluginId : com.JohnBurgess.indigoplugin.TP-Link-Device
pluginProps : com.JohnBurgess.indigoplugin.TP-Link-Device : (dict)
     address : 192.168.0.190 (string)
     addressSelect : 192.168.0.190 (string)
     childId :  (string)
     devPoll : true (bool)
     deviceId : 80066D31000C04C293A02A1507B5430E1B66A551 (string)
     displayManAddress : true (bool)
     displayManAddressButton : false (bool)
     displayOk : true (bool)
     initialize : false (bool)
     mac : 68:FF:7B:78:60:1D (string)
     manualAddressResponse : false (bool)
     model : HS220(US) (string)
     newDev : false (bool)
     offPoll : 10 (string)
     onPoll : 10 (string)
protocol : Plugin
redLevel : None
remoteDisplay : True
states : States : (dict)
     alias :  (string)
     brightnessLevel : 0 (integer)
     doubleClick : 0 (integer)
     fadeOffTime : 0 (integer)
     fadeOnTime : 0 (integer)
     gentleOffTime : 0 (integer)
     gentleOnTime : 0 (integer)
     hardOn : 0 (integer)
     longPress : 0 (integer)
     minThreshold : 0 (integer)
     onOffState : on (on/off bool)
     rampRate : 0 (integer)
     rssi : 0 (integer)
     softOn : 0 (integer)
subModel : 
supportsAllLightsOnOff : False
supportsAllOff : False
supportsColor : False
supportsRGB : False
supportsRGBandWhiteSimultaneously : False
supportsStatusRequest : True
supportsTwoWhiteLevels : False
supportsTwoWhiteLevelsSimultaneously : False
supportsWhite : False
supportsWhiteTemperature : False
version : None
whiteLevel : None
whiteLevel2 : None
whiteTemperature : None.
   TP-Link Devices                 (tplink_relayswitch_plugin.py:getDeviceStateList:85):  called for: States : (list)
     Item : (dict)
          Disabled : false (bool)
          Key : rssi (string)
          StateLabel : rssi (string)
          TriggerLabel : rssi (string)
          Type : 100 (integer)
     Item : (dict)
          Disabled : false (bool)
          Key : alias (string)
          StateLabel : alias (string)
          TriggerLabel : alias (string)
          Type : 150 (integer).
   TP-Link Devices Error           Error in plugin execution ExecuteAction:

Traceback (most recent call last):
  File "plugin.py", line 401, in actionControlDevice
KeyError: (u'192.168.0.190',)
jtburgess commented 3 years ago

James: I really appreciate your helping to test this! As I think I mentioned, I don’t have a device of the SmartSwitch type to test with, although I’m going to order one from Amazon

Anyway, version 0.9.3.19 is now available to download and test. I’m pretty sure I fixed your problems and have made the new device creation more error proof.

-- John

On Mar 3, 2021, at 10:36 AM, James Holcomb notifications@github.com wrote:

TP-Link Devices Error Error in plugin execution ExecuteAction:

Traceback (most recent call last): File "plugin.py", line 401, in actionControlDevice KeyError: (u'192.168.0.190',)

jamesholcomb commented 3 years ago

Of course! Thanks for sticking with it. 0.9.3.19 fixed it...no errors, status reporting works with on/off/dimming 🎉

jtburgess commented 3 years ago

Whoo Hoo! I’ll package and deliver 0.9.4 to Indigo

Thanks again! -- John

On Mar 4, 2021, at 5:19 PM, James Holcomb notifications@github.com wrote:

Of course! Thanks for sticking with it. 0.9.3.19 fixed it...no errors, status reporting works with on/off/dimming 🎉

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jtburgess/indigo-TP-LInk/issues/5#issuecomment-790985016, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHAHALN6Z55V7UGPSZHSVITTCABOLANCNFSM4YKNBWCQ.