Python Plugin : Broadlink

Python and python framework

Moderator: leecollings

Post Reply
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 »

Hogis wrote: Sunday 26 July 2020 17:06 "0x2712 192.168.0.10 780f771852b7" and "Found 0 devices --2020-07-26 17:03:15"
0x2712 is the default device type, work with most of the RM2 devices, but as you know, exceptions always exist !!
Run the discovery from terminal, we need to find/know the device type.
Hogis
Posts: 12
Joined: Wednesday 01 July 2020 19:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by Hogis »

zak45 wrote: Sunday 26 July 2020 19:01
Hogis wrote: Sunday 26 July 2020 17:06 "0x2712 192.168.0.10 780f771852b7" and "Found 0 devices --2020-07-26 17:03:15"
0x2712 is the default device type, work with most of the RM2 devices, but as you know, exceptions always exist !!
Run the discovery from terminal, we need to find/know the device type.
I get nothing. When i run discovery from terminal it just says: Discovering... and nothing more.
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 »

Hogis wrote: Monday 27 July 2020 3:59 I get nothing. When i run discovery from terminal it just says: Discovering... and nothing more.
So, you probably need to verify your network settings, like pi-hole / firewall or others ....
Romel
Posts: 15
Joined: Tuesday 06 August 2019 14:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Kromeriz / Czech
Contact:

Re: Python Plugin : Broadlink

Post by Romel »

zak45 wrote: Saturday 25 July 2020 12:49
Romel wrote: Friday 24 July 2020 20:33

Code: Select all

Checking installation ....
----------------------------------------
Successfully imported googletrans
Error importing translate
Can you do this :
sudo -H python -m pip install translate

and

sudo pip list

ans show the output ?
pi@raspberrypi:~ $ sudo -H python -m pip install translate
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: translate in /usr/local/lib/python3.7/dist-packages (3.5.0)
Requirement already satisfied: tox in /usr/local/lib/python3.7/dist-packages (from translate) (3.17.1)
Requirement already satisfied: pre-commit in /usr/local/lib/python3.7/dist-packages (from translate) (2.6.0)
Requirement already satisfied: lxml in /usr/local/lib/python3.7/dist-packages (from translate) (4.5.2)
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (from translate) (2.21.0)
Requirement already satisfied: click in /usr/local/lib/python3.7/dist-packages (from translate) (6.7)
Requirement already satisfied: pluggy>=0.12.0 in /usr/local/lib/python3.7/dist-packages (from tox->translate) (0.13.1)
Requirement already satisfied: py>=1.4.17 in /usr/local/lib/python3.7/dist-packages (from tox->translate) (1.9.0)
Requirement already satisfied: toml>=0.9.4 in /usr/local/lib/python3.7/dist-packages (from tox->translate) (0.10.1)
Requirement already satisfied: six>=1.14.0 in /usr/local/lib/python3.7/dist-packages (from tox->translate) (1.15.0)
Requirement already satisfied: virtualenv!=20.0.0,!=20.0.1,!=20.0.2,!=20.0.3,!=20.0.4,!=20.0.5,!=20.0.6,!=20.0.7,>=16.0.0 in /usr/local/lib/python3.7/dist-packages (from tox->translate) (20.0.26)
Requirement already satisfied: filelock>=3.0.0 in /usr/local/lib/python3.7/dist-packages (from tox->translate) (3.0.12)
Requirement already satisfied: importlib-metadata<2,>=0.12; python_version < "3.8" in /usr/local/lib/python3.7/dist-packages (from tox->translate) (1.7.0)
Requirement already satisfied: packaging>=14 in /usr/local/lib/python3.7/dist-packages (from tox->translate) (20.4)
Requirement already satisfied: identify>=1.0.0 in /usr/local/lib/python3.7/dist-packages (from pre-commit->translate) (1.4.23)
Requirement already satisfied: cfgv>=2.0.0 in /usr/local/lib/python3.7/dist-packages (from pre-commit->translate) (3.1.0)
Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.7/dist-packages (from pre-commit->translate) (5.3.1)
Requirement already satisfied: nodeenv>=0.11.1 in /usr/local/lib/python3.7/dist-packages (from pre-commit->translate) (1.4.0)
Requirement already satisfied: distlib<1,>=0.3.1 in /usr/local/lib/python3.7/dist-packages (from virtualenv!=20.0.0,!=20.0.1,!=20.0.2,!=20.0.3,!=20.0.4,!=20.0.5,!=20.0.6,!=20.0.7,>=16.0.0->tox->translate) (0.3.1)
Requirement already satisfied: appdirs<2,>=1.4.3 in /usr/local/lib/python3.7/dist-packages (from virtualenv!=20.0.0,!=20.0.1,!=20.0.2,!=20.0.3,!=20.0.4,!=20.0.5,!=20.0.6,!=20.0.7,>=16.0.0->tox->translate) (1.4.4)
Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.7/dist-packages (from importlib-metadata<2,>=0.12; python_version < "3.8"->tox->translate) (3.1.0)
Requirement already satisfied: pyparsing>=2.0.2 in /usr/local/lib/python3.7/dist-packages (from packaging>=14->tox->translate) (2.4.7)
pi@raspberrypi:~ $ sudo pip list
sudo: pip: command not found
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 »

Romel wrote: Monday 27 July 2020 15:22 pi@raspberrypi:~ $ sudo pip list
sudo: pip: command not found
I'm not linux specialist, but looks like pip not installed...
maybe try this :
sudo apt-get install python3-pip
Romel
Posts: 15
Joined: Tuesday 06 August 2019 14:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Kromeriz / Czech
Contact:

Re: Python Plugin : Broadlink

Post by Romel »

zak45 wrote: Monday 27 July 2020 15:39
Romel wrote: Monday 27 July 2020 15:22 pi@raspberrypi:~ $ sudo pip list
sudo: pip: command not found
I'm not linux specialist, but looks like pip not installed...
maybe try this :
sudo apt-get install python3-pip
hmm seems like problem with linking...

Code: Select all

pi@raspberrypi:~ $ sudo apt-get install python3-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-pip is already the newest version (18.1-5+rpt1).
The following packages were automatically installed and are no longer required:
  attr flashrom ibverbs-providers libarchive13 libavahi-client3 libboost-atomic1.67.0 libboost-iostreams1.67.0 libboost-regex1.67.0 libboost-system1.67.0
  libboost-thread1.67.0 libcephfs2 libcups2 libftdi1-2 libgfapi0 libgfrpc0 libgfxdr0 libglusterfs0 libgpgme11 libibverbs1 libjansson4 libldb1 libnspr4 libnss3
  libpython-dev libpython-stdlib libpython2-dev libpython2.7-dev librados2 libtdb1 libtevent0 python2-dev python2.7-dev samba-common tdb-tools
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Code: Select all

sudo -H python3 -m pip install translate
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: translate in /usr/local/lib/python3.7/dist-packages (3.5.0)
Requirement already satisfied: pre-commit in /usr/local/lib/python3.7/dist-packages (from translate) (2.6.0)
Requirement already satisfied: click in /usr/local/lib/python3.7/dist-packages (from translate) (6.7)
Requirement already satisfied: tox in /usr/local/lib/python3.7/dist-packages (from translate) (3.17.1)
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (from translate) (2.21.0)
Requirement already satisfied: lxml in /usr/local/lib/python3.7/dist-packages (from translate) (4.5.2)
Requirement already satisfied: toml in /usr/local/lib/python3.7/dist-packages (from pre-commit->translate) (0.10.1)
Requirement already satisfied: identify>=1.0.0 in /usr/local/lib/python3.7/dist-packages (from pre-commit->translate) (1.4.23)
Requirement already satisfied: importlib-metadata; python_version < "3.8" in /usr/local/lib/python3.7/dist-packages (from pre-commit->translate) (1.7.0)
Requirement already satisfied: cfgv>=2.0.0 in /usr/local/lib/python3.7/dist-packages (from pre-commit->translate) (3.1.0)
Requirement already satisfied: nodeenv>=0.11.1 in /usr/local/lib/python3.7/dist-packages (from pre-commit->translate) (1.4.0)
Requirement already satisfied: virtualenv>=20.0.8 in /usr/local/lib/python3.7/dist-packages (from pre-commit->translate) (20.0.26)
Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.7/dist-packages (from pre-commit->translate) (5.3.1)
Requirement already satisfied: packaging>=14 in /usr/local/lib/python3.7/dist-packages (from tox->translate) (20.4)
Requirement already satisfied: pluggy>=0.12.0 in /usr/local/lib/python3.7/dist-packages (from tox->translate) (0.13.1)
Requirement already satisfied: py>=1.4.17 in /usr/local/lib/python3.7/dist-packages (from tox->translate) (1.9.0)
Requirement already satisfied: six>=1.14.0 in /usr/local/lib/python3.7/dist-packages (from tox->translate) (1.15.0)
Requirement already satisfied: filelock>=3.0.0 in /usr/local/lib/python3.7/dist-packages (from tox->translate) (3.0.12)
Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.7/dist-packages (from importlib-metadata; python_version < "3.8"->pre-commit->translate) (3.1.0)
Requirement already satisfied: appdirs<2,>=1.4.3 in /usr/local/lib/python3.7/dist-packages (from virtualenv>=20.0.8->pre-commit->translate) (1.4.4)
Requirement already satisfied: distlib<1,>=0.3.1 in /usr/local/lib/python3.7/dist-packages (from virtualenv>=20.0.8->pre-commit->translate) (0.3.1)
Requirement already satisfied: pyparsing>=2.0.2 in /usr/local/lib/python3.7/dist-packages (from packaging>=14->tox->translate) (2.4.7)
Hogis
Posts: 12
Joined: Wednesday 01 July 2020 19:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by Hogis »

zak45 wrote: Monday 27 July 2020 11:46
Hogis wrote: Monday 27 July 2020 3:59 I get nothing. When i run discovery from terminal it just says: Discovering... and nothing more.
So, you probably need to verify your network settings, like pi-hole / firewall or others ....
Well I don't have anything installed so I give this a rest now and come back when I got time for it, and You might have gotten some more development into it.
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 »

Hi,
Release 1.3.0 uploaded

# 1.3.0 : 04/08/2020
# module Broadlink v 0.14.1
# some code improvement
#
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 »

Hogis wrote: Sunday 02 August 2020 18:01
zak45 wrote: Monday 27 July 2020 11:46
Hogis wrote: Monday 27 July 2020 3:59 I get nothing. When i run discovery from terminal it just says: Discovering... and nothing more.
So, you probably need to verify your network settings, like pi-hole / firewall or others ....
Well I don't have anything installed so I give this a rest now and come back when I got time for it, and You might have gotten some more development into it.
the broadlink_discovery.py had no relation with the plugin and is part of the broadlink module.
My advice : Check your network settings, try the broadlink_cli.py, once the command line is working, go back to the plugin settings.
uname
Posts: 3
Joined: Wednesday 05 August 2020 13:16
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by uname »

Hi!

Please advise how to manage Broadlink SP3 from a computer running Ubuntu.
I just need to turn the socket on and off.
Preferably in a bash script.

Thanks!
marchutt
Posts: 12
Joined: Monday 06 July 2020 5:12
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Netherlands
Contact:

Re: Python Plugin : Broadlink

Post by marchutt »

I received today my Broadlink RM mini 3, and after a couple of hours reading and trying, i got it working with Domoticz :-)
I struggled with errors for the learning mode, and couldnt solved it.
I had setup the Broadlink in the hardware setting, with 'Remote Control mini RM2/3', but that didnt work.
But when i tried (after a few hours) the 'Remote Control mini RM4' setting, everything started to work without errors.

ps.
Question 1.. i have 2 multi switches 'Broadlink - Opdrachten', what is the difference betweeen those 2?

Question2.. What is the best pratice to use the created ini file in a switch ? (i use a Raspberry Pi)
edit..
I havent figured out yet how the ini file must work..
So the learning part goes great, ini files are written, but how then?
Tried everything the last hours and try to find any information about it, but cant find a way how to do it..
I hope someone have some advice about this..

