Package lights contains invalid customize

8-04-12 00:46:41 WARNING (MainThread) [homeassistant.config] Package lights contains invalid customize
Templet working fine in cofiguration.yaml, but not working in Package.

- platform: mqtt
  name: "Towel heater"
  command_topic: "cmnd/Towel_heater/power"
  state_topic: "stat/Towel_heater/POWER"
  qos: 1
  payload_on: "ON"
  payload_off: "OFF"
  retain: true

TEMPLATE FOR CHANGE THE ENTITY PICTURE

- platform: template
  sensors:
    towel_heater:
      value_template: >-
        {% if is_state('light.towel_heater', 'on') %}
          ON
        {% else %}
          Off
        {% endif %}
      entity_picture_template: >-
        {% if is_state('light.towel_heater', 'on') %}
          /local/1on.png
        {% else %}
          /local/1off.png
        {% endif %}
      friendly_name: 'Towel heater'

You need to show us your whole package.

homeassistant:
  customize:

light:
- platform: mqtt
  name: "Gangen lys"
  command_topic: "cmnd/Gangan lys T1/power"
  state_topic: "stat/Gangan lys T1/POWER"
  qos: 1
  payload_on: "ON"
  payload_off: "OFF"
  retain: true

#        SPISEBORD LYS
#################################################
- platform: mqtt
  name: "Spisebord lys"
  command_topic: "cmnd/spisebord lys/power"
  state_topic: "stat/spisebord lys/POWER"
  qos: 1
  payload_on: "ON"
  payload_off: "OFF"
  retain: true

#         TOWEL HEATER
########################################################
- platform: mqtt
  name: "Towel heater"
  command_topic: "cmnd/Towel_heater/power"
  state_topic: "stat/Towel_heater/POWER"
  qos: 1
  payload_on: "ON"
  payload_off: "OFF"
  retain: true


- platform: template
  sensors:
    towel_heater:
      value_template: >-
        {% if is_state('light.towel_heater', 'on') %}
          ON
        {% else %}
          Off
        {% endif %}
      entity_picture_template: >-
        {% if is_state('light.towel_heater', 'on') %}
          /local/1on.png
        {% else %}
          /local/1off.png
        {% endif %}
      friendly_name: 'Towel heater'

#              PORCH STRIP
######################################################
- platform: mqtt_json
  name: "Porch Strip"
  state_topic: "bruh/porch"
  command_topic: "bruh/porch/set"
  effect: true
  effect_list:
    - bpm
    - candy cane
    - confetti
    - cyclon rainbow
    - dots
    - fire
    - glitter
    - juggle
    - lightning
    - noise
    - police all
    - police one
    - rainbow
    - rainbow with glitter
    - ripple
    - sinelon
    - solid
    - twinkle
  brightness: true
  flash: true
  rgb: true
  optimistic: false
  qos: 0

configuration.yaml

homeassistant:
  name: Home
  latitude: !secret latitude
  longitude: !secret longitude
  elevation: !secret elevation
  unit_system: metric
  time_zone: !secret time_zone
  customize: !include include/customize.yaml
  packages: !include_dir_named packages

frontend:
  extra_html_url:
    - /local/custom_ui/state-card-custom-ui.html
  extra_html_url_es5:
    - /local/custom_ui/state-card-custom-ui-es5.html

customizer:
  custom_ui: local


# Enables configuration UI
config:

http:
  # Secrets are defined in the file secrets.yaml
  api_password: !secret api_password

updater:
  # Optional, allows Home Assistant developers to focus on popular components.
  # include_used_components: true

# Discover some devices automatically
discovery:

#restore_states:

# Allows you to issue voice commands from the frontend in enabled browsers
conversation:

# Enables support for tracking state changes over time
history:

# Tracked history is kept for 10 days
recorder:
  purge_keep_days: 10

# View all events in a logbook
logbook:

# Enables a map showing the location of tracked devices
map:

# Track the sun
sun:

# Text to speech
tts:
  - platform: google


cloud:

group: !include include/groups.yaml
input_boolean: !include include/input_boolean.yaml
input_number: !include include/input_number.yaml

There you go, remove the lines

homeassistant:
  customize:

From the package, it’s invalid because you don’t have anything in it.

1 Like

Removed these lines

homeassistant:
  customize:

There is a error in Configuration validation

Invalid config for [light.template]: required key not provided @ data['lights']. Got None. (See ?, line ?). Please check the docs at https://home-assistant.io/components/light.template/

40

The fourth one down is a template sensor, needs declaring as a sensor, its currently declared as a light, hence the error.

Now templet sensor declare as a sensor, but facing a an other error

