[Solved] Confused by names to use for States tab?

Hi

I’m trying to customise the States tab of HA but I encounter a problem of syntax :frowning: I have added the following code in my config file:

customize:
  light.canape_level:
    hidden: false
    entity_picture: mdi:sofa
    friendly_name: Canape Niveau

where light.canape_level is the zwave ID of my circuit I want to customise but HA complains about syntax in it :frowning:

Vincèn

Try putting quotes around the friendly_name as it has a space in it.

If that doesn’t work, maybe include the error from your log file (or config check)

Paste here the error message it will usually point exactly to the line with the error

@phileep dded quotes but still not working but error message is different now:

2017-07-03 09:56:17 ERROR (MainThread) [homeassistant.loader] Unable to find component customize
2017-07-03 09:56:17 ERROR (MainThread) [homeassistant.setup] Setup failed for customize: Component not found.

Why is it not finding the customize component ???

is customize a child of homeassistant: ?
i.e. it should be under homeassistant: with two space indentation (like name, http, latitude,…)

so in your configuration.yaml you must have

homeassistant:
  customize:
    blablabla

and not

homeassistant:
customize:
  blablabla
1 Like

@lambtho ah oki so here is my fault as I had putted it at root and not under homeassistant but it doesn’t like my code still:

Jul 03 12:47:04 raspberrypi systemd[1]: Started Home Assistant.
Jul 03 12:47:07 raspberrypi hass[14920]: 2017-07-03 12:47:07 ERROR (Thread-1) [homeassistant.util.yaml] while parsing a block mapping
Jul 03 12:47:07 raspberrypi hass[14920]: in "/home/homeassistant/.homeassistant/configuration.yaml", line 19, column 5
Jul 03 12:47:07 raspberrypi hass[14920]: expected <block end>, but found '<block mapping start>'
Jul 03 12:47:07 raspberrypi hass[14920]: in "/home/homeassistant/.homeassistant/configuration.yaml", line 22, column 6
Jul 03 12:47:07 raspberrypi hass[14920]: 2017-07-03 12:47:07 ERROR (MainThread) [homeassistant.bootstrap] Error loading /home/homeassistant/.homeassistant/configuration.y...lock mapping
Jul 03 12:47:07 raspberrypi hass[14920]: in "/home/homeassistant/.homeassistant/configuration.yaml", line 19, column 5
Jul 03 12:47:07 raspberrypi hass[14920]: expected <block end>, but found '<block mapping start>'
Jul 03 12:47:07 raspberrypi hass[14920]: in "/home/homeassistant/.homeassistant/configuration.yaml", line 22, column 6
Jul 03 12:47:07 raspberrypi hass[14920]: Config directory: /home/homeassistant/.homeassistant

And if I comment out whole block and let only the customize keyword it still gets an error and doesn’t recognise it ???

@vincen in order for someone to be able to help you please post both the config and the error

1 Like

Quotes around the friendly_name are not required - none of mine use them.

Also entity_picture is for images. If you want to use an MD Icon, the line should be:

icon: mdi:sofa

1 Like

@andrey oups yep sorry and here it is.

Config file (sensible information replaced !)

homeassistant:
  # Name of the location where Home Assistant is running
  name: Titi
  # Location required to calculate the time the sun rises and sets
  latitude: 1.18370420000001
  longitude: 2.721938899999941
  # Impacts weather/sunrise data (altitude above sea level in meters)
  elevation: 204
  # 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/Paris

#introduction:

frontend:

# Enables configuration UI
config:

upnp:
  port_mapping: false

camera:
  - platform: generic
    still_image_url: http://www.vision-environnement.com/webcams/Grenoble2/image/webcam.jpg
    name: Vercors
  - platform: generic
    still_image_url: http://www.les7laux.com/~webcam/webcam3.jpg
    name: Prapoutel
  - platform: generic
    still_image_url: http://www.les7laux.com/~webcam/webcam8.jpg
    name: Oursieres

zwave:
  usb_path: /dev/ttyACM0
  new_entity_ids: true

http:
  # Uncomment this to add a password (recommended!)
  api_password: XXXXXXXXXXXXXXXXXXXXXi  
  # Uncomment this if you are using SSL or running in Docker etc
  # base_url: example.duckdns.org:8123

updater:
  include_used_components: true

discovery:
  ignore:
    - roku
    - plex_mediaserver

conversation:

history:

logbook:

weather:
  - platform: openweathermap
    api_key: 1234567
    latitude: 1.18370420000001
    longitude: 2.721938899999941

sensor:
  - platform: bitcoin
    currency: EUR
    display_options:
      - exchangerate
#  - platform: time_date
#    display_options:
#      - 'time'
#      - 'date'
  - platform: mqtt
    state_topic: '/esp/salon/temperature'
    name: 'Salon Temp.'
    unit_of_measurement: '°C'
  - platform: mqtt
    state_topic: '/esp/salon/humidite'
    name: 'Salon Hum.'
    unit_of_measurement: '%'
  - platform: mqtt
    state_topic: '/esp/cuisine/temperature'
    name: 'Cuisine Temp.'
    unit_of_measurement: '°C'
  - platform: mqtt
    state_topic: '/esp/cuisine/humidite'
    name: 'Cuisine Hum.'
    unit_of_measurement: '%'
  - platform: mqtt
    state_topic: '/esp/lierre/humidite'
    name: 'Lierre Hum.'
    unit_of_measurement: '%'

tts:
  platform: google

media_player:
  - platform: samsungtv
    host: 192.168.1.10
    name: TV
    mac: F4:7B:5E:B5:28:BB
  - platform: onkyo
    host: 192.168.1.17
    name: Ampli
  - platform: plex
    scan_interval: 3
    show_all_controls: true

device_tracker:
  - platform: owntracks
    max_gps_accuracy: 1000

notify:
  - name: Free_Mobile
    platform: free_mobile
    username: 12345678
    access_token: XXXXXXXXXX

mqtt:
  broker: 127.0.0.1
  port: 1883
  client_id: mqtt
  username: toto
  password: titi
  discovery: true
#  discovery_prefix: mqtt

zone:
  name: Home
  icon: mdi:home
  latitude: 1.183954
  longitude: 2.721917
  radius: 30

customize: !include customize.yaml
group: !include groups.yaml
automation: !include automations.yaml

My customize file is for now empty and here are errors in log of HA since I added the inclusion of external file for customization !!

2017-07-03 12:55:16 ERROR (MainThread) [homeassistant.loader] Unable to find component customize
2017-07-03 12:55:16 ERROR (MainThread) [homeassistant.setup] Setup failed for customize: Component not found.

Let me know if you need more details to find the issue :slight_smile:

@rpitera for quotes we thought it was the issue but it’s not :frowning: thanks for notice about icons, didn’t notice there were icons and pictures :smiley:

1 Like

Like was said above: customize us not a component (like sensor) it is a key inside homeassistant (like latitude)

1 Like

So if you’re using a separate customize.yaml file and including it like I am, it should look something like mine:

Take a look and compare it to yours. Also, take a look at my configuration.yaml in the repo and see how I have all of my includes towards the top of the config. Just a personal preference, but I think includes and enables should be loaded towards the beginning of the config.

See if this helps.

1 Like

customize: !include yourfile.yaml

As I said, you must put it just under time_zone: Europe/Paris with the same indent (it is a child of homeassistant, not a sibling).
As for the customize.yaml separate file, see as @rpitera said.

En français si tu préfères:
En gros customize est une option de ‘homeassistant’, du coup tu dois le mettre directement en dessous, avec une indentation de deux espaces (ça devient un ‘enfant’). Si tu le met n’importe ou et sans les espaces ça fait comme si c’était un composant différent (‘un frère’).
Du coup ça donne

homeassistant:
  # Name of the location where Home Assistant is running
  name: Titi
  # Location required to calculate the time the sun rises and sets
  latitude: 1.18370420000001
  longitude: 2.721938899999941
  # Impacts weather/sunrise data (altitude above sea level in meters)
  elevation: 204
  # 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/Paris
  #customization
  customize: !include customize.yaml 

#introduction:
2 Likes

@rpitera thanks a lot for sharing your files, helped me a lot :wink:
@lambtho thanks for explanation and sorry for missing hierarchy :wink: I was aware of spaces rules but was not aware it was also important spaces and line feeds !!
Started to customise my HA now more deeply :slight_smile:

2 Likes

YAML is a bit of a stickler when it comes to formatting and until you get the flow of it, expect to make formatting mistakes often - we all did - and still do at times!

This thread discuss about a YAML editor you may find useful to avoid syntaxing errors…

Also, please mark my previous comment as “solution” in order for people to find it directly later on if the go on this thread.
Glad I helped :wink: enjoy your customization

1 Like

@rpitera yep still have to be careful when editing but @lambtho sounds like a really nice idea :wink: I have installed Samba on my PI and configured it to get access easily at all HA config files so I can directly edit them from my desktop in graphical mode using Atom and syntax colors for YAML making it a lot easier to find mistakes and/or avoid them :wink:
Very good trick @lambtho :smiley:

thanks… it’s not my trick though, I have only been using atom for a week or so :smile:
but since then, I have never had any syntax issue…