i’m using the xiaomi door sensor to detected if the AC are on or off. its working great!!!
the only thing that i would like to change is the following:
the state present, please see the picture uploaded, is Open/Closed.
i would like to change it to On/Off. and also when its changes to On i would like that the color will also change to yellow like its working now.
If you don’t have a customize.yaml in your folder create one and make sure you add the customize: !include customize.yaml part to you configuration.yaml as in:
homeassistant:
# Name of the location where Home Assistant is running
name: Home
# Location required to calculate the time the sun rises and sets
latitude: !secret latitude
longitude: !secret longitude
# Impacts weather/sunrise data (altitude above sea level in meters)
elevation: 207
# metric for Metric, imperial for Imperial
unit_system: metric
# Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
time_zone: Europe/London
# Customization file
customize: !include customize.yaml
Another way to do it is through the interface.
Delete the contents of your customize.yaml.
Then goto Configuration on the Left panel, then Customization at the bottom.
Select your binary_sensor from the dropdown for Entity.
Then you should have the option to edit the Device_class
i did the following in configuration.yaml
sensor_35:
friendly_name: ‘AC Bedroom’
value_template: “{% if is_state(‘binary_sensor.door_window_sensor_158d00025ead67’, ‘on’) %}On{% else %}Off{% endif %}”
now its working, the only thing is the color not changing to yellow based on the state
So why did it work now but did not work when you tried the first time? You reported it failed to work in this post. Yet the configuration in your first attempt:
is virtually the same as in your second attempt:
cold vs power is not what determines if it works or not, it’s something else you did. What was it?