Closed cgorms closed 4 years ago
For the device having two outlets commands are: Payload "on" to topic "broadlink/power/1" to switch on the first outlet, "off" -> "broadlink/power/1" switch off first, "on" -> "broadlink/power/2" switch on second, "off" -> "broadlink/power/2" switch off second.
I have amended the MQTT.conf file to multiple_lookup as I have 2 BG1 devices.
When I run mqtt.py it discovers both devices and provides me with the PREFIX's for them, but how do I call each one within MQTT?
I also get the following error... DEBUG Connected! to MQTT broker, subscribing to topic broadlink/# DEBUG OOOPS! Broadlink disconnects DEBUG Connected! to MQTT broker, subscribing to topic broadlink/# ERROR error Traceback (most recent call later): File"./mqtt.py", line 510, in broadlink_bg1_state_timer for name in state: TypeError: 'NoneType' object is not iterable
Prefix (with default configuration) should look like broadlink/BG1_03_02_01 And you should use not broadlink/power/ topics, but broadlink/BG1_03_02_01/power/.... instead. E.g. "off" -> "broadlink/BG1_03_02_01/power/1" to switch off first outlet
I also get the following error... DEBUG Connected! to MQTT broker, subscribing to topic broadlink/# DEBUG OOOPS! Broadlink disconnects DEBUG Connected! to MQTT broker, subscribing to topic broadlink/#
Constant reconnection usually happens when you started two instances of broadlink-mqtt script. Could it be a problem?
ERROR error Traceback (most recent call later): File"./mqtt.py", line 510, in broadlink_bg1_state_timer for name in state: TypeError: 'NoneType' object is not iterable
This happens because no information was received from BG1 device. It could have the same reason as above but JIC I've added a fix to do not print an error in this case
Updated my local files, thank you. I’ve followed what you said but no joy yet. Here is my json file details...
"broadlink": { "id": "broadlink", "name": "bg1_plugs", "manufacturer": "BG Electrical", "topicIdentify": "broadlink/#", "category": 7, "services": [ { "name": "Bedroom1", "service": "Outlet", "topic": { "setOn": "broadlink/BG1_01_02_03/power/1", "statusOn": "broadlink/BG1_01_02_03/state", "statusOutletInUse": "" }, "json": { "statusOn": "", "statusOutletInUse": "" }, "payload": { "onFalse": "off", "onTrue": "on" }, "config": {}, "props": {} } ], "payload": {}, "config": {} }
All looks correct, MQTT commands are received by the script and processed but nothing happens, right? Also if you have broadlink_bg1_state_interval configuration parameter specified then BG1 devices state should be sent via MQTT periodically and be visible in logs. Something is wrong here
@vzorglub Do you have any ideas?
Yes, the bg code hasn't been merged in the main repository yet. You need to use the branch
Correct nothing is happening with the outlet... broadlink_bg1_state_interval is set to 30.
I'm not sure what maybe going wrong... where can I check as you say I can see the commands being processed and broadlink_MQTT is identifying the devices.
Yes, the bg code hasn't been merged in the main repository yet. You need to use the branch
What branch is required? I've installed...
git clone https://github.com/eschava/broadlink-mqtt.git pip install git+https://github.com/barnybug/python-broadlink@add_bgelectrical_sockets
@barnybug, sorry for disturbing you Do you have ideas about what could go wrong? Devices were identified correctly but get_state returns None and set_state does nothing
I don't have anything to go on - someone needs to debug it, so I either need more debugging information to go on (python-broadlink has no useful logging), or someone to send me a non-working device.
Where can I get debugging info from?
What repository do I need to confirm are installed?
If your device was correctly identified then definitely you have correct libraries installed
https://github.com/mjg59/python-broadlink/issues/289#issuecomment-541460611
You mention here, you got it working... how did you do that?
Firmware version on the devices are V46043
I used Hoobs on a clean install and did the installation all over again and it is now working.
Noob question how do I add broadlink-mqtt to MQTT and control the BG1 devices...
Many thanks in advance