Send ESPHome sensor value to the KNX bus periodically

Hi all,
I have an ESPHome-based temperature sensor whose temperature value I’d like to send periodically to a KNX group address as input for a heating actor. I tried the KNX expose feature which works fine on temperature changes, but does not send periodically if the temperature remains the same:

knx:
  expose:
    - type: temperature
      entity_id: sensor.temperature_bedroom
      address: "2/4/6"
      cooldown: 10

The KNX heating actor (MDT AKH-0400.03) expects a temperature value at least every N minutes and if not received goes into an emergency mode (Notfallbetrieb).

This sounds more like an automation using the knx.send service, but I don’t know how to specify the temperature sensor value as payload:

alias: KNXSendTemperature
description: ""
# every 5 minutes
trigger:
  - platform: time_pattern
    minutes: /5
condition: []
# send the temperature to the group address 2/4/6
action:
  - service: knx.send
    data:
      address: 2/4/6
      payload: 1 // here I'd like to say e.g. sensor.temperature_bedroom instead of the hardcoded value 1
      type: temperature

Any ideas how I could achieve this?
Thanks,
Chris

Hi :wave:!
Use a template

      payload: '{{ states("sensor.temperature_bedroom") }}'

… or just change the emergency setting to expect a telegram every 6 hours or so if possible.

1 Like

Ah, I see. Works great. Thanks a lot! :slight_smile:

1 Like