Tu as raison @Canaletto it is time to start from scratch.
So in France, our electricity supplier EDF offers us various contracts and two of them are called EJP or Tempo. The prices are not the same according to the color for the Tempo contract and the EJP days for the contract with the same name.
We are informed the day before of the color of the next day and for the most expensive days (Red or EJP) we must use an alternative heating solution in order to limit our consumption.
This information is available on the supplierâs website in JSON format and here is the result in Home Assistant
Her you can get the code to include into configuration.yaml file in sensor: part
TEMPO VERSION
- platform: rest
name: 'Tempo Demain'
resource_template: https://particulier.edf.fr/bin/edf_rc/servlets/ejptemponew?Date_a_remonter={{now().strftime("%Y-%m-%d")}}&TypeAlerte=TEMPO
value_template: '{{ value_json.JourJ1.Tempo }}'
headers:
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Content-Type: application/json
User-Agent: Wget/1.20.3 (linux-gnu)
- platform: rest
name: "Tempo Aujourd'hui"
resource_template: https://particulier.edf.fr/bin/edf_rc/servlets/ejptemponew?Date_a_remonter={{now().strftime("%Y-%m-%d")}}&TypeAlerte=TEMPO
value_template: "{{ value_json['JourJ'].Tempo }}"
headers:
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Content-Type: application/json
User-Agent: Wget/1.20.3 (linux-gnu)
- platform: rest
name: 'Jours Rouge restants'
resource: https://particulier.edf.fr/bin/edf_rc/servlets/ejptempodaysnew?TypeAlerte=TEMPO
value_template: '{{ value_json.PARAM_NB_J_ROUGE }}'
headers:
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Content-Type: application/json
User-Agent: Wget/1.20.3 (linux-gnu)
- platform: rest
name: 'Jours Blanc restants'
resource: https://particulier.edf.fr/bin/edf_rc/servlets/ejptempodaysnew?TypeAlerte=TEMPO
value_template: '{{ value_json.PARAM_NB_J_BLANC }}'
headers:
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Content-Type: application/json
User-Agent: Wget/1.20.3 (linux-gnu)
- platform: rest
name: 'Jours Bleu restants'
resource: https://particulier.edf.fr/bin/edf_rc/servlets/ejptempodaysnew?TypeAlerte=TEMPO
value_template: '{{ value_json.PARAM_NB_J_BLEU }}'
headers:
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Content-Type: application/json
User-Agent: Wget/1.20.3 (linux-gnu)
Then, after restarting HA, you could add an âEntitiesâ card like this:
EJP VERSION
- platform: rest
name: "EJP Aujourd'hui"
resource_template: https://particulier.edf.fr/bin/edf_rc/servlets/ejptemponew?Date_a_remonter={{now().strftime("%Y-%m-%d")}}&TypeAlerte=EJP
value_template: '{{ value_json.JourJ.EjpSud }}'
headers:
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Content-Type: application/json
User-Agent: Wget/1.20.3 (linux-gnu)
- platform: rest
name: 'EJP Demain'
resource_template: https://particulier.edf.fr/bin/edf_rc/servlets/ejptemponew?Date_a_remonter={{now().strftime("%Y-%m-%d")}}&TypeAlerte=EJP
value_template: "{{ value_json['JourJ1'].EjpSud }}"
headers:
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Content-Type: application/json
User-Agent: Wget/1.20.3 (linux-gnu)
- platform: rest
name: 'Jours restants'
resource: https://particulier.edf.fr/services/rest/referentiel/historicEJPStore?searchType=ejp
value_template: '{{ 22 - value_json.SUD.TotalCurrentPeriod }}'
headers:
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Content-Type: application/json
User-Agent: Wget/1.20.3 (linux-gnu)
This example works for the South region and you should modify it to suit your region.
Then, after restarting HA, you could add an âEntitiesâ card like this:
Personally, I have a Tempo contract and I thank Lionel for the information he added regarding EJP.
Hope this example helps you