I need some help with setting up script within my configuration and splitting up into different files.
I’m running version 2021.1.1 of Home Assistant.
I have the following in my configuration.yaml:
---
homeassistant:
# Name of the location where Home Assistant is running
name: Home
# Location required to calculate the time the sun rises and sets
latitude: !secret homeassistant_latitude
longitude: !secret homeassistant_longitude
# HA internal and external URL's
internal_url: !secret homeassistant_internal_url
external_url: !secret homeassistant_external_url
# Impacts weather/sunrise data (altitude above sea level in meters)
elevation: 10
# 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/Amsterdam
# Customization #
customize: !include_dir_merge_named customizations/entities
# Lets me custimize all entities in a domain
# customize_domain: !include_dir_merge_named customizations/domains
# Packages #
packages: !include_dir_named components/packages
# Whitelist #
# whitelist_external_dirs: !secret whitelist_dir_config
# Auth Providers #
auth_providers:
- type: homeassistant
- type: trusted_networks
trusted_networks:
- 192.168.32.0/24
# Configure a default setup of Home Assistant (frontend, api, etc)
# default_config:
config:
frontend:
logbook:
# Discovery integrations
ssdp:
zeroconf:
person:
sun:
# System integration
system_health:
updater:
# Enables map
map:
# Configures logging
logger:
default: info
logs:
pydeconz: debug
homeassistant.components.deconz: debug
# Configures history
history:
# Discover some devices automatically
discovery:
# Enable IOS frontend
ios:
# Enable mobile_app
mobile_app:
#https://www.home-assistant.io/lovelace/yaml-mode/
lovelace:
mode: yaml
resources:
- url: /local/community/mini-media-player/mini-media-player-bundle.js
type: module
- url: /local/community/lovelace-layout-card/layout-card.js
type: module
- url: /local/community/battery-state-card/battery-state-card.js
type: module
- url: /local/community/vertical-stack-in-card/vertical-stack-in-card.js
type: module
- url: /local/community/lovelace-auto-entities/auto-entities.js
type: module
- url: /local/community/lovelace-fold-entity-row/fold-entity-row.js
type: module
- url: /local/community/entity-attributes-card/entity-attributes-card.js
type: module
- url: /local/community/lovelace-card-mod/card-mod.js
type: module
# integrate ZiggoNext https://github.com/Sholofly/ZiggoNext
ziggonext:
username: !secret ziggo_username
password: !secret ziggo_password
# integrate spotify
spotify:
client_id: !secret spotify_client_id
client_secret: !secret spotify_client_secret
# config mqtt broker
mqtt:
broker: 192.168.32.20
username: !secret mqtt_broker_user
password: !secret mqtt_broker_password
# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
http:
# base_url: https://hensl-home.duckdns.org:8123
# ssl_certificate: /ssl/fullchain.pem
# ssl_key: /ssl/privkey.pem
# Moved to UI Integration
# hue:
# bridges:
# - host: 192.168.32.21
# allow_unreachable: true
# allow_hue_groups: true
# config buienradar
weather:
- platform: buienradar
name: 'buienradar_groningen'
latitude: !secret homeassistant_latitude
longitude: !secret homeassistant_longitude
forecast: true
camera:
- platform: buienradar
name: 'buienradar_groningen'
dimension: 512
delta: 600
country_code: NL
# Zones configuration
zone:
- name: Home
latitude: !secret homeassistant_latitude
longitude: !secret homeassistant_longitude
radius: 150
icon: mdi:account-multiple
- name: Work - Kevin
latitude: !secret work_kevin_latitude
longitude: !secret work_kevin_longitude
radius: 200
- name: Work - Erika
latitude: !secret work_erika_latitude
longitude: !secret work_erika_longitude
radius: 350
input_select:
active_cube_side:
name: Active Cube side
options:
- none
- side1
- side2
- side3
- side4
- side5
- side6
initial: none
input_boolean:
bedtime_active:
name: Bedtime is active
initial: 'off'
icon: mdi:bed
# trash_reminder:
# name: Trash reminder enabled
# initial: 'on'
google_assistant:
project_id: homeassistant-608aa
service_account: !include SERVICE_ACCOUNT.json
report_state: true
expose_by_default: false
exposed_domains:
- group
- switch
- light
- sensor
nest:
client_id: !secret nest_client_id
client_secret: !secret nest_client_secret
# "Project ID" in the Device Access Console
project_id: !secret nest_project_id
# Provide the full path exactly as shown under "Subscription name" in Google Cloud Console
subscriber_id: !secret nest_subcriber_id
alarm_control_panel:
- platform: manual
name: Home Alarm
code: '9999'
arming_time: 5
delay_time: 5
trigger_time: 5
disarmed:
trigger_time: 5
armed_home:
arming_time: 5
delay_time: 5
armed_away:
arming_time: 5
delay_time: 5
# # Text to speech
tts:
- platform: google_translate
# group: !include groups.yaml
light:
- platform: group
name: bedroom_nightstand_lights
entities:
- light.bedroom_nightstand_kevin
- light.bedroom_nightstand_erika
sensor: !include_dir_merge_list components/sensors
switch: !include_dir_merge_list components/switches
automation: !include_dir_merge_list components/automations
media_player: !include_dir_merge_list components/media_players
script: !include_dir_merge_list components/scripts
And the following script in components/scripts/bedtime.yaml:
activate_bedtime:
alias: Script activate bedtime
sequence:
- service: notify.mobile_app_iphone_van_kevin
data:
title: "[HomeAssistant] Scene"
message: "Bedtime activated"
- service: light.turn_off
data:
entity_id:
- light.living_room_stand_2
- light.living_room_stand_3
transition: 10
- service: light.turn_on
data:
entity_id:
- light.living_room_stand_1
brightness_pct: 10
- service: media_player.turn_off
data:
entity_id:
- media_player.stb_arris_uhd
- media_player.tv
For some reason I’m getting a error that HA isn’t able to setup groups. Am I doing something wrong?
The error that I find in the logs:
Invalid config for [group]: [alias] is an invalid option for [group]. Check: group->group->activate_bedtime->alias. (See ?, line ?). Please check the docs at https://www.home-assistant.io/integrations/group
If anyone can help me with this issue that would be great!