Hi all,
I’m fairly new to Home Assistant, but I’m a long time coder. This project resonates with me and I’m starting to get it.
In this specific case, I’m looking to replace our aging wired smoke detectors. This model seems intriguing, especially since I have have several other Z-Wave devices working. As a test run I’m trying to integrate a single First Alert Z-Wave combo second generation device. If this works well, I’ll outfit the whole house.
So far I’ve been able to add the device securely to the Z-Wave network, edited the /config/zwcfg*.xml file to get rid of the ugly “unknown” strings, and also edited the core.entity_registry file to better name the entities associated with the device.
Along the way I emulated the OP’s direction for not cluttering the main confg file and created a “sensors” folder, the corresponding templates.yaml file (based on the work of @ideal2545 and @Michael_Griffin) and included it with the following in my main config file like so:
sensor: !include_dir_merge_list sensors
The problem I’m seeing is none of the template defined sensors are available for display in a Lovelace entity card. I always see an error message like this:
Entity not available: sensor.smoke_upstairs_status
This is after multiple reboots and carefull review of the config files, including adding quotes for the friendly names.
I’ve also tried to explicitly set the entity names and restarted HA. Still cannot find the sensors in Lovelace (or anywhere).
Here’s the text of my sensors/templates.yaml file:
## Upstairs First Alert (Gen 2 Zwave Plus)
- platform: template
sensors:
smoke_upstairs_status:
friendly_name: 'Smoke Upstairs Status'
value_template: >-
{% if is_state('sensor.first_alert_upstairs_smoke', '3') %}
Test
{% elif is_state('sensor.first_alert_upstairs_smoke', '2') %}
Smoke
{% elif is_state('sensor.first_alert_upstairs_carbon_monoxide', '2') %}
CO
{% elif is_state('sensor.first_alert_upstairs_smoke', '6') or is_state('sensor.first_alert_upstairs_carbon_monoxide', '6') %}
Silenced
{% elif is_state('sensor.first_alert_upstairs_carbon_monoxide', '5') %}
CO_EOL
{% else %}
Idle
{% endif %}
icon_template: >-
{% if is_state('sensor.first_alert_upstairs_smoke', '3') %}
mdi:cloud-alert
{% elif is_state('sensor.first_alert_upstairs_smoke', '2') %}
mdi:fire
{% elif is_state('sensor.first_alert_upstairs_carbon_monoxide', '2') %}
mdi:cloud-alert
{% elif is_state('sensor.first_alert_upstairs_smoke', '6') or is_state('sensor.first_alert_upstairs_carbon_monoxide', '6') %}
mdi:smoke-detector
{% elif is_state('sensor.first_alert_upstairs_carbon_monoxide', '5') %}
mdi:cloud-alert
{% else %}
mdi:smoke-detector
{% endif %}
- platform: template
sensors:
smoke_upstairs_health:
friendly_name: 'Smoke Upstairs Health'
value_template: >-
{% if is_state('sensor.first_alert_upstairs_system', '5') %}
Healthy
{% elif is_state('sensor.first_alert_upstairs_system', '1') %}
Malfunction Detected
{% elif is_state('sensor.first_alert_upstairs_system', '0') %}
Malfunction Clear
{% endif %}
icon_template: >-
{% if is_state('sensor.first_alert_upstairs_system', '5') %}
{% elif is_state('sensor.first_alert_upstairs_system', '1') %}
mdi:alert
{% elif is_state('sensor.first_alert_upstairs_system', '0') %}
{% endif %}
To be specific, if I try include the sensor.smoke_upstairs_status entity in a Lovelace entity card I get the error above.
Note that I’ve verified that all of the above referenced sensors (like sensor.first_alert_upstairs_smoke) are valid and well known. I’ve also looked at the logs and can see no obvious errors.
I realize that my issue is almost certainly not related to the OP post. But after beating my head against the wall I could really use some advice. Hopefully as I get more skilled in HA I can contribute back to the community and repay the favor for any helpful suggestions.
Thanks in advance!