Python Plugin : Broadlink RM2 V4

Python and python framework

Moderator: leecollings

arcpaqua
Posts: 16
Joined: Saturday 23 June 2018 20:47
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10338
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by arcpaqua »

zak45 wrote: Wednesday 09 January 2019 16:37
arcpaqua wrote: Wednesday 09 January 2019 11:05 Hi all,
I have a Raspberry pi3 with Domoticz 4.1 and I followed the guide to install Broadlink plugin.
I think it works but Domoticz doesn't find any device.
I've my Broadlink device right in front of me working perfectly with his smartphone app.

2019-01-09 10:57:07.484 (BroadLinkRM2) 'Version':'4.0.0'
2019-01-09 10:57:07.484 (BroadLinkRM2) 'Key':'BroadlinkRM2'

Can you help me, please?
Thank you in advance
Two things:
try to go to the last version: plugin.py --> v4.1.0
be sure to have allowed device creation in settings->parameters
Thank you very much Zak!
Now I can find Import, Remote and Command devices on Setup>Devices
But I find anything on Switches.
What I'm missing again?


*UPDATE:
I made some test by changing Device Type on hardware config such as "eSensor multisensor A1", "Remote Control RM2/RM mini3 with Temperature device", "Discovery" and Domoticz creates new switches.
By setting "Remote Control RM2/RM mini3" nothing appears.

**UPDATE:
Maybe I understood, and solved!
What I did was to work on Domoticz from my Windows 10 chrome browser, so remotely in the same network.
I used (obviously) the router raspberry IP (192.168.1.XX:8080) and it didn't work as shown before.
Doing the same thing directly inside Rasp with IP (127.0.0.1:8080) everything has worked.
Is it normal?
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by zak45 »

@arcpaqua
nice you have it running.
What I know, I always done my test/dev on the same VLAN.
kollemt
Posts: 29
Joined: Monday 18 February 2019 20:41
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by kollemt »

Hi all,

I have installed the latest version of Domoticz V4.10436 on my Raspberry.
Today I have done the installation steps for my Broadlink RM3 following all steps of the wiki.

