Automation runs but also changes another value

I’m having trouble with an automation. It works but throws an error. It’s about a Bosch Radiator Thermostat II that I’ve connected via Zigbee2MQTT. The automation is supposed to send the external temperature to the thermostat every 10 minutes. For this, I have the following YAML code.

triggers:
  - minutes: /10
    trigger: time_pattern
conditions: []
actions:
  - action: number.set_value
    metadata: {}
    data:
      value: >-
        {{
        states('sensor.xiaomi_temperatur_feuchtigkeit_wohnzimmer_temperature')
        }}
    target:
      device_id: 48dcde30b46b359c50fad282d0d45621
      entity_id: number.heizkorperthermostat_wohnzimmer_remote_temperature
mode: single

When the automation runs, it sends the values to the thermostat’s remote_temperature, but for some reason, it also sends them to display_ontime. In the trace, the following error message appears.

Fehler: Value 21.5 for number.heizkorperthermostat_wohnzimmer_display_brightness is outside valid range 0.0 - 10.0
Ergebnis:

params:
  domain: number
  service: set_value
  service_data:
    value: 21.5
    device_id:
      - 48dcde30b46b359c50fad282d0d45621
    entity_id:
      - number.heizkorperthermostat_wohnzimmer_remote_temperature
  target:
    device_id:
      - 48dcde30b46b359c50fad282d0d45621
    entity_id:
      - number.heizkorperthermostat_wohnzimmer_remote_temperature
running_script: false

Am I doing something wrong? I would really appreciate any information.

Hi MarkusS1984,

When you put that in the developer / templates sandbox, what do you get?
Open your Home Assistant instance and show your template developer tools.

If you see a list of stuff, you may need to use something like

        {{
        states.sensor.xiaomi_temperatur_feuchtigkeit_wohnzimmer_temperature.state | float(0)
        }}
1 Like

It shows the same thing both times. On the right, the value that is supposed to be transmitted is displayed. In this case, 21.4. Could it possibly be an issue with the device itself?

Are you expecting the outside temperatur to change that often?
Isn’t it better to send it when the value actually changes?

Could you try a normal action (formerly known as call service, such a dumb decision to change this).

1 Like

What is this? Why are you specifying that as well as:

      entity_id: number.heizkorperthermostat_wohnzimmer_remote_temperature

?

1 Like

The Bosch thermostat requires an external value at least once every 30 minutes; otherwise, it switches back to the internal temperature sensor. That’s why the automation is needed.

The device_id was automatically added by HA. I just manually removed the device_id and restarted the automation. Now it’s running smoothly without any issues. It seems there was some conflict caused by the device_id.

Thank you all for your help and suggestions!