Substitute filter not beeing applied to display

Hi all,

I´ve got an ESP32 board with integrated OLED. I want to display the current weather on that display. To be easily readable I want to translate the state of the weather.home entity with a substitute filter:

text_sensor:
  - platform: homeassistant
    entity_id: weather.home
    filters:
      - substitute:
        - "clear-night -> sternenklar"
        - "cloudy -> bew\x94lkt"
    id: wetter2
    internal: true

In the LOG I can see the substitution is effective:

[13:13:13][D][homeassistant.text_sensor:017]: 'weather.home': Got state 'cloudy'
[13:13:13][D][text_sensor:067]: 'wetter2': Sending state 'bew”lkt'

Nevertheless, when I print it to the display it appears as “cloudy”:

display:
  - platform: ssd1306_i2c
    model: "SH1106 128x64"
    reset_pin: 0
    address: 0x3C
    lambda: |-
      it.printf(64, 0, id(font1), TextAlign::TOP_CENTER, "%s", id(wetter2).state.c_str());

Has anyone got an idea what I´m doing wrong?

Thanks a lot in advance
Ronald

Yeah, that’s a bug. I submitted #2893, can try that?

1 Like

Thanks for confirming and submitting the bug.
I wasn´t abled to test the fix with the pullrequest. It seems that the short link with pr# was not supported in my verion (21.10.*).

But after an update to 21.12.1 I can confirm, that the fix worked.

Thanks again! :+1: