Telegram Bot answer with state

Hi guys. I have succesfully configured a telegram bot. When i ask him for the state of the door sensor the bot answers with off or on.
Yeah thats the state… but i would like to let it answer with closed or open. Is it possible?

- action:
  - data_template:
      message: 'Frontdoor: {{states.binary_sensor.door_window_sensor_158d00014d6234.state}}'
    service: notify.telegrambot
  alias: answer for door
  condition: []
  id: '1519033551973'
  - event_data:
      command: /door
    event_type: telegram_command
    platform: event

Change your binary_sensor to a sensor, using a template.

1 Like