Skip to content
Snippets Groups Projects
Verified Commit 6c597546 authored by Andrei Gherzan's avatar Andrei Gherzan :penguin:
Browse files

homeassistant-config-blueprint-dashboard: Configuration improvements


* Use HOMEASSISTANT_TRUSTED_NETWORK (defaults to 192.168.0.0/24)
  variable to define trusted networks in the HomeAssisstant
  configuration.
* Default configuration to autologin when client from
  HOMEASSISTANT_TRUSTED_NETWORK and only one user is available (better
  experience with touchscreen modules).
* Predefine automations setup to include LED control based on human
  presence sensor.

Signed-off-by: Andrei Gherzan's avatarAndrei Gherzan <andrei.gherzan@huawei.com>
parent 9f43f9c7
No related branches found
No related tags found
No related merge requests found
...@@ -10,6 +10,8 @@ INHIBIT_DEFAULT_DEPS = "1" ...@@ -10,6 +10,8 @@ INHIBIT_DEFAULT_DEPS = "1"
inherit allarch inherit allarch
HOMEASSISTANT_TRUSTED_NETWORK ?= "192.168.0.0/24"
do_fetch[noexec] = "1" do_fetch[noexec] = "1"
do_unpack[noexec] = "1" do_unpack[noexec] = "1"
do_patch[noexec] = "1" do_patch[noexec] = "1"
...@@ -33,10 +35,53 @@ sensor: ...@@ -33,10 +35,53 @@ sensor:
switch: switch:
- platform: allscenarios_switch - platform: allscenarios_switch
mac: "${SMART_HOME_SWITCH_MAC}" mac: "${SMART_HOME_SWITCH_MAC}"
homeassistant:
auth_providers:
- type: trusted_networks
trusted_networks:
- "${HOMEASSISTANT_TRUSTED_NETWORK}"
- 127.0.0.1
- ::1
allow_bypass_login: true
- type: homeassistant
automation: !include automations.yaml
EOF
# Preload automation configuration for the loader
# Trigger on/off LED based on the human presence sensor input.
cat >> "${D}${HOMEASSISTANT_CONFIG_DIR}/automations.yaml" << EOF
- id: '1621503053201'
alias: Light on
description: ''
trigger:
- entity_id: sensor.all_scenarios_os_smarthome_device_presence
from: 'False'
platform: state
to: 'True'
condition: []
action:
- data: {}
entity_id: switch.all_scenarios_os_smarthome_device_light
service: switch.turn_on
- id: '1621503121253'
alias: Light off
description: ''
trigger:
- entity_id: sensor.all_scenarios_os_smarthome_device_presence
from: 'True'
platform: state
to: 'False'
condition: []
action:
- data: {}
entity_id: switch.all_scenarios_os_smarthome_device_light
service: switch.turn_off
EOF EOF
chown -R "${HOMEASSISTANT_USER}":homeassistant "${D}${HOMEASSISTANT_CONFIG_DIR}" chown -R "${HOMEASSISTANT_USER}":homeassistant "${D}${HOMEASSISTANT_CONFIG_DIR}"
} }
RDEPENDS_${PN} = "smart-home-homeassistant-plugin" RDEPENDS_${PN} = "smart-home-homeassistant-plugin"
FILES_${PN} += "${HOMEASSISTANT_CONFIG_DIR}/configuration.yaml" FILES_${PN} += "${HOMEASSISTANT_CONFIG_DIR}"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment