Skip to content

Commit b567948

Browse files
committed
Update Aqara W500
1 parent d5cd963 commit b567948

1 file changed

Lines changed: 175 additions & 72 deletions

File tree

Lines changed: 175 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,181 @@
1+
---
2+
tags:
3+
- package
4+
- automated
5+
version: 1.0.0
6+
---
7+
18
# Package: Aqara W500
29

3-
## Executive Summary
4-
This package integrates the Aqara W500 generic climate device. It creates individual **Template Sensors** for the raw temperature and HVAC action state, and a **Filter Sensor** to smooth the temperature readings over time (using a lowpass filter and throttle), likely to reduce noise or fluctuations in the heating logic.
5-
6-
## Architecture
7-
```mermaid
8-
sequenceDiagram
9-
participant Climate as climate.aqara_w500
10-
participant Template as HA Template Engine
11-
participant RawSensor as sensor.aqara_w500_temperature_raw
12-
participant Filter as Filter Integration
13-
participant SmoothSensor as sensor.aqara_w500_temperature_smoothed
14-
15-
Climate->>Template: Attribute Change (current_temperature)
16-
Template->>RawSensor: Update State
17-
RawSensor->>Filter: New Reading
18-
Filter->>Filter: Apply Lowpass & Time Throttle
19-
Filter->>SmoothSensor: Update Smoothed Value
20-
```
10+
**Version:** 1.0.0
11+
**Description:** Manages temperature settings and schedules for the Bathroom Floor Heat (Aqara W500 Climate). Includes logic for high electricity price reduction and shower occupancy boost.
12+
13+
14+
15+
<!-- PACKAGE_SUMMARY_SLOT -->
16+
17+
18+
19+
## Architecture Diagram
20+
21+
22+
<!-- PACKAGE_MERMAID_SLOT -->
2123

22-
## Backend Configuration
24+
25+
26+
## Configuration
2327
```yaml
24-
template:
25-
- sensor:
26-
- name: "Aqara W500 Temperature (Raw)"
27-
unique_id: aqara_w500_temperature_raw
28-
unit_of_measurement: "°C"
29-
device_class: temperature
30-
state_class: measurement
31-
state: >
32-
{% set raw = state_attr('climate.aqara_w500', 'current_temperature') %}
33-
{% set value = raw | float(default=0.0) %}
34-
{{ value | round(1) }}
35-
36-
- sensor:
37-
- name: "Aqara W500 Bathroom Heating HVAC"
38-
unique_id: aqara_w500_bathroom_heating_hvac
39-
state: "{{ state_attr('climate.aqara_w500', 'hvac_action') }}"
40-
icon: mdi:heating-coil
41-
42-
sensor:
43-
- platform: filter
44-
name: "Aqara W500 Temperature (Smoothed)"
45-
entity_id: sensor.aqara_w500_temperature_raw
46-
unique_id: aqara_w500_temperature_smoothed
47-
filters:
48-
- filter: lowpass
49-
time_constant: 10
50-
precision: 1
51-
- filter: time_throttle
52-
window_size: 60
28+
# ------------------------------------------------------------------------------
29+
# Package: Aqara W500 Floor Heating Control
30+
# Version: 1.0.0
31+
# Description: Manages temperature settings and schedules for the Bathroom Floor Heat (Aqara W500 Climate). Includes logic for high electricity price reduction and shower occupancy boost.
32+
# Dependencies:
33+
# - Entities: climate.aqara_w500, binary_sensor.bathroom_fp2_shower_occupancy, sensor.electricity_price_cents
34+
# - Helpers: input_number.electricity_high_price_threshold, input_number.bathroom_floor_heat_target_temperature, input_number.bathroom_floor_heat_default_temperature, input_number.bathroom_floor_heat_override_duration, timer.bathroom_floor_heating_timer
35+
# ------------------------------------------------------------------------------
36+
37+
automation:
38+
# ==============================================================================
39+
# 1. Automation: Bathroom Heating On when showering
40+
# ==============================================================================
41+
- alias: "Heating: Boost Heat on Shower Occupancy"
42+
id: heating_boost_on_shower
43+
description: "Sets the floor heating to target override temperature when prolonged shower occupancy is detected, provided electricity prices are below the high threshold."
44+
trigger:
45+
# If the bathroom is occupied for 30 minutes (suggesting a shower/bath is in progress)
46+
- platform: state
47+
entity_id: binary_sensor.bathroom_fp2_shower_occupancy
48+
from:
49+
- "off"
50+
- "on"
51+
to: "on"
52+
for:
53+
minutes: 30
54+
condition:
55+
# Condition 1: Electricity price is low enough to allow boosting
56+
- condition: numeric_state
57+
entity_id: sensor.electricity_price_cents
58+
below: input_number.electricity_high_price_threshold
59+
# Condition 2: Only boost if the current target is NOT already the override target
60+
- condition: template
61+
value_template: |
62+
{{
63+
state_attr('climate.aqara_w500', 'temperature') | float !=
64+
states('input_number.bathroom_floor_heat_target_temperature') | float
65+
}}
66+
action:
67+
- service: climate.set_temperature
68+
target:
69+
entity_id: climate.aqara_w500
70+
data:
71+
temperature: >-
72+
{{ states('input_number.bathroom_floor_heat_target_temperature') | float }}
73+
mode: single
74+
75+
# ==============================================================================
76+
# 2. Automation: Manage Floor Heat Override Timer
77+
# ==============================================================================
78+
- alias: "Heating: Manage Floor Heat Override Timer"
79+
id: heating_manage_override_timer
80+
description: "Starts timer when manual temperature override is set; cancels timer if temperature is reset to default."
81+
trigger:
82+
# Trigger 1: User sets temp above default (Starts timer)
83+
- platform: numeric_state
84+
entity_id: climate.aqara_w500
85+
attribute: temperature
86+
above: input_number.bathroom_floor_heat_default_temperature
87+
id: start_timer
88+
# Trigger 2: User changes temp (Check if we need to cancel timer)
89+
- platform: state
90+
entity_id: climate.aqara_w500
91+
attribute: temperature
92+
id: cancel_check
93+
condition: []
94+
action:
95+
- choose:
96+
# Case 1: Start timer if temp is set above default
97+
- conditions:
98+
- condition: trigger
99+
id: start_timer
100+
sequence:
101+
- service: timer.start
102+
target:
103+
entity_id: timer.bathroom_floor_heating_timer
104+
data:
105+
duration: >-
106+
{{ states('input_number.bathroom_floor_heat_override_duration') | int(0) * 60 }}
107+
# Case 2: Cancel timer if temp is set back to default or lower
108+
- conditions:
109+
- condition: trigger
110+
id: cancel_check
111+
- condition: template
112+
value_template: >
113+
{# Check if the current set temperature is <= the default temperature #}
114+
{{ state_attr('climate.aqara_w500', 'temperature') | float(0) <=
115+
states('input_number.bathroom_floor_heat_default_temperature') | float(0) }}
116+
sequence:
117+
- service: timer.cancel
118+
target:
119+
entity_id: timer.bathroom_floor_heating_timer
120+
mode: single
121+
122+
# ==============================================================================
123+
# 3. Automation: Reduce Floor Heat when Price is High
124+
# ==============================================================================
125+
- alias: "Heating: Reduce Floor Heat when Price is High"
126+
id: heating_price_reduce
127+
description: "Sets Aqara W500 to default temp when electricity price exceeds a set threshold, but only if temperature is currently higher than the default temp."
128+
trigger:
129+
- platform: numeric_state
130+
entity_id: sensor.electricity_prices
131+
above: input_number.electricity_high_price_threshold
132+
condition:
133+
- condition: state
134+
entity_id: climate.aqara_w500
135+
state: heat
136+
- condition: numeric_state
137+
entity_id: climate.aqara_w500
138+
attribute: temperature
139+
above: input_number.bathroom_floor_heat_default_temperature
140+
action:
141+
- service: climate.set_temperature
142+
target:
143+
entity_id: climate.aqara_w500
144+
data:
145+
temperature: >-
146+
{{ states('input_number.bathroom_floor_heat_default_temperature') | float(22) }}
147+
mode: single
148+
149+
# ==============================================================================
150+
# 4. Automation: Reset Floor Heat on Timer Finish
151+
# ==============================================================================
152+
- alias: "Heating: Reset Floor Heat on Timer Finish"
153+
id: heating_reset_on_timer
154+
description: "Sets Aqara W500 back to the default temperature when the override timer expires."
155+
trigger:
156+
- platform: event
157+
event_type: timer.finished
158+
event_data:
159+
entity_id: timer.bathroom_floor_heating_timer
160+
condition: []
161+
action:
162+
- service: climate.set_temperature
163+
target:
164+
entity_id: climate.aqara_w500
165+
data:
166+
temperature: >-
167+
{{ states('input_number.bathroom_floor_heat_default_temperature') | float(22) }}
168+
mode: single
169+
# ------------------------------------------------------------------------------
170+
# Changelog
171+
# ------------------------------------------------------------------------------
172+
# 1.0.0 (2025-12-08): Initial package consolidation from multiple UI automations. Implemented logic for shower boost, high price reduction, and override timer management.
173+
# ------------------------------------------------------------------------------
174+
53175
```
54176

55-
## Frontend Connection
56-
**Key Entities**:
57-
- `sensor.aqara_w500_temperature_raw`
58-
- `sensor.aqara_w500_bathroom_heating_hvac`
59-
- `sensor.aqara_w500_temperature_smoothed`
60-
61-
**Dashboard Usage**:
62-
No specific dashboard card configuration was found for these entities in the generated dashboards. They might be used in auto-generated views or historical graphs.
63-
64-
### UI Simulation
65-
<div style="border: 1px solid #444; border-radius: 12px; padding: 16px; width: 300px; background: #222; color: white; font-family: sans-serif;">
66-
<div style="display: flex; align-items: center; gap: 12px;">
67-
<div style="background: #e67e22; padding: 8px; border-radius: 50%;">
68-
<span style="font-size: 24px; color: white;">🔥</span>
69-
</div>
70-
<div>
71-
<div style="font-weight: bold;">Bathroom Heating</div>
72-
<div style="color: #aaa; font-size: 0.9em;">Heating</div>
73-
</div>
74-
<div style="margin-left: auto; font-size: 1.2em; font-weight: bold;">
75-
22.5 °C
76-
</div>
77-
</div>
78-
</div>
177+
178+
179+
## Dashboard Connections
180+
<!-- DASHBOARD_CONNECTIONS_SLOT -->
181+

0 commit comments

Comments
 (0)