Energy dashboard problems - not getting the data - trying to work around my limitations - hope for Help

Hi There,

I am trying to get the energy dashboard to work but I kind of stuck. Here is what I want to achieve, what I already tried and what my result is (at the moment).

I want to see the solar energy i produce (DTU data via mqtt)
I want to see the energy I consumed. Here is my first pain point. I only have an old feraris powermeter. Therefor I set up “Ai on the Edge” to get at least the overall value from my powermeter. this sensor returns the total value my powermeter has. BUT when my solar production is greater then the energy I consume it runs backwards. So I get 1. Total Value Powermeter and Raw Value Powermeter. Total Value equals the last top count. The raw value returns the exact number on the Powermeter. AI on the edge keeps the Powermeter Value until the value increases above that.
Further I would like to see if I overproduce (the energy that is then pushed back to the grid).

What I’ve done so far:

  1. defined input helpers:
input_number:
  powermeter_value_last:
    name: Powermeter Value Last
    min: 0
    max: 9999999999
    step: 1
  powermeter_raw_last:
    name: Powermeter Raw Last
    min: 0
    max: 9999999999
    step: 1
  1. Defined the automation to update my input_number helpers in automations.yaml file:
- id: 'update_helpers'
  alias: Update Helpers
  trigger:
    - platform: time_pattern
      minutes: '/1'
  action:
    - service: input_number.set
      target:
        entity_id: input_number.powermeter_value_last
      data:
        value: "{{ states('sensor.powermeter_value') | float }}"
    - service: input_number.set
      target:
        entity_id: input_number.powermeter_raw_last
      data:
        value: "{{ states('sensor.powermeter_raw') | float }}"

  1. Defined sensors using the template platform in my configuration.yaml file:
template:
  - sensor:
    - name: "Grid Consumption"
      unit_of_measurement: "kWh"
      device_class: energy
      state_class: total_increasing
      state: >
        {% if states('sensor.powermeter_value') | float > states('input_number.powermeter_value_last') | float %}
          {{ (states('sensor.powermeter_value') | float - states('input_number.powermeter_value_last') | float) | max(0) }}
        {% else %}
          0
        {% endif %}
      attributes:
        last_reset: "1970-01-01T00:00:00+00:00"
    - name: "Grid Return"
      unit_of_measurement: "kWh"
      device_class: energy
      state_class: total_increasing
      state: >
        {% if states('sensor.powermeter_raw') | float < states('input_number.powermeter_raw_last') | float %}
          {{ (states('input_number.powermeter_raw_last') | float - states('sensor.powermeter_raw') | float) | max(0) }}
        {% else %}
          0
        {% endif %}
      attributes:
        last_reset: "1970-01-01T00:00:00+00:00"

I hoped that then I could use sensor.grid_consumption and sensor.grid_return to get the data into my dashboard.

BUT instead I get an Error regarding my setup:

The automation “Update Helpers” (automation.update_helpers) is using an unknown service: input_number.set.

This error is preventing the automation from running properly. It’s possible that this service is no longer available or a typo has caused it.

To fix this error, edit the automation and remove the action that calls this service.

Press SEND below to confirm that you have corrected this automation.

If someone has an idea how to solve this I would be pleased :slight_smile:

Should be:

- service: input_number.set_value

See: https://www.home-assistant.io/integrations/input_number/#services

thanks! I will try that!