default_config:
lovelace:
  mode: yaml
  resources:
    - url: http://127.0.0.1:5000/button-card.js
      type: module
    - url: https://cdn.jsdelivr.net/gh/thomasloven/lovelace-card-mod@master/card-mod.js
      type: module
    - { type: js, url: '/local/lovelace/lovelace-card-tools/card-tools.js' }
    - { type: js, url: '/local/lovelace/lovelace-card-modder/card-modder.js' }
    - { type: module, url: '/local/lovelace/config-template-card.js' }
    - { type: js, url: '/local/lovelace/vertical-stack-in-card.js' }
    - { type: js, url: '/local/lovelace/decluttering-card.js' }

demo:

input_number:
  test:
    icon: mdi:battery-charging-outline
    min: 0
    max: 255
    step: 5

homeassistant:
  customize:
    switch.skylight:
      device_class: switch

switch:
  - platform: template
    switches:
      skylight:
        value_template: "{{ states('input_number.test') | int == 255 }}"
        turn_on:
          service: input_number.set_value
          data:
            entity_id: input_number.test
            value: '255'
        turn_off:
          service: input_number.set_value
          data:
            entity_id: input_number.test
            value: '0'

sensor:
  - platform: template
    sensors:
      sensor1:
        value_template: "{{ states('input_number.test') }}"
        unit_of_measurement: Kb/s
      raspi_cpu:
        value_template: "{{ ((states('input_number.test') | int) / 255 * 100) | int }}"
        unit_of_measurement: '%'
      raspi_ram:
        value_template: "{{ ((states('input_number.test') | int) / 255 * 100) | int }}"
        unit_of_measurement: '%'
      raspi_sd:
        value_template: "{{ ((states('input_number.test') | int) / 255 * 100) | int }}"
        unit_of_measurement: '%'
      raspi_temp:
        value_template: "{{ ((states('input_number.test') | int) / 255 * 100) | int }}"
        unit_of_measurement: '°C'

binary_sensor:
  - platform: template
    sensors:
      bsensor1:
        friendly_name: Binary 1
        value_template: "{{ states('switch.skylight') == 'on' }}"
        device_class: door

light:
  - platform: template
    lights:
      test_light:
        friendly_name: 'Test Light'
        level_template: '{{ states.sensor.sensor1.state | int }}'
        value_template: '{{ states.sensor.sensor1.state | int > 0 }}'
        turn_on:
          service: input_number.set_value
          data:
            entity_id: input_number.test
            value: '255'
        turn_off:
          service: input_number.set_value
          data:
            entity_id: input_number.test
            value: '0'
        set_level:
          service: input_number.set_value
          data_template:
            value: '{{ brightness }}'

alarm_control_panel:
  - platform: manual
    name: Home Alarm
    code: 1234
    # pending_time: 30
    delay_time: 20
    trigger_time: 4
    disarmed:
      trigger_time: 0
    armed_home:
      # pending_time: 0
      delay_time: 0

timer:
  laundry:
    duration: '01:00:10'

stream:
