HomeWizard Energy

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

Can you explain what your goal is, not what you are trying to achive with this sec_in_quarter thingy?

I don’t really get why you don’t use the build in peak demand (capaciteitstarief) sensors from the P1 Meter, which reflect the real time average. This should be enough to know if you have to adjust your consumption or not.

In my case I want to keep the capaciteitstarief as close to 5Kw as possible.
I can influence the demand (loading my car) based on the peak demand sensor. I use the sec_in_quarter in combination with the peak demand to determine if I can continue loading or if I have to abort for the current quarter to stay under the 5Kw, and restart as soon as possible in the next quarter. If this timing is crucial.

It doesn’t have to be the sec_in_quarter of course the date/time would be fine as well.