Copy temperature to Input number

Hello, can someone help me with the following issue?

I want to save a temperature in a input number to use it the day after.
I would like to know how I can do that.

I already tried this with the following automation.

image

This however doesn’t work.

you need to use templates with an automation.

service: input_number.set_value
data_template:
  entity_id: input_number.max_temp_vandaag
  value: "{{ states('sensor.arnhem_temperature_1d') }}"

Thanks Petro.

I now have the following automation. However it doesn’t seems to work.

* id: ‘1595036473127’
alias: ‘TEMP: Max temp vandaag’
description: De temperatuur van morgen opslaan voor vandaag
trigger:
  * at: 0:00
platform: time
  * event: start
platform: homeassistant
condition: []
action:
service: input_number.set_value
data_template:
entity_id: input_number.max_temp_vandaag
value: “{{ states(‘sensor.arnhem_temperature_1d’) }}”

Maybe a stupid question, but can you also tell me how to program this feature using the automation tool by the UI?

I believe you screwed up your formatting then copied the bad formatting and formatted that. Can you please copy your code from HA and format that?

This is the programming from the Automation tool by the UI.

- id: '1595036473127'
  alias: 'TEMP: Max temp vandaag'
  description: De temperatuur van morgen opslaan voor vandaag
  trigger:
  - at: 0:00
    platform: time
  - event: start
    platform: homeassistant
  condition: []
  action:
  - data:
      value: “{{ states(‘sensor.arnhem_temperature_1d’) }}”
    entity_id: input_number.max_temp_vandaag
    service: input_number.set_value

I implemented the states line. This however doesn’t seem to work.

According your explanation it should be “data_template”. I however don’t know how to implement this in the Automation tool by the UI.

Can you tell me what I’m doing wrong?

I had this problem and updated the Automation Editor docs to explain the process https://www.home-assistant.io/docs/automation/editor/
you can see that you need to click the 3 dots and Edit as YAML. You will then be able to copy Petro’s code into the YAML.

Just be aware that the " you are using (shift+2 on a keyboard) is not the same as the one’s Petro has used (the key to the left on number one, on a keyboard), it is an important difference, as far as YAML is concerned.

Yes, it works!
With the following programming it works.

- id: '1595036473127'
  alias: 'TEMP: Max temp vandaag'
  description: De temperatuur van vandaag opslaan voor morgen
  trigger:
  - at: 0:00
    platform: time
  - event: start
    platform: homeassistant
  condition: []
  action:
  - data_template:
      value: '{{ states(''sensor.arnhem_temperature_1d'') }}'
    entity_id: input_number.max_temp_vandaag
    service: input_number.set_value

The states line is a little bit different from the programming of Petro. I however don’t know why.
Can you tell me the difference?

Thanks a lot for your help!

The gui editor takes “whatever is entered” parses this (I think in a round trips it through JSON (as from now on (until the reparsing is improved (if ever !) (that’s a lot of brackets) that’s all you’ll get) ).
It orders child keys alphabetically (not logically, following the documentations sensible sequence order) and it changes the quotes to what you see.
That’s why many avoid it.