Page 1 of 1

NameNotUniqueError

PostPosted: Sat Nov 09, 2019 5:53 pm
by Peel
I ended up deleting the sense plugin and all of it's devices, including the plugin, preference file, and log from the Indigo folder within Library, and stopped/restarted the server before reinstalling..
Once I reinstalled, I'm getting the same error that @norcoscia got when he merged two devices: NameNotUniqueError. It's showing up for each device that was created. Further, each device that it does create does not show an on/off icon for, nor any power reading, even on devices that are current on and showing a draw within the sense app itself.
Looking at the plugin.log it looks like after creating all of the devices, it tries to create then a second, and third... time.

Screen Shot 2019-11-09 at 15.07.23.png
Screen Shot 2019-11-09 at 15.07.23.png (137.58 KiB) Viewed 3719 times


My Indigo log then gets filled with the same error over and over again every 90 seconds as per my specified polling rate.
Screen Shot 2019-11-09 at 15.37.48.png
Screen Shot 2019-11-09 at 15.37.48.png (98.23 KiB) Viewed 3719 times


I've attached the plugin.log from within the com.howartp.sense folder.
plugin.log
(12.29 KiB) Downloaded 149 times

Re: NameNotUniqueError

PostPosted: Sun Nov 10, 2019 3:16 pm
by howartp
I've just pushed v1.0.5 as a first step towards this.

It's fixed the error I had on my copy of Indigo (which was using Nacrosia's login deails) - I purposely didn't fix my copy manually as I wanted to code a fix for it.

However now it's fixed, I can't see the error any more so please let me know if you still get it - and provide the logs with debugging turned on.

Peter

Re: NameNotUniqueError

PostPosted: Sun Nov 10, 2019 4:56 pm
by Peel
Yes! The devices all now show individual power icons and the power draw for each, and more importantly, no more error messages.

Screen Shot 2019-11-10 at 14.54.37.png
Screen Shot 2019-11-10 at 14.54.37.png (146.18 KiB) Viewed 3681 times

Re: NameNotUniqueError

PostPosted: Tue Nov 26, 2019 9:21 am
by rapamatic
I am getting this error now, here's the debug log details... I have merged some devices in the sense app (I don't remember any specifics since I did this a while ago).

Any ideas?

Code: Select all
Nov 26, 2019 at 9:16:57 AM
   Sense Debug                     IDs: [u'51860e1c', u'd708ca01', u'core', u'always_on', u'241e147f', u'03847b73', u'6ae38f7e', u'a4052429', u'd17aaac1', u'8e6cc103', u'2004270d', u'kmyOfcBb', u'efd2af83', u'W7P45wlF', u'c6ddcf65', u'ef1139d9', u'6915a118', u'b7d20f08', u'3f60cbee', u'7ca48bfe', u'd6a8cc68', u'unknown', u'49e4d4ef', u'5b78d121', u'4d3aa99e', u'c34a1638', u'4ae068ca']
   Sense Debug                     Active: 4176.89941406w
   Sense Debug                     Daily: 24.41173kw
   Sense Debug                     CSV Output: 2019-11-26 09:16:57.487301,4176
   Sense Debug                     CREATED: Master AC
   Sense Debug                     {u'icon': u'ac', u'id': u'8995a507', u'tags': {u'DefaultMake': None, u'PeerNames': [{u'UserDeviceTypeDisplayString': u'AC', u'Icon': u'ac', u'Percent': 83.0, u'Name': u'AC', u'UserDeviceType': u'AC'}, {u'UserDeviceTypeDisplayString': u'Dryer', u'Icon': u'washer', u'Percent': 4.0, u'Name': u'Dryer', u'UserDeviceType': u'Dryer'}, {u'UserDeviceTypeDisplayString': u'Pool Pump', u'Icon': u'pump', u'Percent': 4.0, u'Name': u'Pool pump', u'UserDeviceType': u'PoolPump'}, {u'UserDeviceTypeDisplayString': u'Power Tool', u'Icon': u'drill', u'Percent': 4.0, u'Name': u'Saw', u'UserDeviceType': u'PowerTool'}, {u'UserDeviceTypeDisplayString': u'Pump', u'Icon': u'pump', u'Percent': 1.0, u'Name': u'Sewage pump', u'UserDeviceType': u'Pump'}, {u'UserDeviceTypeDisplayString': u'Pump', u'Icon': u'pump', u'Percent': 1.0, u'Name': u'Pump', u'UserDeviceType': u'Pump'}], u'OriginalName': u'AC 4', u'DefaultUserDeviceType': u'AC', u'DefaultModel': None, u'DateCreated': u'2019-04-23T11:04:15.026Z', u'Type': u'CentralAC', u'UserDeletable': u'true', u'Pending': u'false', u'DeployToMonitor': u'true', u'UserEditableMeta': u'true', u'user_editable': u'true', u'DefaultLocation': None, u'AlwaysOn': u'false', u'Revoked': u'false', u'TimelineDefault': u'false', u'Mature': u'true', u'UserDeviceTypeDisplayString': u'AC', u'DateFirstUsage': u'2019-04-09', u'ModelCreatedVersion': u'46', u'Alertable': u'true', u'UserMergeable': u'true', u'ModelUpdatedVersion': u'85', u'name_useredit': u'true', u'UserEditable': u'true', u'TimelineAllowed': u'true', u'DeviceListAllowed': u'true'}, u'name': u'Master AC'}
   Sense Error                     NameNotUniqueError