11

    light:
    - platform: mqtt
      name: "Gangen lys"
      command_topic: "cmnd/Gangan lys T1/power"
      state_topic: "stat/Gangan lys T1/POWER"
      qos: 1
      payload_on: "ON"
      payload_off: "OFF"
      retain: true

    #        SPISEBORD LYS
    #################################################
    - platform: mqtt
      name: "Spisebord lys"
      command_topic: "cmnd/spisebord lys/power"
      state_topic: "stat/spisebord lys/POWER"
      qos: 1
      payload_on: "ON"
      payload_off: "OFF"
      retain: true

    #         TOWEL HEATER
    ########################################################
    - platform: mqtt
      name: "Towel heater"
      command_topic: "cmnd/Towel_heater/power"
      state_topic: "stat/Towel_heater/POWER"
      qos: 1
      payload_on: "ON"
      payload_off: "OFF"
      retain: true`Preformatted text`

    sensor:
    - platform: template
      sensors:
        towel_heater:
          value_template: >-
            {% if is_state('light.towel_heater', 'on') %}
              ON
            {% else %}
              Off
            {% endif %}
          entity_picture_template: >-
            {% if is_state('light.towel_heater', 'on') %}
              /local/1on.png
            {% else %}
              /local/1off.png
            {% endif %}
          friendly_name: 'Towel heater'

    #              PORCH STRIP
    ######################################################
    - platform: mqtt_json
      name: "Porch Strip"
      state_topic: "bruh/porch"
      command_topic: "bruh/porch/set"
      effect: true
      effect_list:
        - bpm
        - candy cane
        - confetti
        - cyclon rainbow
        - dots
        - fire
        - glitter
        - juggle
        - lightning
        - noise
        - police all
        - police one
        - rainbow
        - rainbow with glitter
        - ripple
        - sinelon
        - solid
        - twinkle
      brightness: true
      flash: true
      rgb: true
      optimistic: false
      qos: 0
    [/quote]

Yeah, because now you have the last light declared as a sensor.

Yaml works like this

Component:
  Option:
    Suboption:

Component2:
  Option:
    Suboption:

When you declared Sensor: halfway down, everything below it becomes a sensor, you need to move the light back in to the light declaration.

1 Like

Thank you very much. Now i put component sensor last in the file and configuration is VALID!

light:
    - platform: mqtt
      name: "Gangen lys"
      command_topic: "cmnd/Gangan lys T1/power"
      state_topic: "stat/Gangan lys T1/POWER"
      qos: 1
      payload_on: "ON"
      payload_off: "OFF"
      retain: true

    #        SPISEBORD LYS
    #################################################
    - platform: mqtt
      name: "Spisebord lys"
      command_topic: "cmnd/spisebord lys/power"
      state_topic: "stat/spisebord lys/POWER"
      qos: 1
      payload_on: "ON"
      payload_off: "OFF"
      retain: true

    #         TOWEL HEATER
    ########################################################
    - platform: mqtt
      name: "Towel heater"
      command_topic: "cmnd/Towel_heater/power"
      state_topic: "stat/Towel_heater/POWER"
      qos: 1
      payload_on: "ON"
      payload_off: "OFF"
      retain: true`Preformatted text`

    #              PORCH STRIP
    ######################################################
    - platform: mqtt_json
      name: "Porch Strip"
      state_topic: "bruh/porch"
      command_topic: "bruh/porch/set"
      effect: true
      effect_list:
        - bpm
        - candy cane
        - confetti
        - cyclon rainbow
        - dots
        - fire
        - glitter
        - juggle
        - lightning
        - noise
        - police all
        - police one
        - rainbow
        - rainbow with glitter
        - ripple
        - sinelon
        - solid
        - twinkle
      brightness: true
      flash: true
      rgb: true
      optimistic: false
      qos: 0
    [/quote]
[/quote]

 sensor:
    - platform: template
      sensors:
        towel_heater:
          value_template: >-
            {% if is_state('light.towel_heater', 'on') %}
              ON
            {% else %}
              Off
            {% endif %}
          entity_picture_template: >-
            {% if is_state('light.towel_heater', 'on') %}
              /local/1on.png
            {% else %}
              /local/1off.png
            {% endif %}
          friendly_name: 'Towel heater'

Is’t not posible put all configurations in one place e.g.- one light component and
related automation, input_number,_input_boolean,sensor tamplet. Like a

input_slider:
   deck_light_time:
    name: Deck light Timer
    initial: 10
    min: 1
    max: 60
    step: 5

script:
  decklight_timer:
    alias: "Deck light Timer"
    sequence:
      - delay: '00:{{ states.input_slider.deck_light_time.state | int }}:00'
      - service: homeassistant.turn_off
        data:
          entity_id: switch.ge_12722_onoff_relay_switch_switch

#######################################
#          automation
########################################

# turn off deck light  if that light is on for more than 10 minutes (or specified via slider)
  - alias: "Decklight: Automatically turn off"
    trigger:
      - platform: state
        entity_id: switch.ge_12722_onoff_relay_switch_switch
        to: 'on'
    action:
      - service: script.turn_on
        entity_id: script.decklight_timer
      - service: script.notify_me
        data_template: {"value1":"Deck light was turned off after", "value2":"{{ states.input_slider.deck_light_time.state | int }} minutes"}

  - alias: "Decklight: reset timer"
    trigger:
      - platform: state
        entity_id: switch.ge_12722_onoff_relay_switch_switch
        to: 'off'
    action:
      - service: script.turn_off
        entity_id: script.decklight_timer
      - service: script.notify_me
        data: {"value1":"Deck light timer was reset!", "value2":""}


group:
  Timers:
    entities:
      - input_slider.deck_light_time

Yeah, you can put it all in one package.

In that one you just posted you’d need to declare automation: for the automations.