Error trying to attach first Shelly device to Indigo

Posted on
Tue Jun 06, 2023 8:35 am
stanleykrasnow offline
Posts: 28
Joined: Dec 10, 2018

Error trying to attach first Shelly device to Indigo

I am working to create alternatives to the Insteon devices in my home and am trying to on-board my first Shelly device into Indigo. I have a Shelly DUO US bulb to start with. I can access the bulb on my home LAN using the Chrome browser on Mac OS (10.15.07 Catalina). I am using Indigo 2022.2 and version 7.20.48 of the Shelly plugin.

I get the following error message every minute in the Indigo log:

Jun 6, 2023 at 10:16:00 AM
shellyDirect Error
Traceback (most recent call last):
File "plugin.py", line 2405, in checkForExpiredDevices
if time.time() - self.SHELLY[devId]["lastMessageFromDevice"] > self.SHELLY[devId]["expirationSeconds"]:
TypeError: '>' not supported between instances of 'float' and 'str'

Attached are some JPEGs showing the setup of the plugin. Can someone please help me figure out if I've made an error in my setup? Thank you.
Attachments
1 DCQ Shelly Setup IV.jpg
1 DCQ Shelly Setup IV.jpg (161.13 KiB) Viewed 1160 times
1 DCQ Shelly Setup III.jpg
1 DCQ Shelly Setup III.jpg (124.72 KiB) Viewed 1160 times
1 DCQ Shelly Setup II.jpg
1 DCQ Shelly Setup II.jpg (186.57 KiB) Viewed 1160 times
1 DCQ Shelly Setup.jpg
1 DCQ Shelly Setup.jpg (108.73 KiB) Viewed 1160 times
1 DCQ Shelly Setup.jpg
1 DCQ Shelly Setup.jpg (108.73 KiB) Viewed 1160 times

Posted on
Tue Jun 06, 2023 3:13 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Error trying to attach first Shelly device to Indigo

I will check tomorrow
Karl


Sent from my iPhone using Tapatalk

Posted on
Wed Jun 07, 2023 1:42 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Error trying to attach first Shelly device to Indigo

v 7.20.49 should fix this.

Karl

Posted on
Wed Jun 07, 2023 6:04 pm
stanleykrasnow offline
Posts: 28
Joined: Dec 10, 2018

Error trying to attach first Shelly device to Indigo

Thank you Karl. When I updated the version of the plugin I was able to use the drop down menu to create the Shelly bulb in Indigo. However, when I attempted to turn the bulb on using the Indigo overview page, there was a programming error. I am using v 7.20.49 of the plugin. The details are:

* * * * Creating Shelly Instance in Indigo * * * *
Jun 7, 2023 at 7:46:56 PM
shellyDirect resetting config push initShelly for devid: 342032265

* * * * Indigo Log when attempting to turn on bulb * * * *
Jun 7, 2023 at 7:47:43 PM
shellyDirect Error
Traceback (most recent call last):
File "plugin.py", line 5045, in actionControlDimmerRelay
page += "{}={}&".format(IndigoStateMapToShellyDev[colorAction], int(min(rgbLimits[1],max(rgbLimits[0],actionValues[colorAction]*255/100.))))
TypeError: unsupported operand type(s) for /: 'str' and 'float'

* * * * Output when asking plugin to print Shelly device characteristics * * * *
Jun 7, 2023 at 7:49:54 PM
shellyDirect keys: ['AllowOnStateChange', 'MAC', 'SupportsColor', 'SupportsOnState', 'SupportsRGB', 'SupportsRGBandWhiteSimultaneously', 'SupportsSensorValue', 'SupportsStatusRequest', 'SupportsTwoWhiteLevels', 'SupportsTwoWhiteLevelsSimultaneously', 'SupportsWhite', 'SupportsWhiteTemperature', 'address', 'automaticPollingFrequency', 'children', 'defaultTask', 'devNo', 'devTypeId', 'deviceEnabled', 'expirationSeconds', 'getStatusDelay', 'ipNumber', 'isChild', 'isParent', 'isRelay', 'isShellyDevice', 'lastActive', 'lastAlarm', 'lastCheck', 'lastMessage-Http', 'lastMessage-settings', 'lastMessage-status', 'lastMessageFromDevice', 'lastRequestedPush', 'lastSuccessfullConfigPush', 'now', 'parentIndigoId', 'pollingFrequency', 'push', 'pushIdActive', 'pushstate', 'pushthread', 'queue', 'reset', 'state', 'tempUnits', 'thread', 'threadNumber', 'usesInputForOnOff']


shellyDirect Error Error in plugin execution UiAction:

File "plugin.py", line 1585, in buttonPrintShellyDevInfoCALLBACK
type: 'dict' object has no attribute 'replace'

Thank you for your continued support!

Posted on
Thu Jun 08, 2023 12:04 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Error trying to attach first Shelly device to Indigo

Sorry I am out of town until Sunday. Will at it then.


Sent from my iPhone using Tapatalk

Posted on
Sun Jun 11, 2023 1:51 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Error trying to attach first Shelly device to Indigo

version .50 should fix that, and thanks for your patience.

Karl

Posted on
Mon Jun 12, 2023 7:52 am
stanleykrasnow offline
Posts: 28
Joined: Dec 10, 2018

Re: Error trying to attach first Shelly device to Indigo

Karl - thank you for sticking with me. There is both favorable and unfavorable news:

Unfavorable -
When I attempt the Smelly bulb to turn on or off I get the following exception:
Jun 12, 2023 at 9:36
shellyDirect Error
Traceback (most recent call last):
File "plugin.py", line 5045, in actionControlDimmerRelay
page += "{}={}&".format(IndigoStateMapToShellyDev[colorAction], int(min(rgbLimits[1],max(rgbLimits[0],actionValues[colorAction]*255/100.))))
TypeError: unsupported operand type(s) for /: 'str' and 'float'

Favorable:
I can instantiate the shelly device in Indigo using the plugin drop down menu. When I use the device's color slide to adjust the whiteness the bulb turns on. If I try to turn the bulb off I get the above message in the Indigo log.

Also, I built an Indigo virtual device in Indigo over the weekend and it can turn the bulb on and off. Also, when the bulb is physically on the plugin's instantiation shows as on. So the foundation is there and seems to be working.

Posted on
Mon Jun 12, 2023 9:32 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Error trying to attach first Shelly device to Indigo

This was all working. The conversion py2 to py3 messed some things up.

I guess py2 was more forgiving than py3

.. fixed in release .52


Karl

And I am now mostly using Philips hue for lights and homematic-ip for valves, radiators and in floor heating


Sent from my iPhone using Tapatalk

Posted on
Tue Jun 13, 2023 9:11 am
stanleykrasnow offline
Posts: 28
Joined: Dec 10, 2018

Re: Error trying to attach first Shelly device to Indigo

Karl - I ran with the latest version of the plug in but still got an error:

Jun 12, 2023 at 10:46:33 PM
shellyDirect Error
Traceback (most recent call last):
File "plugin.py", line 5045, in actionControlDimmerRelay
page += "{}={}&".format(IndigoStateMapToShellyDev[colorAction], int(min(int(rgbLimits[1]),max(int(rgbLimits[0]),int(actionValues[colorAction])*255/100.))))
ValueError: invalid literal for int() with base 10: 'on'

I tried to diagnose the issue and discovered that the variable actionValues[colorAction] contained a string with the value "on". I changed the plug in to add the lines:

if isinstance(actionValues[colorAction], str):
actionValues[colorAction] = 1

and the plug in worked. Of course this is not a solution, but it is a work-around (I just guessed at the value 1).

Thank you for sticking with me on this issue.

Posted on
Tue Jun 13, 2023 10:04 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Error trying to attach first Shelly device to Indigo

please try v .53

Posted on
Tue Jun 13, 2023 2:54 pm
stanleykrasnow offline
Posts: 28
Joined: Dec 10, 2018

Re: Error trying to attach first Shelly device to Indigo

Karl - I tried the new version and it was able to turn on the Shelly bulb without anything in the log. The new version could not turn off the bulb - no log message. Then I tried to delete the existing bulb instantiation on indigo and add it back in. I went through the drop-down menu process, got the "added IP#:192.168.86.037 to shelly discovery process" message, but the device was not instantiated in Indigo. There was nothing in the log from trying to add the device to Indigo.

Posted on
Tue Jun 13, 2023 2:59 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Error trying to attach first Shelly device to Indigo

lets try some logging.

please switch on login in config for :

(1) setup device
(6) actions


the try to setup new device

could you email me the output?
karl wachs at me com

Karl

ps turn of is a bug,

I can add a shelly duo w/o problems and set all prorameters. setting brightness to 0 works turn off does not. that should be an easy fix.

the log is in plugin.log in/Library/Application Support/Perceptive Automation/Indigo 2022.2/Logs/com.karlwachs.shellyDirect/plugin.log

Posted on
Tue Jun 13, 2023 3:32 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Error trying to attach first Shelly device to Indigo

v .54 should fix the turn off issue (bug was introduced in .52/53

the discovery works fine on my side.

i need to logging info to check what is wrong

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest