@janh82 I can only recommend you to try to add a new user to in the admin panel of the Engie website, and then try to log in with that one, it did the trick for me.
Thanks Daan, and glad to see you’re also highly responsive !
I had to reboot my Raspberry during the day, as i was experimenting on other stuff, but on reboot I got an error in your integration “Failed to set up: Authentication failed (401)”. I guess I had to reconnect using 2FA because somehow the token did not persist ? There is no way to manually reconnect at the moment, so I need to delete my account in the integration, and create it again. That took barely a minute so it is not a big deal, but I thought you may want to hear about it.
If it may help you, or anyone else, here is the custom sensor template I made (with AI help) for getting the current tariff state based on current day and time, and then retrieving current injection and offtake price from your integration. Note that this is only valid for tri-rate contracts.
template:
- trigger:
- platform: time_pattern
minutes: "/1"
sensor:
- name: Current Electricity Tariff
unique_id: current_electricity_tariff
icon: mdi:transmission-tower
availability: >
{{
states('sensor.engie_belgium_electricity_peak_offtake_price') not in ['unknown', 'unavailable', 'none', '']
and states('sensor.engie_belgium_electricity_off_peak_offtake_price') not in ['unknown', 'unavailable', 'none', '']
and states('sensor.engie_belgium_electricity_super_off_peak_offtake_price') not in ['unknown', 'unavailable', 'none', '']
}}
state: >
{% set t = now().strftime('%H:%M') %}
{% set is_weekend = now().weekday() >= 5 %}
{% if is_weekend %}
{% if '01:00' <= t < '07:00' or '11:00' <= t < '17:00' %}
Heures super creuses
{% else %}
Heures creuses
{% endif %}
{% else %}
{% if '01:00' <= t < '07:00' %}
Heures super creuses
{% elif '11:00' <= t < '17:00' or t >= '22:00' or t < '01:00' %}
Heures creuses
{% else %}
Heures pleines
{% endif %}
{% endif %}
- name: Current Electricity Offtake Price
unique_id: current_electricity_offtake_price
unit_of_measurement: "EUR/kWh"
availability: >
{{
states('sensor.current_electricity_tariff') not in ['unknown', 'unavailable', 'none', '']
and states('sensor.engie_belgium_electricity_peak_offtake_price') not in ['unknown', 'unavailable', 'none', '']
and states('sensor.engie_belgium_electricity_off_peak_offtake_price') not in ['unknown', 'unavailable', 'none', '']
and states('sensor.engie_belgium_electricity_super_off_peak_offtake_price') not in ['unknown', 'unavailable', 'none', '']
}}
state: >
{% set tariff = states('sensor.current_electricity_tariff') %}
{% set peak_price = states('sensor.engie_belgium_electricity_peak_offtake_price') | float(0) %}
{% set off_peak_price = states('sensor.engie_belgium_electricity_off_peak_offtake_price') | float(0) %}
{% set super_off_peak_price = states('sensor.engie_belgium_electricity_super_off_peak_offtake_price') | float(0) %}
{% if tariff == 'Heures super creuses' %}
{{ super_off_peak_price | round(4) }}
{% elif tariff == 'Heures creuses' %}
{{ off_peak_price | round(4) }}
{% elif tariff == 'Heures pleines' %}
{{ peak_price | round(4) }}
{% else %}
{{ none }}
{% endif %}
- name: Current Electricity Injection Price
unique_id: current_electricity_injection_price
unit_of_measurement: "EUR/kWh"
availability: >
{{
states('sensor.current_electricity_tariff') not in ['unknown', 'unavailable', 'none', '']
and states('sensor.engie_belgium_electricity_peak_injection_price') not in ['unknown', 'unavailable', 'none', '']
and states('sensor.engie_belgium_electricity_off_peak_injection_price') not in ['unknown', 'unavailable', 'none', '']
and states('sensor.engie_belgium_electricity_super_off_peak_injection_price') not in ['unknown', 'unavailable', 'none', '']
}}
state: >
{% set tariff = states('sensor.current_electricity_tariff') %}
{% set peak_price = states('sensor.engie_belgium_electricity_peak_injection_price') | float(0) %}
{% set off_peak_price = states('sensor.engie_belgium_electricity_off_peak_injection_price') | float(0) %}
{% set super_off_peak_price = states('sensor.engie_belgium_electricity_super_off_peak_injection_price') | float(0) %}
{% if tariff == 'Heures super creuses' %}
{{ super_off_peak_price | round(4) }}
{% elif tariff == 'Heures creuses' %}
{{ off_peak_price | round(4) }}
{% elif tariff == 'Heures pleines' %}
{{ peak_price | round(4) }}
{% else %}
{{ none }}
{% endif %}