Re: NameNotUniqueError

PostPosted: Tue Nov 26, 2019 9:33 am
by rapamatic
Ok, issue here was I had two devices with the same name in Sense. I renamed one of the devices and all is well now... checking for this type of situation and handling more gracefully is probably something to add to the long term wish list :)

Re: NameNotUniqueError

PostPosted: Tue Nov 26, 2019 4:49 pm
by howartp
rapamatic wrote:
Checking for this type of situation and handling more gracefully is probably something to add to the long term wish list :)

True, and there's already code towards that in the plugin.

Unfortunately Sense doesn't fully use unique constant IDs, and simultaneously allows duplicate names as you've discovered, so I have to refer to the device name in some areas of the code.

I've added another line in my copy, but won't publish it until I get more time to test it.

(If you want to play with your version and test, grab 1.0.6 then add the following at line 201:

Code: Select all
               except NameNotUniqueError as e:
                  self.errorLog("Duplicate device found - please ensure Sense devices are all uniquely named")

Peter

Re: NameNotUniqueError

PostPosted: Sun Nov 29, 2020 5:48 am
by DU Lou
Sense just "discovered" my modest Hue setup and now I get the error but I am not sure what is NOT unique:

Code: Select all
Nov 29, 2020 at 6:41:48 AM
   Sense Home Energy               Debug logging enabled
   Sense Home Energy Debug         Rate limit is: 60

Nov 29, 2020 at 6:42:15 AM
   Sense Home Energy Debug         IDs: [u'core', u'always_on', u'ssi-cf2831c2', u'gtBTVVOa', u'unknown']
   Sense Home Energy Debug         Active: 729.884033203w
   Sense Home Energy Debug         Daily: 5.826634kw
   Sense Home Energy Debug         CSV Output: 2020-11-29 06:42:16.104269,729
   Sense Home Energy Debug         CREATED: Wall Washer
   Sense Home Energy Debug         {u'name': u'Wall Washer', u'tags': {u'UserEditableMeta': u'false', u'UserMergeable': u'false', u'ControlCapabilities': [u'OnOff', u'Brightness'], u'DUID': u'00:17:88:22:77:2e/00:17:88:01:00:c3:d4:6f-0b', u'UserDeviceTypeDisplayString': u'Light', u'SSIModel': u'SelfReporting', u'DateCreated': u'2020-11-29T04:26:30.000Z', u'SSIEnabled': u'true', u'TimelineAllowed': u'true', u'Revoked': u'false', u'TimelineDefault': u'true', u'name_useredit': u'false', u'UserEditable': u'true', u'DefaultMake': u'Signify Netherlands B.V.', u'IntegrationType': u'Hue', u'OriginalName': u'Wall Washer', u'DefaultUserDeviceType': u'Light', u'DefaultModel': u'LLC012', u'DeviceListAllowed': u'true', u'UserDeletable': u'false', u'Alertable': u'true'}, u'make': u'Signify Netherlands B.V.', u'model': u'LLC012', u'id': u'ssi-3adec713', u'icon': u'lightbulb'}
   Sense Home Energy Error         NameNotUniqueError
   Sense Home Energy Debug         CREATED: Entertainment Light
   Sense Home Energy Debug         {u'name': u'Entertainment Light', u'tags': {u'UserEditableMeta': u'false', u'UserMergeable': u'false', u'ControlCapabilities': [u'OnOff', u'Brightness'], u'DUID': u'00:17:88:22:77:2e/00:17:88:01:04:99:87:0c-0b', u'UserDeviceTypeDisplayString': u'Light', u'SSIModel': u'SelfReporting', u'DateCreated': u'2020-11-29T04:26:30.000Z', u'SSIEnabled': u'true', u'TimelineAllowed': u'true', u'Revoked': u'false', u'TimelineDefault': u'true', u'name_useredit': u'false', u'UserEditable': u'true', u'DefaultMake': u'Signify Netherlands B.V.', u'IntegrationType': u'Hue', u'OriginalName': u'Entertainment Light', u'DefaultUserDeviceType': u'Light', u'DefaultModel': u'LST002', u'DeviceListAllowed': u'true', u'UserDeletable': u'false', u'Alertable': u'true'}, u'make': u'Signify Netherlands B.V.', u'model': u'LST002', u'id': u'ssi-fcab416a', u'icon': u'lightbulb'}
   Sense Home Energy Error         NameNotUniqueError

Re: NameNotUniqueError

PostPosted: Mon Feb 01, 2021 1:41 pm
by norcoscia
Hi, I'm still getting lots of name not unique errors which sorta fill up my log. I tried to suppress them with the suggestion you gave to user rapamatic above but it does not seem to help. Can you tell me how to keep the error from showing up? Error from event log below...

Feb 1, 2021 at 11:33:00 AM
Schedule Update clock
Enabling plugin "Sense Home Energy 1.0.6"
Starting plugin "Sense Home Energy 1.0.6" (pid 42627)
Started plugin "Sense Home Energy 1.0.6"
Sense Home Energy Error NameNotUniqueError
Sense Home Energy Error NameNotUniqueError
Sense Home Energy Error NameNotUniqueError
Sense Home Energy Error NameNotUniqueError


The block of code after I modified it is below (mod in blue) - please help

Re: NameNotUniqueError

PostPosted: Mon Feb 01, 2021 3:22 pm
by howartp
Hi Norm.

As a very quick test, what happens if you change to:

Code: Select all
except ValueError as e:
   pass
   #self.errorLog(e)
except NameNotUniqueError as e:
   pass
   #self.errorLog("Duplicate device found - please ensure Sense devices are all uniquely named")

(Fix your indents so it matches what's there.)

Peter

Re: NameNotUniqueError

PostPosted: Mon Feb 01, 2021 3:26 pm
by norcoscia
No change, same errors :-(

Re: NameNotUniqueError

PostPosted: Mon Feb 01, 2021 4:34 pm
by howartp
Hi Norm

https://github.com/howartp84/Sense/releases/tag/1.0.7

Sense have finally added a "UserDeleted" parameter to their devices, so I can tell if they've been deleted.

Any device that no longer exists in your online portal will now DISABLE itself, for you to manually delete.

I daren't delete it in case it destroys any control pages etc, but if you want to swap the comments on lines 180 and 181 it will delete them instead.

Peter

Re: NameNotUniqueError

PostPosted: Mon Feb 01, 2021 4:37 pm
by howartp
(I've pushed it to the Plugin Store so Indigo should prompt updates at some point)

Re: NameNotUniqueError

PostPosted: Mon Feb 01, 2021 5:18 pm
by norcoscia
Awesome - that fixed it - thanks so much Peter !!!!!!!!