Page 1 of 7

Broadlink plugin - alpha version

Posted: Fri Oct 16, 2020 3:44 pm
by Medy
Broadlink plugin - alpha version

Install steps with pictures : https://imgur.com/a/9XnySxE

Setup
1. Setup the device via the offical broadlink app , just make
sure it is added to you network ... (A manual Setup Device Plugin Action -might be added later so you can skip using the app )

1.1 Unlock Device - After setting up the device via the offical app .. there is a setting in the latest broadlink
app for unlocking the device. You must do this .. alternatively do the manual setup instead.... so your device never gets locked ;)


2. Install the the plugin via the .egplugin file - from my google drive (bottom of each of my posts)

3. Add plugin to eventghost (it will autodiscover your device (only 1 device is supported atm))
(it should print your device name to the console ... looking good so far)

4. Learn IR or RF Signals via the Plugin Actions.
- 1 . Enter a command name , 2 . Press apply 3. Press "Test" or run the action in a makro..

if it worked .. "command added" will be printed to the console ... then you can select
the command in Send IR or RF actions" ...

5. Send IR or Rf Signals via the plugin Actions.
(there will be a dropdown you can select the command... press apply ... or test to see if the magic happens :D)

´
Test version
with v.0.8
- a basic user friendly flow is now in place ... you can name your commands !!!

Tested / Confirmed working Devices
> RM Pro Plus (0x27a9) (old firmware - tested)
> RM 3 Mini (0x5f36) (latest firmware - v44057 - tested )

TESTERS & CREDITS
Thanks to member @Roma & Semicolon & Kgschlosser
for testing/feedback. Also Thx to felipediel from the
python broadlink library team.


CURRENT RELEASE
added naming commands

#GoodbyeIFTTT

Re: Broadlink plugin - test version

Posted: Sat Oct 17, 2020 11:13 am
by kalinkamaen
I am using the old eventghost. Will it work with eventghost 0.4 R1722?

Re: Broadlink plugin - test version

Posted: Sat Oct 17, 2020 11:14 am
by Medy
kalinkamaen wrote:
Sat Oct 17, 2020 11:13 am
I am using the old eventghost. Will it work with eventghost 0.4 R1722?
I think so.

Re: Broadlink plugin - test version

Posted: Sun Oct 18, 2020 7:12 pm
by chipd33
Great job Medy,
I currently use the RM plugin for Tasker but am happy to see you working on this.
I have also been getting bombarded by those recent emails from IFTTT and am just relieved I didn't actually use them as my method for home automation.
All the best.
Chip

Re: Broadlink plugin - test version

Posted: Sun Oct 18, 2020 7:31 pm
by Medy
chipd33 wrote:
Sun Oct 18, 2020 7:12 pm
Great job Medy,
I currently use the RM plugin for Tasker but am happy to see you working on this.
I have also been getting bombarded by those recent emails from IFTTT and am just relieved I didn't actually use them as my method for home automation.
All the best.
Chip
Okay ... cool ... I was using tasker for a long time ... but eventually moved everything to eventghost ;) ...
The only downside is that its still running on python 2.7 ... so newer libraries are likely incompatible ....


im still waiting to get some feedback ... if stuff works ...
Then I can make improvements ...

Re: Broadlink plugin - test version

Posted: Sun Oct 18, 2020 8:38 pm
by chipd33
Hi Medy ,
that is interesting, I hadn't thought about that. 2.7 was sunset on Jan 1 ,2020.
It is just a never ending job to keep software contemporary. At least your work will work with EG but it is a shame if newer libraries won't work.
I will let you know if I find any issues if I use EG to run RF devices now that your plugin has made that possible.
Chip

Re: Broadlink plugin - test version

Posted: Mon Oct 19, 2020 3:51 pm
by *Roma*
Hi Medy,

I have RM mini 3.
I added the plugin to EG 0.5 and got the following error message:

Code: Select all

Searching for Broadlink Device in your Network... please wait
Exception in thread Thread-375:
Traceback (most recent call last):
  File "threading.pyc", line 801, in __bootstrap_inner
  File "threading.pyc", line 754, in run
  File "E:\PROGRAMS\EventGhost\plugins\Broadlink\__init__.py", line 205, in discoverDevices
    discovered = broadlink.discover(timeout=conTimeout)
  File "E:\PROGRAMS\EventGhost\plugins\Broadlink\broadlink\__init__.py", line 198, in discover
    device = gendevice(devtype, host, mac, name=name, is_locked=is_locked)
  File "E:\PROGRAMS\EventGhost\plugins\Broadlink\broadlink\__init__.py", line 112, in gendevice
    is_locked=is_locked,
  File "E:\PROGRAMS\EventGhost\plugins\Broadlink\broadlink\__init__.py", line 728, in __init__
    device.__init__(self, *args, **kwargs)
  File "E:\PROGRAMS\EventGhost\plugins\Broadlink\broadlink\__init__.py", line 234, in __init__
    self.update_aes(key)
  File "E:\PROGRAMS\EventGhost\plugins\Broadlink\broadlink\__init__.py", line 238, in update_aes
    backend=default_backend())
  File "E:\PROGRAMS\EventGhost\plugins\Broadlink\cryptography\hazmat\backends\__init__.py", line 15, in default_backend
    from cryptography.hazmat.backends.openssl.backend import backend
  File "E:\PROGRAMS\EventGhost\plugins\Broadlink\cryptography\hazmat\backends\openssl\__init__.py", line 7, in <module>
    from cryptography.hazmat.backends.openssl.backend import backend
  File "E:\PROGRAMS\EventGhost\plugins\Broadlink\cryptography\hazmat\backends\openssl\backend.py", line 16, in <module>
    from cryptography import utils, x509
  File "E:\PROGRAMS\EventGhost\plugins\Broadlink\cryptography\x509\__init__.py", line 7, in <module>
    from cryptography.x509 import certificate_transparency
ImportError: cannot import name certificate_transparency
Do you know hot to fix this ?

Thanks
Roman

Re: Broadlink plugin - test version

Posted: Mon Oct 19, 2020 5:21 pm
by Medy
*Roma* wrote:
Mon Oct 19, 2020 3:51 pm
Hi Medy,

I have RM mini 3.
I added the plugin to EG 0.5 and got the following error message:

Code: Select all

Searching for Broadlink Device in your Network... please wait
Exception in thread Thread-375:
Traceback (most recent call last):
  File "threading.pyc", line 801, in __bootstrap_inner
  File "threading.pyc", line 754, in run
  File "E:\PROGRAMS\EventGhost\plugins\Broadlink\__init__.py", line 205, in discoverDevices
    discovered = broadlink.discover(timeout=conTimeout)
  File "E:\PROGRAMS\EventGhost\plugins\Broadlink\broadlink\__init__.py", line 198, in discover
    device = gendevice(devtype, host, mac, name=name, is_locked=is_locked)
  File "E:\PROGRAMS\EventGhost\plugins\Broadlink\broadlink\__init__.py", line 112, in gendevice
    is_locked=is_locked,
  File "E:\PROGRAMS\EventGhost\plugins\Broadlink\broadlink\__init__.py", line 728, in __init__
    device.__init__(self, *args, **kwargs)
  File "E:\PROGRAMS\EventGhost\plugins\Broadlink\broadlink\__init__.py", line 234, in __init__
    self.update_aes(key)
  File "E:\PROGRAMS\EventGhost\plugins\Broadlink\broadlink\__init__.py", line 238, in update_aes
    backend=default_backend())
  File "E:\PROGRAMS\EventGhost\plugins\Broadlink\cryptography\hazmat\backends\__init__.py", line 15, in default_backend
    from cryptography.hazmat.backends.openssl.backend import backend
  File "E:\PROGRAMS\EventGhost\plugins\Broadlink\cryptography\hazmat\backends\openssl\__init__.py", line 7, in <module>
    from cryptography.hazmat.backends.openssl.backend import backend
  File "E:\PROGRAMS\EventGhost\plugins\Broadlink\cryptography\hazmat\backends\openssl\backend.py", line 16, in <module>
    from cryptography import utils, x509
  File "E:\PROGRAMS\EventGhost\plugins\Broadlink\cryptography\x509\__init__.py", line 7, in <module>
    from cryptography.x509 import certificate_transparency
ImportError: cannot import name certificate_transparency
Do you know hot to fix this ?

Thanks
Roman
Greetings , thanks for testing.


I was able to reproduce and find the error.... ;)

You can either replace this folder "cryptography" you have here E:\PROGRAMS\EventGhost\plugins\Broadlink\cryptography
with this updated cryptography folder I uploaded here : https://drive.google.com/open?id=1y7Lib ... WJ-LWTO64W


Or you do a fresh install ... I uploaded a new version in my google drive ... called v0.1 ..

maybe remove the previous files just in case ... (Idk what happens to the previous files tbh ... :D running the new egplugin file to update might just work though)

Im thrilled to know if it works ... let me know

Re: Broadlink plugin - test version

Posted: Mon Oct 19, 2020 7:49 pm
by *Roma*
I replace the folder "cryptography", but I get same error as before.
I tried the fresh install of v0.1 plugin, unfortunately I get same error as before.

Thanks
Roman

Re: Broadlink plugin - test version

Posted: Mon Oct 19, 2020 8:45 pm
by Medy
did you restart eventghost ? im not getting that error on a fresh install....
will take a look again tommorrow

Re: Broadlink plugin - test version

Posted: Mon Oct 19, 2020 8:48 pm
by *Roma*
Yes, I restarted the eventghost.

Re: Broadlink plugin - test version

Posted: Mon Oct 19, 2020 8:52 pm
by Medy
*Roma* wrote:
Mon Oct 19, 2020 8:48 pm
Yes, I restarted the eventghost.
okay in your eventghost site.packes folder ... there is no other crypthography package right ?
if there is you need to delete it .

I think I previously made a folder in my gdrive instructing to copy things there ....
EventGhost\lib27\site-packages

delete cryptograhy from all places it could be located
-site packages
- C Drive\program data
- Program Files (x86)

and only use the egplugin file from now to install (so the only place it will be is C Drive\program data...)


i tried it with EG 0.5 rc6 and it works

Will take another look tommorrow gotta sleep now ;)
we will definetly get this sorted out ... I mean it works on my end ... and im using 0.5 too :D ...

Re: Broadlink plugin - test version

Posted: Mon Oct 19, 2020 9:14 pm
by *Roma*
I have only one copy of crypthography package.

When I restart eventghost with enabled plugin - I get other error messages:

Code: Select all

C:\ProgramData\EventGhost\plugins\Broadlink\broadlink\__init__.py:13: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in a future release.
  from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes

Code: Select all

      Exception in thread Thread-5:
      Traceback (most recent call last):
        File "threading.pyc", line 801, in __bootstrap_inner
        File "threading.pyc", line 754, in run
        File "C:\ProgramData\EventGhost\plugins\Broadlink\__init__.py", line 205, in discoverDevices
          discovered = broadlink.discover(timeout=conTimeout)
        File "C:\ProgramData\EventGhost\plugins\Broadlink\broadlink\__init__.py", line 198, in discover
          device = gendevice(devtype, host, mac, name=name, is_locked=is_locked)
        File "C:\ProgramData\EventGhost\plugins\Broadlink\broadlink\__init__.py", line 112, in gendevice
          is_locked=is_locked,
        File "C:\ProgramData\EventGhost\plugins\Broadlink\broadlink\__init__.py", line 728, in __init__
          device.__init__(self, *args, **kwargs)
        File "C:\ProgramData\EventGhost\plugins\Broadlink\broadlink\__init__.py", line 234, in __init__
          self.update_aes(key)
        File "C:\ProgramData\EventGhost\plugins\Broadlink\broadlink\__init__.py", line 238, in update_aes
          backend=default_backend())
        File "C:\ProgramData\EventGhost\plugins\Broadlink\cryptography\hazmat\backends\__init__.py", line 15, in default_backend
          from cryptography.hazmat.backends.openssl.backend import backend
        File "C:\ProgramData\EventGhost\plugins\Broadlink\cryptography\hazmat\backends\openssl\__init__.py", line 7, in <module>
          from cryptography.hazmat.backends.openssl.backend import backend
        File "C:\ProgramData\EventGhost\plugins\Broadlink\cryptography\hazmat\backends\openssl\backend.py", line 16, in <module>
          from cryptography import utils, x509
        File "C:\ProgramData\EventGhost\plugins\Broadlink\cryptography\x509\__init__.py", line 8, in <module>
          from cryptography.x509.base import (
        File "C:\ProgramData\EventGhost\plugins\Broadlink\cryptography\x509\base.py", line 23, in <module>
          from cryptography.x509.extensions import Extension, ExtensionType
        File "C:\ProgramData\EventGhost\plugins\Broadlink\cryptography\x509\extensions.py", line 10, in <module>
          import ipaddress
      ImportError: No module named ipaddress
      
Thanks
Roman

Re: Broadlink plugin - test version

Posted: Tue Oct 20, 2020 6:41 am
by Medy
ohh sheesh anothe package... included it ....
this is fixable too ... Its just another package you need to copy into the folder... hopefully there are not more ... thx for testing


I will upload it when im home if thats the case


... the first error is normal you can igonore it..

Re: Broadlink plugin - test version

Posted: Tue Oct 20, 2020 6:59 am
by *Roma*
Ok, thanks.