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 »

JUNA wrote: Saturday 04 July 2020 9:58
Same error here. How can I set plugin in debug mode?
just select python code
debug.PNG
debug.PNG (15.98 KiB) Viewed 2766 times
JUNA
Posts: 12
Joined: Tuesday 30 June 2020 17:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by JUNA »

Debug: Python Only

2020-07-04 11:57:24.998 (RM3m) onCommand called for Unit 2: Parameter 'Set Level', Level: 10 , Connected : True
2020-07-04 11:57:24.969 Status: User: Admin initiated a switch command (2/RM3m - IR Commands/Set Level)
2020-07-04 11:57:25.007 (RM3m) Update 1:'Learn IR command' (RM3m - RM2-Status)
2020-07-04 11:57:25.016 (RM3m) Update 1:'10' (RM3m - IR Commands)
2020-07-04 11:57:25.016 (RM3m) command to execute : "/home/pi/domoticz/plugins/Broadlink/scr/dombr.sh" "/home/pi/domoticz/plugins/Broadlink/Dombroadlink.py" "192.168.1.118;8080;24Dxxxxxxx;/home/pi/domoticz/scripts/broadlink//;RM2M;192.168.1.173;9000;2;2;/home/pi/domoticz/plugins/Broadlink/;9;en;learnir" no
2020-07-04 11:57:25.036 Error: (RM3m) 'onCommand' failed 'TimeoutExpired'.
2020-07-04 11:57:25.036 Error: (RM3m) ----> Line 445 in '/home/pi/domoticz/plugins/Broadlink/plugin.py', function onCommand
2020-07-04 11:57:25.036 Error: (RM3m) ----> Line 2294 in '/home/pi/domoticz/plugins/Broadlink/plugin.py', function start_shell
2020-07-04 11:57:25.036 Error: (RM3m) ----> Line 342 in '/usr/lib/python3.7/subprocess.py', function check_call
2020-07-04 11:57:25.037 Error: (RM3m) ----> Line 329 in '/usr/lib/python3.7/subprocess.py', function call
2020-07-04 11:57:25.037 Error: (RM3m) ----> Line 1006 in '/usr/lib/python3.7/subprocess.py', function wait
2020-07-04 11:57:25.037 Error: (RM3m) ----> Line 1616 in '/usr/lib/python3.7/subprocess.py', function _wait
Attachments
Debug Python only.png
Debug Python only.png (163.06 KiB) Viewed 2764 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 »

great!
this execute the right command.
verify that dombr.sh can be executed ( +x ) (ls -altr)
chmod +x if necessary...

you can run it by yourself if you open term session...
go to Broadlink folder:
"/home/pi/domoticz/plugins/Broadlink/scr/dombr.sh" "/home/pi/domoticz/plugins/Broadlink/Dombroadlink.py" "192.168.1.118;8080;24Dxxxxxxx;/home/pi/domoticz/scripts/broadlink//;RM2M;192.168.1.173;9000;2;2;/home/pi/domoticz/plugins/Broadlink/;9;en;learnir" no
ayasystems
Posts: 66
Joined: Tuesday 19 April 2016 23:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by ayasystems »

Hi zak45

Execute persmision was set, it was done with your install script, i did not do anything....
learn_device_responde.jpg
learn_device_responde.jpg (68.69 KiB) Viewed 2745 times
If i launch it manually works fine but domoticz gets time out when rise learn command
learn_device.jpg
learn_device.jpg (141.57 KiB) Viewed 2745 times
Best regards!
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 »

ayasystems wrote: Saturday 04 July 2020 19:09 Hi zak45

Execute persmision was set, it was done with your install script, i did not do anything....

learn_device_responde.jpg

If i launch it manually works fine but domoticz gets time out when rise learn command

learn_device.jpg

Best regards!
Hummm... maybe I'm wrong, but what I see, is that you have entered a control / break when you tried to run the command ( ^c )
could be nice to see the content of the nohup.out.

Maybe waiting for something ... and this is the reason of the Timeout error. ?? !!
ayasystems
Posts: 66
Joined: Tuesday 19 April 2016 23:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by ayasystems »

Hi

Timeout is raised without delay.

I did ctrl after a 10 seconds and it worked, the command was readed and ini created. But launched on console. Launched by domoticz raise timeout without delay.

Sorry for my English, it is not enough good to explain all

Regard
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 »

ayasystems wrote: Sunday 05 July 2020 9:40 Hi

Timeout is raised without delay.

