nick7zmail / majordomo-dev_broadlink Goto Github PK
View Code? Open in Web Editor NEWMajorDoMo broadlink devices support
MajorDoMo broadlink devices support
Sequential update of properties linked to Broadlink device properties failed if these properties are updated with single method.
This could be demonstrated with properties updated via call to HYSEN.set_advanced(...).
How to reproduce:
MD is installed on Windows, Broadlink module is configured as PHP module.
Scan and register Hysen thermostat.
Bind new device properties 'svh' and 'svl' to any MD device properties. Let's assume
svh is bound to therm1.svh
and
svl is bound to therm1.svl
Create any method updating properties with php code:
setGlobal('therm1.svh', 10);
setGlobal('therm1.svl', 30);
This code will not store svh value due to second call to set_advanced() will use unchanged 'svh' property value.
Issue may be workarounded with 0.1s delay between calls (if your system is fast enough ;) :
setGlobal('therm1.svh', 10);
usleep(500000);
setGlobal('therm1.svl', 30);
but this workaround is not applicable to (e.g.) Simple Device properties configurator where one of these properties will be saved only.
Thanks!
после последнего обновления перестала работать команда обучения пультов RM(pro), RMmini3, не переходят в режим обучения. Режим переобучения проходит нормально
Я могу управлять Dooya DT360E через MajorDoMo ?
Не появилось ли у Вас возможность сливать бекапы с E-control с телефона в модуль , хотя бы руками? А то возможность добавить выключатели ТС2 433МГЦ , да и всего остального стала проблематична после неработающего облака E-Control
Parse error: syntax error, unexpected '$csv' (T_VARIABLE) in /var/www/html/modules/dev_broadlink/broadlink.class.php on line 26
eturn $csv;
заменить на return $csv;
Я готов подготовить PR еще для одной проблемы но требуется обсуждение и одбрямс :)
Как справедливо мне указали, при недоступности нескольких опрашиваемых в цикле устройств время опроса становится очень большим и MD считает модуль зависшим. А иногда и совсем может его положить.
Причина в том, что модуль опрашивает все устройства подряд (dev_broadlink_check.inc.php#78), независимо от того, доступны ли они в текущий момент или нет. В результате опрос offline устройства занимает до 10 секунд (константа Broadlink->$timeout). А некоторые устройства (тот же HYSEN) опрашиваются в несколько последовательных вызовов и время, соответственно, возрастает кратно.
Проблема более-менее эффективно решается если внутри цикла опроса сделать ping на устройство и проверить результаты (dev_broadlink_check.inc.php#84):
if(!is_null($rm) && $rm->ping() ) {
Я поигрался с этим workaround'ом, выставив таймаут в 500мс. В результате все работает как положено и даже при 10 недоступных устройствах (8 термостатов, RM4Pro и RM4mini) задержка составляет меньше 6 секунд. Успешный ping у меня отрабатывает 10-50мс, здесь тоже говорить не о чем.
НО
Метод ping() уже реализован в базовом классе. И в нем вроде бы все хорошо - за одним исключением: по умолчанию используется UDP ping, который не работает ни с одним из моих устройств. В отличие от ICMP, который (насколько я понимаю) в локальной сети должен отрабатывать практически всегда. Но поскольку у меня нет возможности проверить это на всем зоопарке поддерживаемых устройств а последствия неправильно работающей проверки будут фатальны - вопрос: насколько безопасно будет перевернуть логику, сделав ICMP ping основным, а UDP - на правах исключения для устройств там, где это действительно необходимо?
Безопасности можно добавить, реализовав checkbox "проверять доступность устройств" на странице настроек, выключенный по умолчанию.
м?
Hi,
I have purchased this device:
https://www.bgelectrical.uk/smart-sockets
After a bit of digging, I found out that they use a broadlink chip:
https://community.home-assistant.io/t/uk-wifi-smart-socket-screwfix-testing/119995/5
I only found your repo after trying these things below with the python-broadlink library
So I tried connecting to broadlink-mqtt
Kind of works:
$ pi@piup:~/broadlink-mqtt $ python mqtt.py
[2019-10-09 10:27:40,822] DEBUG Connected to 'Unknown' Broadlink device at '192.168.0.99' (MAC c8:f7:42:fc:e5:45) and started listening for commands at MQTT topic having prefix 'broadlink/'
[2019-10-09 10:27:40,834] DEBUG Connected to MQTT broker, subscribing to topic broadlink/#
It connects, so there must be a way.
I have a spare device that I can send by post
I can also send debug logs or whatever is needed
also:
import broadlink
print hex(broadlink.discover(timeout=10)[0].devtype)
0x51e3
How do I find out what commands it takes?
It could be compatible with an MP1 device but only 2 sockets
It is not. Defining the device as an MP1 type does not work
Your repo has many more devices than the python-broadlink library has.
Are there any simililar devices where this device could be compatible with in your repo?
Thanks for your help
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.