eschava / broadlink-mqtt

MQTT client to control BroadLink devices
MIT License
221 stars 60 forks source link

Help please, new to broadlink #73

Closed jeraldlaa closed 4 years ago

jeraldlaa commented 4 years ago

Hi there,

I am facing the below issue when i key ./mqtt.py please help ):

Traceback (most recent call last): File "./mqtt.py", line 580, in devices = get_device(cf) File "./mqtt.py", line 390, in get_device return configure_device(device, topic_prefix) File "./mqtt.py", line 394, in configure_device device.auth() File "/usr/local/lib/python2.7/dist-packages/broadlink/init.py", line 225, in auth check_error(response[0x22:0x24]) File "/usr/local/lib/python2.7/dist-packages/broadlink/exceptions.py", line 97, in check_errr raise exception(error_code) broadlink.exceptions.AuthenticationError: Authentication failed

This is the error code i get when keying in ./mqtt.py

Below is my custom.conf code

Type of device. Valid options are 'lookup', 'multiple_lookup', 'rm', 'rm4', 'sp1', 'sp2', 'a1', 'mp1', 'dooya', 'bg1'

device_type = 'rm4' # use lookup

lookup parameters

lookup_timeout = 20

local_address = '127.0.0.1'

parameters for direct connection

device_host = '192.168.1.112' device_mac = '24:df:a7:34:a6:72'

MQTT connection parameters

mqtt_broker = 'localhost' # default: 'localhost' mqtt_port = 1883 # default: 1883 mqtt_clientid = 'broadlink' mqtt_username = '' mqtt_password = '' mqtt_topic_prefix = 'broadlink/' mqtt_multiple_subprefixformat = '{type}{mac_nic}/' # use only with 'multiple_lookup' device type (allowed parameters are {type}, {host}, {mac}, {mac_nic})

mqtt_birth_topic = 'clients/broadlink'

mqtt_birth_payload = 'Hello!'

mqtt_will_topic = 'clients/broadlink' mqtt_will_payload = 'Adios!'

MQTT TLS parameters

Required with TLS: a string path to the Certificate Authority certificate files that are to be treated as trusted by this client.

ca_certs = '/path/to/ca_certsfile'

Optional Clients Cert/Key

certfile = '/path/to/certfile'

keyfile = '/path/to/keyfile'

Required TLS version. Valid values: 'sslv3', 'tlsv1', 'tlsv1.2'

tls_version = 'tlsv1.2'

extra parameters

broadlink_rm_temperature_interval = 120 # publish temperature from RM device to broadlink/temperature topic every two minutes broadlink_sp_energy_interval = 30 # publish energy from SP device to broadlink/energy topic every 30 seconds broadlink_a1_sensors_interval = 30 # publish all sensors data from A1 device to broadlink/sensors/[temperature/humidity/light/air_quality/noise] topics every 30 seconds broadlink_a1_sensors_text_values = False # use True to send text representation of light/air quality/noise values broadlink_a1_sensors_json = False # False to send every sensor parameter in separate topic, True - to send all together as JSON object broadlink_mp1_state_interval = 30 # publish all state data from MP1 device to broadlink/state/[s1/s2/s3/s4] topics every 30 seconds broadlink_mp1_state_json = False # False to send every state parameter in separate topic, True - to send all together as JSON object

broadlink_dooya_position_interval = 30 # publish position in percents from Dooya curtain motor to broadlink/percentage topic every 30 seconds

broadlink_bg1_state_interval = 30 # publish all state data from BG1 device to broadlink/state/[pwr/pwr1/pwr2/maxworktime/maxworktime1/maxworktime2/idcbrightness] topics every 30 seconds broadlink_bg1_state_json = False # False to send every state parameter in separate topic, True - to send all together as JSON object

eschava commented 4 years ago

Please check these instructions: https://github.com/mjg59/python-broadlink/issues/301#issuecomment-595086920