HomeAssitant custom integration for dyson

shenxn, updated 🕥 2022-12-12 14:09:10

HomeAssistant Custom Integration for Dyson

This custom integration is still under development.

This is a HA custom integration for dyson. There are several main differences between this custom integration and the official dyson integration:

  • It does not rely on dyson account. Which means once configured, the integration will no longer login to the Dyson cloud service so fast and more reliable start up process.

  • Config flow and discovery is supported, so easier configuration.

  • Based on a new library that is better structured so the code in the integration itself is simplified.

My goal is to make this integration official. However, at the current stage, I don't want to do the changes in core since there could be a lot of breaking changes. Therefore, I'll do be merge when everything seems stable.

Important note regarding connection via Dyson Link

If you use your Dyson Link account to connect to the integration, you may or may not encounter a libdyson.exceptions.DysonInvalidAuth error. In this case, try disconnecting from the mobile app first, it should clear the error. Sometimes, you just need to try multiple times. If you discover a workaround for this issue please open a pull request.

Installation

The minimum supported Home Assistant version is 2021.12.0.

You can install using HACS. Adding https://github.com/shenxn/ha-dyson as custom repository and then install Dyson Local. If you want cloud functionalities as well, add https://github.com/shenxn/ha-dyson-cloud and install Dyson Cloud.

You can also install manually

Local and Cloud

There are two integrations, Dyson Local and Dyson Cloud. Due to the limitation of HACS, they are split into two repositories. This repository hosts Dyson Local, and https://github.com/shenxn/ha-dyson-cloud hosts Dyson Cloud.

Dyson Local

Dyson Local uses MQTT-based protocol to communicate with local Dyson devices using credentials. Currently it supports

  • Dyson 360 Eye robot vacuum
  • Dyson 360 Heurist robot vacuum
  • Dyson Pure Cool
  • Dyson Pure Cool Desk
  • Dyson Pure Cool Link
  • Dyson Pure Cool Link Desk
  • Dyson Pure Hot+Cool
  • Dyson Pure Hot+Cool Link
  • Dyson Pure Humidity+Cool

Dyson Cloud

Dyson Cloud uses HTTP-based API to communicate with cloud service. Currently it supports getting device credentials and show all devices as discovered entities under the Integrations page. It also supports getting cleaning maps as camera entities for 360 Eye robot vacuum.

Setup

Setup using device WiFi information

Version 0.6.1 introduced a new way to set up. This is inspired by https://community.home-assistant.io/t/dyson-pure-cool-link-local-mqtt-control/217263. Set up through UI and select "Setup using WiFi information". Find your device WiFi SSID and password on the sticker on your device body or user's manual (See the figure below). Don't fill in your home WiFi information. Note that this method only uses SSID and password to calculate serial, credential, and device type so you still need to setup your device on the official mobile app first.

Setup using Dyson cloud account

You can also set up Dyson Cloud first so that you don't need to manually get device credentials. To do so, go to Configuration -> Integrations and click the + button. Then find Dyson Cloud. After successful setup, all devices under the account will be shown as discovered entities and you can then set up Dyson Local with single click. Leave host blank to using zeroconf discovery. After that, you can even remove Dyson Cloud entity if you don't need cleaning maps. All local devices that are already set up will remain untouched.

Setup manually

If you want to manually set up Dyson Local, you need to get credentials first. Clone or download https://github.com/shenxn/libdyson, then use python3 get_devices.py to do that. You may need to install some dependencies using pip3 install -r requirements.txt.

Debug Log

To enable debug log, add the following lines to your configuration.yaml and restart your HomeAssistant.

yaml logger: default: info logs: libdyson: debug custom_components.dyson_local: debug custom_components.dyson_cloud: debug

FAQ

I got "not a valid add-on repository" when I try to add this repo

This is a custom integration not a custom add-on. You need to install HACS and add this repo there.

Issues

New actively maintained integration! Collaborators welcome! Details inside.

opened on 2023-03-14 14:59:25 by dotvezz

What Happened?

I've created a new Github organization, The libdyson Working Group and published updated versions of libdyson, ha-dyson, and ha-dyson-cloud. The new forks are actively maintained, and I would be excited to talk with any contributors about joining the organization.

I'm currently working on merging all the commits from Pull Requests, then I'll address all the Issues. There are a few conflicts in the Pull Requests regarding newer devices (Formaldehyde fans/heaters, Humidifiers, and refreshes like the HP07 refresh of the HP04). For the time being, Formaldehyde models are the next on my list of things to tackle.

How can I help?

Anyone interested in helping, even if it's just reviewing and merging Pull Requests, please let me know here in this thread, or via email ([email protected])!

Why Fork?

I'm really grateful to @shenxn for their dedication to the project over the years. Sadly, they've been pretty quiet for the past 4~5 months and the integration has started breaking for some people, especially people using new unsupported devices. Eventually, it seemed appropriate to talk about making a community fork to keep things moving.

I especially want to make sure there's at least two people who can merge Pull Requests. This isn't the biggest repo in the world, but it is used by people and gives us some really nice features that are otherwise impossible to access. So I want to make sure all of us continue to have that.

What are the goals?

Primarily, just to keep this working and maintained. I'd personally like to make the integrations and library easier to use, and I'm open to any kind of improvements that the community might have - PR's welcome! Other than that, my short term goals over the next few days are:

  1. Finish merging all the PR's from the past few months to add support for new devices, features for vacuums. This is partially complete right now.
  2. Get Formaldehyde, Humidifier, and other new models working and reporting the correct information.
    • There are some PRs, but Dyson is being weird and giving different models the same Device ID's which confuses the logic of libdyson right now.
  3. Done: ~~Work with Github support to remove the Fork status so that the new repos can have their own dedicated Issues tracker.~~
  4. Get some more members on the working group to ensure PRs get merged quickly and updates happen.
  5. Try my best to help people get migrated if they need to.
    • If you have issues: https://github.com/libdyson-wg/ha-dyson/issues

How do I switch from @shenxn's repos to the new repos?

Experimental no-reconfiguration swap

I haven't tested this method very much, but in my experiments it seems possible to switch over with zero impact to your current integration configuration, entities/devices, or dashboards. I don't know what side-effects it may have though (leftover old config data might start causing issues or something - no guarantees).

  1. Remove the ha-dyson and ha-dyson-cloud custom repositories from HACS
    • Without removing the integrations themselves.
  2. Add the new ha-dyson and ha-dyson-cloud custom repositories
    • The ha-dyson-cloud repository is only necessary if you already use it, or are intending to use its features. It is not required, but currently, it makes setting up new devices like HP07 (527K) much simpler.
  3. Update the ha-dyson and ha-dyson-cloud repositories using the HACS updater

Proven some-reconfiguration swap

This is proven to work without any side effects. If you used the default IDs for the entities and devices, then you'll just need to re-configure the devices but your dashboards will not need updating.

  1. Remove the Dyson Local and Dyson Cloud integrations from your /config/integrations page.
  2. Remove the Dyson Local and Dyson Cloud integrations from your /hacs/integrations page.
  3. Remove the dyson-ha and dyson-ha-cloud custom repositories from HACS
  4. Add the new dyson-ha and dyson-ha-cloud custom repositories
    • The libdyson-ha-cloud repository is only necessary if you already use it, or are intending to use its features. It is not required, but currently, it makes setting up new devices like HP07 (527K) much simpler.
  5. Update the dyson-ha and dyson-ha-cloud repositories

That should be it! But if you have any issues doing this, please share: https://github.com/libdyson-wg/ha-dyson/issues

New device type Dyson purifier cool formaldehyde

opened on 2023-03-13 20:24:46 by mtjweb

I have two Dyson Purifier+Cool Formaldehyde. One with device type 358E and one with device type 358K.

I could connect the device type 358E in Home Assistant, but for the device type 358K I''m getting the error "Failed to connect".

No Formaldehyde Value

opened on 2023-03-04 09:46:19 by goofsec

When using TP09 (Cool + Formaldehyde) there is currently no attribute / entity in home assistant that represents the measured formaldeyhde value. Device type: 438E Have I missed anything to set up?

Support Request - Add Device - Dyson HP07 Purifier Hot and Cool - Device Type 527k

opened on 2023-02-19 05:18:36 by smarthomesydney

Please add support for HP07 with HA dysonlocal.

https://www.dyson.com.au/dyson-purifier-hot-cool-black-nickel

Serial: X4G-AU-RXXXXXA Name: Living room Device Type: 527K

Pure Hot and Cool, Hot and Cool (New) and Hot and Cool Link options didn't work

Can pull more info for you if required. Thanks and appreciate the work on local control ;-)

Core 2022.2.0: Sensor has device class temperature, state class measurement and unit °C with non-numeric value: off

opened on 2023-02-03 09:38:51 by JCHH2

Since upgrading to HA core 2022.0, 2 of my fans have this warning in the logs yet a 3rd one does not.

The log entries are: Sensor sensor.pure_hot_cool_temperature has device class temperature, state class measurement and unit °C thus indicating it has a numeric value; however, it has the non-numeric value: off (<class 'str'>); Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author. Sensor sensor.pure_cool_temperature has device class temperature, state class measurement and unit °C thus indicating it has a numeric value; however, it has the non-numeric value: off (<class 'str'>); Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author.

The 3rd fan's sensor (Sensor sensor.pure_hot_cool_temperature_2) has the exact same state with no error.

Screenshot 2023-02-03 at 09 38 03


edit: after a restart, the 3rd fan showed the same log entry. Sensor sensor.pure_cool_temperature_2 has device class temperature, state class measurement and unit °C thus indicating it has a numeric value; however, it has the non-numeric value: off (<class 'str'>); Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author.

Stopped working?

opened on 2023-01-25 05:18:44 by custa1200

My integrations seems to have stopped talking to my Dysons after updating to the latest HACS

Releases

v0.16.4-4 2022-04-08 18:51:30

What's new ?

  • Bumped libdyson to v0.8.11, should fix any problems related to connecting to the cloud
  • Added initial support of HCHO (untested)

Full Changelog: https://github.com/shenxn/ha-dyson/compare/v0.16.4-2...v0.16.4-3

v0.16.4 2022-04-08 16:55:18

What's Changed

  • Fixed libdyson not updating
  • Set the native unit of measure, for 2022.4. by @Flameeyes in https://github.com/shenxn/ha-dyson/pull/117

Full Changelog: https://github.com/shenxn/ha-dyson/compare/v0.16.3...v0.16.4

v0.16.4-3 2022-04-08 18:22:12

What's new ?

  • Bumped libdyson to v0.8.11, should fix any problems related to connecting to the cloud
  • Added initial support of HCHO (untested)

Full Changelog: https://github.com/shenxn/ha-dyson/compare/v0.16.4-2...v0.16.4-3

v0.16.4-2 2022-04-08 17:23:43

What's changed

  • Added initial support of HCHO sensor for Formaldehyde devices

Full Changelog: https://github.com/shenxn/ha-dyson/compare/v0.16.4...v0.16.4-2

v0.16.3 2022-04-06 19:04:41

What's Changed

  • Updates to 2021.12.0 best practices. by @Flameeyes in https://github.com/shenxn/ha-dyson/pull/82
  • Fix error when disabling fan timer by @lrb2 in https://github.com/shenxn/ha-dyson/pull/88
  • Add support for DysonPurifierHumidifyCoolFormaldehyde by @austinbeam in https://github.com/shenxn/ha-dyson/pull/90
  • Fan improvements by @Flameeyes in https://github.com/shenxn/ha-dyson/pull/109
  • Use native unit of measurement for Dyson temp sensor by @jasperslits in https://github.com/shenxn/ha-dyson/pull/113

New Contributors

  • @lrb2 made their first contribution in https://github.com/shenxn/ha-dyson/pull/88
  • @austinbeam made their first contribution in https://github.com/shenxn/ha-dyson/pull/90
  • @jasperslits made their first contribution in https://github.com/shenxn/ha-dyson/pull/113

Full Changelog: https://github.com/shenxn/ha-dyson/compare/v0.16.2...v0.16.3

v0.16.2 2021-12-15 10:10:49

What's Changed

  • Add entities for DysonAirQualitySelect by @crowbarz in https://github.com/shenxn/ha-dyson/pull/77
  • fan, vacuum: replace device_state_attributes usage. by @Flameeyes in https://github.com/shenxn/ha-dyson/pull/79
  • Do not convert the target temperature to integer by @vickyg3 in https://github.com/shenxn/ha-dyson/pull/81

This release fixes temperature settings in Fahrenheit for all supported devices. To get more details about each change made, please check the PRs

New Contributors

  • @crowbarz made their first contribution in https://github.com/shenxn/ha-dyson/pull/77
  • @vickyg3 made their first contribution in https://github.com/shenxn/ha-dyson/pull/81

Full Changelog: https://github.com/shenxn/ha-dyson/compare/v0.16.1...v0.16.2

Xiaonan Shen

M.S. in Computer Science at @UCSD

GitHub Repository