Howdy all, I’m trying to get my blueprint going but I may have a fundamental misunderstanding of how this is supposed to work as I’ve been at this all day.
configuration.yaml:
template: !include templates.yaml
templates.yaml:
- use_blueprint:
path: petlibro/dockstream_wifi_signal_strength_with_icon.yaml
input:
wifi_status_sensor: binary_sensor.dockstream_fountain_wi_fi
wifi_signal_sensor: sensor.dockstream_fountain_wi_fi_signal_strength
unique_id: dockstream_testing
friendly_name: Dockstream Testing
/homeassistant/blueprints/template/petlibro/dockstream_wifi_signal_strength_with_icon.yaml:
blueprint:
name: Dockstream WiFi Signal Sensor
description: Creates a binary sensor with an RSSI-strength icon
domain: template
input:
wifi_status_sensor:
name: WiFi binary sensor
description: The binary sensor that reports whether the WiFi is connected
selector:
entity:
domain: binary_sensor
wifi_signal_sensor:
name: WiFi signal strength sensor
description: The sensor that reports RSSI signal strength
selector:
entity:
domain: sensor
unique_id:
name: Unique ID
description: Unique ID of the Entity
selector:
text:
friendly_name:
name: Friendly sensor name
description: Friendly Name of the Entity
selector:
text:
variables:
wifi_status_sensor: !input wifi_status_sensor
wifi_signal_sensor: !input wifi_signal_sensor
sensor:
- name: !input friendly_name
unique_id: !input unique_id
device_class: connectivity
state: >
{{ 'on' if is_state(wifi_status_sensor, 'on') else 'off' }}
availability: >
{{ states(wifi_signal_sensor) not in ['unknown', 'unavailable', None] }}
icon: >
{% if is_state(wifi_status_sensor, 'off') %}
mdi:wifi-off
{% else %}
{% set rssi = states(wifi_signal_sensor) | int(-100) %}
mdi:wifi-strength-{{
4 if rssi >= -60 else
3 if rssi >= -70 else
2 if rssi >= -80 else
1
}}
{% endif %}
I’ve tried a lot of different variations, sometimes I get errors like
The system cannot reload because the configuration is not valid: Unexpected error calling config validator: pop expected at most 1 argument, got 2
sometimes
Invalid config for ‘template’ at templates.yaml, line 22: expected SensorDeviceClass or one of ‘date’, ‘enum’, ‘timestamp’,… for dictionary value ‘sensor->0->device_class’, got None Invalid config for ‘template’ at templates.yaml, line 22: invalid template (TemplateSyntaxError: unexpected char ‘!’ at 10) for dictionary value ‘sensor->0->availability’, got None Invalid config for ‘template’ at templates.yaml, line 22: invalid template (TemplateSyntaxError: unexpected char ‘!’ at 12) for dictionary value ‘sensor->0->state’, got None Invalid config for ‘template’ at templates.yaml, line 22: invalid template (TemplateSyntaxError: unexpected char ‘!’ at 21) for dictionary value ‘sensor->0->icon’, got None
Among others.
So, I’m hoping someone can point me in the right direction, I’ve asked AI but that guy’s crazy.