usando a magia do AI, fiz um cartão para mostrar detalhes e poder mudar os preços como quiser
aqui esta e o codigo
type: vertical-stack
cards:
- type: entities
title: EDA Rate Schedule Status
state_color: true
entities:
- entity: sensor.preco_electricidade_ai
name: Current Price
secondary_info: last-updated
- entity: sensor.preco_electricidade_ai
type: attribute
attribute: period_type
name: Current Period
- type: custom:template-entity-row
name: Next Change
icon: mdi:clock-outline
state: >
{% set current_period = state_attr('sensor.preco_electricidade_ai',
'period_type') %} {% set is_summer = now().month in [5, 6, 7, 8, 9,
10] %} {% set season = 'verao' if is_summer else 'inverno' %} {% set
schedule = 'schedule.eda_' ~ current_period ~ '_' ~ season %} {% set
next = state_attr(schedule, 'next_event') | string %} {% if
current_period == 'cheias' %}
{% set next_hour = next.split(' ')[1].split(':')[0] | int %}
{% set next_period = 'ponta' if next_hour >= 9 and next_hour < 22 else 'vazio' %}
{% else %}
{% set next_period = {
'ponta': 'cheias',
'vazio': 'cheias'
}[current_period] %}
{% endif %} {% if next %}
{% set next_hour = next.split(' ')[1].split(':')[0] | int %}
{% set next_min = next.split(' ')[1].split(':')[1] | int %}
{% set current_hour = now().hour %}
{% set current_min = now().minute %}
{% set mins_until = (next_hour - current_hour) * 60 + (next_min - current_min) %}
{% if mins_until > 0 %}
{% set hours = (mins_until / 60) | int %}
{% set mins = mins_until % 60 %}
{% if hours > 0 %}
{{hours}}h {{mins}}m to {{ next_period }}
{% else %}
{{mins}}m to {{ next_period }}
{% endif %}
{% else %}
Changing soon to {{ next_period }}
{% endif %}
{% else %}
No upcoming change
{% endif %}
- type: horizontal-stack
cards:
- type: custom:mushroom-template-card
primary: Ponta
icon: mdi:lightning-bolt
layout: horizontal
icon_color: >-
{% set is_summer = now().month in [5, 6, 7, 8, 9, 10] %} {% set
schedule = 'schedule.eda_ponta_' ~ ('verao' if is_summer else
'inverno') %} {% if is_state(schedule, 'on') %}white{% else %}grey{%
endif %}
secondary: >-
{% set is_summer = now().month in [5, 6, 7, 8, 9, 10] %} {% set
schedule = 'schedule.eda_ponta_' ~ ('verao' if is_summer else
'inverno') %} {% set next = state_attr(schedule, 'next_event') |
string %} {% if next %}
{% if is_state(schedule, 'on') %}
Until {{ next.split(' ')[1].split(':')[0] }}:{{ next.split(' ')[1].split(':')[1] }}
{% else %}
At {{ next.split(' ')[1].split(':')[0] }}:{{ next.split(' ')[1].split(':')[1] }}
{% endif %}
{% endif %}
fill_container: true
card_mod:
style: >
{% set is_summer = now().month in [5, 6, 7, 8, 9, 10] %}
{% set schedule = 'schedule.eda_ponta_' ~ ('verao' if is_summer else
'inverno') %}
ha-card {
{% if is_state(schedule, 'on') %}
background: rgba(255, 0, 0, 0.7);
{% endif %}
}
- type: custom:mushroom-template-card
primary: Cheias
icon: mdi:lightning-bolt-outline
layout: horizontal
icon_color: >-
{% set is_summer = now().month in [5, 6, 7, 8, 9, 10] %} {% set
schedule = 'schedule.eda_cheias_' ~ ('verao' if is_summer else
'inverno') %} {% if is_state(schedule, 'on') %}white{% else %}grey{%
endif %}
secondary: >-
{% set is_summer = now().month in [5, 6, 7, 8, 9, 10] %} {% set
schedule = 'schedule.eda_cheias_' ~ ('verao' if is_summer else
'inverno') %} {% set next = state_attr(schedule, 'next_event') |
string %} {% if next %}
{% if is_state(schedule, 'on') %}
Until {{ next.split(' ')[1].split(':')[0] }}:{{ next.split(' ')[1].split(':')[1] }}
{% else %}
At {{ next.split(' ')[1].split(':')[0] }}:{{ next.split(' ')[1].split(':')[1] }}
{% endif %}
{% endif %}
fill_container: true
card_mod:
style: >
{% set is_summer = now().month in [5, 6, 7, 8, 9, 10] %}
{% set schedule = 'schedule.eda_cheias_' ~ ('verao' if is_summer
else 'inverno') %}
ha-card {
{% if is_state(schedule, 'on') %}
background: rgba(255, 165, 0, 0.7);
{% endif %}
}
- type: custom:mushroom-template-card
primary: Vazio
icon: mdi:power-sleep
layout: horizontal
icon_color: >-
{% set is_summer = now().month in [5, 6, 7, 8, 9, 10] %} {% set
schedule = 'schedule.eda_vazio_' ~ ('verao' if is_summer else
'inverno') %} {% if is_state(schedule, 'on') %}white{% else %}grey{%
endif %}
secondary: >-
{% set is_summer = now().month in [5, 6, 7, 8, 9, 10] %} {% set
schedule = 'schedule.eda_vazio_' ~ ('verao' if is_summer else
'inverno') %} {% set next = state_attr(schedule, 'next_event') |
string %} {% if next %}
{% if is_state(schedule, 'on') %}
Until {{ next.split(' ')[1].split(':')[0] }}:{{ next.split(' ')[1].split(':')[1] }}
{% else %}
At {{ next.split(' ')[1].split(':')[0] }}:{{ next.split(' ')[1].split(':')[1] }}
{% endif %}
{% endif %}
fill_container: true
card_mod:
style: >
{% set is_summer = now().month in [5, 6, 7, 8, 9, 10] %}
{% set schedule = 'schedule.eda_vazio_' ~ ('verao' if is_summer else
'inverno') %}
ha-card {
{% if is_state(schedule, 'on') %}
background: rgba(0, 255, 0, 0.7);
{% endif %}
}
- type: entities
title: Current Rates
entities:
- entity: input_number.eda_preco_ponta
name: Ponta Rate
- entity: input_number.eda_preco_cheias
name: Cheias Rate
- entity: input_number.eda_preco_vazio
name: Vazio Rate
- entity: input_number.eda_tax_rate
name: Tax Rate