Page 5 of 33

Re: Python Plugin : Broadlink RM2 V4

Posted: Friday 23 February 2018 14:37
by matzeb74
Hey @yoshida Did you get it work? I just have the same Problem.

Re: Python Plugin : Broadlink RM2 V4

Posted: Friday 23 February 2018 16:19
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 &"

Re: Python Plugin : Broadlink RM2 V4

Posted: Friday 23 February 2018 16:35
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)

Re: Python Plugin : Broadlink RM2 V4

Posted: Friday 23 February 2018 21:38
by matzeb74
Maybe the programmer of the Plug-in can help...

Re: Python Plugin : Broadlink RM2 V4

Posted: Saturday 24 February 2018 1:14
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?

Re: Python Plugin : Broadlink RM2 V4

Posted: Saturday 24 February 2018 13:54
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 3889 times
broadlink_plugin.JPG
broadlink_plugin.JPG (81.6 KiB) Viewed 3889 times

Re: Python Plugin : Broadlink RM2 V4

Posted: Saturday 24 February 2018 14:12
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+

Re: Python Plugin : Broadlink RM2 V4

Posted: Saturday 24 February 2018 22:59
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

Re: Python Plugin : Broadlink RM2 V4

Posted: Saturday 24 February 2018 23:15
by matzeb74
I have the Problem with latest stable and latest beta.

Re: Python Plugin : Broadlink RM2 V4

Posted: Sunday 25 February 2018 1:31
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.

Re: Python Plugin : Broadlink RM2 V4

Posted: Sunday 25 February 2018 12:05
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?

Re: Python Plugin : Broadlink RM2 V4

Posted: Sunday 25 February 2018 14:11
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

Re: Python Plugin : Broadlink RM2 V4

Posted: Sunday 25 February 2018 17:05
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 :)

Re: Python Plugin : Broadlink RM2 V4

Posted: Sunday 25 February 2018 20:33
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!

Re: Python Plugin : Broadlink RM2 V4

Posted: Sunday 25 February 2018 23:04
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

Re: Python Plugin : Broadlink RM2 V4

Posted: Wednesday 28 February 2018 11:44
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:

Re: Python Plugin : Broadlink RM2 V4

Posted: Wednesday 28 February 2018 14:29
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.

Re: Python Plugin : Broadlink RM2 V4

Posted: Thursday 01 March 2018 9:40
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.

Re: Python Plugin : Broadlink RM2 V4

Posted: Thursday 01 March 2018 22:17
by matzeb74
Clement, i think its only a rights Problem...

Re: Python Plugin : Broadlink RM2 V4

Posted: Friday 02 March 2018 0:51
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.