I’m using “HomeWizard Energy” to monitor the https://www.fluvius.be/thema/factuur-en-tarieven/capaciteitstarief to take action to implement a limit on this the timing with the digitalmeter is very important. Currently I implemented a Sec_In_Quarter with a Rest API as
rest:
- authentication: basic
resource: http://x.x.x.x/api/v1/telegram
sensor:
- name: P1_Meter_Sec_in_Quarter
#device_class: timestamp
unique_id: P1_Meter_Sec_in_Quarter
# It does not matter what is added here, but it has to be unique.
value_template: >
{% set timestamp = (value|regex_findall_index('0\\-0\\:1\\.0\\.0\\([0-9.]*')).split('(',1)[-1].strip() %}
{% set dTimestamp = strptime(timestamp, '%y%m%d%H%M%S') %}
{{ (dTimestamp.minute * int(60) + dTimestamp.second) % (int(15)*int(60)) }}
My request is to have the “Seconds in Quarter” as an entity in the “P1 Meter” device