libpurecoollink
libpurecoollink copied to clipboard
mqtt connection empty queue error
I'm getting an error when I try to collect data from the environmental sensors, using the following code in a loop:
devices = dyson_account.devices() connected = devices[0].connect("192.168.0.76") env_state=devices[0].environmental_state current_voc = env_state.volatile_organic_compounds devices[0].disconnect()
It works for 4 iterations of my loop and then crashes with the following error:
'File "dyson.py", line 39, in
If anyone has come across this issue or has any ideas how to fix it please let me know!
Not sure why would you use loops? Just subscribe to the message. device.add_message_listener(on_message_listener_procedure)
HI there! Thanks for the reply! I'm not really familiar with how to implement message listeners, ive tried to below but I amn't get any values returned:
def update_state(message): env_state=fan.environmental_state current_pm25 = env_state.particulate_matter_25 print(current_pm25)
devices = dyson_account.devices() \n fan = devices[0] \n connected = fan.connect("192.168.0.76") \n fan.add_message_listener(update_state)
Im trying to access the sensor data to feed its values into controller I have designed for a project, so any advice on how to collect this data would be greatly appreciated.
Take a look at my project https://github.com/exking/udi-dyson-poly/blob/master/dyson-poly.py DysonPureFan is an example
Hi there! Thank you so much for showing me your project! Would you by any chance have an example of how to use that class to send the commands or call for information? Sorry just trying to figure out how each step works.