Get value and insert into another enitity

Hi Eveyone,

im using a mqtt gateway to control my heater. currently its configured by outside temperature. the gateway can emulate a room thermostate, which value has to be set manually. i want to automate this.

how can i get the value of my aqara thermostate every few seconds / minutes and put this into another entity? i cant find a working way to do this, i think im just overcomplicating it , surely this must be really easy?

triggers:
  - trigger: state # this trigggers on all valid temperature changes
    entity_id: sensor.temperature # this is where your Aqara sensor goes
    not_to:
      - unavailable
      - unknown
actions:
  - action: climate.set_temperature
    target:
      entity_id: climate.heater
    data:
      temperature: "{{ trigger.to_state.state }}" 

You didn’t specify what sort of entity you want save the temperature to so I just made up an example action that sets a thermostat temperature. The important part is "{{ trigger.to_state.state }}" this is the value your sensor changed to.

sorry forgot that. the entity is just a number.

alias: Aqara Co/Pa RC20 HK2 (FBH)
description: “EG”
triggers:

  • trigger: state
    entity_id: sensor.temperature_sensor
    not_to:
    • unavailable
    • unknown
      actions:
  • action: climate.set_temperature
    target:
    entity_id: number.thermostat_hc2_room_temperature_from_remote
    data:
    temperature: “{{ trigger.to_state.state }}”

this wont work (obviously?) im am total new to this

tried input_number.set_value but doesnt work either

No it wont.

Firstly to format your post correctly use the </> button, not the quote button, or do this: https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371#oneone-format-it-properly-16

Second, when you want to know how do do something look it up in the docs. If you go to the integrations search page and search for “number” it will lead you here: https://www.home-assistant.io/integrations/number/ Which has the details of the actions you need:

Unfortunately no example this time but most pages have them. So you want the number.set_value action

triggers:
  - trigger: state # this trigggers on all valid temperature changes
    entity_id: sensor.temperature # this is where your Aqara sensor goes
    not_to:
      - unavailable
      - unknown
actions:
  - action: number.set_vaue
    target:
      entity_id: number.thermostat_hc2_room_temperature_from_remote
    data:
      value: "{{ trigger.to_state.state }}"