Hi,
I’d like to change the value of the weewx_heat_index sensor read by multiscrape if the value is ‘N/A’ and is set to the value of another sensor already read, namely weewx_outside_temperature.
Is this possible?
This is the multiscrape yaml config file.
resource: http://www.banfi-gaslini.it/weewx/alexa.html
scan_interval: 300
sensor:
- unique_id: weewx_outside_temperature
name: Temperatura Esterna
unit_of_measurement: "°C"
select: "body > div:nth-child(1) > table > tbody > tr:nth-child(1) > td.stats_data"
value_template: '{{ (((value.split("°")[0]) | replace(",", ".")) | float )}}'
- unique_id: weewx_heat_index
name: Heat Index
unit_of_measurement: "°C"
select: "body > div:nth-child(1) > table > tbody > tr:nth-child(4) > td.stats_data"
value_template: >-
{% if weewx_heat_index == 'N/A' %}
{{ weewx_outside_temperature }}
{% else %}
{{ (((value.split("°")[0]) | replace(",", ".")) | float ) }}
{% endif %}
What am I doing wrong? The weewx_heat_index sensor value is always “unavailable.” The selector is correct.
thnks!!!