I did ctrl after a 10 seconds and it worked, the command was readed and ini created. But launched on console. Launched by domoticz raise timeout without delay.

Sorry for my English, it is not enough good to explain all

Regard
Ok, no problem, thanks for the information.
This show that the script is waiting something. The goal is that when you run the .sh, it launched a second py process and terminate in few ms...
What is the content of the nohup.out ???
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 »

Have installed Debian on a VM, made some test and the Timeout not managed the same as on Windows.
Modification has been made.
Download setup.py and execute it again.
JUNA
Posts: 12
Joined: Tuesday 30 June 2020 17:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by JUNA »

Previous errors have disappeared!

New error while pressing "Learn" in IR Command:
Error: (RM3m) ERR : learnir--Not able to enter learning mode--21

Log:
2020-07-06 17:02:20.886 (RM3m) onCommand called for Unit 2: Parameter 'Set Level', Level: 10 , Connected : True
2020-07-06 17:02:20.894 (RM3m) Update 1:'Learn IR command' (RM3m - RM2-Status)
2020-07-06 17:02:20.903 (RM3m) Update 1:'10' (RM3m - IR Commands)
2020-07-06 17:02:20.903 (RM3m) command to execute : "/home/pi/domoticz/plugins/Broadlink/scr/dombr.sh" "/home/pi/domoticz/plugins/Broadlink/Dombroadlink.py" "192.168.1.118;8080;24Dxxxxxxx;/home/pi/domoticz/scripts/broadlink/;RM2M;192.168.1.173;9000;2;2;/home/pi/domoticz/plugins/Broadlink/;9;en;learnir" no
2020-07-06 17:02:20.859 Status: User: Admin initiated a switch command (2/RM3m - IR Commands/Set Level)
2020-07-06 17:02:21.776 (RM3m) Connected successfully to 192.168.1.118:38418
2020-07-06 17:02:21.777 (RM3m) onMessage called for connection: 192.168.1.118:38418
2020-07-06 17:02:21.777 (RM3m) We bypass URL check
2020-07-06 17:02:21.777 (RM3m) data:b'{"status":{"step":"ERR : learnir","msg":"Not able to enter learning mode","code":"21"}}'
2020-07-06 17:02:21.777 (RM3m) {"status":{"step":"ERR : learnir","msg":"Not able to enter learning mode","code":"21"}}
2020-07-06 17:02:21.777 (RM3m) processing data : {"status":{"step":"ERR : learnir","msg":"Not able to enter learning mode","code":"21"}}
2020-07-06 17:02:21.777 (RM3m) data process OK
2020-07-06 17:02:21.827 (RM3m) Connected successfully to 192.168.1.118:38420
2020-07-06 17:02:21.828 (RM3m) onDisconnect called for connection 192.168.1.118:38418
2020-07-06 17:02:21.828 (RM3m) Server Connections:
2020-07-06 17:02:21.828 (RM3m) --> 192.168.1.118:38418'.
2020-07-06 17:02:21.828 (RM3m) --> 192.168.1.118:38420'.
2020-07-06 17:02:21.828 (RM3m) onMessage called for connection: 192.168.1.118:38420
2020-07-06 17:02:21.828 (RM3m) We bypass URL check
2020-07-06 17:02:21.828 (RM3m) data:b'{"status":{"step":"learnir","msg":"Error to learn IR code","code":"1"}}'
2020-07-06 17:02:21.828 (RM3m) {"status":{"step":"learnir","msg":"Error to learn IR code","code":"1"}}
2020-07-06 17:02:21.828 (RM3m) processing data : {"status":{"step":"learnir","msg":"Error to learn IR code","code":"1"}}
2020-07-06 17:02:21.832 (RM3m) Update 1:'Error to learn IR code' (RM3m - RM2-Status)
2020-07-06 17:02:21.836 (RM3m) Update 0:'Off' (RM3m - IR Commands)
2020-07-06 17:02:21.836 (RM3m) data process OK
2020-07-06 17:02:21.886 (RM3m) onDisconnect called for connection 192.168.1.118:38420
2020-07-06 17:02:21.886 (RM3m) Server Connections:
2020-07-06 17:02:21.886 (RM3m) --> 192.168.1.118:38420'.
2020-07-06 17:02:21.777 Error: (RM3m) ERR : learnir--Not able to enter learning mode--21
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 »

JUNA wrote: Monday 06 July 2020 17:09 Previous errors have disappeared!

New error while pressing "Learn" in IR Command:
Error: (RM3m) ERR : learnir--Not able to enter learning mode--21
fine !!

