NameNotUniqueError

Posted on
Sat Nov 09, 2019 5:53 pm
Peel offline
Posts: 12
Joined: Apr 14, 2015

NameNotUniqueError

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 210 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 210 times


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

Posted on
Sun Nov 10, 2019 3:16 pm
howartp online
Posts: 3801
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: NameNotUniqueError

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

Posted on
Sun Nov 10, 2019 4:56 pm
Peel offline
Posts: 12
Joined: Apr 14, 2015

Re: NameNotUniqueError

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 172 times

Posted on
Tue Nov 26, 2019 9:21 am
rapamatic offline
Posts: 258
Joined: Aug 03, 2015
Location: Glencoe, IL

Re: NameNotUniqueError

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

Posted on
Tue Nov 26, 2019 9:33 am
rapamatic offline
Posts: 258
Joined: Aug 03, 2015
Location: Glencoe, IL

Re: NameNotUniqueError

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 :)

Posted on
Tue Nov 26, 2019 4:49 pm
howartp online
Posts: 3801
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: NameNotUniqueError

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

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest