Can you customise entity values?

Hi. I have gone all out this evening to start building my customize.yaml file. I have created a group that contains my connected Vera devices, one of which is a Fibaro binary sensor that presents itself as a motion sensor with the default values on and off. Input 1 is connected to my garage door, input 2 my rain gauge.

Question: Is it possible to use the customize.yaml to change the default values from on/off to open/close and on/off > dry/wet?

You’ll have to use a template sensor and use that in your group, hiding yours that exist right now

Thanks for the prompt reply. I had seen those but they look a little too complex for my hardware brain at the moment. Baby steps. :slight_smile:

OK, had another look at the sun.sun example. Doesn’t look too scary. Can you advise where to put that though? Here is the group for the previous entities shown. Would it go in their somewhere?

Vera:
  - switch.01_fibaro_garage_door
  - binary_sensor.01_fibaro_garage_door
  - switch.02_fibaro_rain_gauge
  - binary_sensor.02_fibaro_rain_gauge
  - switch.back_water
  - switch.front_water
sensor:
  - platform: template
    sensors:
      Garage_door:
        value_template: '{% if is_state("binary_sensor.01_fibaro_garage_door", "on") %}Open{% else %}Closed{% endif %}'
        friendly_name: 'Garage Door'

Then you’ll have a sensor.garage_door to put in your group.

Thank you! So that entry would go in my sensors.yaml file?

Yes, it goes with the others sensors you have.

Thanks, I’ll try in the morning. Very late here and brain starting to fog. Appreciate your help.

Still going! Would my sensors.yaml look like this?

# sensor 3:
- platform: mqtt
  state_topic: "/ESP02/Dallas/Humidity"
  name: "Desk Humidity"
  qos: 0
  unit_of_measurement: "%"

# Garage Door Sensor 4:
- platform: template
  sensors:
  Garage_door:
  value_template: '{% if is_state("binary_sensor.01_fibaro_garage_door", "on") %}Open{% else %}Closed{% endif %}'
  friendly_name: 'Garage Door'

That should work, yes, but check your indentation.
The Garage_door: part should be indented by two spaces.

When I do that, most of my sensors disappear. Before:

After:

Pastebin your sensors.yaml to check if there are any errors.

16-10-01 00:41:03 homeassistant.bootstrap: Invalid config for [sensor.template]: [Garage_door] is an invalid option for [sensor.template]. Check: sensor.template->sensors->Garage_door. Please check the docs at https://home-assistant.io/components/sensor.template/

Seems like your formatting is off, try this:

-  platform: template
   sensors:
     garage_door:
       value_template: "{% if is_state('binary_sensor.01_fibaro_garage_door', 'on') %}Open{% else %}Closed{% endif %}"

16-10-01 01:50:14 homeassistant.bootstrap: Invalid config for [sensor.template]: expected a dictionary for dictionary value @ data[‘sensors’][‘friendly_name’]. Got ‘Garage Door Status’.

SOLVED with this.

    - platform: template
      sensors:
        garage_door:
          value_template: '{% if is_state("binary_sensor.01_fibaro_garage_door", "on") %}Open{% else %}Closed{% endif %}'
          friendly_name: 'Garage Door Status'

Indenting garage_door 2 lines then the rest 2 lines solved it. Also had Garage_door as sensor name and don’t think you can have a capital?

Thank you for your patience.

It’s all working a treat now but do you know if it is possible to create a sensor_class: moisture when creating a template sensor? I added that in my customized.yaml file but the defined mdi icon for the rain gauge does not alternate when the input changes state. It does for the root sensor but not when a template sensor is created from it.