Fix: Use coefficient_of_variation attribute from volatility sensor

Replaced incorrect day_volatility_% on binary sensor with actual coefficient_of_variation attribute from sensor.tibber_home_volatility_today

Co-authored-by: jpawlowski <75446+jpawlowski@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2025-12-24 17:17:32 +00:00
parent fb70b0ca6b
commit 7dd1d2c8dc
7 changed files with 35 additions and 35 deletions

View file

@ -39,7 +39,7 @@ automation:
# Only act if volatility > 15% (meaningful savings) # Only act if volatility > 15% (meaningful savings)
- condition: template - condition: template
value_template: > value_template: >
{{ state_attr('binary_sensor.tibber_home_best_price_period', 'day_volatility_%') | float(0) > 15 }} {{ state_attr('sensor.tibber_home_volatility_today', 'coefficient_of_variation') | float(0) > 15 }}
# Optional: Ensure dishwasher is idle and door closed # Optional: Ensure dishwasher is idle and door closed
- condition: state - condition: state
entity_id: binary_sensor.dishwasher_door entity_id: binary_sensor.dishwasher_door
@ -50,7 +50,7 @@ automation:
entity_id: switch.dishwasher_smart_plug entity_id: switch.dishwasher_smart_plug
- service: notify.mobile_app - service: notify.mobile_app
data: data:
message: "Dishwasher started during Best Price period ({{ states('sensor.tibber_home_current_interval_price_ct') }} ct/kWh, volatility {{ state_attr('binary_sensor.tibber_home_best_price_period', 'day_volatility_%') }}%)" message: "Dishwasher started during Best Price period ({{ states('sensor.tibber_home_current_interval_price_ct') }} ct/kWh, volatility {{ state_attr('sensor.tibber_home_volatility_today', 'coefficient_of_variation') }}%)"
``` ```
**Why this works:** **Why this works:**
@ -118,7 +118,7 @@ automation:
# Path 1: High volatility day - trust period classification # Path 1: High volatility day - trust period classification
- condition: template - condition: template
value_template: > value_template: >
{{ state_attr('binary_sensor.tibber_home_best_price_period', 'day_volatility_%') | float(0) > 15 }} {{ state_attr('sensor.tibber_home_volatility_today', 'coefficient_of_variation') | float(0) > 15 }}
# Path 2: Low volatility but price is genuinely cheap # Path 2: Low volatility but price is genuinely cheap
- condition: numeric_state - condition: numeric_state
entity_id: sensor.tibber_home_current_interval_price_ct entity_id: sensor.tibber_home_current_interval_price_ct
@ -131,7 +131,7 @@ automation:
data: data:
message: > message: >
EV charging started: {{ states('sensor.tibber_home_current_interval_price_ct') }} ct/kWh EV charging started: {{ states('sensor.tibber_home_current_interval_price_ct') }} ct/kWh
(Volatility: {{ state_attr('binary_sensor.tibber_home_best_price_period', 'day_volatility_%') }}%) (Volatility: {{ state_attr('sensor.tibber_home_volatility_today', 'coefficient_of_variation') }}%)
``` ```
**Why this works:** **Why this works:**
@ -159,7 +159,7 @@ automation:
# And volatility is meaningful # And volatility is meaningful
- condition: template - condition: template
value_template: > value_template: >
{{ state_attr('binary_sensor.tibber_home_best_price_period', 'day_volatility_%') | float(0) > 15 }} {{ state_attr('sensor.tibber_home_volatility_today', 'coefficient_of_variation') | float(0) > 15 }}
action: action:
- service: button.press - service: button.press
target: target:

View file

@ -39,7 +39,7 @@ automation:
# Only act if volatility > 15% (meaningful savings) # Only act if volatility > 15% (meaningful savings)
- condition: template - condition: template
value_template: > value_template: >
{{ state_attr('binary_sensor.tibber_home_best_price_period', 'day_volatility_%') | float(0) > 15 }} {{ state_attr('sensor.tibber_home_volatility_today', 'coefficient_of_variation') | float(0) > 15 }}
# Optional: Ensure dishwasher is idle and door closed # Optional: Ensure dishwasher is idle and door closed
- condition: state - condition: state
entity_id: binary_sensor.dishwasher_door entity_id: binary_sensor.dishwasher_door
@ -50,7 +50,7 @@ automation:
entity_id: switch.dishwasher_smart_plug entity_id: switch.dishwasher_smart_plug
- service: notify.mobile_app - service: notify.mobile_app
data: data:
message: "Dishwasher started during Best Price period ({{ states('sensor.tibber_home_current_interval_price_ct') }} ct/kWh, volatility {{ state_attr('binary_sensor.tibber_home_best_price_period', 'day_volatility_%') }}%)" message: "Dishwasher started during Best Price period ({{ states('sensor.tibber_home_current_interval_price_ct') }} ct/kWh, volatility {{ state_attr('sensor.tibber_home_volatility_today', 'coefficient_of_variation') }}%)"
``` ```
**Why this works:** **Why this works:**
@ -118,7 +118,7 @@ automation:
# Path 1: High volatility day - trust period classification # Path 1: High volatility day - trust period classification
- condition: template - condition: template
value_template: > value_template: >
{{ state_attr('binary_sensor.tibber_home_best_price_period', 'day_volatility_%') | float(0) > 15 }} {{ state_attr('sensor.tibber_home_volatility_today', 'coefficient_of_variation') | float(0) > 15 }}
# Path 2: Low volatility but price is genuinely cheap # Path 2: Low volatility but price is genuinely cheap
- condition: numeric_state - condition: numeric_state
entity_id: sensor.tibber_home_current_interval_price_ct entity_id: sensor.tibber_home_current_interval_price_ct
@ -131,7 +131,7 @@ automation:
data: data:
message: > message: >
EV charging started: {{ states('sensor.tibber_home_current_interval_price_ct') }} ct/kWh EV charging started: {{ states('sensor.tibber_home_current_interval_price_ct') }} ct/kWh
(Volatility: {{ state_attr('binary_sensor.tibber_home_best_price_period', 'day_volatility_%') }}%) (Volatility: {{ state_attr('sensor.tibber_home_volatility_today', 'coefficient_of_variation') }}%)
``` ```
**Why this works:** **Why this works:**
@ -159,7 +159,7 @@ automation:
# And volatility is meaningful # And volatility is meaningful
- condition: template - condition: template
value_template: > value_template: >
{{ state_attr('binary_sensor.tibber_home_best_price_period', 'day_volatility_%') | float(0) > 15 }} {{ state_attr('sensor.tibber_home_volatility_today', 'coefficient_of_variation') | float(0) > 15 }}
action: action:
- service: button.press - service: button.press
target: target:

View file

@ -39,7 +39,7 @@ automation:
# Only act if volatility > 15% (meaningful savings) # Only act if volatility > 15% (meaningful savings)
- condition: template - condition: template
value_template: > value_template: >
{{ state_attr('binary_sensor.tibber_home_best_price_period', 'day_volatility_%') | float(0) > 15 }} {{ state_attr('sensor.tibber_home_volatility_today', 'coefficient_of_variation') | float(0) > 15 }}
# Optional: Ensure dishwasher is idle and door closed # Optional: Ensure dishwasher is idle and door closed
- condition: state - condition: state
entity_id: binary_sensor.dishwasher_door entity_id: binary_sensor.dishwasher_door
@ -50,7 +50,7 @@ automation:
entity_id: switch.dishwasher_smart_plug entity_id: switch.dishwasher_smart_plug
- service: notify.mobile_app - service: notify.mobile_app
data: data:
message: "Dishwasher started during Best Price period ({{ states('sensor.tibber_home_current_interval_price_ct') }} ct/kWh, volatility {{ state_attr('binary_sensor.tibber_home_best_price_period', 'day_volatility_%') }}%)" message: "Dishwasher started during Best Price period ({{ states('sensor.tibber_home_current_interval_price_ct') }} ct/kWh, volatility {{ state_attr('sensor.tibber_home_volatility_today', 'coefficient_of_variation') }}%)"
``` ```
**Why this works:** **Why this works:**
@ -118,7 +118,7 @@ automation:
# Path 1: High volatility day - trust period classification # Path 1: High volatility day - trust period classification
- condition: template - condition: template
value_template: > value_template: >
{{ state_attr('binary_sensor.tibber_home_best_price_period', 'day_volatility_%') | float(0) > 15 }} {{ state_attr('sensor.tibber_home_volatility_today', 'coefficient_of_variation') | float(0) > 15 }}
# Path 2: Low volatility but price is genuinely cheap # Path 2: Low volatility but price is genuinely cheap
- condition: numeric_state - condition: numeric_state
entity_id: sensor.tibber_home_current_interval_price_ct entity_id: sensor.tibber_home_current_interval_price_ct
@ -131,7 +131,7 @@ automation:
data: data:
message: > message: >
EV charging started: {{ states('sensor.tibber_home_current_interval_price_ct') }} ct/kWh EV charging started: {{ states('sensor.tibber_home_current_interval_price_ct') }} ct/kWh
(Volatility: {{ state_attr('binary_sensor.tibber_home_best_price_period', 'day_volatility_%') }}%) (Volatility: {{ state_attr('sensor.tibber_home_volatility_today', 'coefficient_of_variation') }}%)
``` ```
**Why this works:** **Why this works:**
@ -159,7 +159,7 @@ automation:
# And volatility is meaningful # And volatility is meaningful
- condition: template - condition: template
value_template: > value_template: >
{{ state_attr('binary_sensor.tibber_home_best_price_period', 'day_volatility_%') | float(0) > 15 }} {{ state_attr('sensor.tibber_home_volatility_today', 'coefficient_of_variation') | float(0) > 15 }}
action: action:
- service: button.press - service: button.press
target: target:

View file

@ -39,7 +39,7 @@ automation:
# Only act if volatility > 15% (meaningful savings) # Only act if volatility > 15% (meaningful savings)
- condition: template - condition: template
value_template: > value_template: >
{{ state_attr('binary_sensor.tibber_home_best_price_period', 'day_volatility_%') | float(0) > 15 }} {{ state_attr('sensor.tibber_home_volatility_today', 'coefficient_of_variation') | float(0) > 15 }}
# Optional: Ensure dishwasher is idle and door closed # Optional: Ensure dishwasher is idle and door closed
- condition: state - condition: state
entity_id: binary_sensor.dishwasher_door entity_id: binary_sensor.dishwasher_door
@ -50,7 +50,7 @@ automation:
entity_id: switch.dishwasher_smart_plug entity_id: switch.dishwasher_smart_plug
- service: notify.mobile_app - service: notify.mobile_app
data: data:
message: "Dishwasher started during Best Price period ({{ states('sensor.tibber_home_current_interval_price_ct') }} ct/kWh, volatility {{ state_attr('binary_sensor.tibber_home_best_price_period', 'day_volatility_%') }}%)" message: "Dishwasher started during Best Price period ({{ states('sensor.tibber_home_current_interval_price_ct') }} ct/kWh, volatility {{ state_attr('sensor.tibber_home_volatility_today', 'coefficient_of_variation') }}%)"
``` ```
**Why this works:** **Why this works:**
@ -118,7 +118,7 @@ automation:
# Path 1: High volatility day - trust period classification # Path 1: High volatility day - trust period classification
- condition: template - condition: template
value_template: > value_template: >
{{ state_attr('binary_sensor.tibber_home_best_price_period', 'day_volatility_%') | float(0) > 15 }} {{ state_attr('sensor.tibber_home_volatility_today', 'coefficient_of_variation') | float(0) > 15 }}
# Path 2: Low volatility but price is genuinely cheap # Path 2: Low volatility but price is genuinely cheap
- condition: numeric_state - condition: numeric_state
entity_id: sensor.tibber_home_current_interval_price_ct entity_id: sensor.tibber_home_current_interval_price_ct
@ -131,7 +131,7 @@ automation:
data: data:
message: > message: >
EV charging started: {{ states('sensor.tibber_home_current_interval_price_ct') }} ct/kWh EV charging started: {{ states('sensor.tibber_home_current_interval_price_ct') }} ct/kWh
(Volatility: {{ state_attr('binary_sensor.tibber_home_best_price_period', 'day_volatility_%') }}%) (Volatility: {{ state_attr('sensor.tibber_home_volatility_today', 'coefficient_of_variation') }}%)
``` ```
**Why this works:** **Why this works:**
@ -159,7 +159,7 @@ automation:
# And volatility is meaningful # And volatility is meaningful
- condition: template - condition: template
value_template: > value_template: >
{{ state_attr('binary_sensor.tibber_home_best_price_period', 'day_volatility_%') | float(0) > 15 }} {{ state_attr('sensor.tibber_home_volatility_today', 'coefficient_of_variation') | float(0) > 15 }}
action: action:
- service: button.press - service: button.press
target: target:

View file

@ -39,7 +39,7 @@ automation:
# Only act if volatility > 15% (meaningful savings) # Only act if volatility > 15% (meaningful savings)
- condition: template - condition: template
value_template: > value_template: >
{{ state_attr('binary_sensor.tibber_home_best_price_period', 'day_volatility_%') | float(0) > 15 }} {{ state_attr('sensor.tibber_home_volatility_today', 'coefficient_of_variation') | float(0) > 15 }}
# Optional: Ensure dishwasher is idle and door closed # Optional: Ensure dishwasher is idle and door closed
- condition: state - condition: state
entity_id: binary_sensor.dishwasher_door entity_id: binary_sensor.dishwasher_door
@ -50,7 +50,7 @@ automation:
entity_id: switch.dishwasher_smart_plug entity_id: switch.dishwasher_smart_plug
- service: notify.mobile_app - service: notify.mobile_app
data: data:
message: "Dishwasher started during Best Price period ({{ states('sensor.tibber_home_current_interval_price_ct') }} ct/kWh, volatility {{ state_attr('binary_sensor.tibber_home_best_price_period', 'day_volatility_%') }}%)" message: "Dishwasher started during Best Price period ({{ states('sensor.tibber_home_current_interval_price_ct') }} ct/kWh, volatility {{ state_attr('sensor.tibber_home_volatility_today', 'coefficient_of_variation') }}%)"
``` ```
**Why this works:** **Why this works:**
@ -118,7 +118,7 @@ automation:
# Path 1: High volatility day - trust period classification # Path 1: High volatility day - trust period classification
- condition: template - condition: template
value_template: > value_template: >
{{ state_attr('binary_sensor.tibber_home_best_price_period', 'day_volatility_%') | float(0) > 15 }} {{ state_attr('sensor.tibber_home_volatility_today', 'coefficient_of_variation') | float(0) > 15 }}
# Path 2: Low volatility but price is genuinely cheap # Path 2: Low volatility but price is genuinely cheap
- condition: numeric_state - condition: numeric_state
entity_id: sensor.tibber_home_current_interval_price_ct entity_id: sensor.tibber_home_current_interval_price_ct
@ -131,7 +131,7 @@ automation:
data: data:
message: > message: >
EV charging started: {{ states('sensor.tibber_home_current_interval_price_ct') }} ct/kWh EV charging started: {{ states('sensor.tibber_home_current_interval_price_ct') }} ct/kWh
(Volatility: {{ state_attr('binary_sensor.tibber_home_best_price_period', 'day_volatility_%') }}%) (Volatility: {{ state_attr('sensor.tibber_home_volatility_today', 'coefficient_of_variation') }}%)
``` ```
**Why this works:** **Why this works:**
@ -159,7 +159,7 @@ automation:
# And volatility is meaningful # And volatility is meaningful
- condition: template - condition: template
value_template: > value_template: >
{{ state_attr('binary_sensor.tibber_home_best_price_period', 'day_volatility_%') | float(0) > 15 }} {{ state_attr('sensor.tibber_home_volatility_today', 'coefficient_of_variation') | float(0) > 15 }}
action: action:
- service: button.press - service: button.press
target: target:

View file

@ -39,7 +39,7 @@ automation:
# Only act if volatility > 15% (meaningful savings) # Only act if volatility > 15% (meaningful savings)
- condition: template - condition: template
value_template: > value_template: >
{{ state_attr('binary_sensor.tibber_home_best_price_period', 'day_volatility_%') | float(0) > 15 }} {{ state_attr('sensor.tibber_home_volatility_today', 'coefficient_of_variation') | float(0) > 15 }}
# Optional: Ensure dishwasher is idle and door closed # Optional: Ensure dishwasher is idle and door closed
- condition: state - condition: state
entity_id: binary_sensor.dishwasher_door entity_id: binary_sensor.dishwasher_door
@ -50,7 +50,7 @@ automation:
entity_id: switch.dishwasher_smart_plug entity_id: switch.dishwasher_smart_plug
- service: notify.mobile_app - service: notify.mobile_app
data: data:
message: "Dishwasher started during Best Price period ({{ states('sensor.tibber_home_current_interval_price_ct') }} ct/kWh, volatility {{ state_attr('binary_sensor.tibber_home_best_price_period', 'day_volatility_%') }}%)" message: "Dishwasher started during Best Price period ({{ states('sensor.tibber_home_current_interval_price_ct') }} ct/kWh, volatility {{ state_attr('sensor.tibber_home_volatility_today', 'coefficient_of_variation') }}%)"
``` ```
**Why this works:** **Why this works:**
@ -118,7 +118,7 @@ automation:
# Path 1: High volatility day - trust period classification # Path 1: High volatility day - trust period classification
- condition: template - condition: template
value_template: > value_template: >
{{ state_attr('binary_sensor.tibber_home_best_price_period', 'day_volatility_%') | float(0) > 15 }} {{ state_attr('sensor.tibber_home_volatility_today', 'coefficient_of_variation') | float(0) > 15 }}
# Path 2: Low volatility but price is genuinely cheap # Path 2: Low volatility but price is genuinely cheap
- condition: numeric_state - condition: numeric_state
entity_id: sensor.tibber_home_current_interval_price_ct entity_id: sensor.tibber_home_current_interval_price_ct
@ -131,7 +131,7 @@ automation:
data: data:
message: > message: >
EV charging started: {{ states('sensor.tibber_home_current_interval_price_ct') }} ct/kWh EV charging started: {{ states('sensor.tibber_home_current_interval_price_ct') }} ct/kWh
(Volatility: {{ state_attr('binary_sensor.tibber_home_best_price_period', 'day_volatility_%') }}%) (Volatility: {{ state_attr('sensor.tibber_home_volatility_today', 'coefficient_of_variation') }}%)
``` ```
**Why this works:** **Why this works:**
@ -159,7 +159,7 @@ automation:
# And volatility is meaningful # And volatility is meaningful
- condition: template - condition: template
value_template: > value_template: >
{{ state_attr('binary_sensor.tibber_home_best_price_period', 'day_volatility_%') | float(0) > 15 }} {{ state_attr('sensor.tibber_home_volatility_today', 'coefficient_of_variation') | float(0) > 15 }}
action: action:
- service: button.press - service: button.press
target: target:

View file

@ -39,7 +39,7 @@ automation:
# Only act if volatility > 15% (meaningful savings) # Only act if volatility > 15% (meaningful savings)
- condition: template - condition: template
value_template: > value_template: >
{{ state_attr('binary_sensor.tibber_home_best_price_period', 'day_volatility_%') | float(0) > 15 }} {{ state_attr('sensor.tibber_home_volatility_today', 'coefficient_of_variation') | float(0) > 15 }}
# Optional: Ensure dishwasher is idle and door closed # Optional: Ensure dishwasher is idle and door closed
- condition: state - condition: state
entity_id: binary_sensor.dishwasher_door entity_id: binary_sensor.dishwasher_door
@ -50,7 +50,7 @@ automation:
entity_id: switch.dishwasher_smart_plug entity_id: switch.dishwasher_smart_plug
- service: notify.mobile_app - service: notify.mobile_app
data: data:
message: "Dishwasher started during Best Price period ({{ states('sensor.tibber_home_current_interval_price_ct') }} ct/kWh, volatility {{ state_attr('binary_sensor.tibber_home_best_price_period', 'day_volatility_%') }}%)" message: "Dishwasher started during Best Price period ({{ states('sensor.tibber_home_current_interval_price_ct') }} ct/kWh, volatility {{ state_attr('sensor.tibber_home_volatility_today', 'coefficient_of_variation') }}%)"
``` ```
**Why this works:** **Why this works:**
@ -118,7 +118,7 @@ automation:
# Path 1: High volatility day - trust period classification # Path 1: High volatility day - trust period classification
- condition: template - condition: template
value_template: > value_template: >
{{ state_attr('binary_sensor.tibber_home_best_price_period', 'day_volatility_%') | float(0) > 15 }} {{ state_attr('sensor.tibber_home_volatility_today', 'coefficient_of_variation') | float(0) > 15 }}
# Path 2: Low volatility but price is genuinely cheap # Path 2: Low volatility but price is genuinely cheap
- condition: numeric_state - condition: numeric_state
entity_id: sensor.tibber_home_current_interval_price_ct entity_id: sensor.tibber_home_current_interval_price_ct
@ -131,7 +131,7 @@ automation:
data: data:
message: > message: >
EV charging started: {{ states('sensor.tibber_home_current_interval_price_ct') }} ct/kWh EV charging started: {{ states('sensor.tibber_home_current_interval_price_ct') }} ct/kWh
(Volatility: {{ state_attr('binary_sensor.tibber_home_best_price_period', 'day_volatility_%') }}%) (Volatility: {{ state_attr('sensor.tibber_home_volatility_today', 'coefficient_of_variation') }}%)
``` ```
**Why this works:** **Why this works:**
@ -159,7 +159,7 @@ automation:
# And volatility is meaningful # And volatility is meaningful
- condition: template - condition: template
value_template: > value_template: >
{{ state_attr('binary_sensor.tibber_home_best_price_period', 'day_volatility_%') | float(0) > 15 }} {{ state_attr('sensor.tibber_home_volatility_today', 'coefficient_of_variation') | float(0) > 15 }}
action: action:
- service: button.press - service: button.press
target: target: