eschava / broadlink-mqtt

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

adding humidity sensor #86

Closed hi-flyer closed 3 years ago

hi-flyer commented 3 years ago

I have an RM4 unit with the temperature and humidity sensor. I had add to the following areas code to implement the humidity sensor. in def broadlink_rm_temperature_timer section added following lines below mqttc.publish(topic, temperature, qos=qos, retain=retain)

    humidity = str(device.check_humidity())
    topic = mqtt_prefix + "humidity"
    logging.debug("Sending RM humidity " + humidity + " to topic " + topic)
    mqttc.publish(topic, humidity, qos=qos, retain=retain)

and to keep response from indicating an warning added following in def on_message(client, device, msg): after the if command == 'temperature' or \ statement : command == 'humidity' or \

you might consider adding to your code or a variation if you want to have independent timers for temperature and humidity.

Thanks for the excellent software, it is working great with broadlink and Nymea

eschava commented 3 years ago

Should be done now. Please check

hi-flyer commented 3 years ago

Have checked. works as expected. PS good catch on checking for the RM4.

Thanks