HassBridge plugin updated for Python3

User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

HassBridge plugin updated for Python3

Post by FlyingDiver »

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
Colly
Posts: 550
Joined: Sat Jan 16, 2016 10:19 am
Location: Ireland

Re: HassBridge plugin updated for Python3

Post by Colly »

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'
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: HassBridge plugin updated for Python3

Post by FlyingDiver »

Darn it, I thought I fixed that. Hmmm.
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: HassBridge plugin updated for Python3

Post by FlyingDiver »

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
Colly
Posts: 550
Joined: Sat Jan 16, 2016 10:19 am
Location: Ireland

Re: HassBridge plugin updated for Python3

Post by Colly »

Up and running now, will get back to it tomorrow to have a proper play about.
farberm
Posts: 393
Joined: Sun Feb 24, 2008 2:14 pm

Re: HassBridge plugin updated for Python3

Post by farberm »

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
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: HassBridge plugin updated for Python3

Post by FlyingDiver »

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
farberm
Posts: 393
Joined: Sun Feb 24, 2008 2:14 pm

Re: HassBridge plugin updated for Python3

Post by farberm »

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
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: HassBridge plugin updated for Python3

Post by FlyingDiver »

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
farberm
Posts: 393
Joined: Sun Feb 24, 2008 2:14 pm

Re: HassBridge plugin updated for Python3

Post by farberm »

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
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: HassBridge plugin updated for Python3

Post by FlyingDiver »

That file is not included by default. What's in it?
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
farberm
Posts: 393
Joined: Sun Feb 24, 2008 2:14 pm

Re: HassBridge plugin updated for Python3

Post by farberm »

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 3067 times
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: HassBridge plugin updated for Python3

Post by FlyingDiver »

I still want to know what's in that file.
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
farberm
Posts: 393
Joined: Sun Feb 24, 2008 2:14 pm

Re: HassBridge plugin updated for Python3

Post by farberm »

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
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: HassBridge plugin updated for Python3

Post by FlyingDiver »

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

Return to “HassBridge”