Broadlink-mqtt integration with openhab


(Nakh Home) #1

Hi

i am trying to have an openhab integration with broadlink devices.

1 i am aware about this binding but the M1 is not supported and also there’s a lot of sockets connections error in the log.

2.i know that it’s also possible to use some scripts based on this Python broadlink project

it works pretty fine

3.i have found this project Broadlink-mqtt.
it’s really nice, it’s a script which susbcribe to a mqtt feed and send commands to broadlink
it works for all the broadlink devices expect the S1

this script should run as a service.

moreover, i need a such service for each device.

i would prefer the mqtt approach but how to manage such services?

how to create a service from a python script?

which approach would you recommend me for stability and monitoring 2 or 3?

G


(Psyciknz) #2

I have a variation of the original script which does support multiple devices.


(Nakh Home) #3

REALLY IMPRESSIVE!

Thank you.

is there a way to retrieve the current state of the switch ?
in case, that the switch status is updated manually, openhab will be updated according to the last openhab update.

is it possible to know the manual change status?

if yes, it will be an excellent path to install 2 ways switches

till now, i didn’t find a simple solution for two ways switches without neutral wire .

even with z-wave, do you have any ideas ?

G


(Psyciknz) #4

Not sure with mqtt. You normally have outgoing commands (mqtt> for setting state, and mqtt< for getting status), but only if the device reports it.

With the broadlink, I’ve not seen a switchable device, as I only have two of the rm3’s


(Nakh Home) #5

Thanks for your answer

the service do not start

 Main PID: 3030 (code=exited, status=1/FAILURE)

Feb 11 13:39:15 SMHPI systemd[1]: Started Starts and stops the Broadink Python script.
Feb 11 13:39:15 SMHPI python[3030]: /usr/bin/python: can't find '__main__' module in 'etc/openhab2/scripts/MQTT/broadlink/mqtt_SP2_1'
Feb 11 13:39:15 SMHPI systemd[1]: mqtt_SP2_1.service: Main process exited, code=exited, status=1/FAILURE
Feb 11 13:39:15 SMHPI systemd[1]: mqtt_SP2_1.service: Unit entered failed state.
Feb 11 13:39:15 SMHPI systemd[1]: mqtt_SP2_1.service: Failed with result 'exit-code'.
Feb 11 13:39:32 SMHPI systemd[1]: [/usr/lib/systemd/system/mqtt_SP2_1.service:8] Path 'etc/openhab2/scripts/MQTT/broadlink/mqtt_SP2_1/mqtt.conf' is not absolute, ignoring.
Feb 11 13:39:32 SMHPI systemd[1]: [/usr/lib/systemd/system/mqtt_SP2_1.service:11] Working directory path 'etc/openhab2/scripts/MQTT/broadlink/mqtt_SP2_1/mqtt_SP2_1.py' is not absolute, ignoring```

(Psyciknz) #6

Does it run manually? Where does the service expect the python module to exist?


(Nakh Home) #7

Thanks a lot it works!


(Nakh Home) #8

@psyciknz do the script support A1 ?

what can be retrieved ? temperature ? noise? ??

thanks!