Manual water Sensor with a automation and a input_number

I want to put in values of my “smart” Miele wasching machine, which only can cloud, manually.
I created to helper. input_number

I created an automation. When i put in values in the helper, it should be added to a sensor and the helper should be set back to zero.
But my automation don’t trigger.
Someone can tell my why?

alias: Waschmaschine joker
description: ""
trigger:
  - platform: state
    entity_id:
      - input_number.waschgang_joker_energy
    for:
      hours: 0
      minutes: 5
      seconds: 0
    from: "0"
  - platform: state
    entity_id:
      - input_number.waschgang_joker_water
    for:
      hours: 0
      minutes: 5
      seconds: 0
    from: "0"
condition: []
action:
  - if:
      - condition: and
        conditions:
          - condition: numeric_state
            entity_id: input_number.waschgang_joker_energy
            above: 0
          - condition: numeric_state
            entity_id: input_number.waschgang_joker_water
            above: 0
    then:
      - service: python_script.set_state
        data:
          entity_id: sensor.waschmaschine_joker_energy
          state: >-
            {{((states.sensor.waschmaschine_joker_energy.state | float +
            states.input_number.waschgang_joker_energy.state | float))}}
      - service: python_script.set_state
        data:
          entity_id: sensor.waschmaschine_joker_water
          state: >-
            {{(((states.sensor.waschmaschine_joker_water.state) | float +
            (states.input_number.waschgang_joker_water.state | float)/1000))}}
  - service: input_number.set_value
    data:
      value: 0
    target:
      entity_id:
        - input_number.waschgang_joker_energy
        - input_number.waschgang_joker_water
mode: single

Aside from the triggering problem, I assume you realize that python_script.set_state can only temporarily change the value of an entity’s state.

  • The value will not survive a restart.
  • The value can be overwritten by the sensor’s integration.

Looks like my Approach isn’t good at all, what would be a better approach?

What are the requirements of your application?

What do you mean?
I have two input helper. One for water, one for energy.
I want to insert a value in both of them and when this happens it should be inserted in a sensor and reset the input helper.

If these two sensors are part of the Miele integration, you can’t override their values.

sensor.waschmaschine_joker_water
sensor.waschmaschine_joker_energy

So my question is why do you want to change the value of sensors that aren’t designed to be changed by anyone other than the Miele integration?

No they are not part of the Miele Integration.
I don’t want to use them because i don’t want to use the Miele Cloud. (Would if i would get the data local from the wasching machine and not fromt he could)
I read it manual from the display and insert it manual into home assistant.
Thats the sensors in the configuration.yaml

template:
  - sensor:        
        - name: waschmaschine_joker_water
          state: "0"
          unit_of_measurement: "m³"
          state_class: total_increasing
          device_class: water
        - name: waschmaschine_joker_energy
          state: "0"
          unit_of_measurement: "kWh"
          state_class: total_increasing
          device_class: energy

Sorry, that wasn’t clear to me when you stated:

Change your Template Sensors to Trigger-based Template Sensors. Use the triggers that you currently employ in your automation.