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 »

extremeaudio wrote: Monday 08 February 2021 8:21 That worked. Very greatly appreciate your efforts, I was very close to giving up on Domoticz altogether merely because I was not able to control IR devices. Thank you.
great.. happy to keep you with us !
extremeaudio
Posts: 47
Joined: Tuesday 24 November 2020 17:57
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by extremeaudio »

Does e-control work anymore? If not whats a good way to add IR codes without learning? Could not find any information on the exact info for converting pronto and then the syntax for usage with broadlink / domoticz. Any instructions or links would be appreciated!
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 »

extremeaudio wrote: Monday 08 February 2021 15:49 Does e-control work anymore? If not whats a good way to add IR codes without learning? Could not find any information on the exact info for converting pronto and then the syntax for usage with broadlink / domoticz. Any instructions or links would be appreciated!
you have already some links integrated into the WebAdmin page:
Capture.PNG
Capture.PNG (131.03 KiB) Viewed 2154 times
from there you can try to find Ir code from database, convert to pronto if necessary and create ini file from pronto.
extremeaudio
Posts: 47
Joined: Tuesday 24 November 2020 17:57
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by extremeaudio »

So I am trying to learn an airconditioner code. viz Panasonic. It doesnt exist in the IRDB (a lot of aricons dont exist) but the code in the broadlink app does a pretty good job of controlling the aircon. But the new Broadlink app is different and the econtrol app does not recognise the newer broadlink devices like RM4 so I'm a bit stuck as to how to import the codes from the perfectly working and easily testable Broadlink app.

Secondly, if I try to learn the codes I am able to get it to show in the domoticz as switches, so even AC Off can only be set as an "On/ off" type switch or as a "Push On Button". If I try to change the switch type to "Push Off Button" it doesnt send the IR code at all. (I am a little unclear with these switch types concept too). All this is a bit awkward from the logic POV.
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 »

extremeaudio wrote: Thursday 11 February 2021 15:56 So I am trying to learn an airconditioner code. viz Panasonic. It doesnt exist in the IRDB (a lot of aricons dont exist) but the code in the broadlink app does a pretty good job of controlling the aircon. But the new Broadlink app is different and the econtrol app does not recognise the newer broadlink devices like RM4 so I'm a bit stuck as to how to import the codes from the perfectly working and easily testable Broadlink app.

Secondly, if I try to learn the codes I am able to get it to show in the domoticz as switches, so even AC Off can only be set as an "On/ off" type switch or as a "Push On Button". If I try to change the switch type to "Push Off Button" it doesnt send the IR code at all. (I am a little unclear with these switch types concept too). All this is a bit awkward from the logic POV.
1: if you have your code in econtrol app, you can try to use the import feature, see this link https://www.domoticz.com/wiki/Plugins/BroadlinkRM2.html
this is the old version but the export / import from econtrol is similar.

2: this plugin simulate a "remote controller device". On your remote device, to send an IR code to put TV On for example, you "Push" "On" the corresponding button of the "remote device", To put TV Off, you "Push" "On" another button (or the same one in case of "toogle" action).
So, each Domoticz device created by this plugin need to be a "Push On" button linked to a ini file used to store the IR code into it.
acaonweb
Posts: 78
Joined: Thursday 23 March 2017 14:18
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by acaonweb »

Hi Guys,
i've just got my brand new Broadlink RM4 Mini.
The first question is: i've to choose to use it on Domoticz or using native app? There's no way to use both way? Because there are advantage for both, because there something that alexa win and something Domoticz is irreplaceable.

I've started using the guide as described in the first post but i don't undestand what app i have to use: e-control or broadlink app? I'm on iOS device

Thanx in advance

Fabrizio
nono212
Posts: 39
Joined: Sunday 18 December 2016 13:47
Target OS: Linux
Domoticz version: 3.6179
Contact:

Re: Python Plugin : Broadlink

Post by nono212 »

Hi Guys
I am able to work with plugin but the web admin is not ok
I am on synology with Docker .
I follow your guideline zak45 using 127.0.0.1 port 9010 because 9000 is used
I am able to go to the page but i have temporary down
do you have any idea ?
I just used python setup.py

Can you please help
Regards
Attachments
broad.jpg
broad.jpg (73.94 KiB) Viewed 2039 times
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 »

acaonweb wrote: Sunday 14 February 2021 10:45 Hi Guys,
i've just got my brand new Broadlink RM4 Mini.
The first question is: i've to choose to use it on Domoticz or using native app? There's no way to use both way? Because there are advantage for both, because there something that alexa win and something Domoticz is irreplaceable.

I've started using the guide as described in the first post but i don't undestand what app i have to use: e-control or broadlink app? I'm on iOS device

Thanx in advance

Fabrizio
for the moment, do not use the app if you want to use this plugin.
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 »

nono212 wrote: Friday 19 February 2021 10:52 Hi Guys
I am able to work with plugin but the web admin is not ok
I am on synology with Docker .
I follow your guideline zak45 using 127.0.0.1 port 9010 because 9000 is used
I am able to go to the page but i have temporary down
do you have any idea ?
I just used python setup.py

Can you please help
Regards
provide your settings, but I think that you can not use 127.0.0.1 as address.
albebert
Posts: 20
Joined: Friday 18 September 2020 17:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by albebert »

plugins not working for me :(

edit :

install is now OK, i access the admin page but seems that can't talk to my rm pro :(

tried to reset and juste reconnect to wifi with app but no luck
Image

domoticz log :

Code: Select all

2021-02-24 13:56:48.035  Error: (RM Pro) Traceback (most recent call last):
  File "/opt/domoticz/plugins/Broadlink/plugin.py", line 1825, in read_type
    brotype = int(value[0], base=16)
ValueError: invalid literal for int() with base 16: ''

2021-02-24 13:56:48.035  Error: (RM Pro) Erreur pour récupérer le type de ce fichier: /opt/domoticz/plugins/Broadlink/log/6RM2.txt
2021-02-24 13:56:48.037  Error: (RM Pro) Traceback (most recent call last):
  File "/opt/domoticz/plugins/Broadlink/plugin.py", line 1803, in broadlink_connect
    DEVICE.auth()
  File "/usr/local/lib/python3.7/dist-packages/broadlink/__init__.py", line 270, in auth
    response = self.send_packet(0x65, payload)
  File "/usr/local/lib/python3.7/dist-packages/broadlink/__init__.py", line 323, in send_packet
    packet[0x25] = self.devtype >> 8
ValueError: byte must be in range(0, 256)

2021-02-24 13:56:48.037  Error: (RM Pro) Erreur de se connecter à un appareil Broadlink: 192.168.201.90
2021-02-24 13:56:48.040  (RM Pro) fichier html Admin créé: /opt/domoticz/www/templates/Broadlink-RM2-6.html
2021-02-24 13:56:48.040  (RM Pro) commande à exécuter: "/opt/domoticz/plugins/Broadlink/scr/dombr.sh" "/opt/domoticz/plugins/Broadlink/Dombroadlink.py" "192.168.xx.xx;80;780f7xxxxxx;/opt/domoticz/plugins/Broadlink/ini/;RM2;192.168.xx.xx;9000;16;6;/opt/domoticz/plugins/Broadlink/;9;fr;remotePlugin" no

any idea ?
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 »

albebert wrote: Wednesday 24 February 2021 10:15 plugins not working for me :(

edit :

install is now OK, i access the admin page but seems that can't talk to my rm pro :(

tried to reset and juste reconnect to wifi with app but no luck


domoticz log :

Code: Select all

2021-02-24 13:56:48.035  Error: (RM Pro) Traceback (most recent call last):
  File "/opt/domoticz/plugins/Broadlink/plugin.py", line 1825, in read_type
    brotype = int(value[0], base=16)
ValueError: invalid literal for int() with base 16: ''

2021-02-24 13:56:48.035  Error: (RM Pro) Erreur pour récupérer le type de ce fichier: /opt/domoticz/plugins/Broadlink/log/6RM2.txt
2021-02-24 13:56:48.037  Error: (RM Pro) Traceback (most recent call last):
  File "/opt/domoticz/plugins/Broadlink/plugin.py", line 1803, in broadlink_connect
    DEVICE.auth()
  File "/usr/local/lib/python3.7/dist-packages/broadlink/__init__.py", line 270, in auth
    response = self.send_packet(0x65, payload)
  File "/usr/local/lib/python3.7/dist-packages/broadlink/__init__.py", line 323, in send_packet
    packet[0x25] = self.devtype >> 8
ValueError: byte must be in range(0, 256)

2021-02-24 13:56:48.037  Error: (RM Pro) Erreur de se connecter à un appareil Broadlink: 192.168.201.90
2021-02-24 13:56:48.040  (RM Pro) fichier html Admin créé: /opt/domoticz/www/templates/Broadlink-RM2-6.html
2021-02-24 13:56:48.040  (RM Pro) commande à exécuter: "/opt/domoticz/plugins/Broadlink/scr/dombr.sh" "/opt/domoticz/plugins/Broadlink/Dombroadlink.py" "192.168.xx.xx;80;780f7xxxxxx;/opt/domoticz/plugins/Broadlink/ini/;RM2;192.168.xx.xx;9000;16;6;/opt/domoticz/plugins/Broadlink/;9;fr;remotePlugin" no

any idea ?
Can you verify if file exist and you have enough right access ?
/opt/domoticz/plugins/Broadlink/log/6RM2.txt
albebert
Posts: 20
Joined: Friday 18 September 2020 17:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by albebert »

zak45 wrote: Wednesday 24 February 2021 23:09
albebert wrote: Wednesday 24 February 2021 10:15 plugins not working for me :(

edit :

install is now OK, i access the admin page but seems that can't talk to my rm pro :(

tried to reset and juste reconnect to wifi with app but no luck


domoticz log :

Code: Select all

2021-02-24 13:56:48.035  Error: (RM Pro) Traceback (most recent call last):
  File "/opt/domoticz/plugins/Broadlink/plugin.py", line 1825, in read_type
    brotype = int(value[0], base=16)
ValueError: invalid literal for int() with base 16: ''

2021-02-24 13:56:48.035  Error: (RM Pro) Erreur pour récupérer le type de ce fichier: /opt/domoticz/plugins/Broadlink/log/6RM2.txt
2021-02-24 13:56:48.037  Error: (RM Pro) Traceback (most recent call last):
  File "/opt/domoticz/plugins/Broadlink/plugin.py", line 1803, in broadlink_connect
    DEVICE.auth()
  File "/usr/local/lib/python3.7/dist-packages/broadlink/__init__.py", line 270, in auth
    response = self.send_packet(0x65, payload)
  File "/usr/local/lib/python3.7/dist-packages/broadlink/__init__.py", line 323, in send_packet
    packet[0x25] = self.devtype >> 8
ValueError: byte must be in range(0, 256)

2021-02-24 13:56:48.037  Error: (RM Pro) Erreur de se connecter à un appareil Broadlink: 192.168.201.90
2021-02-24 13:56:48.040  (RM Pro) fichier html Admin créé: /opt/domoticz/www/templates/Broadlink-RM2-6.html
2021-02-24 13:56:48.040  (RM Pro) commande à exécuter: "/opt/domoticz/plugins/Broadlink/scr/dombr.sh" "/opt/domoticz/plugins/Broadlink/Dombroadlink.py" "192.168.xx.xx;80;780f7xxxxxx;/opt/domoticz/plugins/Broadlink/ini/;RM2;192.168.xx.xx;9000;16;6;/opt/domoticz/plugins/Broadlink/;9;fr;remotePlugin" no

any idea ?
Can you verify if file exist and you have enough right access ?
/opt/domoticz/plugins/Broadlink/log/6RM2.txt

file exist and rights are correct. removed everithing, new try and all is no ok.

need to understand how it works now :) (tried a single IR remote : ok) need to find how create a on/off command with different IR/RF command now
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 »

albebert wrote: Wednesday 24 February 2021 23:49
need to understand how it works now :) (tried a single IR remote : ok) need to find how create a on/off command with different IR/RF command now
For a simple On/off switch in Domoticz, better create a dummy device and copy paste corresponding http command:
Attachments
Capture.PNG
Capture.PNG (51.43 KiB) Viewed 1982 times
albebert
Posts: 20
Joined: Friday 18 September 2020 17:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by albebert »

zak45 wrote: Thursday 25 February 2021 0:38
albebert wrote: Wednesday 24 February 2021 23:49
need to understand how it works now :) (tried a single IR remote : ok) need to find how create a on/off command with different IR/RF command now
For a simple On/off switch in Domoticz, better create a dummy device and copy paste corresponding http command:
thanks ! i'll try.