now, this error show something wrong when try to put the device into learning mode, but connection looks OK.
Take a look into log folder, more information should be there.
Do a scan and provide the output.
JUNA
Posts: 12
Joined: Tuesday 30 June 2020 17:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by JUNA »

zak45 wrote: Monday 06 July 2020 17:25
JUNA wrote: Monday 06 July 2020 17:09 Previous errors have disappeared!

New error while pressing "Learn" in IR Command:
Error: (RM3m) ERR : learnir--Not able to enter learning mode--21
fine !!

now, this error show something wrong when try to put the device into learning mode, but connection looks OK.
Take a look into log folder, more information should be there.
Do a scan and provide the output.
Broadlink_log.png
Broadlink_log.png (6.74 KiB) Viewed 2654 times
2Mainoutput.txt:
--------------------------------------Start-------------------------------------
STEP ==: learnir --- 2020-07-06 17:07:45
Connected to Broadlink device: 192.168.1.173
Traceback (most recent call last):
File "/home/pi/domoticz/plugins/Broadlink/Dombroadlink.py", line 407, in learnir
device.enter_learning()
File "/usr/lib/python3.7/broadlink/__init__.py", line 615, in enter_learning
check_error(response[0x22:0x24])
File "/usr/lib/python3.7/broadlink/exceptions.py", line 97, in check_error
raise exception(error_code)
broadlink.exceptions.StorageError: The device storage is full

Not able to enter learning mode
Error : <class 'broadlink.exceptions.StorageError'> The device storage is full <traceback object at 0xb5770c
88>
---------------------------------------END--------------------------------------

2Mainoutput.err: Empty file

2RM2M.txt:
0x2712 192.168.1.173 24Dxxxxxxxxx
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 »

JUNA wrote: Monday 06 July 2020 18:31 broadlink.exceptions.StorageError: The device storage is full

Not able to enter learning mode
Error : <class 'broadlink.exceptions.StorageError'> The device storage is full <traceback object at 0xb5770c
88>
2RM2M.txt:
0x2712 192.168.1.173 24Dxxxxxxxxx
Looks like problem with the broadlink library for your device ( suppose RM3 mini )
A link to read : https://github.com/home-assistant/core/issues/35875 and maybe provide some informations
JUNA
Posts: 12
Joined: Tuesday 30 June 2020 17:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by JUNA »

zak45 wrote: Monday 06 July 2020 19:12
JUNA wrote: Monday 06 July 2020 18:31 broadlink.exceptions.StorageError: The device storage is full

Not able to enter learning mode
Error : <class 'broadlink.exceptions.StorageError'> The device storage is full <traceback object at 0xb5770c
88>
2RM2M.txt:
0x2712 192.168.1.173 24Dxxxxxxxxx
Looks like problem with the broadlink library for your device ( suppose RM3 mini )
A link to read : https://github.com/home-assistant/core/issues/35875 and maybe provide some informations


sudo python broadlink_cli.py --device "0x62be 192.168.1.172 xxxxxxxxxx" --learn
Learning...
2600700000012495111511151115111511151115111510391139103911381138123811381138121411151139111412141139111510161114123810161138113812141138123810381300050f0001264b11000c4f0001254b11000c4e0001254c11000c4e0001254c11000c4e0001264b10000d05000000000000
Base64: b'JgBwAAABJJURFREVERURFREVERURFRA5ETkQORE4ETgSOBE4ETgSFBEVETkRFBIUETkRFRAWERQSOBAWETgROBIUETgSOBA4EwAFDwABJksRAAxPAAElSxEADE4AASVMEQAMTgABJUwRAAxOAAEmSxAADQUAAAAAAAA='

Manual I can trigger to learn code, do you think the cause could be that device (rm4c_mini, 0x62be) is missing in Dombroadlink.py file?

(Possible solution mentioned in https://github.com/home-assistant/core/issues/35875 is the need to specify the correct type in the config. Use type: rm4c_mini...)
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 »

JUNA wrote: Monday 06 July 2020 21:38 sudo python broadlink_cli.py --device "0x62be 192.168.1.172 xxxxxxxxxx" --learn
Learning...
2600700000012495111511151115111511151115111510391139103911381138123811381138121411151139111412141139111510161114123810161138113812141138123810381300050f0001264b11000c4f0001254b11000c4e0001254c11000c4e0001254c11000c4e0001264b10000d05000000000000
Base64: b'JgBwAAABJJURFREVERURFREVERURFRA5ETkQORE4ETgSOBE4ETgSFBEVETkRFBIUETkRFRAWERQSOBAWETgROBIUETgSOBA4EwAFDwABJksRAAxPAAElSxEADE4AASVMEQAMTgABJUwRAAxOAAEmSxAADQUAAAAAAAA='

Manual I can trigger to learn code, do you think the cause could be that device (rm4c_mini, 0x62be) is missing in Dombroadlink.py file?

(Possible solution mentioned in https://github.com/home-assistant/core/issues/35875 is the need to specify the correct type in the config. Use type: rm4c_mini...)
Great. If you can learn code in command line, a solution exist.
But first,
you said that your device is a rm4c_mini
but you have a RM2M fle in your log directory with this code on it: 0x2712
this is for the RM2 / RM3 device.

Can you change your plugin settings and select Remote control mini RM4 ?
JUNA
Posts: 12
Joined: Tuesday 30 June 2020 17:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by JUNA »

zak45 wrote: Monday 06 July 2020 23:32
JUNA wrote: Monday 06 July 2020 21:38 sudo python broadlink_cli.py --device "0x62be 192.168.1.172 xxxxxxxxxx" --learn
Learning...
2600700000012495111511151115111511151115111510391139103911381138123811381138121411151139111412141139111510161114123810161138113812141138123810381300050f0001264b11000c4f0001254b11000c4e0001254c11000c4e0001254c11000c4e0001264b10000d05000000000000
Base64: b'JgBwAAABJJURFREVERURFREVERURFRA5ETkQORE4ETgSOBE4ETgSFBEVETkRFBIUETkRFRAWERQSOBAWETgROBIUETgSOBA4EwAFDwABJksRAAxPAAElSxEADE4AASVMEQAMTgABJUwRAAxOAAEmSxAADQUAAAAAAAA='

Manual I can trigger to learn code, do you think the cause could be that device (rm4c_mini, 0x62be) is missing in Dombroadlink.py file?

(Possible solution mentioned in https://github.com/home-assistant/core/issues/35875 is the need to specify the correct type in the config. Use type: rm4c_mini...)
Great. If you can learn code in command line, a solution exist.
But first,
you said that your device is a rm4c_mini
but you have a RM2M fle in your log directory with this code on it: 0x2712
this is for the RM2 / RM3 device.

Can you change your plugin settings and select Remote control mini RM4 ?
Sorry for the confusion. I have both, I own a rm4c_mini and a RM mini 3. I have been switching between the two models to see if there was a difference. (Strange, since reinstall I cannot see device 0x2712 any more in the log.)

sudo python broadlink_discovery.py

RM mini 3 discovered as:
###########################################
RM4
# broadlink_cli --type 0x5f36 --host 192.168.1.173 --mac xxxxe0a7df24
Device file data (to be used with --device @filename in broadlink_cli) :
0x5f36 192.168.1.173 xxxxe0a7df24
Traceback (most recent call last):
File "broadlink_discovery.py", line 24, in <module>
print("temperature = {}".format(device.check_temperature()))
File "/usr/lib/python3.7/broadlink/__init__.py", line 673, in check_temperature
return self._read_sensor( 0x24, 4, 100.0 )
File "/usr/lib/python3.7/broadlink/__init__.py", line 653, in _read_sensor
check_error(response[0x22:0x24])
File "/usr/lib/python3.7/broadlink/exceptions.py", line 97, in check_error
raise exception(error_code)
broadlink.exceptions.StorageError: The device storage is full

RM4c mini:
###########################################
RM4
# broadlink_cli --type 0x62be --host 192.168.1.172 --mac xxxx31a7df24
Device file data (to be used with --device @filename in broadlink_cli) :
0x62be 192.168.1.172 xxxx31a7df24
temperature = 0.0
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 »

JUNA wrote: Tuesday 07 July 2020 9:03
Sorry for the confusion. I have both, I own a rm4c_mini and a RM mini 3. I have been switching between the two models to see if there was a difference. (Strange, since reinstall I cannot see device 0x2712 any more in the log.)

sudo python broadlink_discovery.py

RM mini 3 discovered as:
###########################################
RM4
# broadlink_cli --type 0x5f36 --host 192.168.1.173 --mac xxxxe0a7df24
Device file data (to be used with --device @filename in broadlink_cli) :
0x5f36 192.168.1.173 xxxxe0a7df24
Traceback (most recent call last):
File "broadlink_discovery.py", line 24, in <module>
print("temperature = {}".format(device.check_temperature()))
File "/usr/lib/python3.7/broadlink/__init__.py", line 673, in check_temperature
return self._read_sensor( 0x24, 4, 100.0 )
File "/usr/lib/python3.7/broadlink/__init__.py", line 653, in _read_sensor
check_error(response[0x22:0x24])
File "/usr/lib/python3.7/broadlink/exceptions.py", line 97, in check_error
raise exception(error_code)
broadlink.exceptions.StorageError: The device storage is full

RM4c mini:
###########################################
RM4
# broadlink_cli --type 0x62be --host 192.168.1.172 --mac xxxx31a7df24
Device file data (to be used with --device @filename in broadlink_cli) :
0x62be 192.168.1.172 xxxx31a7df24
temperature = 0.0
Ok. no problem.

For the RM3:
looks like your is part of the broadlink bug, maybe see if you can upgrade the firmware (do not know how to do that, I have a RM2 only)

For the RM4:
you have been able to learn manually, so this should work with the plugin.
Put the right settings (RM4) and IP (.172) /mac on the plugin, restart and test.
Let us know.
JUNA
Posts: 12
Joined: Tuesday 30 June 2020 17:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by JUNA »

zak45 wrote: Tuesday 07 July 2020 12:32
JUNA wrote: Tuesday 07 July 2020 9:03
Sorry for the confusion. I have both, I own a rm4c_mini and a RM mini 3. I have been switching between the two models to see if there was a difference. (Strange, since reinstall I cannot see device 0x2712 any more in the log.)

sudo python broadlink_discovery.py

RM mini 3 discovered as:
###########################################
RM4
# broadlink_cli --type 0x5f36 --host 192.168.1.173 --mac xxxxe0a7df24
Device file data (to be used with --device @filename in broadlink_cli) :
0x5f36 192.168.1.173 xxxxe0a7df24
Traceback (most recent call last):
File "broadlink_discovery.py", line 24, in <module>
print("temperature = {}".format(device.check_temperature()))
File "/usr/lib/python3.7/broadlink/__init__.py", line 673, in check_temperature
return self._read_sensor( 0x24, 4, 100.0 )
File "/usr/lib/python3.7/broadlink/__init__.py", line 653, in _read_sensor
check_error(response[0x22:0x24])
File "/usr/lib/python3.7/broadlink/exceptions.py", line 97, in check_error
raise exception(error_code)
broadlink.exceptions.StorageError: The device storage is full

RM4c mini:
###########################################
RM4
# broadlink_cli --type 0x62be --host 192.168.1.172 --mac xxxx31a7df24
Device file data (to be used with --device @filename in broadlink_cli) :
0x62be 192.168.1.172 xxxx31a7df24
temperature = 0.0
Ok. no problem.

For the RM3:
looks like your is part of the broadlink bug, maybe see if you can upgrade the firmware (do not know how to do that, I have a RM2 only)

For the RM4:
you have been able to learn manually, so this should work with the plugin.
Put the right settings (RM4) and IP (.172) /mac on the plugin, restart and test.
Let us know.
zak45, You are a genius! Thank you for your patience.
After reinstall setup.py it worked.
Spoiler: show

Code: Select all

2020-07-07 19:41:54.540 Status: Domoticz V2020.2 (c)2012-2020 GizMoCuz
2020-07-07 19:41:54.540 Status: Build Hash: b63341bc0, Date: 2020-04-26 13:47:55
2020-07-07 19:41:54.541 Status: Startup Path: /home/pi/domoticz/
2020-07-07 19:41:54.618 Status: PluginSystem: Started, Python version '3.7.3'.
2020-07-07 19:41:54.623 Status: WebServer(HTTP) started on address: :: with port 8080
2020-07-07 19:41:54.627 Status: WebServer(SSL) started on address: :: with port 443
2020-07-07 19:41:54.629 Status: TCPServer: shared server started...
2020-07-07 19:41:54.629 Status: RxQueue: queue worker started...
2020-07-07 19:41:56.629 Status: (RM4) Started.
2020-07-07 19:41:56.630 Status: NotificationSystem: thread started...
2020-07-07 19:41:56.630 Status: EventSystem: reset all events...
2020-07-07 19:41:56.631 Status: EventSystem: reset all device statuses...
2020-07-07 19:41:56.722 Status: Python EventSystem: Initalizing event module.
2020-07-07 19:41:56.723 Status: EventSystem: Started
2020-07-07 19:41:56.723 Status: EventSystem: Queue thread started...
2020-07-07 19:41:57.059 Status: PluginSystem: Entering work loop.
2020-07-07 19:41:57.769 Status: (RM4) Entering work loop.
2020-07-07 19:41:57.770 Status: (RM4) Initialized version 1.0.0, author 'zak45'
2020-07-07 19:42:29.293 Status: User: Admin initiated a switch command (2/RM4 - IR Commands/Set Level)
2020-07-07 19:42:40.064 (RM4) Update 1:'20' (RM4 - IR Commands)
2020-07-07 19:42:40.064 (RM4) data process OK
2020-07-07 19:42:40.114 (RM4) onDisconnect called for connection 192.168.1.118:50802
2020-07-07 19:42:40.114 (RM4) Server Connections:
2020-07-07 19:42:40.115 (RM4) --> 192.168.1.118:50802'.
2020-07-07 19:42:43.120 (RM4) Connected successfully to 192.168.1.118:50804
2020-07-07 19:42:43.120 (RM4) onMessage called for connection: 192.168.1.118:50804
2020-07-07 19:42:43.121 (RM4) We bypass URL check
2020-07-07 19:42:43.121 (RM4) data:b'{"end":{"step":"learnir","msg":"END learnir"}}'
2020-07-07 19:42:43.121 (RM4) {"end":{"step":"learnir","msg":"END learnir"}}
2020-07-07 19:42:43.121 (RM4) processing data : {"end":{"step":"learnir","msg":"END learnir"}}
2020-07-07 19:42:43.130 (RM4) Update 1:'END learnir' (RM4 - RM24-Status)
2020-07-07 19:42:43.138 (RM4) Update 1:'On' (RM4 - RM24-Status)
2020-07-07 19:42:43.138 (RM4) data process OK
2020-07-07 19:42:43.189 (RM4) onDisconnect called for connection 192.168.1.118:50804
2020-07-07 19:42:43.189 (RM4) Server Connections:
2020-07-07 19:42:43.189 (RM4) --> 192.168.1.118:50804'.
2020-07-07 19:42:44.742 (RM4) onCommand called for Unit 2: Parameter 'Set Level', Level: 30 , Connected : True
2020-07-07 19:42:44.746 (RM4) ini file created.../home/pi/domoticz/scripts/broadlink/Broadlink-2-010.ini
2020-07-07 19:42:44.755 (RM4) Update 1:'Ini created' (RM4 - RM24-Status)
2020-07-07 19:42:44.764 (RM4) Update 0:'Off' (RM4 - IR Commands)
2020-07-07 19:42:44.739 Status: User: Admin initiated a switch command (2/RM4 - IR Commands/Set Level)
2020-07-07 19:43:03.147 (RM4) Connected successfully to 192.168.1.160:55388
2020-07-07 19:43:03.147 (RM4) Connected successfully to 192.168.1.160:55389
2020-07-07 19:43:03.147 (RM4) onMessage called for connection: 192.168.1.160:55388
2020-07-07 19:43:03.148 (RM4) Request from : 192.168.1.160:55388 to : /web/css/button.css
2020-07-07 19:43:03.148 (RM4) web
2020-07-07 19:43:03.148 (RM4) onMessage called for connection: 192.168.1.160:55389
2020-07-07 19:43:03.148 (RM4) Request from : 192.168.1.160:55389 to : /manage?key=242606367345150
2020-07-07 19:43:03.181 (RM4) manage
2020-07-07 19:43:03.382 (RM4) Connected successfully to 192.168.1.160:55390
2020-07-07 19:43:03.382 (RM4) Connected successfully to 192.168.1.160:55391
2020-07-07 19:43:03.383 (RM4) Connected successfully to 192.168.1.160:55392
2020-07-07 19:43:03.383 (RM4) Connected successfully to 192.168.1.160:55393
2020-07-07 19:43:03.383 (RM4) onMessage called for connection: 192.168.1.160:55389
2020-07-07 19:43:03.383 (RM4) Request from : 192.168.1.160:55389 to : /web/css/manage.css
2020-07-07 19:43:03.383 (RM4) web
2020-07-07 19:43:03.384 (RM4) onMessage called for connection: 192.168.1.160:55388
2020-07-07 19:43:03.384 (RM4) Request from : 192.168.1.160:55388 to : /web/js/RGraph.common.core.js
2020-07-07 19:43:03.384 (RM4) web
2020-07-07 19:43:03.385 (RM4) onMessage called for connection: 192.168.1.160:55390
2020-07-07 19:43:03.385 (RM4) Request from : 192.168.1.160:55390 to : /web/js/RGraph.thermometer.js
2020-07-07 19:43:03.385 (RM4) web
2020-07-07 19:43:03.385 (RM4) onMessage called for connection: 192.168.1.160:55391
2020-07-07 19:43:03.385 (RM4) Request from : 192.168.1.160:55391 to : /web/js/RGraph.vprogress.js
2020-07-07 19:43:03.386 (RM4) web
2020-07-07 19:43:03.386 (RM4) onMessage called for connection: 192.168.1.160:55392
2020-07-07 19:43:03.386 (RM4) Request from : 192.168.1.160:55392 to : /web/js/RGraph.meter.js
2020-07-07 19:43:03.386 (RM4) web
2020-07-07 19:43:03.386 (RM4) onMessage called for connection: 192.168.1.160:55393
2020-07-07 19:43:03.386 (RM4) Request from : 192.168.1.160:55393 to : /web/js/RGraph.odo.js
2020-07-07 19:43:03.387 (RM4) web
2020-07-07 19:43:03.445 (RM4) onMessage called for connection: 192.168.1.160:55389
2020-07-07 19:43:03.445 (RM4) Request from : 192.168.1.160:55389 to : /web/js/RGraph.fuel.js
2020-07-07 19:43:03.445 (RM4) web
2020-07-07 19:43:03.445 (RM4) onMessage called for connection: 192.168.1.160:55388
2020-07-07 19:43:03.446 (RM4) Request from : 192.168.1.160:55388 to : /web/js/RGraph.gauge.js
2020-07-07 19:43:03.446 (RM4) web
2020-07-07 19:43:11.211 (RM4) onMessage called for connection: 192.168.1.160:55388
2020-07-07 19:43:11.211 (RM4) Request from : 192.168.1.160:55388 to : /iniList?key=242606367345150
2020-07-07 19:43:11.212 (RM4) iniList
2020-07-07 19:43:11.312 (RM4) onMessage called for connection: 192.168.1.160:55388
2020-07-07 19:43:11.313 (RM4) Request from : 192.168.1.160:55388 to : /web/css/button.css
2020-07-07 19:43:11.313 (RM4) web
2020-07-07 19:43:13.667 (RM4) onMessage called for connection: 192.168.1.160:55388
2020-07-07 19:43:13.668 (RM4) Request from : 192.168.1.160:55388 to : /Broadlink-2-010.ini
2020-07-07 19:43:13.668 (RM4) browser
2020-07-07 19:43:16.474 (RM4) onMessage called for connection: 192.168.1.160:55388
2020-07-07 19:43:16.474 (RM4) Request from : 192.168.1.160:55388 to : /iniList?key=242606367345150
2020-07-07 19:43:16.475 (RM4) iniList
2020-07-07 19:43:19.731 (RM4) onMessage called for connection: 192.168.1.160:55388
2020-07-07 19:43:19.731 (RM4) Request from : 192.168.1.160:55388 to : /list?key=242606367345150
2020-07-07 19:43:19.733 (RM4) list
2020-07-07 19:43:31.606 (RM4) onMessage called for connection: 192.168.1.160:55388
2020-07-07 19:43:31.606 (RM4) Request from : 192.168.1.160:55388 to : /list?key=242606367345150
2020-07-07 19:43:31.608 (RM4) list
2020-07-07 19:43:34.013 (RM4) onMessage called for connection: 192.168.1.160:55388
2020-07-07 19:43:34.013 (RM4) Request from : 192.168.1.160:55388 to : /manage?key=242606367345150
2020-07-07 19:43:34.043 (RM4) manage
2020-07-07 19:43:34.194 (RM4) onMessage called for connection: 192.168.1.160:55388
2020-07-07 19:43:34.194 (RM4) Request from : 192.168.1.160:55388 to : /web/css/manage.css
2020-07-07 19:43:34.195 (RM4) web
2020-07-07 19:43:38.904 (RM4) onMessage called for connection: 192.168.1.160:55388
2020-07-07 19:43:38.904 (RM4) Request from : 192.168.1.160:55388 to : /manage?key=242606367345150
2020-07-07 19:43:38.933 (RM4) manage
2020-07-07 19:43:38.984 (RM4) onMessage called for connection: 192.168.1.160:55388
2020-07-07 19:43:38.984 (RM4) Request from : 192.168.1.160:55388 to : /web/css/manage.css
2020-07-07 19:43:38.984 (RM4) web
2020-07-07 19:43:49.454 (RM4) onMessage called for connection: 192.168.1.160:55388
2020-07-07 19:43:49.454 (RM4) Request from : 192.168.1.160:55388 to : /createDevice?key=242606367345150&iunit=010&icustom=IR
2020-07-07 19:43:49.454 (RM4) createDevice
2020-07-07 19:44:10.394 (RM4) Device not modified by plugin
2020-07-07 19:44:10.351 Status: EventSystem: reset all device statuses...
2020-07-07 19:44:13.704 (RM4) onCommand called for Unit 10: Parameter 'On', Level: 0 , Connected : True
2020-07-07 19:44:13.704 (RM4) Generate "ON" Command for learned code stored on unit/ini : 10
2020-07-07 19:44:13.706 (RM4) Code loaded : 260058000001249511151016101611151016111511151039113811391039103912381039113812141115113910151214123810161016101610391115103910391115123810391039110005100001254d10000c4f0001254c10000d050000000000000000000000000000
2020-07-07 19:44:13.706 (RM4) b'&\x00X\x00\x00\x01$\x95\x11\x15\x10\x16\x10\x16\x11\x15\x10\x16\x11\x15\x11\x15\x109\x118\x119\x109\x109\x128\x109\x118\x12\x14\x11\x15\x119\x10\x15\x12\x14\x128\x10\x16\x10\x16\x10\x16\x109\x11\x15\x109\x109\x11\x15\x128\x109\x109\x11\x00\x05\x10\x00\x01%M\x10\x00\x0cO\x00\x01%L\x10\x00\r\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
2020-07-07 19:44:13.734 (RM4) Code sent....
2020-07-07 19:44:13.744 (RM4) Update 1:'On-1' (Kaarsen aan)
2020-07-07 19:44:13.678 Status: User: Admin initiated a switch command (4/Kaarsen aan/On)
2020-07-07 19:44:52.766 (RM4) Device not modified by plugin
2020-07-07 19:44:52.718 Status: EventSystem: reset all device statuses...
2020-07-07 19:45:07.875 (RM4) Connected to Broadlink device: 192.168.1.172 RM4
2020-07-07 19:45:07.890 (RM4) Update 1:'On' (RM4 - RM24-Status)
2020-07-07_195041.png
2020-07-07_195041.png (59.25 KiB) Viewed 2576 times
2020-07-07_195353.png
2020-07-07_195353.png (96.59 KiB) Viewed 2576 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 »

Great that you have it working.
Do not forget to remove the debug mode !
vodor
Posts: 39
Joined: Friday 19 February 2016 14:47
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by vodor »

I wish I found this thread 2 days earlier. I got a broadlink mini 3 recently and of course the old plugin does not work with the new version. I had to figure this out the hard way.
I managed to get this plugin installed fairly quickly.
One note not sure if anybody picked up on this yet.

On Debian / Raspbian running python setup.py will run as python2 while python3 setup.py will run as python3. All additional commands inside the script set to run as sudo -H python will also run as python2 therefore I edited the setup.py and changed all lines from sudo -H python to sudo -H python3 and the script ran perfectly. I now have the web interface but I must figure out how to use it. It sure looks pretty..

Thanks for this.
vodor
Posts: 39
Joined: Friday 19 February 2016 14:47
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by vodor »

Though I am able to communicate with my device now I am unable to send commands to it. I imported some codes for my Samsung air conditioner but when I try and send commands I still seem to get device storage full error.
Any pointers?

2020-07-09 19:58:38.423 Error: (BroadLink) Traceback (most recent call last):
2020-07-09 19:58:38.423 File "/home/pi/domoticz/plugins/broadlink/plugin.py", line 1629, in send
2020-07-09 19:58:38.423 DEVICE.send_data(SENDCOMMAND)
2020-07-09 19:58:38.423 File "/usr/local/lib/python3.7/dist-packages/broadlink/__init__.py", line 621, in send_data
2020-07-09 19:58:38.423 check_error(response[0x22:0x24])
2020-07-09 19:58:38.423 File "/usr/local/lib/python3.7/dist-packages/broadlink/exceptions.py", line 97, in check_error
2020-07-09 19:58:38.423 raise exception(error_code)
2020-07-09 19:58:38.423 broadlink.exceptions.StorageError: The device storage is full
2020-07-09 19:58:38.423 Error: (BroadLink) Warning : Code sent ....Probably timeout
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest