Adjust slider to external value got by mqtt

I have following running configuration
a) in configuration.yaml
mqtt:
sensor:
- state_topic: state/Wohnung/Gaerk/soll_time
name: “Gärschrank soll Temperatur”

b) in automation.yaml

— Gärschrank soll Temperatur —

  • alias: “Set temp slider”
    trigger:
    platform: mqtt
    topic: “command/Wohnung/Gaerk/soll_temp”
    action:
    service: input_number.set_value
    target:
    entity_id: input_number.gs_soll_temp
    data:
    value: “{{ trigger.payload }}”

  • alias: “Temp slider moved”
    trigger:
    platform: state
    entity_id: input_number.gs_soll_temp
    action:
    service: mqtt.publish
    data:
    topic: “command/Wohnung/Gaerk/soll_temp”
    retain: true
    payload: “{{ states(‘input_number.gs_soll_temp’) | int }}”

that works fine as far, the values set with the slider are set on the device and reported back, but now I can change the values on the device too and they are display but the sliders does not move to the new vales.
I found one solution in the community but it old and do do get it running
Need help
Rainr

You have been a member of this forum for five years, we should not have to ask you to 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