apiVersion: v1
kind: ConfigMap
metadata:
  name: hass-configuration
  namespace: home-assistant
data:
  configuration.yaml: |
    # Configure a default setup of Home Assistant (frontend, api, etc)
    default_config:

    alarm_control_panel:
      - platform: manual
        arming_time: 10

    # Text to speech
    tts:
      - platform: google_translate

    group: !include groups.yaml
    automation: !include automations.yaml
    script: !include scripts.yaml
    scene: !include scenes.yaml

    light:
      - platform: group
        name: Office Lights
        entities:
          - light.office_back_left_light
          - light.office_back_right_light
          - light.office_front_left_light
          - light.office_front_right_light
      - platform: group
        name: Key Lights
        entities:
          - light.key_light_left
          - light.key_light_right

    prometheus:

    nest:
      client_id: !secret nest_client_id
      client_secret: !secret nest_client_secret
      project_id: !secret nest_project_id
      subscriber_id: !secret nest_subscriber_id

    logbook:

    binary_sensor:
      - platform: template
        sensors:
          living_room_tv:
            friendly_name: Living Room TV
            value_template: "{{ not is_state('media_player.living_room_tv', 'off') }}"
          master_bedroom_tv:
            friendly_name: Master Bedroom TV
            value_template: "{{ not is_state('media_player.master_bedroom_tv', 'off') }}"
          guest_bedroom_tv:
            friendly_name: Guest Bedroom TV
            value_template: "{{ not is_state('media_player.guest_bedroom_tv', 'off') }}"

    sensor:
      - platform: template
        sensors:
          outside_temperature:
            friendly_name: Outside Temperature
            unit_of_measurement: °F
            value_template: "{{ state_attr('weather.climacell_nowcast', 'temperature') }}"
            device_class: temperature

    http:
      use_x_forwarded_for: true
      trusted_proxies:
        - 10.42.0.0/16
        - 10.43.0.0/16
        - 192.168.79.30
        - 192.168.79.31
        - 192.168.79.32
        - 192.168.79.33