edit 2..
After lot and lot of hours, i have it working :shock:
Used the wrong (rm3) code in my send commands..(seeing that after using broadlink_discovery..)
Now my fan is completly working with Domoticz, without any error or problem :D
The rest is piece of cake with this plugin.

Thanks and really great work zak45.
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 »

@marchutt
thanks for sharing ...

Some informations that could be usefull for you and others :

at first setup, default code is retreived depend of what device type you select on hardware page.
This should work for most devices but exceptions exist...
so, if the learning process do not work, do a 'network scan'.. this will retreive and display all Broadlink devices found on the network.
nscan.PNG
nscan.PNG (114.59 KiB) Viewed 2003 times
nscan2.PNG
nscan2.PNG (105.47 KiB) Viewed 2003 times
Take not of your device type and modify the default one.
overwrite.PNG
overwrite.PNG (76.58 KiB) Viewed 1954 times


Ini files are created by the plugin every time you had learned a code and clicked on save.
these files are used to store the learned code and some others informations.
You should include them in your backup procedure to be secure in case of system restoration/re-installation.
Last edited by zak45 on Saturday 08 August 2020 12:54, edited 1 time in total.
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 »

Hi,
new version uploaded:

# 1.4.0 : 06/08/2020
# display customname on manage()
# check if Jquery (& ui) loaded, if not load them (admin)
# use broadlink.get_devices() to have devices list
# implement iframeResizer for dynamic iframe resize (autoresize:True)
#
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 »

uname wrote: Wednesday 05 August 2020 15:43 Hi!

Please advise how to manage Broadlink SP3 from a computer running Ubuntu.
I just need to turn the socket on and off.
Preferably in a bash script.

Thanks!
You need python to be able to use this plugin.
Follow first post, and you should be able to manage your SP3 plug from Domoticz and you will have all tool to be able to manage it by bash too.
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 »

Hi,
New version:
# 1.4.1 : 07/08/2020
# added MyMemory link for translation (admin-language)
# added 'Scroll to top' feature
#
marchutt
Posts: 12
Joined: Monday 06 July 2020 5:12
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Netherlands
Contact:

Re: Python Plugin : Broadlink

Post by marchutt »

Hello zak45,
Thank you for the response.
First, all the problems i had with the plugin was mostly my own mistakes or misunderstanding. (couldnt find 'noob' information :? )
I'am a programmer in mostly php and js (and some other languages), but a real noob with python and linux. (just have Raspberry Pi for counple of weeks)

I have another button at my web admin page, that is chinese for me...
gegevens.png
gegevens.png (26.28 KiB) Viewed 1951 times
So when i started, i didnt use that button, but now when i use it, it gives alot of errors in my Domoticz log.
Spoiler: show
2020-08-08 12:42:48.135 Error: (Broadlink) Traceback (most recent call last):
2020-08-08 12:42:48.135 File "/home/pi/domoticz/plugins/Broadlink/plugin.py", line 1826, in check_temp
2020-08-08 12:42:48.135 TEMP = DEVICE.check_temperature()
2020-08-08 12:42:48.135 File "/usr/local/lib/python3.7/dist-packages/broadlink/__init__.py", line 705, in check_temperature
2020-08-08 12:42:48.135 data = self._check_sensors(0x24)
2020-08-08 12:42:48.135 File "/usr/local/lib/python3.7/dist-packages/broadlink/__init__.py", line 684, in _check_sensors
2020-08-08 12:42:48.135 check_error(response[0x22:0x24])
2020-08-08 12:42:48.135 File "/usr/local/lib/python3.7/dist-packages/broadlink/exceptions.py", line 97, in check_error
2020-08-08 12:42:48.135 raise exception(error_code)
2020-08-08 12:42:48.135 broadlink.exceptions.StorageError: The device storage is full
2020-08-08 12:42:48.135
2020-08-08 12:42:48.136 Error: (Broadlink) Fout bij ophalen van temperatuurgegevens van Broadlink-apparaat ... Time-out
2020-08-08 12:42:48.207 Error: (Broadlink) No transport, write directive to '192.168.178.10:56805' ignored.
2020-08-08 12:43:30.788 Error: (Broadlink) Traceback (most recent call last):
2020-08-08 12:43:30.788 File "/home/pi/domoticz/plugins/Broadlink/plugin.py", line 1826, in check_temp
2020-08-08 12:43:30.788 TEMP = DEVICE.check_temperature()
2020-08-08 12:43:30.788 File "/usr/local/lib/python3.7/dist-packages/broadlink/__init__.py", line 705, in check_temperature
2020-08-08 12:43:30.788 data = self._check_sensors(0x24)
2020-08-08 12:43:30.788 File "/usr/local/lib/python3.7/dist-packages/broadlink/__init__.py", line 684, in _check_sensors
2020-08-08 12:43:30.788 check_error(response[0x22:0x24])
2020-08-08 12:43:30.788 File "/usr/local/lib/python3.7/dist-packages/broadlink/exceptions.py", line 97, in check_error
2020-08-08 12:43:30.788 raise exception(error_code)
2020-08-08 12:43:30.788 broadlink.exceptions.StorageError: The device storage is full
2020-08-08 12:43:30.788
2020-08-08 12:43:30.788 Error: (Broadlink) Fout bij ophalen van temperatuurgegevens van Broadlink-apparaat ... Time-out
2020-08-08 12:47:45.709 Error: (Broadlink) Traceback (most recent call last):
2020-08-08 12:47:45.709 File "/home/pi/domoticz/plugins/Broadlink/plugin.py", line 1826, in check_temp
2020-08-08 12:47:45.709 TEMP = DEVICE.check_temperature()
2020-08-08 12:47:45.709 File "/usr/local/lib/python3.7/dist-packages/broadlink/__init__.py", line 705, in check_temperature
2020-08-08 12:47:45.709 data = self._check_sensors(0x24)
2020-08-08 12:47:45.709 File "/usr/local/lib/python3.7/dist-packages/broadlink/__init__.py", line 684, in _check_sensors
2020-08-08 12:47:45.709 check_error(response[0x22:0x24])
2020-08-08 12:47:45.709 File "/usr/local/lib/python3.7/dist-packages/broadlink/exceptions.py", line 97, in check_error
2020-08-08 12:47:45.709 raise exception(error_code)
2020-08-08 12:47:45.709 broadlink.exceptions.StorageError: The device storage is full
2020-08-08 12:47:45.709
2020-08-08 12:47:45.709 Error: (Broadlink) Fout bij ophalen van temperatuurgegevens van Broadlink-apparaat ... Time-out
2020-08-08 12:48:05.780 Error: (Broadlink) Traceback (most recent call last):
2020-08-08 12:48:05.780 File "/home/pi/domoticz/plugins/Broadlink/plugin.py", line 1826, in check_temp
2020-08-08 12:48:05.780 TEMP = DEVICE.check_temperature()
2020-08-08 12:48:05.780 File "/usr/local/lib/python3.7/dist-packages/broadlink/__init__.py", line 705, in check_temperature
2020-08-08 12:48:05.780 data = self._check_sensors(0x24)
2020-08-08 12:48:05.780 File "/usr/local/lib/python3.7/dist-packages/broadlink/__init__.py", line 684, in _check_sensors
2020-08-08 12:48:05.780 check_error(response[0x22:0x24])
2020-08-08 12:48:05.780 File "/usr/local/lib/python3.7/dist-packages/broadlink/exceptions.py", line 97, in check_error
2020-08-08 12:48:05.780 raise exception(error_code)
2020-08-08 12:48:05.780 broadlink.exceptions.StorageError: The device storage is full
The plugin is working perfect at this time, but has only to do with the lack of a temperature sensor at my RM mini 3 i think.
Instead of this button, i used the broadlink_discovery.py that gives me good information for the broadlink scripts/calls.
Spoiler: show
# broadlink_cli --type 0x5f36 --host 192.168.xxx.xx --mac xxxxxxxxxx
Device file data (to be used with --device @filename in broadlink_cli) :
0x5f36 192.168.xxx.xx xxxxxxxxxx
The update to my device is not working at the admin page when i do this like you said above.
After the update with this dialog, and restarting Domoticz nothing changed in admin page.
update.png
update.png (12.77 KiB) Viewed 1951 times
In the left top there is still the default? device information (Broadlink device : RM24M --- 0x51da)

But like i said, the plugin is now working without a problem or errors, and i had a nice learning curve within linux and python 8-)
Last edited by marchutt on Wednesday 12 August 2020 4:49, edited 2 times in total.
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 »

@marchutt
I have another button at my web admin page, that is chinese for me...
plugin use machine translation ... so fun things happen ;-)
you can modify that by editing your language file : 'network scan '
2020-08-08 12:42:48.135 broadlink.exceptions.StorageError: The device storage is full
this has been already discussed, see some posts before ...
The update to my device is not working at the admin pagem when i do this like you said above.
After the update with this dialog, and restarting Domoticz nothing changed in admin page.
Probably due to browser cache (try to open domoticz in private mode), if you take a look to the label of your device in the Web admin page, just after the few menu buttons, you should see : 0x5f36 ;-)
Instead of this button, i used the broadlink_discovery.py that gives me good information for the broadlink scripts/calls.
hummm... this button should work and do the same thing (more or less) than the broadlink_discovery.py... I'm interested by more information.
Just put plugin on debug mode (python only) , click on it, wait few seconds and show your Domoticz log and the content of the files under log folder,
thanks.
broadlink_cli --type 0x5f36 --host 192.168.xxx.xx --mac xxxxxxxxxx
Device file data (to be used with --device @filename in broadlink_cli) :
0x5f36 192.168.xxx.xx xxxxxxxxxx
... this one is part of the exceptions (as you see, name mini 3 but use rm4 as type) !!!!! :?
To use the learned commands you have to make a executable file, and link this as a script in a dummy device at Domoticz.
hummmm.. no.. just click on 'create device' and you will have a Domoticz device created automatically for you with the corresponding ini file linked to !!
marchutt
Posts: 12
Joined: Monday 06 July 2020 5:12
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Netherlands
Contact:

Re: Python Plugin : Broadlink

Post by marchutt »

Hello zak45,
Probably due to browser cache (try to open domoticz in private mode), if you take a look to the label of your device in the Web admin page, just after the few menu buttons, you should see : 0x5f36
Yep, that show now the right value.
click on it, wait few seconds and show your Domoticz log and the content of the files under log folder,
This de python error log when i use the network scan button
Spoiler: show
2020-08-08 19:02:37.364 (Broadlink) Succesvol verbonden.
2020-08-08 19:02:37.365 (Broadlink) onMessage heeft om verbinding gevraagd: 192.168.xxx.xx: 34748
2020-08-08 19:02:37.366 (Broadlink) We omzeilen URL-controle
2020-08-08 19:02:37.366 (Broadlink) data:b'{"status":{"step":"scan","msg":"Fout bij het ophalen van Broadlink-apparaten","code":"1"}}'
2020-08-08 19:02:37.366 (Broadlink) {"status":{"step":"scan","msg":"Fout bij het ophalen van Broadlink-apparaten","code":"1"}}
2020-08-08 19:02:37.366 (Broadlink) gegevens worden verwerkt...
2020-08-08 19:02:37.366 (Broadlink) scan--Fout bij het ophalen van Broadlink-apparaten--1
2020-08-08 19:02:37.367 (Broadlink) gegevensverwerking OK
2020-08-08 19:02:37.417 (Broadlink) onDisconnect verzocht om verbinding &#39;192.168.xxx.xx:34748&#39;
2020-08-08 19:02:37.418 (Broadlink) Serververbindingen:
2020-08-08 19:02:37.418 (Broadlink) --> 192.168.xxx.xx:58194'.
2020-08-08 19:02:37.418 (Broadlink) --> 192.168.xxx.xx:34748'.
2020-08-08 19:02:42.427 (Broadlink) Succesvol verbonden.
2020-08-08 19:02:42.427 (Broadlink) onMessage heeft om verbinding gevraagd: 192.168.xxx.xx: 34750
2020-08-08 19:02:42.428 (Broadlink) We omzeilen URL-controle
2020-08-08 19:02:42.428 (Broadlink) data:b'{"end":{"step":"scan","msg":"EINDE scan"}}'
2020-08-08 19:02:42.428 (Broadlink) {"end":{"step":"scan","msg":"EINDE scan"}}
2020-08-08 19:02:42.428 (Broadlink) gegevens worden verwerkt...
2020-08-08 19:02:42.443 (Broadlink) Update 1:'EINDE scan' (Broadlink - RM2M-Status)
2020-08-08 19:02:42.454 (Broadlink) Update 1:'On' (Broadlink - RM2M-Status)
2020-08-08 19:02:42.454 (Broadlink) gegevensverwerking OK
2020-08-08 19:02:42.506 (Broadlink) onDisconnect verzocht om verbinding &#39;192.168.xxx.xx:34750&#39;
2020-08-08 19:02:42.506 (Broadlink) Serververbindingen:
2020-08-08 19:02:42.506 (Broadlink) --> 192.168.xxx.xx:58194'.
2020-08-08 19:02:42.506 (Broadlink) --> 192.168.xxx.xx:34750'.
And the 13MainOutput.txt from log dir (13MainOutput.err was empty)
Spoiler: show
--------------------------------------Start-------------------------------------
STEP ==: scan --- 2020-08-08 19:02:22
Discovering...
Found 1broadlink devices ---2020-08-08 19:02:37

###########################################
RM4
# broadlink_cli --type 0x5f36 --host 192.168.xxx.xx --mac xxxxxxxxxx
Device file data (to be used with --device @filename in broadlink_cli) :
0x5f36 192.168.xxx.xx xxxxxxxxx
Traceback (most recent call last):
File "/home/pi/domoticz/plugins/Broadlink/Dombroadlink.py", line 874, in <module>
brodevices = discover()
File "/home/pi/domoticz/plugins/Broadlink/Dombroadlink.py", line 377, in discover
print("temperature = {}".format(idevice.check_temperature()))
File "/usr/local/lib/python3.7/dist-packages/broadlink/__init__.py", line 705, in check_temperature
data = self._check_sensors(0x24)
File "/usr/local/lib/python3.7/dist-packages/broadlink/__init__.py", line 684, in _check_sensors
check_error(response[0x22:0x24])
File "/usr/local/lib/python3.7/dist-packages/broadlink/exceptions.py", line 97, in check_error
raise exception(error_code)
broadlink.exceptions.StorageError: The device storage is full

---------------------------------------END--------------------------------------
no.. just click on 'create device' and you will have a Domoticz device created automatically for you with the corresponding ini file linked to !!
I thought from start that there must be something like that, after reading the docs from the 'old' plugin.
My first expectation was that after saving the learned ini file, automaticly a device was added.
But nothing happend and no device added, so i did this linking manual after a lot of try and error... :roll:

I see also no button 'create device' at all, not in broadlink devices and not on admin page..
devices.png
devices.png (61.29 KiB) Viewed 1907 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 »

thanks for the info... will take a look.

marchutt wrote: Saturday 08 August 2020 21:25
no.. just click on 'create device' and you will have a Domoticz device created automatically for you with the corresponding ini file linked to !!
I thought from start that there must be something like that, after reading the docs from the 'old' plugin.
My first expectation was that after saving the learned ini file, automaticly a device was added.
But nothing happend and no device added, so i did this linking manual after a lot of try and error... :roll:

I see also no button 'create device' at all, not in broadlink devices and not on admin page..
devices.png
here it is :
just click on the ini fille you want to manage, and submenu should appear:
Capture.PNG
Capture.PNG (100.32 KiB) Viewed 1886 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 »

Hi,
# 1.4.2 : 10/08/2020
# no overwrite lang file during update
# added link for cmd command (manage-send code)
#
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest