Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ RUN set -eux \
google-cloud==0.34.0 \
grpcio==1.64.0 \
homeassistant=="${VERSION}" \
libdyson==0.8.11 \
numpy==1.26.4 \
pillow==11.0.0 \
pip==23.1.2 \
Expand Down
22 changes: 21 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,26 @@ install: ## Install all the things
pip3 install -r requirements.txt; \
fi

install-dyson: ## Install Dyson custom integration
$(info --> Installing Dyson custom integration)
@./scripts/install-dyson-integration.sh

build: ## Build Docker image
$(info --> Building Docker image)
docker build -t bdossantos/home-assistant .

up: ## Start Home Assistant container
$(info --> Starting Home Assistant)
docker-compose up -d

down: ## Stop Home Assistant container
$(info --> Stopping Home Assistant)
docker-compose down

logs: ## Show Home Assistant logs
$(info --> Showing Home Assistant logs)
docker-compose logs -f home-assistant

pre-commit: ## Run pre-commit tests
$(info --> Run pre-commit)
@pre-commit run --all-files
Expand All @@ -25,7 +45,7 @@ shellcheck: ## Run shellcheck on /scripts directory

test: ## Run tests suite
$(MAKE) pre-commit
docker build -t bdossantos/home-assistant .
$(MAKE) build
docker run \
-v "${PWD}/homeassistant:/config" \
-v '${PWD}/homeassistant/secrets.yaml.dist:/config/secrets.yaml:ro' \
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@

See the [UI Improvements Documentation](docs/UI_IMPROVEMENTS.md) for detailed information.

### Smart Home Integrations
- **🌪️ Dyson Pure Hot Cool**: Full air purifier, heater, and fan control with air quality monitoring
- See [Dyson Integration Setup](docs/dyson-integration.md) for installation and configuration

## Installation

