Python Plugin : Broadlink

Python and python framework

Moderator: leecollings

zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

matekogon wrote: Friday 09 October 2020 22:42 Zak45
everything is already working. I installed in the wrong folder. I still have a question.
I bought Broadlink RM4 mini + sensor temp and humidity.I can see the temperature, I cannot see the humidity.
Does the plug support a humidity sensor?
Ok,nice to see you have it working.
and sorry, no support for humidity.
skywi13
Posts: 2
Joined: Thursday 08 October 2020 16:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by skywi13 »

zak45 wrote: Thursday 08 October 2020 23:58
skywi13 wrote: Thursday 08 October 2020 17:02 "Checking installation ....
----------------------------------------
Successfully imported googletrans
Error importing translate

2020-10-08 15:42:19.545 Error: (RM4-SAM) Module Import failed, exception: 'ModuleNotFoundError'
pi@raspberrypi:~ $ python --version
Python 3.5.4
Be sure to have executed installation with sudo ... and that rigth python version has been set for your system not only for your user ...
Modulenotfounderror has been already discussed many time, check on this topic.
After installation of "googletrans" separatly and 3 or 4 more installation it's fine.
Thank you for assistance.
psy501
Posts: 1
Joined: Monday 12 October 2020 9:29
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by psy501 »

Hey, i cannot install it
i have an error

https://ibb.co/Rh07mmx

thanks for help
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

psy501 wrote: Monday 12 October 2020 9:36 Hey, i cannot install it
i have an error



thanks for help
Do not provide this kind of help.
lamama1234
Posts: 14
Joined: Tuesday 17 October 2017 9:02
Target OS: Windows
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by lamama1234 »

Hi,

Plugin is working great. Many thanks to all contributors.

I'm trying to manually enter an IR code which doesn't exist in my TV remote (from here https://gitlab.com/snippets/1690600)

How do I convert the IR codes listed in the attached link, e.g. 20DFA35C, to the codes generated in this plugin's ini files?

Thanks
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

lamama1234 wrote: Wednesday 14 October 2020 15:53 Hi,

Plugin is working great. Many thanks to all contributors.

I'm trying to manually enter an IR code which doesn't exist in my TV remote (from here https://gitlab.com/snippets/1690600)

How do I convert the IR codes listed in the attached link, e.g. 20DFA35C, to the codes generated in this plugin's ini files?

Thanks
You need to see if you can have it on Pronto HEX. so you can import it. take a look also to the IR code DB:
ircode.PNG
ircode.PNG (71.19 KiB) Viewed 2137 times
garycooper
Posts: 21
Joined: Sunday 10 March 2019 20:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by garycooper »

Hello, when I'm trying to install the plugin (using sudo), I've got this error :
*
================================================================================
*
Broadlink Plugin Installation
*
================================================================================
*
Python 3.7.3 (default, Jul 25 2020, 13:03:44)
[GCC 8.3.0] on linux
________________________________________
# We need Domoticz Net info
----------------------------------------
ENTER Domoticz IP address (e.g. 192.168.1.45): 192.168.1.xx
ENTER Domoticz Port Number (e.g. 8080): xxxx
IP/PORT OK
Installation initialized ......
________________________________________
# we retrieve Domoticz language
Traceback (most recent call last):
File "setup.py", line 73, in exe_domoticz
html = urllib.request.urlopen('http://' + str(Domoticz) + ':' + str(Port) + '/json.htm?' + params, timeout=20)
File "/usr/lib/python3.7/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.7/urllib/request.py", line 531, in open
response = meth(req, response)
File "/usr/lib/python3.7/urllib/request.py", line 641, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python3.7/urllib/request.py", line 569, in error
return self._call_chain(*args)
File "/usr/lib/python3.7/urllib/request.py", line 503, in _call_chain
result = func(*args)
File "/usr/lib/python3.7/urllib/request.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 401: Unauthorized

Error sending command to Domoticz :type=settings
Could you help me ? python version using is 3.7.3 (also on SU) and I've got a raspberry pi 4.
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

garycooper wrote: Wednesday 14 October 2020 23:45 Hello, when I'm trying to install the plugin (using sudo), I've got this error :

urllib.error.HTTPError: HTTP Error 401: Unauthorized

Error sending command to Domoticz :type=settings
see here : viewtopic.php?f=65&t=33223&start=60#p252626
garycooper
Posts: 21
Joined: Sunday 10 March 2019 20:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by garycooper »

Thanks ! It's work 8-)
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

lamama1234 wrote: Wednesday 14 October 2020 15:53 Hi,

Plugin is working great. Many thanks to all contributors.

I'm trying to manually enter an IR code which doesn't exist in my TV remote (from here https://gitlab.com/snippets/1690600)

How do I convert the IR codes listed in the attached link, e.g. 20DFA35C, to the codes generated in this plugin's ini files?

Thanks
you can try this one also :
https://www.yamaha.com/ypab/irhex_converter.asp
garycooper
Posts: 21
Joined: Sunday 10 March 2019 20:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by garycooper »

Hello, I use the plugin with a broadlink Multiplug 1 and 2 broadlink RM3 mini. I always have this error on logs :
2020-10-18 22:57:50.711 Error: (Multiprise TV etage) Traceback (most recent call last):
2020-10-18 22:57:50.711 File "/usr/local/lib/python3.7/dist-packages/broadlink/__init__.py", line 369, in send_packet
2020-10-18 22:57:50.711 response = cs.recvfrom(2048)
2020-10-18 22:57:50.711 socket.timeout: timed out
2020-10-18 22:57:50.711
2020-10-18 22:57:50.711 During handling of the above exception, another exception occurred:
2020-10-18 22:57:50.711
2020-10-18 22:57:50.711 Traceback (most recent call last):
2020-10-18 22:57:50.711 File "/home/pi/domoticz/plugins/Broadlink/plugin.py", line 2258, in check_power_mp1
2020-10-18 22:57:50.711 STATEMP1 = DEVICE.check_power()
2020-10-18 22:57:50.711 File "/usr/local/lib/python3.7/dist-packages/broadlink/__init__.py", line 431, in check_power
2020-10-18 22:57:50.711 state = self.check_power_raw()
2020-10-18 22:57:50.711 File "/usr/local/lib/python3.7/dist-packages/broadlink/__init__.py", line 420, in check_power_raw
2020-10-18 22:57:50.711 response = self.send_packet(0x6a, packet)
2020-10-18 22:57:50.711 File "/usr/local/lib/python3.7/dist-packages/broadlink/__init__.py", line 374, in send_packet
2020-10-18 22:57:50.711 raise exception(0xfffd)
2020-10-18 22:57:50.711 broadlink.exceptions.DeviceOfflineError: The device is offline
2020-10-18 22:57:50.711
2020-10-18 22:57:50.711 Error: (Multiprise TV etage) Erreur pour vérifier l état d alimentation du dispositif de MP1
2020-10-18 23:31:51.211 Error: (TV salon) No data received from TV, probably it has just been turned off (time data '' does not match format '%Y-%m-%dT%H:%M:%S')
2020-10-18 23:41:32.872 Error: (Multiprise TV etage) Traceback (most recent call last):
2020-10-18 23:41:32.872 File "/usr/local/lib/python3.7/dist-packages/broadlink/__init__.py", line 369, in send_packet
2020-10-18 23:41:32.872 response = cs.recvfrom(2048)
2020-10-18 23:41:32.872 socket.timeout: timed out
2020-10-18 23:41:32.872
2020-10-18 23:41:32.872 During handling of the above exception, another exception occurred:
2020-10-18 23:41:32.872
2020-10-18 23:41:32.872 Traceback (most recent call last):
2020-10-18 23:41:32.872 File "/home/pi/domoticz/plugins/Broadlink/plugin.py", line 2258, in check_power_mp1
2020-10-18 23:41:32.872 STATEMP1 = DEVICE.check_power()
2020-10-18 23:41:32.872 File "/usr/local/lib/python3.7/dist-packages/broadlink/__init__.py", line 431, in check_power
2020-10-18 23:41:32.872 state = self.check_power_raw()
2020-10-18 23:41:32.872 File "/usr/local/lib/python3.7/dist-packages/broadlink/__init__.py", line 420, in check_power_raw
2020-10-18 23:41:32.872 response = self.send_packet(0x6a, packet)
2020-10-18 23:41:32.872 File "/usr/local/lib/python3.7/dist-packages/broadlink/__init__.py", line 374, in send_packet
2020-10-18 23:41:32.872 raise exception(0xfffd)
2020-10-18 23:41:32.872 broadlink.exceptions.DeviceOfflineError: The device is offline
2020-10-18 23:41:32.872
2020-10-18 23:41:32.872 Error: (Multiprise TV etage) Erreur pour vérifier l état d alimentation du dispositif de MP1
I don't understand and broadlinks devices work normaly
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

garycooper wrote: Sunday 18 October 2020 23:54
I don't understand and broadlinks devices work normaly
I do not own MP1 device and could not test...
Got this error also, from time to time, with my RM2 device.
If your devices work so you can just forget these errors...
they are related to Network error as the plugin try to connect to your devices in background.
torM6
Posts: 18
Joined: Tuesday 29 May 2018 18:11
Target OS: NAS (Synology & others)
Domoticz version: 3.9390
Contact:

Re: Python Plugin : Broadlink

Post by torM6 »

Sorry for my misunderstanding, but I still not understand how I can move my ini files with codes from old plugin to new one. E.g. I have old ini file like

Code: Select all

[DEFAULT]
unit = 73
customname = zgemma Power
hardwareid = 9
pluginkey = Broadlink
pluginfolder = /Users/tor/bld/domb/dom11804/plugins/Broadlink/
pluginname = mRM Pro+

[Device]
host = 192.168.1.97
mac = xxxxxxx (my real Mac masked out)

[LearnedCode]
73 = 2600480000012a921436133713371311151113381212141113371312143514381113121412361337131411121411141213121312131313121436123911371336133616361335143614000d05
Should I install 0.15 versions of broadlink python module or older is enough?
W hat I should to to have this device (button) appears in Domoticz like with older plugin?
Now I see only 3 devices like Status/etc...
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

torM6 wrote: Tuesday 27 October 2020 16:29 Sorry for my misunderstanding, but I still not understand how I can move my ini files with codes from old plugin to new one. E.g. I have old ini file like
W hat I should to to have this device (button) appears in Domoticz like with older plugin?
You need to copy your old ini file to the new import folder of the new plugin location.
Clicking on import button should create the ini file for the new plugin.
if you want a Domoticz button, just click on the create device button once you have selected the ini from the manage web page.
torM6
Posts: 18
Joined: Tuesday 29 May 2018 18:11
Target OS: NAS (Synology & others)
Domoticz version: 3.9390
Contact:

Re: Python Plugin : Broadlink

Post by torM6 »

zak45 wrote: Tuesday 27 October 2020 16:45 You need to copy your old ini file to the new import folder of the new plugin location.
Clicking on import button should create the ini file for the new plugin.
if you want a Domoticz button, just click on the create device button once you have selected the ini from the manage web page.
Thanks, now it works!
3 small comments/suggestions:
1. this sequence is completely unclear, so, it will be helpful if you modify your first post and add small instruction like
to import old settings do:
a) use web interface as http://<yourIP>:900
b) move old file from BroadlinkRM2/ini to new plugin Broadlink/import
c) goto web page from a) and choose import from the button <import ini> in the left bottom, then click to every ini file with *** in names and click to <create device>

2. I have around 60 up to 100 buttons, so, I have to select each one-by-one, rotate 100 lines bottom, click to <create device> and then to refresh page (otherwise it show white screen on my Mac Safari).
It will be nice to have collective import operation...

3. Created device has kind of prefix like "mRM Pro+ - 9-043 zgemma mute" instead of just old name used in my scripts like "zgemma mute". So, I have to manually edit it 100 times inside settings... May be it worth to have button "do not prepend device name" to save at least part of my work?
jon205
Posts: 39
Joined: Monday 05 November 2018 16:17
Target OS: Linux
Domoticz version: 2022.2
Location: @home
Contact:

Re: Python Plugin : Broadlink

Post by jon205 »

Dear Zak45,

I've got your plugin running, but no devices are being created when I want to save a command. I've set the debuglevel to all and found this after saving the command:

Code: Select all

2020-10-29 09:31:22.384 Status: User: Admin initiated a switch command (231/Broadlink - Opdrachten/Set Level)
2020-10-29 09:31:22.424 Error: (Broadlink) Bestand bestaat
2020-10-29 09:31:22.424 Error: (Broadlink) Bestand bestaat
2020-10-29 09:31:22.424 Error: (Broadlink) Bestand bestaat
2020-10-29 09:31:22.424 Error: (Broadlink) Bestand bestaat
2020-10-29 09:31:22.424 Error: (Broadlink) Bestand bestaat
2020-10-29 09:31:26.078 (Broadlink) Pushing 'ProtocolDirective' on to queue 
It's in Dutch, but 'Bestand bestaat' means 'File exists'. What file is this and how can I fix this error?
Thanks.
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

jon205 wrote: Thursday 29 October 2020 9:43 Dear Zak45,

I've got your plugin running, but no devices are being created when I want to save a command. I've set the debuglevel to all and found this after saving the command:

Code: Select all

2020-10-29 09:31:22.384 Status: User: Admin initiated a switch command (231/Broadlink - Opdrachten/Set Level)
2020-10-29 09:31:22.424 Error: (Broadlink) Bestand bestaat
2020-10-29 09:31:22.424 Error: (Broadlink) Bestand bestaat
2020-10-29 09:31:22.424 Error: (Broadlink) Bestand bestaat
2020-10-29 09:31:22.424 Error: (Broadlink) Bestand bestaat
2020-10-29 09:31:22.424 Error: (Broadlink) Bestand bestaat
2020-10-29 09:31:26.078 (Broadlink) Pushing 'ProtocolDirective' on to queue 
It's in Dutch, but 'Bestand bestaat' means 'File exists'. What file is this and how can I fix this error?
Thanks.
First, should have a problem with your lng file.
Modify it like this :

File exist : {}|;|Bestand bestaat : {}

This message mean that during the saving process, and this should happend only after plugin restart, plugin search for the first available number.
So, this is only informative error : maybe should have to put it as warning ???

Now, your ini file should be there.
If you go to the manage web page, hope you can see it.
Let me know.
jon205
Posts: 39
Joined: Monday 05 November 2018 16:17
Target OS: Linux
Domoticz version: 2022.2
Location: @home
Contact:

Re: Python Plugin : Broadlink

Post by jon205 »

Hey Zak,

Thanks for you reply. I've checked it, the ini file is being created. The device is still not created.
jon205
Posts: 39
Joined: Monday 05 November 2018 16:17
Target OS: Linux
Domoticz version: 2022.2
Location: @home
Contact:

Re: Python Plugin : Broadlink

Post by jon205 »

Nevermind, RTFM did the trick. ;-)
krystian
Posts: 1
Joined: Thursday 29 October 2020 18:20
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by krystian »

hello, i'm new in here and new in Domoticz ;)

problem:

Code: Select all

2020-10-29 18:10:44.442 Error: (Broadlink) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/Broadlink/:/usr/lib/python37.zip:/usr/lib/python3.7:/usr/lib/python3.7/lib-dynload:/usr/local/lib/python3.7/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.7/dist-packages'.

Code: Select all

python --version
Returns
Python 3.7.3

When i run manually:

Code: Select all

python plugin.py
Traceback (most recent call last):
  File "plugin.py", line 110, in <module>
    import Domoticz
ModuleNotFoundError: No module named 'Domoticz'
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest