libdyson-wg / ha-dyson

Home Assistant custom integration for Wi-Fi connected Dyson devices
MIT License
208 stars 23 forks source link

Air quality index always 0 with Pure Cool Link 475 #159

Open ro8inmorgan opened 1 month ago

ro8inmorgan commented 1 month ago

Air quality index always shows 0, but I can see it in the app. How to get this data in HA?

Volatile Organic Compounds Index, Temperature and Humidity show data

dotvezz commented 6 days ago

Hi @ro8inmorgan! Sorry for the late reply here. This is interesting. I actually have two 475 devices. AQI is working for both of them on my installation. Here's some screenshots for context; you can see that Home Assistant shows raw values on its chart, and the MyDyson app applies some kind of smoothing. There also seems to be a difference in resolution, but I don't know how much we can do about that right now. So there's not a perfect 1:1 relationship, but otherwise they basically appear to be showing the same information.

image image

There is a new tool I released yesterday (not well-documented yet, that's on my to-do list for today) called opendyson. If you're willing to help debug this, you can use it to get the values directly from your fan.

You can run opendyson devices to list your devices, find the serial number for the specific device you want to pull information from. Then run opendyson listen YOUR-SERIAL-NUMBER and it will start printing information from your device to the screen. Here's an example below.

$ opendyson devices
Use China region for account? (Default is no) [y/n]: n
Email Address: myemail@provider.com
Code from confirmation email: 123456         
Password: 
Available devices:
- basedevice:
    name: Dyson Fan
    serial: NM7-US-XXXXXXXX
    model: TP02
    type: "475"
    variant: ""
    productCategory: ec
    connectionCategory: wifiOnly
  mqtt:
    password: REDACTED
    username: NM7-US-XXXXXXXX
    root_topic: "475"
    address: 192.168.1.31
  iot:
    endpoint: REDACTED
    client_id: REDACTED
    custom_authorizer_name: REDACTED
    token_key: REDACTED
    token_signature: REDACTED
    token_value: REDACTED
  firmware:
    version: 21.04.03
    auto_update_enabled: false
    new_version_available: false

This is sensitive information that can be used to remotely control your Dyson devices. Please take caution before sharing it with anyone you don't trust.

$ opendyson listen NM7-US-XXXXXXXX
Subscribing to 475/NM7-US-XXXXXXXX/status/current
Subscribing to 475/NM7-US-XXXXXXXX/status/fault
Subscribing to 475/NM7-US-XXXXXXXX/command
Command:  {"msg": "REQUEST-PRODUCT-ENVIRONMENT-CURRENT-SENSOR-DATA", "time": "2024-07-08T16:32:03Z"}
Status:   {"msg":"ENVIRONMENTAL-CURRENT-SENSOR-DATA","time":"2024-07-08T16:32:03.000Z","data":{"tact":"2970","hact":"0052","pact":"0000","vact":"0000","sltm":"OFF"}}
Command:  {"msg": "REQUEST-PRODUCT-ENVIRONMENT-CURRENT-SENSOR-DATA", "time": "2024-07-08T16:32:33Z"}
Status:   {"msg":"ENVIRONMENTAL-CURRENT-SENSOR-DATA","time":"2024-07-08T16:32:33.000Z","data":{"tact":"2970","hact":"0052","pact":"0000","vact":"0000","sltm":"OFF"}}

If you're able to get this to work, please share two things:

  1. The value of your device's firmware version field (maybe there's a firmware-specific bug to be aware of)
  2. The the output of opendyson listen after letting it run for a while. We can review the values to see if there's something to be worried about.