Skip to content

Using External Temp Sensor to Manage Room Temp Accuracy V2 #619

@iredsell-png

Description

@iredsell-png

Firstly I recognise that I am new to YAML and HA, however I have been trying to setup and test this automation. I am attempting to link my wiser system to an ESP32 Thermostat creatively named bathtemp its integration is ESPHome and its sensor is temperature

Using the first automation script as a trigger I have followed the instructions which appeared to be straightforward resulting in the script as appended.

The ESPDevice works locally I can view it and see the output updating. I can also use it to drive a switch

What I wish to do though is link to Wiser. I found this excellent GitHub ad I want to thank you for your work.

I have used the run to test the automation but suspect that as there is no entity triggered the trace results in an entity not found within the following script -

  {% if temp_sensor in integration_entities(temp_sensor_integration)
          and temp_sensor.startswith(temp_sensor_prefix) 
          and temp_sensor.endswith(temp_sensor_suffix)
  %}

I have checked the entity name, integration and sensor name and I realise that all I had to do was change 2 lines of variables, but I cannot get the automation to trigger and I am running out of ideas to diagnose further.

Can anyone advise this enthusiastic amateur?

Thank you

`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
`

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions