I use the scrape sensor to get the printer status. The printer page has the ISO-8859-2 encoding and string from sensor has incorrectly coded Polish diacritics. For example, it should be PROSZĘ CZEKAĆ
and it is PROSZÊ CZEKAÆ
. Is there a way to change the encoding of the string in Jinja or completely get rid of diacritics?
I tried to use the template but operators do not recognize characters and sensor still display string with incorrect coding.
- platform: scrape
resource: !secret brother_status_url
name: printer_status
select: 'dd:nth-of-type(1)'
scan_interval: 2
value_template: >-
{% if value == 'PROSZÊ CZEKAÆ' %}
PROSZĘ CZEKAĆ
{% elif value == 'MA£O TONERU' %}
MAŁO TONERU
{% else %}
{{ value }}
{% endif %}