Add control for heatpump targettemp value

Hi!

I have a test installation where i use node-red for reading values from modbus and then resend to MQTT broker. HA has sensor mqtt inputs for those values wich are then showed on ui.

configuration.yaml

    - name: "Housesettemp"
      state_topic: "modbus/GWheatpump/501"
      unit_of_measurement: "°C"
      value_template: "{{ value_json.housesettemp }}"

The question is how to make a value a variable that can be adjusted from a view. The problem is that this value can be changed elsewhere, such as the heat pump itself, and in that case the change should not trigger automation from the change but update only value for view.

alias: GW_targettemp
description: GW targettemp
trigger:
  - platform: state
    entity_id:
      - sensor.Housesettemp 
condition: []
action:
  - service: mqtt.publish
    data:
      topic: modbus/gw/control/targettemp
      payload: "{{ states.sensor.Housesettemp.state }}"
mode: single

Got it working.

Helper needed. “input_number.helper1”

alias: number_slider update
description: ""
trigger:
  - platform: state
    entity_id: sensor.Housesettemp 
condition: []
action:
  - service: input_number.set_value
    target:
      entity_id: input_number.helper1
    data:
      value: "{{ states('sensor.Housesettemp ') }}"
mode: single
alias: GW_targettemp
description: GW targettemp
trigger:
  - platform: state
    entity_id:
      - sensor.Housesettemp 
      - input_number.helper1
condition: []
action:
  - service: mqtt.publish
    data:
      topic: modbus/gw/control/targettemp
      payload_template: "{\"Housesettemp \": {{ states(\"input_number.helper1\") }} }"
mode: single