Transfer value from one entity to another

Thought this would be rather simple, but have not managed to find out how. Would like to take a value from one entity (eg weight registered in garmin) and transfer that value to another entity (eg color temp for a hue bulb). Tried to get a value from an entity into an input number and then from the input number into another entity, but without success.

Any guidance would be much appreciated

Create a template sensor

1 Like

To use it to set another existing entity you would need to call the appropriate service call to do that. Aka, just make an automation! :smiley:

thanks, and sorry for my ignorance, but thought I could do something like this

service: input_number.set_value
data:
value: β€˜{{ sensor.weight }}’
target:
entity_id: input_number.weightnow

… but does not work

You can, if you get the syntax right. Here’s my max power recorder automation that copies the power sensor value to an input_number for long-term storage:

- alias: Energy - max power recorder

  description: Updates the maximum power recorder whenever prior maximum is exceeded

  id: 1fef4933-5115-4055-91d2-48d5d3a051b7

  trigger:
    - platform: template
      value_template: "{{ (states('sensor.power_meter_house')|float > states('input_number.max_power')|float) }}"

  action:
    - service: input_number.set_value
      data:
        entity_id: input_number.max_power
        value: "{{ states('sensor.power_meter_house')|float }}"

You cold also use '{{trigger.to_state.state}}'

service: input_text.set_value
target:
  entity_id: input_text.input_text_test
data:
  value: '{{trigger.to_state.state}}'

thanks, worked