Page 4 of 16
Re: Python Plugin: Broadlink RM2 V3
Posted: Friday 07 July 2017 14:07
by Andree
I can not believe it.I installed the x64 versions of Python.
The wiki was also specified to use x86.
Shame for me!
Now with Python 3.5.3 x86 I installed everything and the devices appeared.
Tonight I try to configure the various actions, I hope I have no problems anymore.
Thank you Zak and sorry for the trouble
Re: Python Plugin: Broadlink RM2 V3
Posted: Friday 07 July 2017 19:25
by zak45
Andree wrote:I can not believe it.I installed the x64 versions of Python.
The wiki was also specified to use x86.
Shame for me!
Now with Python 3.5.3 x86 I installed everything and the devices appeared.
Tonight I try to configure the various actions, I hope I have no problems anymore.
Thank you Zak and sorry for the trouble
Happy you have it working .. enjoy !
Re: Python Plugin: Broadlink RM2 V3
Posted: Monday 10 July 2017 9:39
by Andree
Many thanks Zak, it works perfectly with both of my Broadlink RM Mini 3.
Thx for your work!
Re: Python Plugin: Broadlink RM2 V3
Posted: Monday 17 July 2017 16:25
by DrJS
Hi, after some quick diagnostic assistance.
I've got the Broadlink configured (successfully I assume) within my Domoticz. I can use it through the Android bridge, so I know the IP address, MAC address etc. are all correct.
However, within Domoticz, it doesn't appear to work. So I went to the Linux shell and executed the plugin_send.py against some INI files that I know have correct codes, but nothing happens. It doesn't even make the Broadlink orange light come on, yet the IP and MAC are correct.
Anyone know how else I can diagnose this? I've put various print commands within the .py and confirm that the python script is working and with all the right variables. I've downloaded the plugin_send.py again in case it has been updated, but a diff shows no changes. Obviously it's never going to work within Domoticz if I can't run it from the command line, but I'm at a loss why it's not working.
I've tried:
python3 plugin_send.py ini/BroadlinkRM2-7-34.ini
sudo python3 plugin_send.py ini/BroadlinkRM2-7-34.ini
Neither has any effect. This is the last part in getting this plugin to work so I'm really frustrated I'm probably missing something obvious!
Anyone have any thoughts how I can fix/diagnose this?
Thanks so much.
Here are the log lines when I invoke a button press: from the logs, you'd think it was working, but the RM2 never receives it (it doesn't light up, for example...)
2017-07-18 01:18:30.608 User: Admin initiated a switch command (192/BroadlinkRM2 Unit 1 - 7-34 Sort in order Fan On/Speed/On)
2017-07-18 01:18:30.658 (BroadlinkRM2 Lounge) Code Sent....
2017-07-18 01:18:30.658 (BroadlinkRM2 Lounge) Command line : "/home/pi/domoticz/plugins/BroadlinkRM2/plugin_send.py" /home/pi/domoticz/plugins/BroadlinkRM2/ini/BroadlinkRM2-7-34.ini
2017-07-18 01:18:30.658 (BroadlinkRM2 Unit 1 - 7-34 Sort in order Fan On/Speed) Updating device from 1:'On-9' to have values 1:'On-10'.
2017-07-18 01:18:30.673 (BroadlinkRM2 Lounge) Update 1:'On-10' (BroadlinkRM2 Unit 1 - 7-34 Sort in order Fan On/Speed)
2017-07-18 01:18:30.674 (BroadlinkRM2 Lounge) Calling message handler 'onCommand'.
2017-07-18 01:18:30.674 (BroadlinkRM2 Lounge) onCommand called for Unit 34: Parameter 'On', Level: 0 , Connected : True
2017-07-18 01:18:30.674 (BroadlinkRM2 Lounge) Generate on Command for learned code stored on unit :34
2017-07-18 01:18:30.679 (BroadlinkRM2 Lounge) Code loaded : 26009600124113403c173c16124113403c173c17124112403d163c173c1711413d161241134012413c163c173c1712413c17120002da134013403b183c17124013403c173c17124013403c173d163b1811413d161340134012413c173c163c1713403b18120002da134012413c183b17124013403c173c17114212403d163d163b1811423c161241134013403b183b173c1712413b1812000d050000
2017-07-18 01:18:30.740 (BroadlinkRM2 Lounge) Connected to Broadlink device.
2017-07-18 01:18:30.741 (BroadlinkRM2 Lounge) b'&\x00\x96\x00\x12A\x13@<\x17<\x16\x12A\x13@<\x17<\x17\x12A\x12@=\x16<\x17<\x17\x11A=\x16\x12A\x13@\x12A<\x16<\x17<\x17\x12A<\x17\x12\x00\x02\xda\x13@\x13@;\x18<\x17\x12@\x13@<\x17<\x17\x12@\x13@<\x17=\x16;\x18\x11A=\x16\x13@\x13@\x12A<\x17<\x16<\x17\x13@;\x18\x12\x00\x02\xda\x13@\x12A<\x18;\x17\x12@\x13@<\x17<\x17\x11B\x12@=\x16=\x16;\x18\x11B<\x16\x12A\x13@\x13@;\x18;\x17<\x17\x12A;\x18\x12\x00\r\x05\x00\x00'
2017-07-18 01:18:31.453 (BroadlinkRM2 Lounge) Code Sent....
2017-07-18 01:18:31.453 (BroadlinkRM2 Lounge) Command line : "/home/pi/domoticz/plugins/BroadlinkRM2/plugin_send.py" /home/pi/domoticz/plugins/BroadlinkRM2/ini/BroadlinkRM2-7-34.ini
2017-07-18 01:18:31.454 (BroadlinkRM2 Unit 1 - 7-34 Sort in order Fan On/Speed) Updating device from 1:'On-10' to have values 1:'On-11'.
Re: Python Plugin: Broadlink RM2 V3
Posted: Saturday 22 July 2017 22:45
by michaldobrotka
Hi Guys,
I made new installation of domoticz on Rpi after instant crashing last weeks. For few days I was testing with all my hardware and its now stable. Now Im trying to install the most important thing and Im desperate.
I installed Python 3.4.2. and everything was running as should. Than I installed Broadlink
Code: Select all
sudo pip3 install Crypto
sudo pip3 install broadlink
sudo pip3 install pyaes
sudo cp -r /usr/local/lib/python3.4/dist-packages/Crypto/ /usr/lib/python3.4/
sudo cp -r /usr/local/lib/python3.4/dist-packages/broadlink /usr/lib/python3.4/
and copied files into domoticz/plugins/BroadlinkRM2
Code: Select all
plugin_send.py
plugin_send.cmd
plugin_http.py
plugin_http.cmd
after reboot i cant connect to domoticz via browser at all
When Im runnig domoticz via ssh ./domoticz, it starts to load everything till it comes to Broadlink version 3.0.0 and its over.
I tried everything what I could find on forum but no effect
Code: Select all
cd /home/pi
sudo rm -r /usr/local/lib/python3.4/dist-packages/broadlink*
git clone https://github.com/mjg59/python-broadlink
sudo pip3 install python-broadlink/
sudo cp -r /usr/local/lib/python3.4/dist-packages/broadlink /usr/lib/python3.4/
sudo systemctl restart domoticz.service
As soon I rename plugin.py in domoticz/plugins folder domoticz is running wit error message
Code: Select all
2017-07-22 22:26:00.252 Error: (BroadlinkRM2) failed to load 'plugin.py', Python Path used was ':/usr/lib/python3.4/:/usr/lib/python3.4/plat-arm-linux-gnueabihf:/usr/lib/python3.4/lib-dynload'.
2017-07-22 22:26:00.252 Error: (Broadlink) Module Import failed, exception: 'ImportError'
2017-07-22 22:26:00.252 Error: (Broadlink) Module Import failed: ' Name: plugin'
2017-07-22 22:27:00.501 Error: Broadlink hardware (13) thread seems to have ended unexpectedly
Can someone help me please?
Re: Python Plugin: Broadlink RM2 V3
Posted: Sunday 23 July 2017 1:11
by zak45
@michaldobrotka
you have installed pyaes
do you have also copy it ???
sudo cp -r /usr/local/lib/python3.4/dist-packages/pyaes/ /usr/lib/python3.4/
FYI: you need only Crypto or pyaes, both are not necessary on v3
Re: Python Plugin: Broadlink RM2 V3
Posted: Sunday 23 July 2017 8:53
by michaldobrotka
HI @zak45
Thanks for your respond,
I just copied it but no change, after that i uninstalled Crypto but still same error.
Re: Python Plugin: Broadlink RM2 V3
Posted: Tuesday 25 July 2017 6:24
by michaldobrotka
Hi @zak45,
Yesterday after I updated to latest beta I tried It again. I was able to run the plugin, even to configure Broadlink device, and I added one remote command for test. I restarted device and no error occurred. I went to bed. This morning I checked Domoticz and it was down again. It lasted not even one hour running.
Re: Python Plugin: Broadlink RM2 V3
Posted: Tuesday 25 July 2017 9:42
by Paint
I couldn't get this to work on my rpi - i am currently trying to see if python 3.6.2 compiled from source will help.
While waiting forever for it to compile, I moved my Domoticz installation to a different machine (24c xeon running Ubuntu 16.04 lts) and it is working perfectly. Thank you so much, @zak45
I basically used your import functionality and learn mode to map my AC remote in excel and then wrote a quick vba script to create the ini files. I tested them in the CLI and it worked.
Last step is to write the lua to combine the AC Setpoint value with a selector switch (e.g. Off, ac fan low, ac fan high, fan only med) to trigger the right IR command.
Is there anyway to so multiple IR commands in one INI file?
Sent from my SM-G955U using Tapatalk
Re: Python Plugin: Broadlink RM2 V3
Posted: Wednesday 26 July 2017 8:48
by jackslayter
Hi,
I have a problem with plugin_send.py in standalone
Code: Select all
Traceback (most recent call last):
File "domoticz/plugins/Broadlink/plugin_send.py", line 15, in <module>
import configparser
ImportError: No module named configparser
Code: Select all
pip install configparser
Requirement already satisfied: configparser in /usr/local/lib/python3.4/dist-packages
thank you
Re: Python Plugin: Broadlink RM2 V3
Posted: Wednesday 26 July 2017 14:56
by Paint
jackslayter wrote:Hi,
I have a problem with plugin_send.py in standalone
Code: Select all
Traceback (most recent call last):
File "domoticz/plugins/Broadlink/plugin_send.py", line 15, in <module>
import configparser
ImportError: No module named configparser
Code: Select all
pip install configparser
Requirement already satisfied: configparser in /usr/local/lib/python3.4/dist-packages
thank you
can you try the command below?
Re: Python Plugin: Broadlink RM2 V3
Posted: Wednesday 26 July 2017 14:59
by michaldobrotka
Yesterday I uninstalled broadlink and pyaes and installed all new.
Added Broadlink in hardware an recorded some commands. Everything was working just fine, no errors, no delays, no cpu increase until I restarted domoticz. Then again no connection to system via browser.
Is someone who installed broadlink recently on raspi got it working on python 3.4.2?
Thanks
Re: Python Plugin: Broadlink RM2 V3
Posted: Wednesday 26 July 2017 15:33
by jackslayter
Paint wrote:jackslayter wrote:Hi,
I have a problem with plugin_send.py in standalone
Code: Select all
Traceback (most recent call last):
File "domoticz/plugins/Broadlink/plugin_send.py", line 15, in <module>
import configparser
ImportError: No module named configparser
Code: Select all
pip install configparser
Requirement already satisfied: configparser in /usr/local/lib/python3.4/dist-packages
thank you
can you try the command below?
yes at first
Re: Python Plugin: Broadlink RM2 V3
Posted: Wednesday 26 July 2017 15:50
by Paint
michaldobrotka wrote:Yesterday I uninstalled broadlink and pyaes and installed all new.
Added Broadlink in hardware an recorded some commands. Everything was working just fine, no errors, no delays, no cpu increase until I restarted domoticz. Then again no connection to system via browser.
Is someone who installed broadlink recently on raspi got it working on python 3.4.2?
Thanks
try using it on V3.5 or greater of Python. For RPI, you will need to manually compile it.
You can also try making the following change to the plugin.py, as per the wiki:
developer info
this code : learnedCommand=str(ir_packet.hex()) is pecific to python 3.5 or >, not work on 3.4
replaced by : learnedCommand=str(codecs.encode(ir_packet, 'hex_codec')) ( & import codecs ) to have it running in 3.x
Re: Python Plugin: Broadlink RM2 V3
Posted: Thursday 27 July 2017 10:45
by jackslayter
Hi,
it's possible to learn code in standalone, like send ?
thx
Re: Python Plugin: Broadlink RM2 V3
Posted: Thursday 27 July 2017 11:52
by Paint
At the moment, all learning has to be done via the broadlink import process or via the widget the plugin creates
Sent from my SM-G955U using Tapatalk
Re: Python Plugin: Broadlink RM2 V3
Posted: Saturday 29 July 2017 11:50
by petzno
My domoticz is crashing and going to offline several times a day after ensbling this plugin. This is the last message in the log before it happens:
2017-07-29 11:10:17.238 Error: (Broadlink) Error getting temperature data from Broadlink device....Timeout
Re: Python Plugin: Broadlink RM2 V3
Posted: Saturday 29 July 2017 18:29
by Paint
petzno wrote:My domoticz is crashing and going to offline several times a day after ensbling this plugin. This is the last message in the log before it happens:
2017-07-29 11:10:17.238 Error: (Broadlink) Error getting temperature data from Broadlink device....Timeout
Disable the temp sensor on the hardware page in domoticz.
Sent from my SM-G955U using Tapatalk
Re: Python Plugin: Broadlink RM2 V3
Posted: Saturday 29 July 2017 20:33
by petzno
Paint wrote:Disable the temp sensor on the hardware page in domoticz.
Sent from my SM-G955U using Tapatalk
Actually the temp sensor was the main reason I added the plugin, to get the indoor temp.
Re: Python Plugin: Broadlink RM2 V3
Posted: Saturday 29 July 2017 21:34
by Paint
petzno wrote:Paint wrote:Disable the temp sensor on the hardware page in domoticz.
Sent from my SM-G955U using Tapatalk
Actually the temp sensor was the main reason I added the plugin, to get the indoor temp.
From my experience, the rm pro temp sensor is the only one that is accurate...and it's not that accurate.
Sent from my SM-G955U using Tapatalk