I just wanted to add that this article really helped me:
In my case, I don’t have anything connected to the Linky: I only have a Shelly EM reading imported and exported energy.
So to couple the prices with the RTE Tempo integration from @hekmon, I have created a bunch of entries:
First one input number for each combination of Color and HP / HC.
Then I have created a utility meter with 6 tariffs + TRV (this will auto-create 7 utility meters with a selector)
I can then create these cards to set prices and select the current utility meter where the read energy data will go:
But now, the magic is that thanks to the RTE Temp plugin, I can have a script and an automation that will automatically switch the right utility meter to use:
The script:
alias: "Grid: Energy Meter Selection"
sequence:
- choose:
- conditions:
- condition: state
entity_id: sensor.rte_tempo_couleur_actuelle
state: Bleu
- type: is_on
condition: device
device_id: 9c2a0444638b52b827cc51a274c5d1f9
entity_id: binary_sensor.rte_tempo_heures_creuses
domain: binary_sensor
sequence:
- service: select.select_option
data:
option: EDF Tempo Bleu HC
target:
entity_id: select.grid_energy_meter
- conditions:
- condition: state
entity_id: sensor.rte_tempo_couleur_actuelle
state: Bleu
- type: is_off
condition: device
device_id: 9c2a0444638b52b827cc51a274c5d1f9
entity_id: binary_sensor.rte_tempo_heures_creuses
domain: binary_sensor
sequence:
- service: select.select_option
data:
option: EDF Tempo Bleu HP
target:
entity_id: select.grid_energy_meter
- conditions:
- condition: state
entity_id: sensor.rte_tempo_couleur_actuelle
state: Blanc
- type: is_on
condition: device
device_id: 9c2a0444638b52b827cc51a274c5d1f9
entity_id: binary_sensor.rte_tempo_heures_creuses
domain: binary_sensor
sequence:
- service: select.select_option
data:
option: EDF Tempo Blanc HC
target:
entity_id: select.grid_energy_meter
- conditions:
- condition: state
entity_id: sensor.rte_tempo_couleur_actuelle
state: Blanc
- type: is_off
condition: device
device_id: 9c2a0444638b52b827cc51a274c5d1f9
entity_id: binary_sensor.rte_tempo_heures_creuses
domain: binary_sensor
sequence:
- service: select.select_option
data:
option: EDF Tempo Blanc HP
target:
entity_id: select.grid_energy_meter
- conditions:
- condition: state
entity_id: sensor.rte_tempo_couleur_actuelle
state: Rouge
- type: is_on
condition: device
device_id: 9c2a0444638b52b827cc51a274c5d1f9
entity_id: binary_sensor.rte_tempo_heures_creuses
domain: binary_sensor
sequence:
- service: select.select_option
data:
option: EDF Tempo Rouge HC
target:
entity_id: select.grid_energy_meter
- conditions:
- condition: state
entity_id: sensor.rte_tempo_couleur_actuelle
state: Rouge
- type: is_off
condition: device
device_id: 9c2a0444638b52b827cc51a274c5d1f9
entity_id: binary_sensor.rte_tempo_heures_creuses
domain: binary_sensor
sequence:
- service: select.select_option
data:
option: EDF Tempo Rouge HP
target:
entity_id: select.grid_energy_meter
mode: single
icon: mdi:script-text
The automation:
alias: "Grid: Energy Meter Selection"
description: ""
trigger:
- type: turned_on
platform: device
device_id: 9c2a0444638b52b827cc51a274c5d1f9
entity_id: binary_sensor.rte_tempo_heures_creuses
domain: binary_sensor
- type: turned_off
platform: device
device_id: 9c2a0444638b52b827cc51a274c5d1f9
entity_id: binary_sensor.rte_tempo_heures_creuses
domain: binary_sensor
- platform: state
entity_id:
- sensor.rte_tempo_couleur_actuelle
condition: []
action:
- service: script.grid_energy_meter_selection
data: {}
mode: single
Device ID 9c2a0444638b52b827cc51a274c5d1f9 is actually the RTE Tempo device created by the RTE Tempo integration.
Then in the Energy Dashboard, we need to add all the utility meters, and for each one, link it with the corresponding price entity