Hello, I'm on version 1.6.1zak45 wrote: ↑Sunday 03 January 2021 0:19What's your actual version ?garycooper wrote: ↑Saturday 02 January 2021 22:37 Hy ! Could you tell me how updating the plugin without loosing devices please ?
Thks
Python Plugin : Broadlink
Moderator: leecollings
-
- Posts: 21
- Joined: Sunday 10 March 2019 20:50
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python Plugin : Broadlink
-
- Posts: 952
- Joined: Sunday 22 January 2017 11:37
- Target OS: Windows
- Domoticz version: V2024.4
- Contact:
Re: Python Plugin : Broadlink
So....
With Gdrive do not have feature I like...
With DropBox ... from time to time.. do not work.. maybe too much download, or spam or free account.
Had already done some test to implement my own Cloud share, so decided to go in this way with the help of NextCloud : https://nextcloud.com/
New source for Broadliink files is here : https://synnas.publicvm.com:32701/s/gmt22Ad7TyYJGdN
Used a self signed certificat, so you need to accept it.
Happy new year to all !
With Gdrive do not have feature I like...
With DropBox ... from time to time.. do not work.. maybe too much download, or spam or free account.
Had already done some test to implement my own Cloud share, so decided to go in this way with the help of NextCloud : https://nextcloud.com/
New source for Broadliink files is here : https://synnas.publicvm.com:32701/s/gmt22Ad7TyYJGdN
Used a self signed certificat, so you need to accept it.
Happy new year to all !
-
- Posts: 92
- Joined: Friday 08 November 2019 23:07
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python Plugin : Broadlink
perhaps Github is the best solutionzak45 wrote: ↑Monday 04 January 2021 13:59 So....
With Gdrive do not have feature I like...
With DropBox ... from time to time.. do not work.. maybe too much download, or spam or free account.
Had already done some test to implement my own Cloud share, so decided to go in this way with the help of NextCloud : https://nextcloud.com/
New source for Broadliink files is here : https://synnas.publicvm.com:32701/s/gmt22Ad7TyYJGdN
Used a self signed certificat, so you need to accept it.
Happy new year to all !
-
- Posts: 18
- Joined: Tuesday 29 May 2018 18:11
- Target OS: NAS (Synology & others)
- Domoticz version: 3.9390
- Contact:
Re: Python Plugin : Broadlink
bug: setup.py fail in the end because there is no *.sh files in scr/ directoryzak45 wrote: ↑Monday 04 January 2021 13:59
New source for Broadliink files is here : https://synnas.publicvm.com:32701/s/gmt22Ad7TyYJGdN
Used a self signed certificat, so you need to accept it.
-
- Posts: 952
- Joined: Sunday 22 January 2017 11:37
- Target OS: Windows
- Domoticz version: V2024.4
- Contact:
Re: Python Plugin : Broadlink
Thanks, *.sh file backtorM6 wrote: ↑Wednesday 06 January 2021 0:02bug: setup.py fail in the end because there is no *.sh files in scr/ directoryzak45 wrote: ↑Monday 04 January 2021 13:59
New source for Broadliink files is here : https://synnas.publicvm.com:32701/s/gmt22Ad7TyYJGdN
Used a self signed certificat, so you need to accept it.

-
- Posts: 18
- Joined: Tuesday 29 May 2018 18:11
- Target OS: NAS (Synology & others)
- Domoticz version: 3.9390
- Contact:
Re: Python Plugin : Broadlink
another problem with current version and installation of domoticz into docker container.
I have the following setup of network:
NAS (Synology) with main address 192.168.1.216
container with bridge network, address of inside-container interface is 172.17.0.2
I have mapping of the following TCP ports from container to NAS local ports: 6144, 1443, 8080 and 9000.
my first attempt to configure of plugin was to setup its address and web admin (in web interface of dotomicz device) as 192.168.1.216:9000, and during start of Domoticz it fail check that port is in use (250 line in python.py). It always return for this (only this) port that it is in use in function is_open(192.168.1.216,9000)?
I try to make address and web admin as 192.168.1.216:9001 and map internal port 9000 to local 9001 in container setup. it fail in check around 939 line saying that 192.168.1.216:9000 != 192.168.1.216:9001
ok, next attempt- in plugin config I setup address of Domoticz as 172.17.0.2 and port as 9000
now it pass checks, but always say in the same line 939 that 172.17.0.2:9000 != 192.168.1.216:9000
and throw error "Not implemented"...
I am stuck...
I restore config (192.168.1.216:9000), container port mapping 9000/tcp -> 0.0.0.0:9000 and disable correctness check in plugin (call of is_open() in the place above). does not work, no admin web interface on 9000 port (no response, seems that no-one listen for 9000 port )
output of log (add translation for simplicity)
I have the following setup of network:
NAS (Synology) with main address 192.168.1.216
container with bridge network, address of inside-container interface is 172.17.0.2
I have mapping of the following TCP ports from container to NAS local ports: 6144, 1443, 8080 and 9000.
my first attempt to configure of plugin was to setup its address and web admin (in web interface of dotomicz device) as 192.168.1.216:9000, and during start of Domoticz it fail check that port is in use (250 line in python.py). It always return for this (only this) port that it is in use in function is_open(192.168.1.216,9000)?
I try to make address and web admin as 192.168.1.216:9001 and map internal port 9000 to local 9001 in container setup. it fail in check around 939 line saying that 192.168.1.216:9000 != 192.168.1.216:9001
ok, next attempt- in plugin config I setup address of Domoticz as 172.17.0.2 and port as 9000
now it pass checks, but always say in the same line 939 that 172.17.0.2:9000 != 192.168.1.216:9000
and throw error "Not implemented"...
I am stuck...
I restore config (192.168.1.216:9000), container port mapping 9000/tcp -> 0.0.0.0:9000 and disable correctness check in plugin (call of is_open() in the place above). does not work, no admin web interface on 9000 port (no response, seems that no-one listen for 9000 port )
output of log (add translation for simplicity)
- Spoiler: show
Last edited by torM6 on Thursday 07 January 2021 14:00, edited 1 time in total.
-
- Posts: 952
- Joined: Sunday 22 January 2017 11:37
- Target OS: Windows
- Domoticz version: V2024.4
- Contact:
Re: Python Plugin : Broadlink
You fall in security check....torM6 wrote: ↑Thursday 07 January 2021 12:53 another problem with current version and installation of domoticz into docker container.
ok, next attempt- in plugin config I setup address of Domoticz as 172.17.0.2 and port as 9000
now it pass checks, but always say in the same line 939 that 172.17.0.2:9000 != 192.168.1.216:9000
and throw error "Not implemented"...
I am stuck...
Do not use docker but could try to see possible workaround.
Put your browser in devloper mode and provide a screen shot with network details when error occurs
e.g.:
-
- Posts: 18
- Joined: Tuesday 29 May 2018 18:11
- Target OS: NAS (Synology & others)
- Domoticz version: 3.9390
- Contact:
Re: Python Plugin : Broadlink
with what address in config of plugin? 192.168.1.216 (NAS external address) or internal address of container 172.17.0.2?
PS I do add 192.168 and 172.17.*.* networks to Domoticz no-passwprd access, it is allowed from both network.
-
- Posts: 18
- Joined: Tuesday 29 May 2018 18:11
- Target OS: NAS (Synology & others)
- Domoticz version: 3.9390
- Contact:
Re: Python Plugin : Broadlink
developer mode in safari show only content of error message like "192.168.1.216:9000 server reset connection, could be busy, try again later"
no any messages inside log of Domoticz
like below
here I drop check and print args in this line (message is "port in use"):
2021-01-07 14:57:02.958 Error: (mRM Pro+) Уже используется192.168.1.216 9000
- Spoiler: show
ERR_CONNECTION_RESET
and no response
Last edited by torM6 on Thursday 07 January 2021 14:33, edited 1 time in total.
-
- Posts: 952
- Joined: Sunday 22 January 2017 11:37
- Target OS: Windows
- Domoticz version: V2024.4
- Contact:
Re: Python Plugin : Broadlink
@torM6
do not have docker for test.
try this version, some check has been changed.
do not have docker for test.
try this version, some check has been changed.
-
- Posts: 18
- Joined: Tuesday 29 May 2018 18:11
- Target OS: NAS (Synology & others)
- Domoticz version: 3.9390
- Contact:
Re: Python Plugin : Broadlink
same, no response to 9000 port...
no messages in log - seems that requests do not goto web server
will try with config with 172 address
yes, with config like 172:9000, mapping 9000->9000 it start working with attached plugin.py!
will check other functionality
no, except header nothing shown (like list of devices, list of ini files).
and I do not see anything about this access in Domoticz log.
found error when try to use opera...
seems that bottom of page is not created because it use to access directly address 172!
error message is
can't access the site
Сайт 172.17.0.2 не позволяет установить соединение.
can't setup connection to...
so, this is not a solution.
need to fix a problem with access to myself via NAT server, the root of problem is here...
-
- Posts: 952
- Joined: Sunday 22 January 2017 11:37
- Target OS: Windows
- Domoticz version: V2024.4
- Contact:
Re: Python Plugin : Broadlink
No more idea for the moment and without test platform not easy... will try to see that in future.torM6 wrote: ↑Thursday 07 January 2021 14:44 found error when try to use opera...
seems that bottom of page is not created because it use to access directly address 172!
error message is
can't access the site
Сайт 172.17.0.2 не позволяет установить соединение.
can't setup connection to...
so, this is not a solution.
need to fix a problem with access to myself via NAT server, the root of problem is here...
-
- Posts: 952
- Joined: Sunday 22 January 2017 11:37
- Target OS: Windows
- Domoticz version: V2024.4
- Contact:
Re: Python Plugin : Broadlink
@torM6
tested in docker env and have it working.
made few modifications to avoid errors.
My test env:
docker in synology 6.2
docker image used : linuxserver-domoticz
domoticz plugin settings:
you need the new plugin.py and Dombroadlink.py
tested in docker env and have it working.
made few modifications to avoid errors.
My test env:
docker in synology 6.2
docker image used : linuxserver-domoticz
domoticz plugin settings:
you need the new plugin.py and Dombroadlink.py
-
- Posts: 18
- Joined: Tuesday 29 May 2018 18:11
- Target OS: NAS (Synology & others)
- Domoticz version: 3.9390
- Contact:
Re: Python Plugin : Broadlink
@zak45 - seems that I still unable to find webadmin interface even after complete reinstall of plugin using setup.py. Do you use bridged network for container?
I found the same problem - message that "port in use" for port 9000
and later due to this web admin page do not created.
I make very small test and run it inside docker
Code: Select all
import socket
import os
import sys
#
# check if port is already opened or not
#
def is_open(ip, port):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(1.0)
try:
s.connect((ip, int(port)))
s.shutdown(2)
return True
except (ValueError, Exception):
return False
if is_open("192.168.1.216", 9000):
print("opened")
else:
print("closed")
if I map port 9000 to outside (still nothing inside container for port 9000) - it say opened
therefore test in your plugin failed...
-
- Posts: 952
- Joined: Sunday 22 January 2017 11:37
- Target OS: Windows
- Domoticz version: V2024.4
- Contact:
Re: Python Plugin : Broadlink
yep, bridged network.torM6 wrote: ↑Saturday 09 January 2021 0:15 @zak45 - seems that I still unable to find webadmin interface even after complete reinstall of plugin using setup.py. Do you use bridged network for container?
if I run it inside docker container without anything on 9000 port -it say closed
if I map port 9000 to outside (still nothing inside container for port 9000) - it say opened
therefore test in your plugin failed...
try with another port number.
-
- Posts: 18
- Joined: Tuesday 29 May 2018 18:11
- Target OS: NAS (Synology & others)
- Domoticz version: 3.9390
- Contact:
Re: Python Plugin : Broadlink
tried with 7000, with freshly created container with ubuntu.
the only port mapped is 7000
same result - if mapped, your test return opened, if not mapped - return "not".
I even make telnet tcpdump in both cases (for 9000 which is mapped and 9001 is not), different response from socket:
- Spoiler: show
Code: Select all
admin@stormain:~$ sudo tcpdump -nvv host 192.168.1.216
tcpdump: listening on docker0, link-type EN10MB (Ethernet), capture size 262144 bytes
01:31:20.517342 IP (tos 0x10, ttl 64, id 42615, offset 0, flags [DF], proto TCP (6), length 60)
172.17.0.3.40440 > 192.168.1.216.7000: Flags [S], cksum 0x6ec3 (incorrect -> 0x763e), seq 1427778998, win 29200, options [mss 1460,sackO0
01:31:20.517384 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 60)
192.168.1.216.7000 > 172.17.0.3.40440: Flags [S.], cksum 0x6ec3 (incorrect -> 0xce9a), seq 2384749922, ack 1427778999, win 28960, option0
01:31:20.517404 IP (tos 0x10, ttl 64, id 42616, offset 0, flags [DF], proto TCP (6), length 52)
172.17.0.3.40440 > 192.168.1.216.7000: Flags [.], cksum 0x6ebb (incorrect -> 0x6da2), seq 1, ack 1, win 229, options [nop,nop,TS val 6910
01:31:20.517684 IP (tos 0x0, ttl 64, id 61090, offset 0, flags [DF], proto TCP (6), length 52)
192.168.1.216.7000 > 172.17.0.3.40440: Flags [F.], cksum 0x6ebb (incorrect -> 0x6da3), seq 1, ack 1, win 227, options [nop,nop,TS val 690
01:31:20.517767 IP (tos 0x10, ttl 64, id 42617, offset 0, flags [DF], proto TCP (6), length 52)
172.17.0.3.40440 > 192.168.1.216.7000: Flags [.], cksum 0x6ebb (incorrect -> 0x6da0), seq 1, ack 2, win 229, options [nop,nop,TS val 6910
01:31:20.517816 IP (tos 0x10, ttl 64, id 42618, offset 0, flags [DF], proto TCP (6), length 52)
172.17.0.3.40440 > 192.168.1.216.7000: Flags [F.], cksum 0x6ebb (incorrect -> 0x6d9f), seq 1, ack 2, win 229, options [nop,nop,TS val 690
01:31:20.517826 IP (tos 0x0, ttl 64, id 18465, offset 0, flags [DF], proto TCP (6), length 52)
192.168.1.216.7000 > 172.17.0.3.40440: Flags [.], cksum 0x6da0 (correct), seq 2, ack 2, win 227, options [nop,nop,TS val 691702722 ecr 60
01:31:28.225011 IP (tos 0x10, ttl 64, id 34718, offset 0, flags [DF], proto TCP (6), length 60)
172.17.0.3.44540 > 192.168.1.216.7001: Flags [S], cksum 0x6ec3 (incorrect -> 0x2353), seq 2035756611, win 29200, options [mss 1460,sackO0
01:31:28.225051 IP (tos 0x10, ttl 64, id 22136, offset 0, flags [DF], proto TCP (6), length 40)
192.168.1.216.7001 > 172.17.0.3.44540: Flags [R.], cksum 0xd04a (correct), seq 0, ack 2035756612, win 0, length 0
-
- Posts: 952
- Joined: Sunday 22 January 2017 11:37
- Target OS: Windows
- Domoticz version: V2024.4
- Contact:
Re: Python Plugin : Broadlink
Do not know your net infrastructure but here it is how this suppose to work:torM6 wrote: ↑Saturday 09 January 2021 19:05 tried with 7000, with freshly created container with ubuntu.
the only port mapped is 7000
same result - if mapped, your test return opened, if not mapped - return "not".
I even make telnet tcpdump in both cases (for 9000 which is mapped and 9001 is not), different response from socket:
outside docker IP / host with docker installed : 192.168.1.216
Domiticz inside docker IP: 172.17.0.3
let suppose we want port 9000 for the listener.
outside docker :
telnet 192.168.1.216 9000 >> unable to connect
inside docker :
telnet 172.17.0.3 9000 >> unable to connect
you need to map (NAT) from 192.168.1.216:9000 to 172.17.0.3:9000
you need to map (NAT) from 192.168.1.216:8080 to 172.17.0.3:8080 (suppose Domoticz is on port 8080)
Broadlink plugin need to have as IP for Domoticz : 192.168.1.216 and for Listener port : 9000
Once the plugin start, inside docker, plugin check to see if 0.0.0.0:9000 is open (this include 172.17.0.3)
if yes ==> error else
this will create a listener inside the docker : 172.17.0.3:9000
you should be able to connect now using this command inside docker : telnet 172.17.0.3 9000
you should be able to connect now using this command outside docker : telnet 192.168.1.216 9000
if this not work, verify any fw/av or something else that could block/disable ports.
-
- Posts: 18
- Joined: Tuesday 29 May 2018 18:11
- Target OS: NAS (Synology & others)
- Domoticz version: 3.9390
- Contact:
Re: Python Plugin : Broadlink
to @zak45
Thank you for reply!
And seems that I found a problem (talking with one of docker core developer).
Problem that docker start dedicated proxy for internal container processes to be mapped later.
In particular, if we map 9000 (NAT) port for container (e.g. docker command -p option, or using Synology web interface),
it will create automatically internal proxy which accept connection to port 9000 even if we do not have any process inside.
This docker feature created to allow connection to the docker internal processes right after start of docker itself (not waiting for particular process inside).
So, in case of docker function is_open() will always give wrong result (as I see in my example).
Suggestion from developer - try to bind() this address:port (instead of socket.socket) and if it fail then it is not in use...
another option - use code below to detect that we are in docker and make different check...
Thank you for reply!
this is exactly as I have in my setup.zak45 wrote: ↑Sunday 10 January 2021 13:02
Do not know your net infrastructure but here it is how this suppose to work:
outside docker IP / host with docker installed : 192.168.1.216
Domiticz inside docker IP: 172.17.0.3
let suppose we want port 9000 for the listener.
outside docker :
telnet 192.168.1.216 9000 >> unable to connect
inside docker :
telnet 172.17.0.3 9000 >> unable to connect
you need to map (NAT) from 192.168.1.216:9000 to 172.17.0.3:9000
you need to map (NAT) from 192.168.1.216:8080 to 172.17.0.3:8080 (suppose Domoticz is on port 8080)
Broadlink plugin need to have as IP for Domoticz : 192.168.1.216 and for Listener port : 9000
Once the plugin start, inside docker, plugin check to see if 0.0.0.0:9000 is open (this include 172.17.0.3)
if yes ==> error else
this will create a listener inside the docker : 172.17.0.3:9000
you should be able to connect now using this command inside docker : telnet 172.17.0.3 9000
you should be able to connect now using this command outside docker : telnet 192.168.1.216 9000
if this not work, verify any fw/av or something else that could block/disable ports.
And seems that I found a problem (talking with one of docker core developer).
Problem that docker start dedicated proxy for internal container processes to be mapped later.
In particular, if we map 9000 (NAT) port for container (e.g. docker command -p option, or using Synology web interface),
it will create automatically internal proxy which accept connection to port 9000 even if we do not have any process inside.
This docker feature created to allow connection to the docker internal processes right after start of docker itself (not waiting for particular process inside).
So, in case of docker function is_open() will always give wrong result (as I see in my example).
Suggestion from developer - try to bind() this address:port (instead of socket.socket) and if it fail then it is not in use...
another option - use code below to detect that we are in docker and make different check...
Code: Select all
import os
def is_docker():
path = '/proc/self/cgroup'
return (
os.path.exists('/.dockerenv') or
os.path.isfile(path) and any('docker' in line for line in open(path))
)
Re: Python Plugin : Broadlink
Hi Henk,henk99 wrote: ↑Thursday 19 November 2020 23:36 I have 4 Broadcom SP3S smartplugs which used to work fine with the older plugin.
Due to a system fail I installed domoticz completely new, with the 2020.2 version (instead of the old V3.8) and also with the new V4 plugin. The installing went fine, and according to description. Then:
1. Added one of the plugs in 'Hardware' with all the data needed
2. Three new devices can be seen in the list
3. Switch fuction works, current wattage works
At this point I go into the settings for the usage, and set it to 'usage' and select 'computed', as these are also the settings in my old version to be able to see the used energy (KWh). As soon as I update this, domoticz freezes and doesn't come out of it.
I restarted the domoticz service and when it is back I have 30 seconds or so to do anything. So, by doing that a few times, I was able to remove the item in 'hardware' and domoticz is back to normal again.
What is going wrong here? As soon as I set the usage to computional, domoticz goes crazy. By the way, this is a brand new install from scratch with Debian 10 (buster) and domoticz 2020.2.
I posted after yours that I had the exact same problem. Did you already found any solution for this?
Gr. Theo.
-
- Posts: 142
- Joined: Friday 21 October 2016 9:25
- Target OS: NAS (Synology & others)
- Domoticz version:
- Location: Netherlands
- Contact:
Re: Python Plugin : Broadlink
Updated my install to Buster, and now it no longer works. I keep getting the following:
I have installed Python3.7 and set as system default, installed all the modules, they show as listed in .
I'm guessing something is messed up with Python; but I've set Python3.7 as system wide version using
If I run the from the /home/pi/domoticz/plugins/Broadlink directory, it responds correctly:
Anyone got any thoughts aside from complete fresh install?
Code: Select all
2021-01-25 15:56:02.067 Error: Python Plugin System: (Broadlink) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/Broadlink/:/usr/lib/python37.zip:/usr/lib/python3.7:/usr/lib/python3.7/lib-dynload:/usr/local/lib/python3.7/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.7/dist-packages'.
2021-01-25 15:56:02.067 Error: Python Plugin System: (BroadlinkRM2-New) Module Import failed, exception: 'AttributeError'
2021-01-25 15:56:02.067 Error: Python Plugin System: (BroadlinkRM2-New) Error Line details not available.
2021-01-25 15:57:08.876 Error: BroadlinkRM2-New hardware (28) thread seems to have ended unexpectedly
Code: Select all
/usr/local/lib/python3.7/dist-packages
I'm guessing something is messed up with Python; but I've set Python3.7 as system wide version using
Code: Select all
sudo update-alternatives --config python
Code: Select all
./broadlink_discovery.py
Code: Select all
# broadlink_cli --type 0x2787 --host 192.168.178.17 --mac AABBCCDDEEFF
Device file data (to be used with --device @filename in broadlink_cli) :
0x2787 192.168.178.17 AABBCCDDEEFF
temperature = 22.1
Who is online
Users browsing this forum: No registered users and 1 guest