Boa noite,
Estou a tentar por a funcionar o template em baixo para undervoltage mas estou a obter um erro no regex_match
Could not render template System: Charger: UndefinedError: 'regex_match' is undefined
Já tentei algumas alterações e até testes mais simples mas sem sucesso. Estou a fazer algo mal ou será que o regex_match já não é suportado ?
- platform: template
sensors:
check_charger:
friendly_name: "System: Charger"
value_template: >
{% if is_state("sensor.system_undervoltage_status", "throttled=0x0") -%}
No throttling detected
{% elif regex_match(states("sensor.system_undervoltage_status"), 'throttled=0x4', ignorecase=FALSE) -%}
Throttling detected {{ states("sensor.system_number_of_undervoltage_messages") }} times
{% elif regex_match(states("sensor.system_undervoltage_status") , 'throttled=0x5', ignorecase=FALSE) -%}
Throttling detected {{ states("sensor.system_number_of_undervoltage_messages") }} times
{% else %}
There is a problem with your power supply or system, state {{ states("sensor.system_undervoltage_status") }} reported
{%- endif %}
Obrigado