Python Plugin : Broadlink RM2 V4

Python and python framework

Moderator: leecollings

Post Reply
matzeb74
Posts: 49
Joined: Sunday 07 January 2018 19:23
Target OS: Raspberry Pi / ODroid
Domoticz version: newest
Location: Stuttgart
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by matzeb74 »

Hey @yoshida Did you get it work? I just have the same Problem.
yoshida
Posts: 4
Joined: Wednesday 21 February 2018 10:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by yoshida »

Hi, not yet :(

I have just installed 3.4 python, and set it as default with this article:

https://linuxconfig.org/how-to-change-f ... bian-linux

but the crash is the same. Now realized that probably the default python was 2.7, and I have now tried 3.4, but maybe 3.5 was not yet tried :)

So will try now the 3.5 as well.

One thing I do not understand in the wiki is:

"NOTA: the cmd/script to execute plugin_http.py need to be done in the way to not block Domoticz plugin system. This is the case for the windows version provided, for other OS this should be something like that : nohup python /path/to/plugin/plugin_http.py $1 $2 $3 &"
yoshida
Posts: 4
Joined: Wednesday 21 February 2018 10:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by yoshida »

set to 3.5, and still Domoticz crashes :( (so originally it was 2.7, than set to 3.4, and now tried with 3.5, reboots were done between)
matzeb74
Posts: 49
Joined: Sunday 07 January 2018 19:23
Target OS: Raspberry Pi / ODroid
Domoticz version: newest
Location: Stuttgart
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by matzeb74 »

Maybe the programmer of the Plug-in can help...
matzeb74
Posts: 49
Joined: Sunday 07 January 2018 19:23
Target OS: Raspberry Pi / ODroid
Domoticz version: newest
Location: Stuttgart
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by matzeb74 »

Im also wondering why only 2 ppl has so big Problems with python and the others not.

At the Moment i Copy the Files into the Plugins folder my domoticz Crashes. But why?

Maybe not a Python Problem, but a rights Problem?
mxg10011
Posts: 5
Joined: Monday 19 February 2018 23:43
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by mxg10011 »

Hi again from my side :)

because I wanted to use aurora theme I installed the latest beta release of domoticz (3.8944).
With my Backup (stable version) I have no problem with the broadlink plugin.

Within the beta release i tried to include the plugin as well like I did it in the stable version.

The problem is that i can't see the Broadlink hardware...

When I backup my stable version everything is fine... Any ideas what is wrong?
hardware_dm.png
hardware_dm.png (35.55 KiB) Viewed 3882 times
broadlink_plugin.JPG
broadlink_plugin.JPG (81.6 KiB) Viewed 3882 times
matzeb74
Posts: 49
Joined: Sunday 07 January 2018 19:23
Target OS: Raspberry Pi / ODroid
Domoticz version: newest
Location: Stuttgart
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by matzeb74 »

Again me.

I now reinstalled Crypto, pyaes, broadlink, i changed between Python 2.7 to 3.5. Ich edited plugin_http.sh so that it fits to my path, i tried all i can but nothing.

If i copy the Pluginfiles to Pluginfolder and restart domoticz everything is ok.

Just in the moment i add Broadlink as new Hardware in domoticz, my domoticz exited. If i only remove the plugin.py from the Pluginfolder and restart then again everything is fine.

What must i do to get this running with domoticz?

Domoticz running on rpi3.
python 2.7, 3.4 and 3.5 are present.

Operating System: Raspbian GNU/Linux 9 (stretch)
Kernel: Linux 4.9.59-v7+
mxg10011
Posts: 5
Joined: Monday 19 February 2018 23:43
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by mxg10011 »

matzeb74 wrote: Saturday 24 February 2018 14:12 Again me.

I now reinstalled Crypto, pyaes, broadlink, i changed between Python 2.7 to 3.5. Ich edited plugin_http.sh so that it fits to my path, i tried all i can but nothing.

If i copy the Pluginfiles to Pluginfolder and restart domoticz everything is ok.

Just in the moment i add Broadlink as new Hardware in domoticz, my domoticz exited. If i only remove the plugin.py from the Pluginfolder and restart then again everything is fine.

What must i do to get this running with domoticz?

Domoticz running on rpi3.
python 2.7, 3.4 and 3.5 are present.

Operating System: Raspbian GNU/Linux 9 (stretch)
Kernel: Linux 4.9.59-v7+
Same problem here... but only with beta release of domoticz...

Tested with beta Version: 3.8944 -> same issue
Tested with release Version: 3.815 -> no problem with RM plugin

--raspi3 --python3.5
matzeb74
Posts: 49
Joined: Sunday 07 January 2018 19:23
Target OS: Raspberry Pi / ODroid
Domoticz version: newest
Location: Stuttgart
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by matzeb74 »

I have the Problem with latest stable and latest beta.
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 »

You can find some information here :
viewtopic.php?f=6&t=22012

Another way to investigate is to compile Domoticz from source and not use pre-compiled version.
matzeb74
Posts: 49
Joined: Sunday 07 January 2018 19:23
Target OS: Raspberry Pi / ODroid
Domoticz version: newest
Location: Stuttgart
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by matzeb74 »

I think i got it now. And what should i say? It was a rights Problem on my Rpi. raspbian installed as user pi, domoticz as user domoticz, all stuff what need sudo to work is user root. So there is one of the biggest problem. Also my domoticz only starts with sudo, every folder and file generated by domoticz has only root rights.
So i changed owner and rights and now the Plugin works.

Only one issue left, on http my Hardwarepage is empty, on https the hardwarepage works perfect.


Now im working on my imported remotes. I have 2 RF remotes with 4 on and 4off Buttons. In the smartphone app its shown as one remote. But after import i have 16 single switches in domoticz, all work as Power on. That works, but its not so nice.

Is there any way to tell domoticz wich switches have to work together as on/off switch?
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 »

matzeb74 wrote: Sunday 25 February 2018 12:05 I think i got it now. And what should i say? It was a rights Problem on my Rpi. raspbian installed as user pi, domoticz as user domoticz, all stuff what need sudo to work is user root. So there is one of the biggest problem. Also my domoticz only starts with sudo, every folder and file generated by domoticz has only root rights.
So i changed owner and rights and now the Plugin works.

Only one issue left, on http my Hardwarepage is empty, on https the hardwarepage works perfect.


Now im working on my imported remotes. I have 2 RF remotes with 4 on and 4off Buttons. In the smartphone app its shown as one remote. But after import i have 16 single switches in domoticz, all work as Power on. That works, but its not so nice.

Is there any way to tell domoticz wich switches have to work together as on/off switch?
see this :
viewtopic.php?f=65&t=21645&start=60#p172048
mxg10011
Posts: 5
Joined: Monday 19 February 2018 23:43
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by mxg10011 »

zak45 wrote: Wednesday 21 February 2018 17:45
mxg10011 wrote: Monday 19 February 2018 23:55 Is it possible to define a virtual switch and use "On action" to send the "ON" command and "Off action" to send the "OFF" command of my light?
If yes, i need two scripts right? But what needs to be the content of the script? Which function do I have to call and which parameters have to be filled?

Can you give me some help? I am really struggling with it :?
Plugin provide command line feature (put on debug mode to have full path/command)
you can define a virtual switch (dummy hardware) and put on the ON& OFF the command line to execute
something like that:
Capture.JPG
It does not work like that. The plugin_send is a python script.
I found out that script:// points to /home/pi/domoticz/scripts

If I use "script://home/pi/domoticz/plugins/BroadlinkRM2/plugin_send.py" the log shows the following path trying to run the plugin_send.py:
/home/pi/domoticz/scripts/home/pi/domoticz/plugins/BroadlinkRM2/plugin_send.py

Maybe I do something wrong but I found a workaround.

I created a python script located in /home/pi/domoticz/scripts/python/MyScripts called e.g. light_on.py
Inside used the following code:

Code: Select all

#!/usr/bin/python3.5

import os

os.system('python3.5 /home/pi/domoticz/plugins/BroadlinkRM2/plugin_send.py /home/pi/domoticz/plugins/BroadlinkRM2/BroadlinkINI/BroadlinkRM2-2-2.ini')
os.system('python3.5 /home/pi/domoticz/plugins/BroadlinkRM2/plugin_send.py /home/pi/domoticz/plugins/BroadlinkRM2/BroadlinkINI/BroadlinkRM2-2-12.ini')
For the on command of a virtual switch I use the following command now:

Code: Select all

