Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95451

Help needed with custom sensor

$
0
0

@michel72 wrote:

Hi, I need a custom template sensor that will create a state based on the attribute and state of the original sensor.

The original sensor is:

However if I set the fan speed to off, the sensor speed attribute actually remains ‘medium’, it just switches the fan off.

What I need is 1 sensor that will display the speed attribute, but not when the fan is off, so what I need is a template sensor with the following states:

Off
Low
Medium
High

I build this template:

sensor:
- platform: template
  sensors:
    comfofan_state:
      friendly_name: "Comfofan status"
      entity_id: fan.esp32_fan_controller_02
      value_template: "{{ state_attr('fan.esp32_fan_controller_02', 'speed') }}"

But that will only give me low, medium and high. but not off.

How to do this?

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 95451

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>