Late to the party: Need help converting plugin to PY3

Posted on
Mon Oct 23, 2023 7:31 am
BillC offline
Posts: 237
Joined: Mar 09, 2008

Re: Late to the party: Need help converting plugin to PY3

DaveL17 wrote:
Just to be sure that everyone is on the same page:

1. Indigo General Settings --> General Settings... --> Plugins --> Enable debugging menus {is checked]
2. Plugins --> NOAA Weather --> Reload in Interactive Shell

The option in number 2 is not present? That's really weird.

Screenshot 2023-10-23 at 4.12.14 AM-2.png


Yes, Enable debugging menus is checked.

The option is available in some plugins but not all, as stated above.

Am trying your Ghost XML plugin. Looks promising. Still curious about the above issues, though.

Posted on
Mon Oct 23, 2023 8:16 am
jay (support) offline
Site Admin
User avatar
Posts: 18224
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Late to the party: Need help converting plugin to PY3

You can't debug the built-in plugins that are included with Indigo.

I would highly recommend going with the GhostXML plugin rather than hacking the NOAA plugin.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Oct 23, 2023 12:30 pm
BillC offline
Posts: 237
Joined: Mar 09, 2008

Re: Late to the party: Need help converting plugin to PY3

jay (support) wrote:
You can't debug the built-in plugins that are included with Indigo.

I would highly recommend going with the GhostXML plugin rather than hacking the NOAA plugin.


Hi Jay and thanks for chiming in.

I'm not trying to hack the current NOAA plugin. Quite a while ago, with your help, I used the then-current NOAA plugin as a model for an HVAC monitor (detailed in first post this thread). It's worked flawlessly until the need to move to PY3. All I'm trying to do is get my old plugin to work in Indigo 2023.x.x.

GhostXML works to a point. My plugin (code in 1st post) does two things that I don't see how to do in GhostXML:
- Exposes my device state names for use in control pages (rather than Device_nn)
- Performs rounding of number values and expressing binary state values as 1 or 0

I'd really like to get my old plugin running again and would appreciate any assistance.

Posted on
Mon Oct 23, 2023 12:37 pm
FlyingDiver offline
User avatar
Posts: 7222
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Late to the party: Need help converting plugin to PY3

BillC wrote:
I'd really like to get my old plugin running again and would appreciate any assistance.


Can you send me a copy of your plugin?

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Mon Oct 23, 2023 12:42 pm
BillC offline
Posts: 237
Joined: Mar 09, 2008

Re: Late to the party: Need help converting plugin to PY3

Email address? (PM if you'd rather not post)

Posted on
Mon Oct 23, 2023 2:47 pm
FlyingDiver offline
User avatar
Posts: 7222
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Late to the party: Need help converting plugin to PY3

Based on that code, I'd just rip the update() function out and make it a script that does the query and saves the data in a series of Indigo variables. The rest of the plugin structure is wasted overhead for your use case.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Mon Oct 23, 2023 3:00 pm
BillC offline
Posts: 237
Joined: Mar 09, 2008

Re: Late to the party: Need help converting plugin to PY3

FlyingDiver wrote:
Based on that code, I'd just rip the update() function out and make it a script that does the query and saves the data in a series of Indigo variables. The rest of the plugin structure is wasted overhead for your use case.


I guess that's an approach, but (1) not sure I could code that (I'm not really competent in PY) and (2) i'd really like to understand why the PY3 version won't do the updates while the PY2 version works fine in Indigo 2022.x.x.

Posted on
Mon Oct 23, 2023 3:03 pm
FlyingDiver offline
User avatar
Posts: 7222
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Late to the party: Need help converting plugin to PY3

Quite possibly because the urllib calls are obsolete in Python3. But that's just a guess. I'm also not 100% sure you're running the right version of the plugin. Renaming is not a good way to do version control.

The other thing you could do is use GhostXML and do your formatting/naming/conversion into Indigo variables from the device states.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Mon Oct 23, 2023 5:58 pm
BillC offline
Posts: 237
Joined: Mar 09, 2008

Re: Late to the party: Need help converting plugin to PY3

FlyingDiver wrote:
The other thing you could do is use GhostXML and do your formatting/naming/conversion into Indigo variables from the device states.


Decided to go this route and have it working now. Thanks for the suggestion and your time, I really appreciate it.

Who is online

Users browsing this forum: No registered users and 4 guests

cron