First post here and not an experts but have been reading the forum for many hours to try and find a response that matches my problem. So head up over the parapet!
I am trying to implement a Wiser Thermostat template from the GitHub put together to assist in coding third party thermostats with wiser.
https://github.com/asantaga/wiserHomeAssistantPlatform/blob/8511c8dc01d1469c5d531584573ba397ec910463/recipes/manage_temps_v2.md
My question is the trace says that the section testing if my device entity is part of the sensor integration fails.
This part :` {% if temp_sensor in integration_entities(temp_sensor_integration)
and temp_sensor.startswith(temp_sensor_prefix)
and temp_sensor.endswith(temp_sensor_suffix)
%}
True
Now the trace says this always fails. So I have broken down the code by removing each element (deleting the code for each of the select statements (in each and section and it appears that the integration never has my ESP32 device in it.
So I have been trying to find out how to obtain a list of integration entities to see if my device is in fact there.
temp_sensor_integration: esphome
temp_sensor_prefix: sensor.bathtemp
temp_sensor_suffix: temperature
I need to find a way of getting the variables out of the code. Of course this does not work until there is a proper event, otherwise the entity is null.
My question is how do I find out why the test is false?
I have tried verifying the device details and I believe they are correct..
Thank you for anyone who can improve my understanding.
Cheers
The YAML is here
alias: Fire Event When Room Monitoring Temp Sensors Change Reading
description: ""
triggers:
- event_type: state_changed
variables:
temp_sensor: "{{trigger.event.data.entity_id}}"
trigger: event
conditions:
- condition: template
value_template: |-
{% if temp_sensor in integration_entities(temp_sensor_integration)
and temp_sensor.startswith(temp_sensor_prefix)
and temp_sensor.endswith(temp_sensor_suffix)
%}
True
{% endif %}
actions:
- event: external_temp_sensor_changed
event_data:
entity_id: "{{temp_sensor}}"
old_temp: "{{trigger.event.data.old_state.state}}"
new_temp: "{{trigger.event.data.new_state.state}}"
trigger_variables:
temp_sensor_integration: esphome
temp_sensor_prefix: sensor.bathtemp
temp_sensor_suffix: temperature
mode: queued
max: 25