Remaining energy per hour

When in The Netherlands dynamic enery contract is in place, hourly rates apply. If simultaniously energy production is in place, it would be beneficial to know how much kWh would remain, and perferably being able to control appliances to end up with a summed zero balance for that hour.

Many topics mention they would like to have a realtime Energy dashoard, which is currently not available. But is something available as computed value that would take the current meter values, substract in by the current hour + ‘:00:00’ active meter value?

Since you are interested in control of power use based on production, you may be interested in this BluePrint topic:

I want to share what I have created.

template:
  - trigger:
    - platform: time_pattern
      minutes: "0"
      seconds: "0"
    sensor:
      - name: "Laatste kWh (relatief)"
        unique_id: grid_import_energy_start_of_hour
        state_class: total
        unit_of_measurement: kWh
        device_class: energy
        icon: mdi:transmission-tower-import
        availability: "{{ has_value('sensor.electricity_meter_energy_production_tarif_1') and has_value('sensor.electricity_meter_energy_production_tarif_2') and has_value('sensor.electricity_meter_energy_consumption_tarif_1') and has_value('sensor.electricity_meter_energy_consumption_tarif_2') }}"
        state: "{{ (states('sensor.electricity_meter_energy_consumption_tarif_1') | float + states('sensor.electricity_meter_energy_consumption_tarif_2') | float) - (states('sensor.electricity_meter_energy_production_tarif_1') | float + states('sensor.electricity_meter_energy_production_tarif_2') | float) }}"
  - sensor:
      - name: "Laatste uur over"
        unit_of_measurement: 'kWh'
        device_class: energy
        icon: mdi:transmission-tower-import
        unique_id: energy_remaining_per_hour
        availability: "{{ has_value('sensor.electricity_meter_energy_production_tarif_1') and has_value('sensor.electricity_meter_energy_production_tarif_2') and has_value('sensor.electricity_meter_energy_consumption_tarif_1') and has_value('sensor.electricity_meter_energy_consumption_tarif_2') }}"
        state: "{{ states('sensor.laatste_kwh_relatief') | float - ((states('sensor.electricity_meter_energy_consumption_tarif_1') | float + states('sensor.electricity_meter_energy_consumption_tarif_2') | float) - (states('sensor.electricity_meter_energy_production_tarif_1') | float + states('sensor.electricity_meter_energy_production_tarif_2') | float)) }}"

image