THe HW and the Broadlink devices are visible.
However I get errors, not able to find my RM#:
019-02-18 21:18:07.010 Error: (Broadlink RM3 mini #1) Error Connecting to Broadlink device....192.168.178.150
2019-02-18 21:20:02.487 Error: Broadlink RM3 mini #1 hardware (5) thread seems to have ended unexpectedly
2019-02-18 21:20:16.327 Error: (Broadlink RM3 mini #1) Error getting temperature data from Broadlink device....Timeout
2019-02-18 21:20:16.328 Error: (Broadlink RM3 mini #1) Error Connecting to Broadlink device....192.168.178.150
2019-02-18 21:25:16.364 Error: (Broadlink RM3 mini #1) Error getting temperature data from Broadlink device....Timeout
2019-02-18 21:25:16.364 Error: (Broadlink RM3 mini #1) Error Connecting to Broadlink device....192.168.178.150
2019-02-18 21:30:16.453 Error: (Broadlink RM3 mini #1) Error getting temperature data from Broadlink device....Timeout
2019-02-18 21:30:16.453 Error: (Broadlink RM3 mini #1) Error Connecting to Broadlink device....192.168.178.150
2019-02-18 21:35:16.487 Error: (Broadlink RM3 mini #1) Error getting temperature data from Broadlink device....Timeout
2019-02-18 21:35:16.488 Error: (Broadlink RM3 mini #1) Error Connecting to Broadlink device....192.168.178.150

Also when trying to activate a Broadlink device :
2019-02-18 21:44:01.075 Error: (Broadlink RM3 mini #1) 'onCommand' failed 'FileNotFoundError'.
2019-02-18 21:44:01.075 Error: (Broadlink RM3 mini #1) ----> Line 262 in '/home/pi/domoticz/plugins/BroadlinkRM2/plugin.py', function onCommand
2019-02-18 21:44:01.075 Error: (Broadlink RM3 mini #1) ----> Line 823 in '/home/pi/domoticz/plugins/BroadlinkRM2/plugin.py', function createIniImport

Help is very much appreciated.

The status of the startup looks fine:
2019-02-18 21:18:00.007 Status: Domoticz V4.10436 (c)2012-2019 GizMoCuz
2019-02-18 21:18:00.022 Status: Build Hash: fb1eaa01, Date: 2019-02-18 16:43:29
2019-02-18 21:18:00.034 Status: Startup Path: /home/pi/domoticz/
2019-02-18 21:18:00.628 Status: EventSystem: reset all events...
2019-02-18 21:18:02.090 Status: PluginSystem: Started, Python version '3.5.3'.
2019-02-18 21:18:02.285 Status: WebServer(HTTP) started on address: :: with port 8080
2019-02-18 21:18:02.547 Status: WebServer(SSL) started on address: :: with port 443
2019-02-18 21:18:02.550 Status: Proxymanager started.
2019-02-18 21:18:02.589 Status: Camera: settings (re)loaded
2019-02-18 21:18:02.604 Status: TCPServer: shared server started...
2019-02-18 21:18:02.604 Status: RxQueue: queue worker started...
2019-02-18 21:18:04.605 Status: P1 Smart Meter: Using serial port: /dev/ttyUSB1
2019-02-18 21:18:04.609 Status: P1 Smart Meter: Worker started...
2019-02-18 21:18:04.610 Status: (Broadlink RM3 mini #1) Started.
2019-02-18 21:18:04.610 Status: EventSystem: reset all events...
2019-02-18 21:18:04.612 Status: RFXCOM: Worker started...
2019-02-18 21:18:04.613 Status: EventSystem: reset all device statuses...
2019-02-18 21:18:04.789 Status: PluginSystem: Entering work loop.
2019-02-18 21:18:05.021 Status: P1 Smart Meter: Meter reports as DSMR 5.0
2019-02-18 21:18:05.386 Status: P1 Smart Meter: Found gas meter on M-Bus channel 1
2019-02-18 21:18:05.616 Status: RFXCOM: Using serial port: /dev/ttyUSB0
2019-02-18 21:18:06.267 Status: RFXCOM: Async Disabled
2019-02-18 21:18:06.972 Status: (Broadlink RM3 mini #1) Entering work loop.
2019-02-18 21:18:06.973 Status: (Broadlink RM3 mini #1) Initialized version 4.1.0, author 'zak45'
2019-02-18 21:18:07.154 Status: Python EventSystem: Initalizing event module.
2019-02-18 21:18:07.154 Status: EventSystem: Started
2019-02-18 21:18:07.155 Status: EventSystem: Queue thread started...


2019-02-18 21:38:46.518 (Broadlink RM3 mini #1) Pushing 'onHeartbeatCallback' on to queue
2019-02-18 21:38:46.560 (Broadlink RM3 mini #1) Processing 'onHeartbeatCallback' message
2019-02-18 21:38:46.560 (Broadlink RM3 mini #1) Calling message handler 'onHeartbeat'.
Attachments
Hw definition in Domoticz
Hw definition in Domoticz
HW Broadlink.JPG (54.88 KiB) Viewed 1569 times
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by zak45 »

put your MAC addres in this format :
2017-03-26 18:33:39.278 (My br) Device 1 MAC address = b3330ddd260b
kollemt
Posts: 29
Joined: Monday 18 February 2019 20:41
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by kollemt »

Ok
Thanks. The layout issue of the MAC address did indeed solve the problem of the connection.
Now when pressing the" learn" button on the command switch after a few second I get "Test".
and then I can save the button.

However sometimes I get the following error messages, mostly during the learning, testing, saving process.
Not sure if they can cause problems. So far I did not see any effect:
2019-02-19 00:48:41.743 Error: Broadlink RM3 mini #2 hardware (6) thread seems to have ended unexpectedly
2019-02-19 00:50:20.219 Error: (Broadlink RM3 mini #1) 'onHeartbeat' failed 'TypeError':'unorderable types: NoneType() > int()'.
2019-02-19 00:50:20.219 Error: (Broadlink RM3 mini #1) ----> Line 473 in '/home/pi/domoticz/plugins/BroadlinkRM2/plugin.py', function onHeartbeat
2019-02-19 00:50:20.219 Error: (Broadlink RM3 mini #1) ----> Line 757 in '/home/pi/domoticz/plugins/BroadlinkRM2/plugin.py', function checkTemp

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

Re: Python Plugin : Broadlink RM2 V4

Post by zak45 »

kollemt wrote: Tuesday 19 February 2019 0:59 Not sure if they can cause problems. So far I did not see any effect:
2019-02-19 00:48:41.743 Error: Broadlink RM3 mini #2 hardware (6) thread seems to have ended unexpectedly
2019-02-19 00:50:20.219 Error: (Broadlink RM3 mini #1) 'onHeartbeat' failed 'TypeError':'unorderable types: NoneType() > int()'.
2019-02-19 00:50:20.219 Error: (Broadlink RM3 mini #1) ----> Line 473 in '/home/pi/domoticz/plugins/BroadlinkRM2/plugin.py', function onHeartbeat
2019-02-19 00:50:20.219 Error: (Broadlink RM3 mini #1) ----> Line 757 in '/home/pi/domoticz/plugins/BroadlinkRM2/plugin.py', function checkTemp

Any explanation ?
probably a 'bug', already reported by some others...
will need some times to try to solve it.
thanks to report.
maury
Posts: 6
Joined: Wednesday 16 January 2019 1:17
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by maury »

186/5000
Hi guys
sorry for my English.
it's the first time I've written in the forum.

I managed to learn a key,
test ok,
but then it does not work

How can I solve?
thank you all

Code: Select all

2019-02-19 17:55:40.958 (BroadlinkSCS) Pushing 'onCommandCallback' on to queue
2019-02-19 17:55:40.966 (BroadlinkSCS) Processing 'onCommandCallback' message
2019-02-19 17:55:40.966 (BroadlinkSCS) Calling message handler 'onCommand'.
2019-02-19 17:55:40.966 (BroadlinkSCS) onCommand called for Unit 2: Parameter 'On', Level: 0 , Connected : False
2019-02-19 17:55:40.966 (BroadlinkSCS) Generate on Command for learned code stored on unit/ini :2
2019-02-19 17:55:40.971 (BroadlinkSCS) Code loaded : 2600180192951139103911391014111411141015101411391039113910141114111410151014113910391139101411141114101510141114111410141139103911391039113910000600939511381139103911141114101411141114113811391039111411141014111411141138113910391114111410141114111411141014111411391039113811391138110006009395113811391039111411141014111411141138113910391114111410141114111411381139103911141114101510141114111410141114113910391139103911381100060093951138113910391114111410141114111411381139103911141114101411141114103911391039111411141014111411141015101411141138113911381139103911000d05
2019-02-19 17:55:40.971 (BroadlinkSCS) <b> Command line : "/home/pi/domoticz/plugins/BroadlinkRM2/plugin_send.py" /home/pi/domoticz/plugins/BroadlinkRM2/fileini/BroadlinkRM2-2-2.ini </b>
2019-02-19 17:55:40.971 (alza volume tv samsung) Updating device from 1:'On-8' to have values 1:'On-9'.
2019-02-19 17:55:40.990 (BroadlinkSCS) Update 1:'On-9' (samsung)
2019-02-19 17:55:40.957 Status: User: Admin initiated a switch command (4/samsung/On)
2019-02-19 17:55:44.356 (BroadlinkSCS) Pushing 'onHeartbeatCallback' on to queue
2019-02-19 17:55:44.397 (BroadlinkSCS) Processing 'onHeartbeatCallback' message
2019-02-19 17:55:44.397 (BroadlinkSCS) Calling message handler 'onHeartbeat'.
2019-02-19 17:55:44.410 Error: (BroadlinkSCS) 'onHeartbeat' failed 'TypeError':'unorderable types: NoneType() > int()'.
2019-02-19 17:55:44.410 Error: (BroadlinkSCS) ----> Line 473 in /home/pi/domoticz/plugins/BroadlinkRM2/plugin.py, function onHeartbeat
2019-02-19 17:55:44.410 Error: (BroadlinkSCS) ----> Line 757 in /home/pi/domoticz/plugins/BroadlinkRM2/plugin.py, function checkTemp

kollemt
Posts: 29
Joined: Monday 18 February 2019 20:41
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by kollemt »

Hi,

I can only manage to add one Broadlink device after starting my Raspberry Pi. Eg the on/off button of my TV
If I want to add a second button I do see the RM3 blinking while pushing a button on my remote but pressing Test” does not react.
Also when pressing Reset before trying to add a new button does not help.

After restarting my Raspberry I can add another button, but again only one.

I see in the error log :
2019-02-19 20:21:07.032 Error: Broadlink RM3 mini #1 hardware (5) thread seems to have ended unexpectedly

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

Re: Python Plugin : Broadlink RM2 V4

Post by zak45 »

Looks like people on trouble use all RM3 mini.
Maybe try to update broadlink module from git:
https://github.com/mjg59/python-broadlink

if you have trouble with the learning process, you can learn from the android application and do an import into domoticz after.
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by zak45 »

v 4.2 uploaded. Hope solve checktemp error.
kollemt
Posts: 29
Joined: Monday 18 February 2019 20:41
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by kollemt »

I have updated plugin.py to version 4.1

Assume to install the latest broadlink package on my Raspberry PI using https://github.com/mjg59/python-broadlink I can use the commands described in the wiki:sudo pip3 install broadlink.
Do not think this is needed niw as I am on version0.9:
@raspberrypi:~$ sudo pip3 show broadlinkName: broadlinkVersion: 0.9Summary: Python API for controlling Broadlink IR controllersHome-page: http://github.com/mjg59/python-broadlinkAuthor: Matthew GarrettAuthor-email: [email protected]: UNKNOWNLocation: /usr/local/lib/python3.5/dist-packagesRequires: PyCRC, pycryptodomepi@raspberrypi:~$

Still get 2019-02-19 23:43:06.567 Error: Broadlink RM3 mini #1 hardware (5) thread seems to have ended unexpectedly
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by zak45 »

kollemt wrote: Tuesday 19 February 2019 23:52 Still get 2019-02-19 23:43:06.567 Error: Broadlink RM3 mini #1 hardware (5) thread seems to have ended unexpectedly
Have already seen this one and looks like related to some networks problem.
maury
Posts: 6
Joined: Wednesday 16 January 2019 1:17
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by maury »

I'm sorry,
where is the 4.2 plugin?

broadlink 0.9
plugin 4.0
domoticz 4.97
raspberry pi 3 b+

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

Re: Python Plugin : Broadlink RM2 V4

Post by zak45 »

maury wrote: Wednesday 20 February 2019 14:03 I'm sorry,
where is the 4.2 plugin?
No problem, .. just download it from dropbox, file name: plugin.py, download link: wiki
maury
Posts: 6
Joined: Wednesday 16 January 2019 1:17
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by maury »

ok, but I often have this error

I have a mini
2019-02-19 17:55:40.958 (BroadlinkSCS) Pushing 'onCommandCallback' on to queue
2019-02-19 17:55:40.966 (BroadlinkSCS) Processing 'onCommandCallback' message
2019-02-19 17:55:40.966 (BroadlinkSCS) Calling message handler 'onCommand'.
2019-02-19 17:55:40.966 (BroadlinkSCS) onCommand called for Unit 2: Parameter 'On', Level: 0 , Connected : False
2019-02-19 17:55:40.966 (BroadlinkSCS) Generate on Command for learned code stored on unit/ini :2
2019-02-19 17:55:40.971 (BroadlinkSCS) Code loaded : 2600180192951139103911391014111411141015101411391039113910141114111410151014113910391139101411141114101510141114111410141139103911391039113910000600939511381139103911141114101411141114113811391039111411141014111411141138113910391114111410141114111411141014111411391039113811391138110006009395113811391039111411141014111411141138113910391114111410141114111411381139103911141114101510141114111410141114113910391139103911381100060093951138113910391114111410141114111411381139103911141114101411141114103911391039111411141014111411141015101411141138113911381139103911000d05
2019-02-19 17:55:40.971 (BroadlinkSCS) <b> Command line : "/home/pi/domoticz/plugins/BroadlinkRM2/plugin_send.py" /home/pi/domoticz/plugins/BroadlinkRM2/fileini/BroadlinkRM2-2-2.ini </b>
2019-02-19 17:55:40.971 (alza volume tv samsung) Updating device from 1:'On-8' to have values 1:'On-9'.
2019-02-19 17:55:40.990 (BroadlinkSCS) Update 1:'On-9' (samsung)
2019-02-19 17:55:40.957 Status: User: Admin initiated a switch command (4/samsung/On)
2019-02-19 17:55:44.356 (BroadlinkSCS) Pushing 'onHeartbeatCallback' on to queue
2019-02-19 17:55:44.397 (BroadlinkSCS) Processing 'onHeartbeatCallback' message
2019-02-19 17:55:44.397 (BroadlinkSCS) Calling message handler 'onHeartbeat'.
2019-02-19 17:55:44.410 Error: (BroadlinkSCS) 'onHeartbeat' failed 'TypeError':'unorderable types: NoneType() > int()'.
2019-02-19 17:55:44.410 Error: (BroadlinkSCS) ----> Line 473 in /home/pi/domoticz/plugins/BroadlinkRM2/plugin.py, function onHeartbeat
2019-02-19 17:55:44.410 Error: (BroadlinkSCS) ----> Line 757 in /home/pi/domoticz/plugins/BroadlinkRM2/plugin.py, function checkTemp

kollemt
Posts: 29
Joined: Monday 18 February 2019 20:41
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by kollemt »

Hi,

I managed to create my first remote for my TV in the living room.
Want to create a second remote for my mediaplayer in the living room.
Have only one RM3 in the living room.

Any suggestion how to manage this ?
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by zak45 »

One broadlink can manage several remote devices.
kollemt
Posts: 29
Joined: Monday 18 February 2019 20:41
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by kollemt »

Ok thanks.
But assume I have one RM3 with hardware number 13.
I create in Domoticz a remote for my TV and create an ini file plugin_remote_13.ini and store it in the remote folder.
Do I have to create another ini file for my mediaplayer and with what name?
How do I get a second remote device for my mediaplayer in Domoticz?
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by zak45 »

kollemt wrote: Thursday 21 February 2019 15:15 Ok thanks.
But assume I have one RM3 with hardware number 13.
I create in Domoticz a remote for my TV and create an ini file plugin_remote_13.ini and store it in the remote folder.
Do I have to create another ini file for my mediaplayer and with what name?
How do I get a second remote device for my mediaplayer in Domoticz?
OK... I think I see.. when you say remote you mean the remote GUI (Kodi like).
Main purpose of this plugin is to run in background.. but If you want a second remote, you can create another HW and put the same settings as the first one.
On your example you will have hardware number 14.
Never test it, but you can give it a try.
maury
Posts: 6
Joined: Wednesday 16 January 2019 1:17
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by maury »

Hi Zac, I'm sorry

I have this error, how can I do?

2019-02-19 17:55:44.410 Error: (BroadlinkSCS) ----> Line 473 in /home/pi/domoticz/plugins/BroadlinkRM2/plugin.py, function onHeartbeat
2019-02-19 17:55:44.410 Error: (BroadlinkSCS) ----> Line 757 in /home/pi/domoticz/plugins/BroadlinkRM2/plugin.py, function checkTemp

raspberry pi 3 b+
domoticz 4.9700
broadlink rm mini3
plugin 4.0
broadlink 0.9

please help me
thank you
Post Reply

Who is online

Users browsing this forum: FireWizard and 1 guest