I've a problem with RF learn,i click on scan, click on my remote, rm2 change to learn, and stuck on learn :(
alexbadcat
Posts: 1
Joined: Thursday 25 February 2021 23:02
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by alexbadcat »

Hi, have error in log. Can you tell me what could be the problem?

Code: Select all

Error: (RM pro) Traceback (most recent call last):
2021-02-25 23:52:51.880 File "/home/pi/domoticz/plugins/Broadlink/plugin.py", line 1801, in broadlink_connect
2021-02-25 23:52:51.880 mac=bytearray.fromhex(Parameters["Mode1"])
2021-02-25 23:52:51.880 ValueError: non-hexadecimal number found in fromhex() arg at position 2
2021-02-25 23:52:51.880
2021-02-25 23:52:51.880 Error: (RM pro) Error to connect to Broadlink device: 192.168.1.5
2021-02-25 23:52:58.363 
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 »

alexbadcat wrote: Thursday 25 February 2021 23:10 Hi, have error in log. Can you tell me what could be the problem?

Error: (RM pro) Traceback (most recent call last):
2021-02-25 23:52:51.880 mac=bytearray.fromhex(Parameters["Mode1"])
2021-02-25 23:52:51.880 ValueError: non-hexadecimal number found in fromhex() arg at position 2
Verify your MAC address entry.
extremeaudio
Posts: 47
Joined: Tuesday 24 November 2020 17:57
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by extremeaudio »

zak45 wrote: Thursday 11 February 2021 18:09 1: if you have your code in econtrol app, you can try to use the import feature, see this link https://www.domoticz.com/wiki/Plugins/BroadlinkRM2.html
this is the old version but the export / import from econtrol is similar.
econtrol app does not work with any of the new devices like RM4. Any idea how to extract from newer app? Or to adapt and use from Pronto or Hex for compatibility with Broadlink/ Domoticz please? 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 »

extremeaudio wrote: Friday 26 February 2021 14:33
zak45 wrote: Thursday 11 February 2021 18:09 1: if you have your code in econtrol app, you can try to use the import feature, see this link https://www.domoticz.com/wiki/Plugins/BroadlinkRM2.html
this is the old version but the export / import from econtrol is similar.
econtrol app does not work with any of the new devices like RM4. Any idea how to extract from newer app? Or to adapt and use from Pronto or Hex for compatibility with Broadlink/ Domoticz please? Thanks
Does it mean that you do not own the original remote device ?
vernwood
Posts: 3
Joined: Tuesday 29 December 2020 8:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by vernwood »

hi zak45

does the plugin support the new sp4 power socket already?
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 »

vernwood wrote: Saturday 27 February 2021 5:53 hi zak45

does the plugin support the new sp4 power socket already?
Not yet officialy, but you can made a test and select sp2 as device.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest