Page 1 of 3

HassBridge plugin updated for Python3

PostPosted: Sun Jul 16, 2023 4:23 pm
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

Re: HassBridge plugin updated for Python3

PostPosted: Sun Jul 16, 2023 4:36 pm
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'

Re: HassBridge plugin updated for Python3

PostPosted: Sun Jul 16, 2023 4:37 pm
by FlyingDiver
Darn it, I thought I fixed that. Hmmm.

Re: HassBridge plugin updated for Python3

PostPosted: Sun Jul 16, 2023 4:48 pm
by FlyingDiver

Re: HassBridge plugin updated for Python3

PostPosted: Sun Jul 16, 2023 4:54 pm
by Colly
Up and running now, will get back to it tomorrow to have a proper play about.

Re: HassBridge plugin updated for Python3

PostPosted: Mon Jul 17, 2023 5:42 am
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

Re: HassBridge plugin updated for Python3

PostPosted: Mon Jul 17, 2023 6:03 am
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.

Re: HassBridge plugin updated for Python3

PostPosted: Mon Jul 17, 2023 6:54 am
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

Re: HassBridge plugin updated for Python3

PostPosted: Mon Jul 17, 2023 10:17 am
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.

Re: HassBridge plugin updated for Python3

PostPosted: Mon Jul 17, 2023 10:53 am
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

Re: HassBridge plugin updated for Python3

PostPosted: Mon Jul 17, 2023 10:54 am
by FlyingDiver
That file is not included by default. What's in it?

Re: HassBridge plugin updated for Python3

PostPosted: Mon Jul 17, 2023 11:03 am
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.

Re: HassBridge plugin updated for Python3

PostPosted: Mon Jul 17, 2023 11:04 am
by FlyingDiver
I still want to know what's in that file.

Re: HassBridge plugin updated for Python3

PostPosted: Mon Jul 17, 2023 11:14 am
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

Re: HassBridge plugin updated for Python3

PostPosted: Mon Jul 17, 2023 11:19 am
by FlyingDiver