HassBridge plugin updated for Python3

Posted on
Sun Jul 16, 2023 4:23 pm
FlyingDiver offline
User avatar
Posts: 7222
Joined: Jun 07, 2014
Location: Southwest Florida, USA

HassBridge plugin updated for Python3

This one SEEMS to work, but I've been unable to test it very much.

https://github.com/FlyingDiver/hassbrid ... g/2022.0.0

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

Posted on
Sun Jul 16, 2023 4:36 pm
Colly offline
Posts: 535
Joined: Jan 16, 2016
Location: Ireland

Re: HassBridge plugin updated for Python3

Hi Joe,
I can't seem to create an issue on GitHub (probably my unfamiliarity). See error below until I figure out GitHub.
Code: Select all
  HassBridge Error                Error in plugin execution InitializeMain:

  File "plugin.py", line 30, in <module>
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/imp.py", line 172, in load_source
  File "<frozen importlib._bootstrap>", line 719, in _load
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/Library/Application Support/Perceptive Automation/Indigo 2022.2/Plugins/HassBridge.indigoPlugin/Contents/Server Plugin/__init__.py", line 31, in <module>
  File "/Library/Application Support/Perceptive Automation/Indigo 2022.2/Plugins/HassBridge.indigoPlugin/Contents/Server Plugin/libs/yaml/__init__.py", line 2, in <module>
type: No module named 'error'

Posted on
Sun Jul 16, 2023 4:37 pm
FlyingDiver offline
User avatar
Posts: 7222
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: HassBridge plugin updated for Python3

Darn it, I thought I fixed that. Hmmm.

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

Posted on
Sun Jul 16, 2023 4:48 pm
FlyingDiver offline
User avatar
Posts: 7222
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: HassBridge plugin updated for Python3


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

Posted on
Sun Jul 16, 2023 4:54 pm
Colly offline
Posts: 535
Joined: Jan 16, 2016
Location: Ireland

Re: HassBridge plugin updated for Python3

Up and running now, will get back to it tomorrow to have a proper play about.

Posted on
Mon Jul 17, 2023 5:42 am
farberm offline
Posts: 393
Joined: Feb 24, 2008

Re: HassBridge plugin updated for Python3

Thanks again for your help with getting this update. I am getting the following error.


HassBridge Error Error in plugin execution InitializeMain:

File "<string>", line 1, in <module>
File "plugin.py", line 92, in __init__
File "/Library/Application Support/Perceptive Automation/Indigo 2022.2/Plugins/HassBridge.indigoPlugin/Contents/Server Plugin/__init__.py", line 92, in __init__
File "/Library/Application Support/Perceptive Automation/Indigo 2022.2/Plugins/HassBridge.indigoPlugin/Contents/Server Plugin/__init__.py", line 109, in __read_customization_file
File "/Library/Application Support/Perceptive Automation/Indigo 2022.2/Plugins/HassBridge.indigoPlugin/Contents/Server Plugin/__init__.py", line 114, in __handle_exception
type: name 'unicode' is not defined

Posted on
Mon Jul 17, 2023 6:03 am
FlyingDiver offline
User avatar
Posts: 7222
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: HassBridge plugin updated for Python3

https://github.com/FlyingDiver/hassbrid ... g/2022.0.1

You'll have to move this into the plugins folder directly, I messed up the version numbers.

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

Posted on
Mon Jul 17, 2023 6:54 am
farberm offline
Posts: 393
Joined: Feb 24, 2008

Re: HassBridge plugin updated for Python3

Did the manual install and now I get this error..making progress I think.
Reloading plugin "HassBridge 2022.0.1" using API v3.0.0
Starting plugin "HassBridge 2022.0.1" (pid 43529)
HassBridge Error Exception trapped:name 'file' is not defined
HassBridge Error Error in plugin execution InitializeMain:

File "<string>", line 1, in <module>
File "plugin.py", line 92, in __init__
File "/Library/Application Support/Perceptive Automation/Indigo 2022.2/Plugins/HassBridge.indigoPlugin/Contents/Server Plugin/__init__.py", line 92, in __init__
File "/Library/Application Support/Perceptive Automation/Indigo 2022.2/Plugins/HassBridge.indigoPlugin/Contents/Server Plugin/__init__.py", line 99, in __read_customization_file
type: name 'file' is not defined

Posted on
Mon Jul 17, 2023 10:17 am
FlyingDiver offline
User avatar
Posts: 7222
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: HassBridge plugin updated for Python3

At the bottom of the plugin config dialog, do you have "Use a customization file" checked? And if so, what's in that file?

Try unchecking it and see if it runs.

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

Posted on
Mon Jul 17, 2023 10:53 am
farberm offline
Posts: 393
Joined: Feb 24, 2008

Re: HassBridge plugin updated for Python3

Thats it.

Found the issue... typo in the configuration file location

Yes it was checked.. the file name should be...... /Library/Application\ Support/Perceptive\ Automation/Indigo\ 2022.1/Preferences/Plugins/hassbridge/hassbridge.yaml

Posted on
Mon Jul 17, 2023 10:54 am
FlyingDiver offline
User avatar
Posts: 7222
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: HassBridge plugin updated for Python3

That file is not included by default. What's in it?

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

Posted on
Mon Jul 17, 2023 11:03 am
farberm offline
Posts: 393
Joined: Feb 24, 2008

Re: HassBridge plugin updated for Python3

The only thing that I need to mention is that the configuration menu option does not show up if the plugin is stopped. I had to load the old plugin... uncheck the customization file and then relaod the new plug-in. My guess this is just a programming issue that can be corrected so that is someone types in the wrong file location in the next version of the plugin, then they do not have to install the old version to correct the error I made.. I included an image of the configuration menu item not appearing.
Attachments
Screenshot 2023-07-17 at 1.01.54 PM.png
Screenshot 2023-07-17 at 1.01.54 PM.png (71.48 KiB) Viewed 1385 times

Posted on
Mon Jul 17, 2023 11:04 am
FlyingDiver offline
User avatar
Posts: 7222
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: HassBridge plugin updated for Python3

I still want to know what's in that file.

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

Posted on
Mon Jul 17, 2023 11:14 am
farberm offline
Posts: 393
Joined: Feb 24, 2008

Re: HassBridge plugin updated for Python3

Here is a copy of what in the file.... I need to relook at the old plugin thread. There was a discussion that you were actually involved with several years ago about an error that this custom file help resolve. Give me a bit to dig that up...

hassbridge.yaml file contents

Code: Select all
devices:
  Couch Lamp:
    config_vars:
      device_class: light

variables:
  Caddx_panelStatus:
    name: Caddx Panel Status
    bridge_type: VariableBinarySensor
    on_value: Open
    config_vars:
      device_class: door

  daily_pool_water_fill:
    name: Pool Water Fill
    bridge_type: VariableSensor
    config_vars:
      device_class: sensor

Posted on
Mon Jul 17, 2023 11:19 am
FlyingDiver offline
User avatar
Posts: 7222
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: HassBridge plugin updated for Python3


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

Who is online

Users browsing this forum: No registered users and 5 guests