```
Expand Down
107 changes: 107 additions & 0 deletions docs/dyson-integration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# Dyson Integration Setup

This directory contains the setup for the Dyson Pure Hot Cool integration in Home Assistant.

## Prerequisites

1. **libdyson Library**: Added to the Docker image dependencies in `Dockerfile`
2. **ha-dyson Custom Component**: Must be installed before starting Home Assistant

## Installation Steps

### 1. Install the Custom Component

Run the installation script to download and install the ha-dyson custom component:

```bash
./scripts/install-dyson-integration.sh
```

This script will:
- Download the latest release of ha-dyson from GitHub
- Extract the custom component to `homeassistant/custom_components/dyson/`
- Provide setup instructions

### 2. Configure Secrets

Add your Dyson account credentials to `homeassistant/secrets.yaml`:

```yaml
dyson_username: [email protected]
dyson_password: your_dyson_password
```

### 3. Build and Start Home Assistant

```bash
make build
make up
```

### 4. Configure Integration in Home Assistant

1. Navigate to **Settings** > **Devices & Services**
2. Click **Add Integration**
3. Search for **Dyson**
4. Follow the setup wizard:
- Option A: Use your MyDyson account (recommended)
- Option B: Use device Wi-Fi information from the sticker

## Integration Features

### Fan Control (`homeassistant/fan/dyson.yaml`)
- Speed adjustment (1-10)
- Oscillation control
- Power on/off
- Timer functions

### Climate Control (`homeassistant/climate/dyson.yaml`)
- Heating mode
- Temperature control
- Heat mode on/off

### Sensors (Auto-discovered)
- PM2.5 air quality
- PM10 air quality
- VOC index
- NO2 index
- Temperature
- Humidity
- Filter life

### HomeKit Integration
- Fan controls available in Apple Home app
- Climate controls as thermostat
- Temperature sensors for automation

## Device Information

- **Device**: Dyson Pure Hot Cool
- **Hostname**: dyson-pure-hot-cool01.bds.home.arpa
- **IP Address**: 10.92.66.8
- **Supported Models**: HP07, HP09, TP07, TP09, and others (see ha-dyson documentation)

## Troubleshooting

### Connection Issues
1. **Power cycle the device**: Unplug for 10 seconds and plug back in
2. **Check network connectivity**: Ensure device is on the same network
3. **Verify credentials**: Check MyDyson account email/password
4. **Check MQTT**: Device runs an MQTT broker with connection limits

### Integration Not Found
1. Ensure the custom component is installed: `ls homeassistant/custom_components/dyson/`
2. Restart Home Assistant after installing the component
3. Check Home Assistant logs for errors

### Platform Configuration Issues
The configuration files (`fan/dyson.yaml` and `climate/dyson.yaml`) use the `dyson` platform which is provided by the custom component. If you see "Unknown platform" errors, ensure:
1. The custom component is properly installed
2. Home Assistant has been restarted
3. The libdyson dependency is available

## References

- [ha-dyson GitHub Repository](https://github.com/libdyson-wg/ha-dyson)
- [libdyson Python Library](https://github.com/libdyson-wg/libdyson)
- [Home Assistant Custom Components Documentation](https://developers.home-assistant.io/docs/creating_integration_file_structure/)
62 changes: 62 additions & 0 deletions homeassistant/automation/dyson.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
# Dyson Air Quality Automation Examples
# These automations demonstrate smart air quality management

# Turn on Dyson fan when air quality is poor
- alias: "Auto Air Purification - High PM2.5"
trigger:
platform: numeric_state
entity_id: sensor.dyson_pure_hot_cool01_particulate_matter_2_5
above: 35 # WHO recommended limit
condition:
condition: state
entity_id: fan.dyson_pure_hot_cool01
state: "off"
action:
- service: fan.turn_on
entity_id: fan.dyson_pure_hot_cool01
data:
speed: "medium"
- service: notify.all_smartphones
data:
title: "Air Quality Alert"
message: "High PM2.5 detected. Dyson air purifier activated."

# Turn on heating when temperature drops and someone is home
- alias: "Smart Heating - Temperature Control"
trigger:
platform: numeric_state
entity_id: sensor.dyson_pure_hot_cool01_temperature
below: 20
condition:
condition: and
conditions:
- condition: state
entity_id: input_boolean.vacation_mode
state: "off"
- condition: or
conditions:
- condition: state
entity_id: person.benjamin
state: "home"
- condition: state
entity_id: person.gf
state: "home"
action:
- service: climate.set_temperature
entity_id: climate.dyson_pure_hot_cool01
data:
temperature: 22
hvac_mode: "heat"

# Energy saving: Turn off during vacation
- alias: "Vacation Mode - Disable Dyson"
trigger:
platform: state
entity_id: input_boolean.vacation_mode
to: "on"
action:
- service: fan.turn_off
entity_id: fan.dyson_pure_hot_cool01
- service: climate.turn_off
entity_id: climate.dyson_pure_hot_cool01
4 changes: 4 additions & 0 deletions homeassistant/climate/dyson.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[]
# This file is intentionally empty.
# Dyson integration is configured through the Home Assistant UI.
# See docs/dyson-integration.md for setup instructions.
22 changes: 22 additions & 0 deletions homeassistant/configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ sensor: !include_dir_merge_list sensor

binary_sensor: !include_dir_merge_list binary_sensor

fan: !include_dir_merge_list fan

climate: !include_dir_merge_list climate

device_tracker: !include_dir_merge_list device_tracker

homekit:
Expand Down Expand Up @@ -117,6 +121,8 @@ homekit:
- camera
- switch # Add switches for smart plugs and controls
- scene # Include scenes for HomeKit automation
- fan # Include fans for air circulation and purification
- climate # Include climate controls for heating/cooling

# Include specific entity patterns
include_entity_globs:
Expand All @@ -128,6 +134,10 @@ homekit:
- binary_sensor.*_motion # Include motion sensors
- sensor.*_temperature # Include temperature sensors
- sensor.*_illuminance # Include light sensors
- fan.dyson_* # Include Dyson fan controls
- climate.dyson_* # Include Dyson climate controls
- sensor.dyson_*_temperature # Include Dyson temperature sensors
- sensor.dyson_*_humidity # Include Dyson humidity sensors
- scene.good_* # Include good morning/night scenes
- scene.movie_* # Include movie time scene
- scene.candle_* # Include candle light scene
Expand Down Expand Up @@ -192,6 +202,16 @@ homekit:
name: Water Heater
type: switch

# Fan configurations
fan.dyson_pure_hot_cool01:
name: Dyson Air Purifier
type: fan

# Climate configurations
climate.dyson_pure_hot_cool01:
name: Dyson Heater
type: thermostat

# Motion sensor configurations
binary_sensor.hue_motion_sensor_hallway_motion:
name: Hallway Motion
Expand Down Expand Up @@ -289,6 +309,8 @@ group:
entities:
- light.livingroom1
- media_player.living_room
- fan.dyson_pure_hot_cool01
- climate.dyson_pure_hot_cool01
- sensor.ups_input_voltage
- sensor.ups_load

Expand Down
5 changes: 5 additions & 0 deletions homeassistant/customize/climate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
# Dyson Climate Customization
climate.dyson_pure_hot_cool01:
friendly_name: "Dyson Heater"
icon: mdi:thermostat
5 changes: 5 additions & 0 deletions homeassistant/customize/fan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
# Dyson Fan Customization
fan.dyson_pure_hot_cool01:
friendly_name: "Dyson Pure Hot Cool"
icon: mdi:fan
20 changes: 20 additions & 0 deletions homeassistant/customize/sensor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,23 @@ sensor.hot_water_cylinder_total_consumption:
sensor.hot_water_cylinder_voltage:
friendly_name: "Supply Voltage"
icon: mdi:lightning-bolt

# Dyson Pure Hot Cool Sensors
sensor.dyson_pure_hot_cool01_temperature:
friendly_name: "Dyson Temperature"
icon: mdi:thermometer
sensor.dyson_pure_hot_cool01_humidity:
friendly_name: "Dyson Humidity"
icon: mdi:water-percent
sensor.dyson_pure_hot_cool01_particulate_matter_2_5:
friendly_name: "PM2.5"
icon: mdi:dots-circle
sensor.dyson_pure_hot_cool01_particulate_matter_10:
friendly_name: "PM10"
icon: mdi:dots-circle
sensor.dyson_pure_hot_cool01_volatile_organic_compounds:
friendly_name: "VOC Index"
icon: mdi:chemical-weapon
sensor.dyson_pure_hot_cool01_nitrogen_dioxide:
friendly_name: "NO2 Level"
icon: mdi:molecule
4 changes: 4 additions & 0 deletions homeassistant/fan/dyson.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[]
# This file is intentionally empty.
# Dyson integration is configured through the Home Assistant UI.
# See docs/dyson-integration.md for setup instructions.
2 changes: 2 additions & 0 deletions homeassistant/secrets.yaml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ home_longitude: 00.00000
icloud_bds_accountname: secret
work_latitude: 00.00000
work_longitude: 00.00000
dyson_username: [email protected]
dyson_password: your_dyson_password
# cat /dev/urandom | tr -dc '0-9A-F' | fold -w 32 | head -n 1 | sed -e 's/\(..\)/0x\1, /g' -e 's/, $//'
z_wave_network_key: "0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10"
29 changes: 29 additions & 0 deletions homeassistant/ui-lovelace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,17 @@ views:
entities:
- sensor.hue_motion_sensor_kitchen_temperature
- sensor.hue_motion_sensor_hallway_temperature
- sensor.dyson_pure_hot_cool01_temperature
icon: mdi:thermometer

- type: entities
title: Air Quality & Climate Control
entities:
- fan.dyson_pure_hot_cool01
- climate.dyson_pure_hot_cool01
- sensor.dyson_pure_hot_cool01_particulate_matter_2_5
icon: mdi:air-filter

- type: grid
columns: 2
square: false
Expand Down Expand Up @@ -71,6 +80,26 @@ views:
- type: media-control
entity: media_player.living_room

- type: entities
title: Air Quality & Climate
entities:
- fan.dyson_pure_hot_cool01
- climate.dyson_pure_hot_cool01
- sensor.dyson_pure_hot_cool01_temperature
- sensor.dyson_pure_hot_cool01_humidity
icon: mdi:air-filter

- type: gauge
entity: sensor.dyson_pure_hot_cool01_particulate_matter_2_5
name: Air Quality (PM2.5)
min: 0
max: 100
severity:
green: 0
yellow: 25
red: 50
unit: "µg/m³"

- type: entities
title: Environment
entities:
Expand Down
Loading