script://python/MyScripts/light_on.py
At least it works great now :)
yoshida
Posts: 4
Joined: Wednesday 21 February 2018 10:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by yoshida »

matzeb74 wrote: Sunday 25 February 2018 12:05 So i changed owner and rights and now the Plugin works.
Great to hear, but can you please specify, which folders/files did you adjust the rights?
I have also started to play with domoticz\plugins folder, also with the BroadlinkRM2 folder, and sub items, but I still have only crash..

Thanks!
matzeb74
Posts: 49
Joined: Sunday 07 January 2018 19:23
Target OS: Raspberry Pi / ODroid
Domoticz version: newest
Location: Stuttgart
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by matzeb74 »

yoshida wrote: Sunday 25 February 2018 20:33
matzeb74 wrote: Sunday 25 February 2018 12:05 So i changed owner and rights and now the Plugin works.
Great to hear, but can you please specify, which folders/files did you adjust the rights?
I have also started to play with domoticz\plugins folder, also with the BroadlinkRM2 folder, and sub items, but I still have only crash..

Thanks!
I Changed everything in domoticz scripts and plugins to owner domoticz and gave 755 and /plugins/BroadlinkRM2/ i gave 777
mxg10011 wrote: Sunday 25 February 2018 17:05

Maybe I do something wrong but I found a workaround.

I created a python script located in /home/pi/domoticz/scripts/python/MyScripts called e.g. light_on.py
Inside used the following code:

Code: Select all

#!/usr/bin/python3.5

import os

os.system('python3.5 /home/pi/domoticz/plugins/BroadlinkRM2/plugin_send.py /home/pi/domoticz/plugins/BroadlinkRM2/BroadlinkINI/BroadlinkRM2-2-2.ini')
os.system('python3.5 /home/pi/domoticz/plugins/BroadlinkRM2/plugin_send.py /home/pi/domoticz/plugins/BroadlinkRM2/BroadlinkINI/BroadlinkRM2-2-12.ini')
For the on command of a virtual switch I use the following command now:

Code: Select all

script://python/MyScripts/light_on.py
At least it works great now :)
Thanks for that. This works for me too
CLEMENT99
Posts: 36
Joined: Friday 26 January 2018 9:18
Target OS: Windows
Domoticz version: BETA
Location: Brussels
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by CLEMENT99 »

Does not work for me. As soon as a make the BroadlinkRM2 plugin available, domoticz stops to work after 3 seconds (last beta version)
If I type the following: python --version, I get Python 3.5.3
I tried to change to 3.4.4 but without success :cry:
I tried to reinstall the plugin but without success :evil:

If I go back to a stable version, everything works !
The problem is that I need the beta version for my xiaomi devices :cry:
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 »

CLEMENT99 wrote: Wednesday 28 February 2018 11:44 Does not work for me. As soon as a make the BroadlinkRM2 plugin available, domoticz stops to work after 3 seconds (last beta version)
If I type the following: python --version, I get Python 3.5.3
I tried to change to 3.4.4 but without success :cry:
I tried to reinstall the plugin but without success :evil:

If I go back to a stable version, everything works !
The problem is that I need the beta version for my xiaomi devices :cry:
try to compile from source.
CLEMENT99
Posts: 36
Joined: Friday 26 January 2018 9:18
Target OS: Windows
Domoticz version: BETA
Location: Brussels
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by CLEMENT99 »

zak45 wrote: Wednesday 28 February 2018 14:29 try to compile from source.
Perhaps but I don't understand why it does not run in the beta version but well with the stable version. I did a updaterelease and now it works except some of my xiaomi devices :(
... and this only on my Pi because I have the last domoticz beta running under win10 without problem.
matzeb74
Posts: 49
Joined: Sunday 07 January 2018 19:23
Target OS: Raspberry Pi / ODroid
Domoticz version: newest
Location: Stuttgart
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by matzeb74 »

Clement, i think its only a rights Problem...
CLEMENT99
Posts: 36
Joined: Friday 26 January 2018 9:18
Target OS: Windows
Domoticz version: BETA
Location: Brussels
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by CLEMENT99 »

matzeb74 wrote: Thursday 01 March 2018 22:17 Clement, i think its only a rights Problem...
Well I saw your last post and I'm checking the rights. User domoticz does not exist. For the scripts owner-> pi and mod: 755, plugins -> owner: pi and mod:777
Still not working.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest