├── .editorconfig ├── .gitattributes ├── .gitignore ├── LICENSE ├── README.md ├── TODO.md ├── configuration.yaml ├── customize.yaml ├── examples ├── @AdithyanI │ └── music_alarm.yaml ├── @CCOSTAN │ └── detect_state_change.yaml ├── @albyalby_twitter │ ├── brightness_trigger.yaml │ └── manual_light.yaml ├── @andrew-curtis │ └── tv_input.yaml ├── @aptonline │ └── homebridge.yaml ├── @araneolusporcus │ └── publish_sensor_to_mqtt.yaml ├── @bart274 │ └── post_gps.yaml ├── @brmo │ └── radio.yaml ├── @brusc │ └── shell_espeak.yaml ├── @carlostico │ ├── group-people.yaml │ └── icloud_failover.yaml ├── @clemon79 │ ├── configuration.yaml │ ├── customize.yaml │ ├── script.yaml │ ├── secrets.sample.yaml │ └── shell_command.yaml ├── @cmsimike │ └── wife_purse.yaml ├── @darkstardxm │ └── above_threshold.yaml ├── @dbray925 │ ├── kodi_volume.yaml │ └── sunrise.yaml ├── @docs │ ├── shell_command.md │ ├── splitting_configuration.markdown │ └── splitting_configuration.orig.markdown ├── @ericboxer │ └── tue_5am.yaml ├── @eugenelai │ └── scene_selector.yaml ├── @frEEEki_twitter │ ├── blinds.yaml │ ├── conditional_actions.yaml │ └── icloud_update.yaml ├── @freland │ └── copy_switch.md ├── @garymaurizi │ └── toggle_zwave_network.yaml ├── @gussyh │ ├── icloud_failover.yaml │ └── maybe_notify_alarm.yaml ├── @hensing │ └── bitcoin_threshold.yaml ├── @i7iceguy │ └── counter.yaml ├── @jacobtomlinson │ └── charge_heaters.yaml ├── @jainsarthak │ └── initialize_sensor.yaml ├── @jpenyc │ └── weather_mqtt.yaml ├── @jscoLP_twitter │ └── temp_sensor.yaml ├── @kevinpanaro │ ├── package.json │ └── pushover-proxy.js ├── @ki8as │ ├── configuration.yaml │ └── customize.yaml ├── @ktpx │ └── groups_wrong.md ├── @kyle-kennedy │ └── marantz_avr_cmd.yaml ├── @lwis │ ├── slider_to_sonos.yaml │ ├── sonos.yaml │ └── sonos_to_slider.yaml ├── @michaelcm │ └── device_online.yaml ├── @mikenolet │ ├── date_range.yaml │ ├── ecobee_fan.yaml │ ├── harmonyhub.yaml │ └── harmonyhub_script.yaml ├── @multiholle │ └── sonos_turn_on.yaml ├── @p0nts │ └── sensitive_strips_door.yaml ├── @photo64 │ └── camera.yaml ├── @ryanlaux │ └── steam_game.yaml ├── @sgauche │ ├── better_sensor_notify.yaml │ └── detect_sensor_change.yaml ├── @soggypretzels │ └── default_toggle_brightness.yaml ├── @stress1ner │ └── milight_colors.yaml ├── @thundergreen │ └── logincheck.php ├── @tuckwat │ ├── hvac-zwave.py │ └── tstat-zwave.py ├── @w1ll1am23 │ └── basking_tank.yaml ├── @wyznerd │ ├── include_dir_list.md │ ├── include_dir_merge_list.md │ ├── include_dir_merge_named.md │ └── include_dir_named.md ├── bootstrap │ ├── automation │ │ ├── easy.yaml │ │ └── peasy.yaml │ ├── configuration.yaml │ ├── customize.yaml │ ├── input_boolean │ │ ├── easy.yaml │ │ └── peasy.yaml │ └── secrets.sample.yaml ├── broadlink_input_select.yaml ├── configuration.demo.yaml ├── google_tts.yaml ├── homebridge.md ├── human_time.j2 ├── learn_yaml.yaml ├── packages │ ├── kodi_control.yaml │ ├── led_h801.yaml │ ├── low_charge_sms.sh │ ├── low_charge_sms.yaml │ ├── mqtt_publish.yaml │ ├── philips_hue_dimmer.yaml │ ├── philips_hue_motion.yaml │ ├── pill_tracker.yaml │ ├── restart_mqtt.yaml │ └── tts_alerts.yaml ├── select_timer.yaml ├── services │ ├── home-assistant.service │ ├── ozwcp.service │ └── virtualenv │ │ └── home-assistant.service ├── slow_dim_lights.yaml ├── sunset_light_ramping.yaml ├── sync_media_player_volume.yaml ├── yaml_anchors.yaml └── zwave_link.sh ├── packages ├── alarm.yaml ├── alarm_clock.yaml ├── apple_tv.yaml ├── asuswrt.yaml ├── batteries.yaml ├── blueiris.yaml ├── brightness.yaml ├── broadlink.yaml ├── climate.yaml ├── configurator.yaml ├── customizer.yaml ├── drop-in │ ├── curl.yaml │ ├── light_control.yaml │ ├── persistence.yaml │ ├── secrets_container.yaml │ ├── tts_alerts.yaml │ └── zwave_minimote.yaml ├── ecobee.yaml ├── eventghost.yaml ├── ffmpeg.yaml ├── floorplan.yaml ├── flux_led.yaml ├── front_porch_light.yaml ├── garage.yaml ├── good_morning_night.yaml ├── google_cast.yaml ├── grafana.yaml ├── groups │ ├── automation_override.yaml │ ├── batteries2.yaml │ ├── media_components.yaml │ ├── motion.yaml │ ├── occupancy.yaml │ ├── people.yaml │ ├── rooms.yaml │ └── temperature.yaml ├── haaska.yaml ├── hagraph.yaml ├── harmony.yaml ├── haveibeenpwned.yaml ├── homebridge.yaml ├── house_mode.yaml ├── http.yaml ├── ios.yaml ├── limitless_led.yaml ├── logbook.yaml ├── logger.yaml ├── media_lights.yaml ├── morning_lights.yaml ├── mqtt.yaml ├── nap_time.yaml ├── network_devices.j2 ├── network_devices.yaml ├── notify.yaml ├── ozwcp.yaml ├── philips_hue.yaml ├── plex.yaml ├── presence.yaml ├── projector_screen.yaml ├── recorder.yaml ├── sabnzbd.yaml ├── sensor_lights.yaml ├── shower_mode.yaml ├── smartthings.yaml ├── speech.yaml ├── sun.yaml ├── switchmate.yaml ├── system.yaml ├── telegram.yaml ├── tts.yaml ├── ups.yaml ├── usps.yaml ├── utilities.yaml ├── views.yaml ├── weather.yaml ├── web_power_switch.yaml ├── windy.yaml ├── xbox_live.yaml ├── xiaomi.yaml ├── zones.yaml ├── zwave.yaml └── zwave_remotes.yaml ├── phrases ├── bedtime_story.yaml ├── good_morning.yaml └── good_night.yaml ├── python_scripts └── hello_world.py ├── secrets.sample.env ├── secrets.sample.yaml ├── shell_scripts ├── backup_config.sh ├── gitupdate.sh ├── pm2ctl.sh ├── switchmate.py └── update_hass.sh ├── themes ├── dark-orange.yaml └── pink.yaml ├── wizard ├── assets │ └── mosquitto.conf.asset ├── homebridge-wizard.sh ├── mosquitto-wizard.sh ├── mqtt-dasher-wizard.sh ├── openresty-wizard.sh ├── openzwave-hassbian.sh ├── openzwave-wizard.sh ├── perm-wizard.sh ├── pm2-wizard.sh └── venv-alias.sh └── zwave_device_config.yaml /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | insert_final_newline = true 6 | trim_trailing_whitespace = true 7 | indent_style = space 8 | indent_size = 2 9 | 10 | [*.py] 11 | indent_style = space 12 | indent_size = 4 13 | 14 | [*.sh] 15 | indent_style = space 16 | indent_size = 2 17 | 18 | [*.xml] 19 | indent_style = tab 20 | indent_size = 4 21 | 22 | [*.yaml] 23 | indent_style = space 24 | indent_size = 2 25 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.conf text eol=lf 3 | *.js text eol=lf 4 | *.json text eol=lf 5 | *.md text eol=lf 6 | *.yaml text eol=lf 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | 6 | # Runtime data 7 | pids 8 | *.pid 9 | *.seed 10 | 11 | # Directory for instrumented libs generated by jscoverage/JSCover 12 | lib-cov 13 | 14 | # Coverage directory used by tools like istanbul 15 | coverage 16 | 17 | # nyc test coverage 18 | .nyc_output 19 | 20 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 21 | .grunt 22 | 23 | # node-waf configuration 24 | .lock-wscript 25 | 26 | # Compiled binary addons (http://nodejs.org/api/addons.html) 27 | build/Release 28 | 29 | # Dependency directories 30 | node_modules 31 | jspm_packages 32 | 33 | # Optional npm cache directory 34 | .npm 35 | 36 | # Optional REPL history 37 | .node_repl_history 38 | 39 | # Python cache 40 | __pycache__ 41 | *.pyc 42 | 43 | # Other 44 | components 45 | config 46 | custom_components 47 | deps 48 | icloud 49 | panels 50 | tts 51 | www 52 | __* 53 | *.conf 54 | *.db 55 | *.db-journal 56 | *.log 57 | *.moved 58 | *.noload 59 | *.notes 60 | *.txt 61 | *.sqlite 62 | *.xml 63 | *.backup 64 | .ftpconfig 65 | .ftpignore 66 | .HA_VERSION 67 | .uuid 68 | configurator.py 69 | home-assistant.* 70 | !home-assistant.service 71 | ip_bans.yaml 72 | known_devices.yaml 73 | secrets.env 74 | secrets.yaml 75 | usps_cookies.pickle 76 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 dale3h 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Home Assistant Configuration by [@dale3h](https://gitter.im/dale3h) Flattr this 2 | [Home Assistant](https://home-assistant.io/) configuration files (YAMLs) 3 | 4 | This is my Home Assistant Configuration. I often try new components to help test them for others. 5 | 6 | I have Home Assistant running on a [Raspberry Pi 2 B](http://amzn.to/2i6mwYR) with [Aeotec Z-Wave Stick (Gen 5)](http://amzn.to/2id0EsA). 7 | 8 | Software on the pi: 9 | * [Home Assistant](https://home-assistant.io/) 10 | * [MQTT Dasher](https://github.com/stjohnjohnson/mqtt-dasher) 11 | * [SmartThings MQTT Bridge](https://github.com/stjohnjohnson/smartthings-mqtt-bridge) 12 | * [Homebridge](https://github.com/nfarina/homebridge) 13 | * [PositiveSSL from SSLs.com](https://www.ssls.com/ssl-certificates/comodo-positivessl) - only $4.99 per year 14 | 15 | **Devices in Use:** 16 | * RFID Chip Implant (Right Hand) 17 | * Apple/iOS/tvOS Devices - [iPhone 7 Plus](http://amzn.to/2xWOzPI), [iPad Air](http://amzn.to/2iD9dMu), Apple TV (Gen 4) 18 | * Chromecast Audio 19 | * [ecobee3 Thermostat](http://amzn.to/2iD0v0z) with [ecobee3 Remote Sensors](http://amzn.to/2iCZFRw) 20 | * [Amazon Echo](http://amzn.to/2i6mShX) 21 | * [Amazon Echo Dot Gen 2](http://amzn.to/2hvCexj) 22 | * Amazon Echo Show 23 | * [Amazon Dash Buttons](http://amzn.to/2i6acYv) 24 | * [Amazon Fire TV Stick](http://amzn.to/2iD9uPx) 25 | * Amazon Dash Wand 26 | * Amazon Fire 7 Tablet 27 | * Google Home 28 | * [Philips Hue (Gen 2)](http://amzn.to/2hvyzzK) 29 | * [Philips Hue Dimmer](http://amzn.to/2hs5HH1) 30 | * [Philips Hue Motion](http://amzn.to/2iD7jLX) 31 | * [Philips Hue Tap](http://amzn.to/2i6nlAV) 32 | * [SmartThings Hub (Gen 2)](http://amzn.to/2idb8bA) 33 | * [Iris Door Sensor](http://amzn.to/2i6iqQd) 34 | * [Iris Smart Button](http://amzn.to/2i6nzIh) 35 | * [LiftMaster myQ](http://amzn.to/2eVEezb) Garage Door Controller 36 | * [Xbox One S](http://amzn.to/2igdusB) 37 | * [RGBWW LED Strip WiFi Controller](http://amzn.to/2i6mUqn) with [RGB LED Strips](http://amzn.to/2i68N42) 38 | * [Aeon Labs MultiSensor 6](http://amzn.to/2hMzmrW) 39 | * [Aeon Labs Z-Wave Minimote](http://amzn.to/2igetsU) 40 | * [Logitech Harmony Ultimate](http://amzn.to/2i6jNPb) 41 | * DigitalLoggers Web Power Switch 42 | * Xiaomi Mi Home Hub 43 | * Broadlink RM2/Pro 44 | * HUSBZB-1 ZigBee/Z-Wave Stick 45 | * deCONZ ConBee 46 | * Aeon Labs Z-Wave MultiSensor 6 47 | * Aeon Labs Z-Wave Door/Window Sensor 48 | * Aeon Labs Z-Wave Minimote 49 | * Aeon Labs Z-Wave Siren 50 | * GoControl Z-Wave Siren 51 | * Kwikset Z-Wave Smart Lock 52 | * IKEA Tradfri Bridge 53 | * IKEA Tradfri Motion 54 | * IKEA Tradfri Dimmer 55 | * IKEA Tradfri Remote 56 | * IKEA Tradfri Light 57 | * Switchmate 58 | -------------------------------------------------------------------------------- /TODO.md: -------------------------------------------------------------------------------- 1 | ## Todo 2 | 3 | - [ ] Look into NUT (Network UPS Tools) 4 | - [ ] https://home-assistant.io/components/sensor.nut/ 5 | - [ ] Seek advice from @bassclarinetl2 and @quadflight 6 | - [x] Add OZWCP to hass sidebar 7 | - [x] Add an input boolean for toggling the Z-Wave network 8 | - [ ] Write a script to detect changes to zwcfg and restart hass if necessary? 9 | - [x] Add guest mode switch 10 | - [ ] Automatically toggle when a guest is present 11 | - [x] Allow manual toggle 12 | - [x] `persistent: true` in customize 13 | - [ ] Figure out why input_select triggers a reset after changing (re: persistence) 14 | - [ ] Add radar map (shell_command + local file) 15 | - [ ] Remove redundant switches for automations 16 | - [ ] Clean up customize.yaml to remove old/outdated entities 17 | - [ ] Automate Good Morning/Night button 18 | - [ ] After 9pm, trigger good night script (unless already triggered) 19 | - [ ] After 5am, trigger good morning script (unless already triggered) 20 | - [ ] After 10am, toggle bedroom motion 21 | - [ ] Organize groups better 22 | - [ ] Iconify everything 23 | - [ ] Add panic mode/security mode scene 24 | 25 | ## More Todo 26 | - [ ] Figure out a decent way to mount the projector 27 | - [ ] Find an affordable yet reliable rack PDU 28 | - [ ] Find an affordable yet reliable rack UPS 29 | - [ ] Setup Z-Wave minimotes for each room 30 | - [ ] Buy more Z-Wave door/window sensors 31 | - [ ] Make ethernet cables for each component 32 | - [ ] Buy proper length, matching interconnects for all components 33 | 34 | ## Discussion: 35 | 36 | - [ ] Build web UI for managing config files 37 | - [ ] Use ACE for the editor 38 | - [ ] Need something to read/write files 39 | 40 | ## Pending Removal 41 | 42 | - [ ] Nothing :) 43 | -------------------------------------------------------------------------------- /configuration.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Configuration 3 | ################################################################ 4 | 5 | homeassistant: 6 | name: Home 7 | latitude: !secret home_latitude 8 | longitude: !secret home_longitude 9 | elevation: !secret home_elevation 10 | time_zone: America/Chicago 11 | unit_system: imperial 12 | customize: !include customize.yaml 13 | packages: !include_dir_named packages 14 | 15 | config: 16 | conversation: 17 | # discovery: 18 | history: 19 | python_script: 20 | 21 | frontend: 22 | themes: !include_dir_named themes 23 | -------------------------------------------------------------------------------- /customize.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Customize 3 | ################################################################ 4 | 5 | -------------------------------------------------------------------------------- /examples/@AdithyanI/music_alarm.yaml: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Start playing music at a selected time 3 | # 4 | # Written for: 5 | # @AdithyanI 6 | # 7 | # Components: 8 | # automation 9 | # input_slider 10 | # sensor 11 | # shell_command 12 | # 13 | # License: 14 | # MIT 15 | # 16 | # Author: 17 | # Dale Higgs <@dale3h> 18 | # 19 | # PLEASE NOTE: THIS CONFIGURATION IS UNTESTED AND MAY CONTAIN ERRORS 20 | 21 | automation: 22 | - alias: turn_on_music_at_selected_time 23 | trigger: 24 | - platform: template 25 | value_template: "{{ is_state('sensor.time', states('input_slider.music_hour')|int ~ ':' ~ states('input_slider.music_minute')|int) }}" 26 | action: 27 | - service: shell_command.play_sound 28 | 29 | input_slider: 30 | music_hour: 31 | initial: 6 32 | min: 0 33 | max: 23 34 | step: 1 35 | music_minute: 36 | initial: 30 37 | min: 0 38 | max: 59 39 | step: 1 40 | 41 | sensor: 42 | - platform: time_date 43 | display_options: 44 | - time 45 | 46 | shell_command: 47 | play_sound: sudo /usr/bin/omxplayer /home/pi/Downloads/Aigiri_Nandhini_BombaySisters.mp3 48 | -------------------------------------------------------------------------------- /examples/@CCOSTAN/detect_state_change.yaml: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Detect a light turning on and set brightness to 30% (76) if before 8am 3 | # 4 | # Written for: 5 | # @CCOSTAN 6 | # 7 | # Components: 8 | # automation 9 | # light 10 | # 11 | # License: 12 | # MIT 13 | # 14 | # Author: 15 | # Dale Higgs <@dale3h> 16 | # 17 | # PLEASE NOTE: THIS CONFIGURATION IS UNTESTED AND MAY CONTAIN ERRORS 18 | 19 | - alias: detect_light_on_in_morning 20 | trigger: 21 | - platform: event 22 | event_type: state_changed 23 | condition: 24 | - condition: time 25 | before: '08:00:00' 26 | - condition: template 27 | value_template: "{{ trigger.event.data is not none }}" 28 | - condition: template 29 | value_template: "{{ trigger.event.data.entity_id is not none }}" 30 | - condition: template 31 | value_template: "{{ trigger.event.data.entity_id.split('.')[0] == 'light' }}" 32 | - condition: template 33 | value_template: "{{ trigger.event.data.new_state is not none }}" 34 | - condition: template 35 | value_template: "{{ trigger.event.data.new_state.state is not none }}" 36 | - condition: template 37 | value_template: "{{ trigger.event.data.new_state.state == 'on' }}" 38 | - condition: template 39 | value_template: "{{ trigger.event.data.new_state.attributes is not none }}" 40 | - condition: template 41 | value_template: "{{ trigger.event.data.new_state.attributes.brightness|default(0)|int > 76 }}" 42 | action: 43 | - service: light.turn_on 44 | data_template: 45 | entity_id: "{{ trigger.event.data.entity_id }}" 46 | brightness: 76 47 | -------------------------------------------------------------------------------- /examples/@albyalby_twitter/brightness_trigger.yaml: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Trigger an automation based on a light's brightness 3 | # 4 | # Written for: 5 | # @albyalby_twitter 6 | # 7 | # Components: 8 | # automation 9 | # input_boolean 10 | # light 11 | # 12 | # License: 13 | # MIT 14 | # 15 | # Author: 16 | # Dale Higgs <@dale3h> 17 | # 18 | # PLEASE NOTE: THIS CONFIGURATION IS UNTESTED AND MAY CONTAIN ERRORS 19 | 20 | automation: 21 | # Test for a specific brightness level 22 | - alias: let_there_be_light 23 | trigger: 24 | - platform: template 25 | entity_id: light.living_room_lamp 26 | value_template: "{{ trigger.to_state.attributes.brightness == 255 }}" 27 | action: 28 | - service: input_boolean.turn_on 29 | entity_id: input_boolean.light_is_max 30 | state: 'on' 31 | 32 | # Test for brightness in a range 33 | - alias: let_there_be_more_light 34 | trigger: 35 | - platform: template 36 | entity_id: light.living_room_lamp 37 | value_template: "{{ trigger.to_state.attributes.brightness >= 170 and trigger.to_state.attributes.brightness <= 255 }}" 38 | action: 39 | - service: input_boolean.turn_on 40 | entity_id: input_boolean.light_is_high 41 | state: 'on' 42 | 43 | # Test for brightness in a range (simple, but not sure it'll work) 44 | - alias: let_there_be_even_more_light 45 | trigger: 46 | - platform: numeric_state 47 | entity_id: light.living_room_lamp 48 | above: 0 49 | below: 85 50 | value_template: "{{ trigger.to_state.attributes.brightness }}" 51 | action: 52 | - service: input_boolean.turn_on 53 | entity_id: input_boolean.light_is_low 54 | state: 'on' 55 | -------------------------------------------------------------------------------- /examples/@albyalby_twitter/manual_light.yaml: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Detect if a light was turned on manually 3 | # 4 | # Written for: 5 | # @albyalby_twitter 6 | # 7 | # Components: 8 | # automation 9 | # input_boolean 10 | # light 11 | # notify 12 | # 13 | # License: 14 | # MIT 15 | # 16 | # Author: 17 | # Dale Higgs <@dale3h> 18 | # 19 | # PLEASE NOTE: THIS CONFIGURATION IS UNTESTED AND MAY CONTAIN ERRORS 20 | 21 | input_boolean: 22 | bedroom_light_flag: 23 | name: Bedroom Light Flag 24 | initial: off 25 | 26 | automation: 27 | - alias: event_turns_flag_on 28 | trigger: 29 | - platform: event 30 | event_type: call_service 31 | event_data: 32 | domain: homeassistant 33 | service: turn_on 34 | service_data: 35 | entity_id: light.bedroom_light 36 | action: 37 | - service: homeassistant.turn_on 38 | entity_id: input_boolean.bedroom_light_flag 39 | 40 | - alias: event_turns_flag_off 41 | trigger: 42 | - platform: event 43 | event_type: call_service 44 | event_data: 45 | domain: homeassistant 46 | service: turn_off 47 | service_data: 48 | entity_id: light.bedroom_light 49 | action: 50 | - service: homeassistant.turn_off 51 | entity_id: input_boolean.bedroom_light_flag 52 | 53 | - alias: light_was_turned_on_manually 54 | trigger: 55 | - platform: state 56 | entity_id: light.bedroom_light 57 | to: 'on' 58 | condition: 59 | - condition: state 60 | entity_id: input_boolean.bedroom_light_flag 61 | state: 'off' 62 | action: 63 | - service: homeassistant.turn_on 64 | entity_id: input_boolean.bedroom_light_flag 65 | - service: notify.notify 66 | data: 67 | message: Bedroom light was turned on manually 68 | -------------------------------------------------------------------------------- /examples/@andrew-curtis/tv_input.yaml: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Select an HDMI CEC device/input using input_select 3 | # 4 | # Written for: 5 | # @andrew-curtis 6 | # 7 | # Components: 8 | # automation 9 | # hdmi_cec 10 | # input_select 11 | # persistent_notification 12 | # 13 | # License: 14 | # MIT 15 | # 16 | # Author: 17 | # Dale Higgs <@dale3h> 18 | # 19 | # PLEASE NOTE: THIS CONFIGURATION IS UNTESTED AND MAY CONTAIN ERRORS 20 | 21 | automation: 22 | - alias: ps3_input 23 | trigger: 24 | - platform: state 25 | entity_id: input_select.tv_input 26 | to: 'PS3' 27 | action: 28 | - service: hdmi_cec.select_device 29 | data: 30 | device: PS3 31 | - service: persistent_notification.create 32 | data: 33 | title: Automation Executed 34 | message: PS3 On 35 | 36 | - alias: turn_off_tv 37 | trigger: 38 | - platform: state 39 | entity_id: input_select.tv_input 40 | to: 'Off' 41 | action: 42 | - service: hdmi_cec.standby 43 | - service: persistent_notification.create 44 | data: 45 | title: Automation Executed 46 | message: PS3 Off 47 | 48 | input_select: 49 | tv_input: 50 | name: TV 51 | options: 52 | - 'Off' 53 | - 'PS3' 54 | initial: 'Off' 55 | -------------------------------------------------------------------------------- /examples/@aptonline/homebridge.yaml: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Restart Homebridge on Home Assistant startup 3 | # 4 | # Written for: 5 | # @aptonline 6 | # 7 | # Components: 8 | # automation 9 | # shell_command 10 | # 11 | # License: 12 | # MIT 13 | # 14 | # Author: 15 | # Dale Higgs <@dale3h> 16 | # 17 | # PLEASE NOTE: THIS CONFIGURATION IS UNTESTED AND MAY CONTAIN ERRORS 18 | 19 | automation: 20 | - alias: restart_homebridge 21 | trigger: 22 | - platform: event 23 | event_type: homeassistant_start 24 | action: 25 | - delay: '00:01:00' 26 | - service: shell_command.restart_homebridge 27 | 28 | shell_command: 29 | restart_homebridge: 'sudo su pi -c "pm2 restart homebridge"' 30 | start_homebridge: 'sudo su pi -c "pm2 start homebridge"' 31 | stop_homebridge: 'sudo su pi -c "pm2 stop homebridge"' 32 | -------------------------------------------------------------------------------- /examples/@araneolusporcus/publish_sensor_to_mqtt.yaml: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Publish a sensor to MQTT when it changes 3 | # 4 | # Written for: 5 | # @araneolusporcus 6 | # 7 | # Components: 8 | # automation 9 | # mqtt 10 | # sensor 11 | # 12 | # License: 13 | # MIT 14 | # 15 | # Author: 16 | # Dale Higgs <@dale3h> 17 | # 18 | # PLEASE NOTE: THIS CONFIGURATION IS UNTESTED AND MAY CONTAIN ERRORS 19 | 20 | automation: 21 | - alias: publish_sensor_to_mqtt 22 | trigger: 23 | - platform: state 24 | entity_id: sensor.dark_sky_apparent_temperature 25 | action: 26 | - service: mqtt.publish 27 | data_template: 28 | topic: hass01/ds/Temperature 29 | payload: "{{ trigger.to_state.state }}" 30 | retain: true 31 | -------------------------------------------------------------------------------- /examples/@bart274/post_gps.yaml: -------------------------------------------------------------------------------- 1 | ################################################ 2 | ## One Device w/ Passing Service Data 3 | ################################################ 4 | 5 | shell_command: 6 | update_pgm: 'curl -X POST http://localhost:5000/next_loc?lat={{ latitude }}&lon={{ longitude }}' 7 | 8 | automation: 9 | - alias: POST GPS Coordinates 10 | trigger: 11 | platform: state 12 | entity_id: device_tracker.iphonebart 13 | condition: 14 | condition: or 15 | conditions: 16 | - condition: template 17 | value_template: "{{ trigger.to_state.attributes.latitude != trigger.from_state.attributes.latitude }}" 18 | - condition: template 19 | value_template: "{{ trigger.to_state.attributes.longitude != trigger.from_state.attributes.longitude }}" 20 | action: 21 | service: shell_command.update_pgm 22 | data: 23 | latitude: "{{ trigger.to_state.attributes.latitude }}" 24 | longitude: "{{ trigger.to_state.attributes.longitude }}" 25 | 26 | ################################################ 27 | ## Multiple Devices w/ Passing Service Data 28 | ################################################ 29 | 30 | shell_command: 31 | update_pgm: 'curl -X POST http://localhost:5000/next_loc?lat={{ latitude }}&lon={{ longitude }}&device={{ device }}' 32 | 33 | automation: 34 | - alias: POST GPS Coordinates 35 | trigger: 36 | platform: state 37 | entity_id: device_tracker.iphonebart, device_tracker.ipadbart 38 | condition: 39 | condition: or 40 | conditions: 41 | - condition: template 42 | value_template: "{{ trigger.to_state.attributes.latitude != trigger.from_state.attributes.latitude }}" 43 | - condition: template 44 | value_template: "{{ trigger.to_state.attributes.longitude != trigger.from_state.attributes.longitude }}" 45 | action: 46 | service: shell_command.update_pgm 47 | data: 48 | latitude: "{{ trigger.to_state.attributes.latitude }}" 49 | longitude: "{{ trigger.to_state.attributes.longitude }}" 50 | device: "{{ trigger.to_state.entity_id }}" 51 | 52 | ################################################ 53 | ## Multiple Devices w/ Passed Service Data 54 | ################################################ 55 | 56 | shell_command: 57 | update_pgm: 'curl -X POST http://localhost:5000/next_loc?lat={{ trigger.to_state.attributes.latitude }}&lon={{ trigger.to_state.attributes.longitutde }}&device={{ trigger.to_state.entity_id }}'@ 58 | 59 | automation: 60 | - alias: POST GPS Coordinates 61 | trigger: 62 | platform: state 63 | entity_id: device_tracker.iphonebart, device_tracker.ipadbart 64 | condition: 65 | condition: or 66 | conditions: 67 | - condition: template 68 | value_template: "{{ trigger.to_state.attributes.latitude != trigger.from_state.attributes.latitude }}" 69 | - condition: template 70 | value_template: "{{ trigger.to_state.attributes.longitude != trigger.from_state.attributes.longitude }}" 71 | action: 72 | service: shell_command.update_pgm 73 | -------------------------------------------------------------------------------- /examples/@brmo/radio.yaml: -------------------------------------------------------------------------------- 1 | automation: 2 | - alias: Stop Streaming Radio 3 | trigger: 4 | platform: state 5 | entity_id: input_select.radio_station 6 | to: 'None' 7 | condition: or 8 | conditions: 9 | - condition: state 10 | entity_id: input_select.radio_player 11 | state: 'Office' 12 | - condition: state 13 | entity_id: input_select.radio_player 14 | state: 'Bedroom' 15 | - condition: state 16 | entity_id: input_select.radio_player 17 | state: 'Kitchen' 18 | action: 19 | service: media_player.turn_off 20 | data_template: 21 | entity_id: > 22 | {%- if is_state('input_select.radio_player', 'Office') -%} 23 | media_player.office 24 | {%- elif is_state('input_select.radio_player', 'Bedroom') -%} 25 | media_player.bedroom 26 | {%- elif is_state('input_select.radio_player', 'Kitchen') -%} 27 | media_player.kitchen 28 | {%- endif -%} 29 | 30 | - alias: Start Streaming Radio 31 | trigger: 32 | - platform: state 33 | entity_id: input_select.radio_station 34 | to: 'X96' 35 | - platform: state 36 | entity_id: input_select.radio_station 37 | to: 'KISS FM' 38 | - platform: state 39 | entity_id: input_select.radio_station 40 | to: 'Country Time' 41 | condition: or 42 | conditions: 43 | - condition: state 44 | entity_id: input_select.radio_player 45 | state: 'Office' 46 | - condition: state 47 | entity_id: input_select.radio_player 48 | state: 'Bedroom' 49 | - condition: state 50 | entity_id: input_select.radio_player 51 | state: 'Kitchen' 52 | action: 53 | service: media_player.play_media 54 | data_template: 55 | entity_id: > 56 | {%- if is_state('input_select.radio_player', 'Office') -%} 57 | media_player.office 58 | {%- elif is_state('input_select.radio_player', 'Bedroom') -%} 59 | media_player.bedroom 60 | {%- elif is_state('input_select.radio_player', 'Kitchen') -%} 61 | media_player.kitchen 62 | {%- endif -%} 63 | media_content_id: > 64 | {%- if is_state('input_select.radio_station', 'X96') -%} 65 | 'http://ice41.securenetsystems.net/KXRK?type=.mp4' 66 | {%- elif is_state('input_select.radio_station', 'KISS FM') -%} 67 | 'http://ice41.securenetsystems.net/KISS?type=.mp4' 68 | {%- elif is_state('input_select.radio_station', 'Country Time') -%} 69 | 'http://ice41.securenetsystems.net/CTRY?type=.mp4' 70 | {%- endif -%} 71 | media_content_type: 'audio/mp4' 72 | -------------------------------------------------------------------------------- /examples/@brusc/shell_espeak.yaml: -------------------------------------------------------------------------------- 1 | shell_command: 2 | espeak: 'espeak "{{ text }}"' 3 | 4 | automation: 5 | - alias: Speak welcome message for Ben 6 | trigger: 7 | platform: state 8 | entity_id: device_tracker.bens_phone 9 | to: 'home' 10 | action: 11 | service: shell_command.espeak 12 | data_template: 13 | text: 'Welcome home Ben. The time is {{ now.strftime("%-I:%M %p") }} and the temperature is {{ states("sensor.temperature") }} degrees.' 14 | -------------------------------------------------------------------------------- /examples/@carlostico/group-people.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Group / People 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Household 7 | ################################################ 8 | 9 | household: 10 | name: Household 11 | view: yes 12 | entities: 13 | - group.person_carlos 14 | - group.person_betzi 15 | - group.guests 16 | 17 | person_carlos: 18 | name: Carlos 19 | entities: 20 | - device_tracker.carlossiphone 21 | - device_tracker.carlossiphone_netgear 22 | 23 | person_betzi: 24 | name: Betzi 25 | entities: 26 | - device_tracker.betzisiphone 27 | - device_tracker.betzisiphone_netgear 28 | 29 | ################################################ 30 | ## Guests 31 | ################################################ 32 | 33 | guests: 34 | name: Guests 35 | entities: 36 | - group.person_patrick 37 | - group.person_sarah 38 | 39 | person_patrick: 40 | name: Patrick 41 | entities: 42 | - device_tracker.patrick_iphone 43 | 44 | person_sarah: 45 | name: Sarah 46 | entities: 47 | - device_tracker.sarah_android 48 | -------------------------------------------------------------------------------- /examples/@carlostico/icloud_failover.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Automation / iCloud Failover 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Carlos's iPhone 7 | ################################################ 8 | 9 | - alias: iCloud Interval 1min if Carlos Netgear is NOT_HOME and iCloud is HOME 10 | trigger: 11 | - platform: state 12 | entity_id: device_tracker.carlossiphone_netgear 13 | to: 'not_home' 14 | condition: 15 | - condition: state 16 | entity_id: device_tracker.carlossiphone 17 | state: 'home' 18 | action: 19 | - service: icloud.setinterval 20 | data: 21 | accountname: carlos 22 | interval: 1 23 | 24 | - alias: iCloud Interval 30min if Carlos Netgear is HOME and iCloud is HOME and interval < 30 25 | trigger: 26 | - platform: state 27 | entity_id: device_tracker.carlossiphone_netgear 28 | to: 'home' 29 | condition: 30 | - condition: and 31 | conditions: 32 | - condition: state 33 | entity_id: device_tracker.carlossiphone 34 | state: 'home' 35 | - condition: numeric_state 36 | entity_id: idevice.carlossiphone 37 | below: 30 38 | action: 39 | - service: icloud.setinterval 40 | data: 41 | accountname: carlos 42 | interval: 30 43 | 44 | ################################################ 45 | ## Betzi's iPhone 46 | ################################################ 47 | 48 | - alias: iCloud Interval 1min if Betzi Netgear is NOT_HOME and iCloud is HOME 49 | trigger: 50 | - platform: state 51 | entity_id: device_tracker.betzisiphone_netgear 52 | to: 'not_home' 53 | condition: 54 | - condition: state 55 | entity_id: device_tracker.betzisiphone 56 | state: 'home' 57 | action: 58 | - service: icloud.setinterval 59 | data: 60 | accountname: betzi 61 | interval: 1 62 | 63 | - alias: iCloud Interval 30min if Betzi Netgear is HOME and iCloud is HOME and interval < 30 64 | trigger: 65 | - platform: state 66 | entity_id: device_tracker.betzisiphone_netgear 67 | to: 'home' 68 | condition: 69 | - condition: and 70 | conditions: 71 | - condition: state 72 | entity_id: device_tracker.betzisiphone 73 | state: 'home' 74 | - condition: numeric_state 75 | entity_id: idevice.betzisiphone 76 | below: 30 77 | action: 78 | - service: icloud.setinterval 79 | data: 80 | accountname: betzi 81 | interval: 30 82 | 83 | -------------------------------------------------------------------------------- /examples/@clemon79/configuration.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Configuration 3 | ################################################################ 4 | 5 | homeassistant: 6 | name: Home 7 | latitude: !secret home_latitude 8 | longitude: !secret home_longitude 9 | elevation: !secret home_elevation 10 | time_zone: America/Chicago 11 | unit_system: imperial 12 | customize: !include customize.yaml 13 | 14 | frontend: 15 | history: 16 | logbook: 17 | sun: 18 | updater: 19 | 20 | emulated_hue: 21 | host_ip: 192.168.1.186 22 | exposed_domains: 23 | - script 24 | 25 | http: 26 | api_password: !secret http_api_password 27 | 28 | script: !include script.yaml 29 | shell_command: !include shell_command.yaml 30 | -------------------------------------------------------------------------------- /examples/@clemon79/customize.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Customize 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Script 7 | ################################################ 8 | 9 | script.hello_world_wrapper: 10 | friendly_name: Hello World 11 | 12 | script.restart_ha: 13 | friendly_name: Restart Home Assistant 14 | icon: mdi:power 15 | -------------------------------------------------------------------------------- /examples/@clemon79/script.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Script 3 | ################################################################ 4 | 5 | hello_world_wrapper: 6 | sequence: 7 | - service: shell_command.hello_world 8 | 9 | restart_ha: 10 | sequence: 11 | - service: homeassistant.restart 12 | -------------------------------------------------------------------------------- /examples/@clemon79/secrets.sample.yaml: -------------------------------------------------------------------------------- 1 | home_latitude: [REDACTED] 2 | home_longitude: [REDACTED] 3 | home_elevation: [REDACTED] 4 | 5 | http_api_password: [REDACTED] 6 | -------------------------------------------------------------------------------- /examples/@clemon79/shell_command.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Shell Command 3 | ################################################################ 4 | 5 | hello_world: 'echo "Hello World" > /home/pi/hello-world.txt' 6 | -------------------------------------------------------------------------------- /examples/@cmsimike/wife_purse.yaml: -------------------------------------------------------------------------------- 1 | automation: 2 | - alias: x left her purse 3 | trigger: 4 | platform: state 5 | entity_id: binary_sensor.x_purse 6 | state: 'on' 7 | condition: 8 | condition: state 9 | entity_id: device_tracker.x 10 | state: 'home' 11 | action: 12 | ... 13 | -------------------------------------------------------------------------------- /examples/@darkstardxm/above_threshold.yaml: -------------------------------------------------------------------------------- 1 | binary_sensor: 2 | platform: template 3 | sensors: 4 | furnace_above_threshold: 5 | value_template: '{{ states('sensor.furnace') > 2}}' 6 | friendly_name: 'Furnace Above Threshold' 7 | 8 | automation: 9 | - trigger: 10 | platform: state 11 | entity_id: binary_sensor.furnace_above_threshold 12 | state: 'on' 13 | for: 14 | minutes: 1 15 | condition: 16 | ...your condition(s)... 17 | action: 18 | ...your actions if threshold is reached for >1 minute... 19 | -------------------------------------------------------------------------------- /examples/@dbray925/kodi_volume.yaml: -------------------------------------------------------------------------------- 1 | automation: 2 | - alias: 'Getting up, turn Kodi up' 3 | trigger: 4 | platform: time 5 | after: '07:00:00' 6 | condition: 7 | entity_id: media_player.bedroom_kodi 8 | state: 'on' 9 | action: 10 | service: media_player.set_volume_level 11 | data: 12 | entity_id: media_player.bedroom_kodi 13 | volume: 50 14 | -------------------------------------------------------------------------------- /examples/@dbray925/sunrise.yaml: -------------------------------------------------------------------------------- 1 | automation: 2 | - alias: Turn on lights when sun sets 3 | trigger: 4 | platform: sun 5 | event: sunset 6 | offset: '+00:30:00' 7 | action: 8 | service: switch.turn_on 9 | entity_id: switch.front_port_lights_switch_2, switch.back_yard_lights_switch_4, switch.driveway_lights_switch_3 10 | 11 | - alias: Turn off lights when sun rises 12 | trigger: 13 | platform: sun 14 | event: sunrise 15 | offset: '-01:00:00' 16 | action: 17 | service: switch.turn_off 18 | entity_id: switch.front_port_lights_switch_2, switch.back_yard_lights_switch_4, switch.driveway_lights_switch_3 19 | -------------------------------------------------------------------------------- /examples/@docs/shell_command.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: page 3 | title: "Shell command" 4 | description: "Instructions how to integrate Shell commands into Home Assistant." 5 | date: 2015-10-13 19:10 6 | sidebar: true 7 | comments: false 8 | sharing: true 9 | footer: true 10 | ha_category: Automation 11 | source: https://github.com/home-assistant/home-assistant/blob/master/homeassistant/components/shell_command.py 12 | --- 13 | 14 | This component can expose regular shell commands as services. Services can be called from a [script] or in [automation]. 15 | 16 | [script]: /components/script/ 17 | [automation]: /getting-started/automation/ 18 | 19 | ```yaml 20 | # Example configuration.yaml entry 21 | # Exposes service shell_command.restart_pow 22 | shell_command: 23 | restart_pow: touch ~/.pow/restart.txt 24 | ``` 25 | 26 | Configuration variables: 27 | 28 | - Alias for the command 29 | - Command itself. 30 | 31 | The commands can be dynamic, using templates to insert values of other entities. When using templates you are limited to only template the arguments. You are also no longer allowed to use pipe symbols when using templates. 32 | 33 | Any service data passed into the service call to activate the shell command will be available as a variable within the template. 34 | 35 | ```yaml 36 | # Apply value of a GUI slider to the shell_command 37 | input_slider: 38 | ac_temperature: 39 | name: A/C Setting 40 | initial: 24 41 | min: 18 42 | max: 32 43 | step: 1 44 | {% raw %} 45 | shell_command: 46 | set_ac_to_slider: 'irsend SEND_ONCE DELONGHI AC_{{ states.input_slider.ac_temperature.state }}_AUTO' 47 | {% endraw %} 48 | ``` 49 | 50 | ```yaml 51 | # Set AC temperature with service data 52 | automation: 53 | alias: Set AC Temperature upon Arrival 54 | trigger: 55 | platform: state 56 | entity_id: device_tracker.my_phone 57 | to: 'home' 58 | action: 59 | service: shell_command.set_ac_temp 60 | data: 61 | temperature: 74 62 | {% raw %} 63 | shell_command: 64 | set_ac_temp: 'irsend SEND_ONCE DELONGHI AC_{{ temperature }}_AUTO' 65 | {% endraw %} 66 | ``` 67 | -------------------------------------------------------------------------------- /examples/@ericboxer/tue_5am.yaml: -------------------------------------------------------------------------------- 1 | automation: 2 | - alias: This triggers at 5am every Tuesday 3 | trigger: 4 | - platform: time 5 | after: '05:00:00' 6 | condition: 7 | - condition: time 8 | weekday: 9 | - tue 10 | action: 11 | - service: notify.telegram 12 | data: 13 | message: It is 5am on Tuesday! 14 | -------------------------------------------------------------------------------- /examples/@eugenelai/scene_selector.yaml: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Activate a scene using an input_select 3 | # 4 | # Written for: 5 | # @eugenelai 6 | # 7 | # Components: 8 | # automation 9 | # input_select 10 | # scene 11 | # 12 | # License: 13 | # MIT 14 | # 15 | # Author: 16 | # Dale Higgs <@dale3h> 17 | # 18 | # PLEASE NOTE: THIS CONFIGURATION IS UNTESTED AND MAY CONTAIN ERRORS 19 | 20 | automation: 21 | - alias: select_a_scene 22 | trigger: 23 | # Trigger when the input_select changes 24 | - platform: state 25 | entity_id: input_select.scene_selector 26 | condition: 27 | # Do not trigger if "None" is selected 28 | - platform: template 29 | value_template: "{{ not is_state('input_select.scene_selector', 'None') }}" 30 | action: 31 | # Turn the selected scene on 32 | - service: scene.turn_on 33 | data_template: 34 | entity_id: "scene.{{ states('input_select.scene_selector')|lower|replace(' ', '_') }}" 35 | # Set the input_select back to "None" 36 | - service: input_select.select_option 37 | entity_id: input_select.scene_selector 38 | data: 39 | option: 'None' 40 | 41 | input_select: 42 | scene_selector: 43 | name: Scene Selector 44 | initial: 'None' 45 | options: 46 | - 'None' 47 | - 'Low' 48 | - 'Bright' 49 | 50 | scene: 51 | - name: Low 52 | entities: 53 | light.bedroom: 54 | state: on 55 | brightness: 20 56 | 57 | - name: Bright 58 | entities: 59 | light.bedroom: 60 | state: on 61 | brightness: 100 62 | -------------------------------------------------------------------------------- /examples/@frEEEki_twitter/conditional_actions.yaml: -------------------------------------------------------------------------------- 1 | ### Example using `automation` 2 | 3 | ```yaml 4 | automation: 5 | - alias: Conditional Action (Simple) 6 | trigger: 7 | - platform: state 8 | entity_id: device_tracker.device1, device_tracker.device2 9 | to: 'not_home' 10 | action: 11 | - service: notify.telegram 12 | data_template: 13 | message: > 14 | {% if trigger.entity_id == 'device_tracker.device1' %} 15 | Device 1 is away. 16 | {% elif trigger.entity_id == 'device_tracker.device2' %} 17 | Device 2 is away. 18 | {% endif %} 19 | ``` 20 | 21 | ### Example using `automation` and `script` 22 | 23 | ```yaml 24 | automation: 25 | - alias: Conditional Action (Advanced) 26 | trigger: 27 | - platform: state 28 | entity_id: device_tracker.device1, device_tracker.device2 29 | to: 'not_home' 30 | action: 31 | - service_template: "script.{{ trigger.entity_id.split('.', 1)[1] }}_is_away" 32 | 33 | script: 34 | device1_is_away: 35 | name: Device 1 is Away 36 | sequence: 37 | - service: notify.telegram 38 | data: 39 | message: Device 1 has left the building. 40 | - service: light.turn_off 41 | entity_id: light.kitchen 42 | 43 | device2_is_away: 44 | name: Device 2 is Away 45 | sequence: 46 | - service: notify.telegram 47 | data: 48 | message: Device 2 went bye-bye! 49 | - service: climate.set_away_mode 50 | data: 51 | entity_id: climate.home 52 | away_mode: true 53 | ``` 54 | -------------------------------------------------------------------------------- /examples/@frEEEki_twitter/icloud_update.yaml: -------------------------------------------------------------------------------- 1 | ### Example 1 - `automation` 2 | 3 | automation: 4 | - alias: Update iPhone Location when Front Door Opens 5 | trigger: 6 | - platform: state 7 | entity_id: binary_sensor.front_door 8 | to: 'open' 9 | condition: 10 | - condition: or 11 | conditions: 12 | - condition: template 13 | value_template: "{{ not is_state('device_tracker.marcsiphone', 'home') }}" 14 | - condition: template 15 | value_template: "{{ not is_state('device_tracker.janesiphone', 'home') }}" 16 | action: 17 | - service: icloud.update_icloud 18 | data_template: 19 | accountname: > 20 | {% if not is_state('device_tracker.marcsiphone', 'home') and not is_state('device_tracker.janesiphone', 'home') %} 21 | None 22 | {% elif not is_state('device_tracker.marcsiphone', 'home') %} 23 | marc 24 | {% elif not is_state('device_tracker.janesiphone', 'home') %} 25 | jane 26 | {% else %} 27 | None 28 | {% endif %} 29 | devicename: > 30 | {% if not is_state('device_tracker.marcsiphone', 'home') and not is_state('device_tracker.janesiphone', 'home') %} 31 | None 32 | {% elif not is_state('device_tracker.marcsiphone', 'home') %} 33 | marcsiphone 34 | {% elif not is_state('device_tracker.janesiphone', 'home') %} 35 | janesiphone 36 | {% else %} 37 | None 38 | 39 | ### Example 2 - `automation` and `script` 40 | 41 | automation: 42 | - alias: Update iPhone Location when Front Door Opens 43 | trigger: 44 | - platform: state 45 | entity_id: binary_sensor.front_door 46 | to: 'open' 47 | condition: 48 | - condition: or 49 | conditions: 50 | - condition: template 51 | value_template: "{{ not is_state('device_tracker.marcsiphone', 'home') }}" 52 | - condition: template 53 | value_template: "{{ not is_state('device_tracker.janesiphone', 'home') }}" 54 | action: 55 | - service: script.update_icloud_marcsiphone 56 | - service: script.update_icloud_janesiphone 57 | 58 | script: 59 | update_icloud_marcsiphone: 60 | name: Update Marc's iPhone Location 61 | sequence: 62 | - condition: template 63 | value_template: "{{ not is_state('device_tracker.marcsiphone', 'home') }}" 64 | - service: icloud.update_icloud 65 | data: 66 | accountname: marc 67 | devicename: marcsiphone 68 | 69 | update_icloud_janesiphone: 70 | name: Update Jane's iPhone Location 71 | sequence: 72 | - condition: template 73 | value_template: "{{ not is_state('device_tracker.janesiphone', 'home') }}" 74 | - service: icloud.update_icloud 75 | data: 76 | accountname: jane 77 | devicename: janesiphone 78 | -------------------------------------------------------------------------------- /examples/@freland/copy_switch.md: -------------------------------------------------------------------------------- 1 | You need to use an automation to accomplish what you're trying to do. 2 | 3 | With two automations: 4 | 5 | automation: 6 | - trigger: 7 | platform: state 8 | entity_id: switch.magnetic 9 | to: 'on' 10 | action: 11 | service: switch.turn_on 12 | entity_id: switch.switch_31 13 | 14 | - trigger: 15 | platform: state 16 | entity_id: switch.magnetic 17 | to: 'off' 18 | action: 19 | service: switch.turn_off 20 | entity_id: switch.switch_31 21 | 22 | 23 | It might also be possible with just one automation (untested): 24 | 25 | automation: 26 | - trigger: 27 | platform: state 28 | entity_id: switch.magnetic 29 | action: 30 | service_template: "switch.turn_{{ states('switch.magnetic') }}" 31 | entity_id: switch.switch_31 32 | 33 | If the one-automation version produces an error, try using this instead: 34 | 35 | automation: 36 | - trigger: 37 | platform: state 38 | entity_id: switch.magnetic 39 | action: 40 | service_template: > 41 | {%- if states('switch.magnetic') == 'on' -%} 42 | switch.turn_on 43 | {%- else -%} 44 | switch.turn_off 45 | {%- endif -%} 46 | entity_id: switch.switch_31 47 | -------------------------------------------------------------------------------- /examples/@garymaurizi/toggle_zwave_network.yaml: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Add a switch to the UI to toggle your Z-Wave network (for use with OZWCP) 3 | # 4 | # Written for: 5 | # @garymaurizi 6 | # 7 | # Components: 8 | # automation 9 | # input_boolean 10 | # zwave 11 | # 12 | # License: 13 | # MIT 14 | # 15 | # Author: 16 | # Dale Higgs <@dale3h> 17 | # 18 | # PLEASE NOTE: THIS CONFIGURATION IS UNTESTED AND MAY CONTAIN ERRORS 19 | 20 | automation: 21 | - alias: zwave_network_toggle 22 | trigger: 23 | - platform: state 24 | entity_id: input_boolean.zwave_network 25 | action: 26 | - service_template: "zwave.{{ 'start' if trigger.to_state.state == 'on' else 'stop' }}_network" 27 | 28 | input_boolean: 29 | zwave_network: 30 | initial: on 31 | -------------------------------------------------------------------------------- /examples/@gussyh/icloud_failover.yaml: -------------------------------------------------------------------------------- 1 | - alias: "iCloud Interval 1min if Fi's nmap away and iCloud home" 2 | trigger: 3 | - platform: state 4 | entity_id: device_tracker.fiona_nmap 5 | state: 'not_home' 6 | condition: 7 | - condition: state 8 | entity_id: device_tracker.fisphone 9 | state: 'home' 10 | - condition: state 11 | entity_id: device_tracker.jhayes_htcm8 12 | state: 'not_home' 13 | action: 14 | - service: icloud.setinterval 15 | data: 16 | accountname: 'Justin' 17 | interval: 1 18 | 19 | - alias: "iCloud Interval 30min if Fi's nmap home and iCloud home and interval < 30" 20 | trigger: 21 | - platform: state 22 | entity_id: device_tracker.fiona_nmap 23 | state: 'home' 24 | condition: 25 | condition: and 26 | conditions: 27 | - condition: state 28 | entity_id: device_tracker.fisphone 29 | state: 'home' 30 | - condition: numeric_state 31 | entity_id: idevice.fisphone 32 | below: 30 33 | action: 34 | - service: icloud.setinterval 35 | data: 36 | accountname: 'Justin' 37 | interval: 30 38 | -------------------------------------------------------------------------------- /examples/@gussyh/maybe_notify_alarm.yaml: -------------------------------------------------------------------------------- 1 | script: 2 | maybe_send_notification: 3 | alias: Maybe Send Alarm Notification 4 | sequence: 5 | - delay: 6 | seconds: "{{ states.alarm_control_panel.your_wishes_are_my_command.attributes.trigger_time|int + 10 }}" 7 | - condition: state 8 | entity_id: alarm_control_panel.your_wishes_are_my_command 9 | state: 'triggered' 10 | - service: notify.pushover 11 | data: 12 | title: Alarm Triggered 13 | message: Someone triggered your alarm system!!! 14 | -------------------------------------------------------------------------------- /examples/@hensing/bitcoin_threshold.yaml: -------------------------------------------------------------------------------- 1 | automation: 2 | - alias: Input Slider Threshold Example 3 | trigger: 4 | platform: template 5 | value_template: "{{ states('sensor.exchange_rate_1_btc')|float <= states('input_slider.bitcoin_low')|float }}" 6 | action: 7 | service: notify.push 8 | data: 9 | message: Bitcoin price has dropped below the threshold 10 | -------------------------------------------------------------------------------- /examples/@i7iceguy/counter.yaml: -------------------------------------------------------------------------------- 1 | sensor: 2 | - platform: template 3 | sensors: 4 | open_windows: 5 | value_template: >- 6 | {%- set open = 0 -%} 7 | {%- set open = open + (1 if is_state('binary_sensor.window1', 'on') else 0) -%} 8 | {%- set open = open + (1 if is_state('binary_sensor.window2', 'on') else 0) -%} 9 | {%- set open = open + (1 if is_state('binary_sensor.window3', 'on') else 0) -%} 10 | {%- set open = open + (1 if is_state('binary_sensor.window4', 'on') else 0) -%} 11 | {%- set open = open + (1 if is_state('binary_sensor.window5', 'on') else 0) -%} 12 | {%- set open = open + (1 if is_state('binary_sensor.window6', 'on') else 0) -%} 13 | {{ open }} 14 | -------------------------------------------------------------------------------- /examples/@jacobtomlinson/charge_heaters.yaml: -------------------------------------------------------------------------------- 1 | - alias: Charge Heaters 2 | # Charge the storage heaters during eco7 3 | trigger: 4 | platform: time 5 | minutes: '/5' 6 | seconds: 0 7 | condition: 8 | - condition: time 9 | after: '00:00:00' 10 | before: '08:00:00' 11 | action: 12 | service_template: > 13 | {%- if float(now().hour) < float(states('input_slider.storage_heating_time')) -%} 14 | switch.turn_on 15 | {%- else -%} 16 | switch.turn_off 17 | {%- endif -%} 18 | entity_id: 19 | - switch.radiator_kitchen 20 | - switch.radiator_front 21 | - switch.radiator_back 22 | -------------------------------------------------------------------------------- /examples/@jainsarthak/initialize_sensor.yaml: -------------------------------------------------------------------------------- 1 | shell_command: 2 | initialize_sensor: 'curl -X POST -H "x-ha-access: YOUR_PASSWORD" -H "Content-Type: application/json" -d ''{"state": "unknown", "attributes": {"friendly_name": "{{ friendly_name }}"}}'' http://localhost:8123/api/states/{{ entity_id }}' 3 | 4 | automation: 5 | - alias: Initialize HTTP sensors 6 | trigger: 7 | - platform: event 8 | event_type: homeassistant_start 9 | action: 10 | - service: shell_command.initialize_sensor 11 | data: 12 | entity_id: sensor.bathroom_temperature 13 | friendly_name: Bathroom Temperature 14 | -------------------------------------------------------------------------------- /examples/@jpenyc/weather_mqtt.yaml: -------------------------------------------------------------------------------- 1 | - alias: pub wuweather temp mqtt 2 | trigger: 3 | platform: state 4 | entity_id: sensor.pws_temp_f 5 | action: 6 | - service: mqtt.publish 7 | data_template: 8 | payload: "{{ trigger.to_state.state }}" 9 | topic: wuweather/temp 10 | -------------------------------------------------------------------------------- /examples/@jscoLP_twitter/temp_sensor.yaml: -------------------------------------------------------------------------------- 1 | sensor: 2 | - platform: template 3 | sensors: 4 | home_temperature: 5 | value_template: "{{ states.climate.home.attributes.current_temperature if states.climate.home is not none else 'unknown' }}" 6 | unit_of_measurement: 'F' 7 | entity_id: climate.home 8 | -------------------------------------------------------------------------------- /examples/@kevinpanaro/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pushover-proxy", 3 | "version": "1.0.0", 4 | "description": "Relay requests to Home Assistant", 5 | "main": "pushover-proxy.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "Dale Higgs ", 10 | "license": "MIT", 11 | "dependencies": { 12 | "http": "0.0.0", 13 | "request": "^2.75.0", 14 | "xtend": "^4.0.1" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /examples/@kevinpanaro/pushover-proxy.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var http = require('http'); 4 | var request = require('request'); 5 | var extend = require('xtend'); 6 | 7 | var config = { 8 | forwardUrl: 'http://localhost:8123', 9 | listenPort: 8120 10 | }; 11 | 12 | function forwardRequest(req, res) { 13 | var url_parts = require('url').parse(req.url, true); 14 | 15 | req.params = url_parts.query; 16 | 17 | console.log(req.method, req.url); 18 | 19 | var apiPassword = req.params.api_password || ''; 20 | var method = req.params.method || 'post'; 21 | var contentType = req.params.content_type || 'application/json'; 22 | var data = req.params.data; 23 | 24 | delete req.params.api_password; 25 | delete req.params.method; 26 | delete req.params.content_type; 27 | delete req.params.data; 28 | 29 | if (data) { 30 | try { 31 | data = JSON.parse(data); 32 | } catch (err) { 33 | data = {} 34 | } 35 | } 36 | 37 | data = extend(data, req.params); 38 | 39 | request({ 40 | method: method.toUpperCase(), 41 | url: config.forwardUrl + url_parts.pathname, 42 | headers: { 43 | 'x-ha-access': apiPassword, 44 | 'content-type': contentType 45 | }, 46 | body: JSON.stringify(data) 47 | }, 48 | function(err, response, body) { 49 | if (err) { 50 | res.end(); 51 | return console.error(err); 52 | } 53 | 54 | res.writeHead(response.statusCode, response.headers); 55 | res.end(body); 56 | }); 57 | } 58 | 59 | http.createServer(forwardRequest).listen(config.listenPort, function() { 60 | console.log('Forwarding proxy listening on: http://localhost:%s', config.listenPort); 61 | }); 62 | -------------------------------------------------------------------------------- /examples/@ki8as/configuration.yaml: -------------------------------------------------------------------------------- 1 | homeassistant: 2 | # Name of the location where Home Assistant is running 3 | name: Home 4 | # Location required to calculate the time the sun rises and sets 5 | latitude: ##.#### 6 | longitude: ##.#### 7 | # Impacts weather/sunrise data 8 | elevation: 253 9 | # C for Celsius, F for Fahrenheit 10 | temperature_unit: F 11 | # Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones 12 | time_zone: America/Detroit 13 | # CUSTOMIZE NEEDS TO BE NESTED UNDER "homeassistant:" 14 | customize: !include customize.yaml 15 | 16 | # Show links to resources in log and frontend 17 | #introduction: 18 | 19 | # Weather Prediction 20 | sensor: 21 | platform: yr 22 | monitored_conditions: 23 | - temperature 24 | - precipitation 25 | - windSpeed 26 | - windDirection 27 | - humidity 28 | 29 | # Discover some devices automatically 30 | discovery: 31 | 32 | # View all events in a logbook 33 | logbook: 34 | 35 | # Checks for available updates 36 | updater: 37 | 38 | # Allows you to issue voice commands from the frontend 39 | conversation: 40 | 41 | # Enables support for tracking state changes over time. 42 | history: 43 | 44 | # Enables the frontend 45 | frontend: 46 | 47 | # Track the sun 48 | sun: 49 | 50 | # My Sensors Gateway 51 | mysensors: 52 | gateways: 53 | - device: '/dev/ttyUSB0' 54 | persistence_file: 'path/mysensors.json' 55 | 56 | zwave: 57 | usb_path: /dev/ttyUSB1 58 | -------------------------------------------------------------------------------- /examples/@ki8as/customize.yaml: -------------------------------------------------------------------------------- 1 | switch.ge_unknown_type4952_id3031_switch_3: 2 | friendly_name: Hall Plug 3 | 4 | switch.toms_lamp: 5 | friendly_name: LivRoom Pwr Switch 6 | -------------------------------------------------------------------------------- /examples/@ktpx/groups_wrong.md: -------------------------------------------------------------------------------- 1 | > @ktpx: well first of all your missing entities in the group 2 | The `entities:` is optional, but required when using `name:` 3 | 4 | > @ktpx: and im not sure your allowed to make a "home" group .. might be some internal stuff using that..not sure thou. 5 | Making a group named "home" is allowed. 6 | 7 | > @ktpx: i think u want to use the name: as well in groups 8 | I strongly recommend using the `name:` key in every group configuration. 9 | 10 | > @ktpx: might be optional...forget 11 | Yes, `name:` is optional, but highly recommended. -------------------------------------------------------------------------------- /examples/@lwis/slider_to_sonos.yaml: -------------------------------------------------------------------------------- 1 | alias: Bedroom Sonos Volume Link (Slider > Device) 2 | trigger: 3 | - platform: state 4 | entity_id: input_slider.bedroom_sonos_volume 5 | condition: 6 | - condition: template 7 | value_template: "{{ not is_state_attr('media_player.bedroom_sonos', 'volume_level', states('input_slider.bedroom_sonos_volume')|int / 100) }}" 8 | action: 9 | - service: media_player.volume_set 10 | data_template: 11 | entity_id: media_player.bedroom_sonos 12 | volume_level: "{{ states('input_slider.bedroom_sonos_volume')|int / 100 }}" 13 | -------------------------------------------------------------------------------- /examples/@lwis/sonos.yaml: -------------------------------------------------------------------------------- 1 | - alias: Bedroom Sonos Volume Link (Device > Slider) 2 | trigger: 3 | - platform: state 4 | entity_id: media_player.bedroom_sonos 5 | condition: 6 | - condition: template 7 | value_template: "{{ not is_state_attr('media_player.bedroom_sonos', 'volume_level', states('input_slider.bedroom_sonos_volume')|int / 100) }}" 8 | action: 9 | - service: input_slider.select_value 10 | data_template: 11 | entity_id: input_slider.bedroom_sonos_volume 12 | value: "{{ trigger.to_state.attributes.volume_level | multiply(100) | int }}" 13 | 14 | - alias: Bedroom Sonos Volume Link (Slider > Device) 15 | trigger: 16 | - platform: state 17 | entity_id: input_slider.bedroom_sonos_volume 18 | condition: 19 | - condition: template 20 | value_template: "{{ not is_state_attr('media_player.bedroom_sonos', 'volume_level', states('input_slider.bedroom_sonos_volume')|int / 100) }}" 21 | action: 22 | - service: media_player.volume_set 23 | data_template: 24 | entity_id: media_player.bedroom_sonos 25 | volume_level: "{{ states('input_slider.bedroom_sonos_volume')|int / 100 }}" 26 | -------------------------------------------------------------------------------- /examples/@lwis/sonos_to_slider.yaml: -------------------------------------------------------------------------------- 1 | alias: Bedroom Sonos Volume Link (Device > Slider) 2 | trigger: 3 | - platform: state 4 | entity_id: media_player.bedroom_sonos 5 | condition: 6 | - condition: template 7 | value_template: "{{ not is_state_attr('media_player.bedroom_sonos', 'volume_level', states('input_slider.bedroom_sonos_volume')|int / 100) }}" 8 | action: 9 | - service: input_slider.select_value 10 | data_template: 11 | entity_id: input_slider.bedroom_sonos_volume 12 | value: "{{ trigger.to_state.attributes.volume_level | multiply(100) | int }}" 13 | -------------------------------------------------------------------------------- /examples/@michaelcm/device_online.yaml: -------------------------------------------------------------------------------- 1 | sensor: 2 | - platform: template 3 | sensors: 4 | router: 5 | friendly_name: Router 6 | value_template: "{{ 'online' if is_state('device_tracker.router', 'home') else 'offline' }}" 7 | -------------------------------------------------------------------------------- /examples/@mikenolet/date_range.yaml: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Restrict an automation to a date range (ex: Oct 24 to Oct 31, inclusive) 3 | # 4 | # Written for: 5 | # @mikenolet 6 | # 7 | # Components: 8 | # automation 9 | # 10 | # License: 11 | # MIT 12 | # 13 | # Author: 14 | # Dale Higgs <@dale3h> 15 | # 16 | # PLEASE NOTE: THIS CONFIGURATION IS UNTESTED AND MAY CONTAIN ERRORS 17 | 18 | automation: 19 | - alias: 20 | trigger: 21 | ... 22 | condition: 23 | - condition: template 24 | value_template: "{{ (now().strftime('%m')|int == 10) and (24 <= now().strftime('%d')|int <= 31) }}" 25 | action: 26 | ... 27 | -------------------------------------------------------------------------------- /examples/@mikenolet/ecobee_fan.yaml: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Adjust the ecobee3 fan run time throughout the day 3 | # 4 | # Written for: 5 | # @mikenolet 6 | # 7 | # Components: 8 | # automation 9 | # climate 10 | # 11 | # License: 12 | # MIT 13 | # 14 | # Author: 15 | # Dale Higgs <@dale3h> 16 | # 17 | # PLEASE NOTE: THIS CONFIGURATION IS UNTESTED AND MAY CONTAIN ERRORS 18 | 19 | automation: 20 | - alias: ecobee3_fan_run_time 21 | trigger: 22 | - platform: time 23 | after: '23:00:00' 24 | - platform: time 25 | after: '01:00:00' 26 | action: 27 | - service: climate.ecobee_set_fan_min_on_time 28 | data_template: 29 | entity_id: climate.home 30 | fan_min_on_time: "{{ 0 if trigger.now.hour == '23' else 30 }}" 31 | -------------------------------------------------------------------------------- /examples/@mikenolet/harmonyhub.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Switch / Harmony Hub 3 | ################################################################ 4 | 5 | - platform: mqtt 6 | name: living_room_movie 7 | state_topic: harmony-api/hubs/living-room/activities/movie/state 8 | command_topic: harmony-api/hubs/living-room/activities/movie/command 9 | payload_on: 'on' 10 | payload_off: 'off' 11 | 12 | - platform: mqtt 13 | name: living_room_tv 14 | state_topic: harmony-api/hubs/living-room/activities/tv/state 15 | command_topic: harmony-api/hubs/living-room/activities/tv/command 16 | payload_on: 'on' 17 | payload_off: 'off' 18 | 19 | - platform: mqtt 20 | name: living_room_roku 21 | state_topic: harmony-api/hubs/living-room/activities/watch-roku/state 22 | command_topic: harmony-api/hubs/living-room/activities/watch-roku/command 23 | payload_on: 'on' 24 | payload_off: 'off' 25 | 26 | - platform: mqtt 27 | name: upstairs_tv_room_chromecast 28 | state_topic: harmony-api/hubs/upstairs-tv-room/activities/chromecast/state 29 | command_topic: harmony-api/hubs/upstairs-tv-room/activities/chromecast/command 30 | payload_on: 'on' 31 | payload_off: 'off' 32 | 33 | - platform: mqtt 34 | name: upstairs_tv_room_tv 35 | state_topic: harmony-api/hubs/upstairs-tv-room/activities/tv/state 36 | command_topic: harmony-api/hubs/upstairs-tv-room/activities/tv/command 37 | payload_on: 'on' 38 | payload_off: 'off' 39 | 40 | - platform: mqtt 41 | name: upstairs_tv_room_roku 42 | state_topic: harmony-api/hubs/upstairs-tv-room/activities/watch-roku/state 43 | command_topic: harmony-api/hubs/upstairs-tv-room/activities/watch-roku/command 44 | payload_on: 'on' 45 | payload_off: 'off' 46 | -------------------------------------------------------------------------------- /examples/@mikenolet/harmonyhub_script.yaml: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Script to mute harmony-api device 3 | # 4 | # Written for: 5 | # @mikenolet 6 | # 7 | # Components: 8 | # mqtt 9 | # script 10 | # 11 | # License: 12 | # MIT 13 | # 14 | # Author: 15 | # Dale Higgs <@dale3h> 16 | # 17 | # PLEASE NOTE: THIS CONFIGURATION IS UNTESTED AND MAY CONTAIN ERRORS 18 | 19 | script: 20 | harmony_avr_mute: 21 | sequence: 22 | - service: mqtt.publish 23 | data: 24 | topic: harmony-api/hubs/living-room/devices/yamaha-av-receiver/command 25 | payload: 'mute' 26 | -------------------------------------------------------------------------------- /examples/@multiholle/sonos_turn_on.yaml: -------------------------------------------------------------------------------- 1 | automation: 2 | - alias: Denon likes Sonos 3 | trigger: 4 | platform: state 5 | entity_id: media_player.wohnzimmer 6 | to: 'playing' 7 | condition: 8 | condition: template 9 | value_template: "{{ trigger.from_state != 'playing' }}" 10 | action: 11 | service: homeassistant.turn_on 12 | entity_id: 13 | - media_player.denon_avrx2000 14 | -------------------------------------------------------------------------------- /examples/@p0nts/sensitive_strips_door.yaml: -------------------------------------------------------------------------------- 1 | binary_sensor: 2 | - platform: template 3 | sensors: 4 | bedroom_door_contact: 5 | friendly_name: Bedroom Door Contact 6 | sensor_class: opening 7 | value_template: "{{ not is_state('sensor.sensative_strips_sensor', '23') }}" 8 | -------------------------------------------------------------------------------- /examples/@photo64/camera.yaml: -------------------------------------------------------------------------------- 1 | camera: 2 | - platform: mjpeg 3 | mjpeg_url: http://192.168.1.17/cgi-bin/mjpg/video.cgi 4 | name: Cam1 5 | username: xxxxxx 6 | password: xxxxxxxx 7 | 8 | - platform: mjpeg 9 | mjpeg_url: http://192.168.1.18/cgi-bin/mjpg/video.cgi 10 | name: Cam2 11 | username: xxxxxx 12 | password: xxxxxxxx 13 | -------------------------------------------------------------------------------- /examples/@ryanlaux/steam_game.yaml: -------------------------------------------------------------------------------- 1 | # NOTE: The attribute "Game" must be capitalized for this to work 2 | 3 | sensor: 4 | - platform: template 5 | sensors: 6 | steam_game: 7 | friendly_name: Playing Now 8 | value_template: "{{ states.sensor.steam_XXXXXXXX.attributes.Game if states.sensor.steam_XXXXXXXX else 'None' }}" 9 | entity_id: sensor.steam_XXXXXXXX 10 | 11 | automation: 12 | - alias: Rocket League 13 | trigger: 14 | - platform: state 15 | entity_id: sensor.steam_game 16 | to: 'Rocket League' 17 | action: 18 | - service: scene.turn_on 19 | entity_id: scene.80s 20 | -------------------------------------------------------------------------------- /examples/@sgauche/better_sensor_notify.yaml: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Notify on sensor change if no one is home (using customize) 3 | # 4 | # Written for: 5 | # @sgauche 6 | # 7 | # Components: 8 | # automation 9 | # notify 10 | # 11 | # License: 12 | # MIT 13 | # 14 | # Author: 15 | # Dale Higgs <@dale3h> 16 | # 17 | # PLEASE NOTE: THIS CONFIGURATION IS UNTESTED AND MAY CONTAIN ERRORS 18 | 19 | ################################################################ 20 | ## Add `notify_change: true` in the customize section to enable 21 | ## notification on an entity. 22 | ## 23 | ## Example Configuration: 24 | ## 25 | ## homeassistant: 26 | ## customize: 27 | ## binary_sensor.ecolink_doorwindow_sensor_sensor_5_0: 28 | ## notify_change: true 29 | ## 30 | ## binary_sensor.ecolink_doorwindow_sensor_sensor_6_0: 31 | ## notify_change: true 32 | ## 33 | ## binary_sensor.ecolink_garage_door_sensor_sensor_3_0: 34 | ## notify_change: true 35 | ## 36 | ## binary_sensor.ecobee_occupancy: 37 | ## notify_change: true 38 | ## 39 | ## binary_sensor.living_room_occupancy: 40 | ## notify_change: true 41 | ## 42 | ## binary_sensor.master_bedroom_occupancy: 43 | ## notify_change: true 44 | ## 45 | ## binary_sensor.office_occupancy: 46 | ## notify_change: true 47 | ## 48 | ## switch.linear_fs20z_isolated_contact_fixture_module_switch_4_0 49 | ## notify_change: true 50 | ## 51 | ## switch.ge_12727_inwall_smart_switch_toggle_switch_7_0 52 | ## notify_change: true 53 | ################################################################ 54 | 55 | automation: 56 | - alias: notify_sensor_change_away 57 | trigger: 58 | - platform: event 59 | event_type: state_changed 60 | condition: 61 | - condition: state 62 | entity_id: group.all_devices 63 | state: 'not_home' 64 | - condition: template 65 | value_template: "{{ (trigger.event.data is not none) and (trigger.event.data.old_state is not none) and (trigger.event.data.new_state is not none) and (trigger.event.data.new_state.attributes is not none) }}" 66 | - condition: template 67 | value_template: "{{ (trigger.event.data.old_state.state == 'off') and (trigger.event.data.new_state.state == 'on') }}" 68 | - condition: template 69 | value_template: "{{ trigger.event.data.new_state.attributes.notify_change|default(false, true) }}" 70 | action: 71 | - service: notify.html5_scott_phone 72 | data_template: 73 | title: "Alarm!" 74 | message: "The {{ trigger.event.data.new_state.name }} was changed to {{ trigger.event.data.new_state.state }} while no one is home. - {{ as_timestamp(now())|timestamp_custom('%I:%M:%S %p %d%b%Y', true) }}" 75 | -------------------------------------------------------------------------------- /examples/@sgauche/detect_sensor_change.yaml: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Notify on sensor change if no one is home (using a group) 3 | # 4 | # Written for: 5 | # @sgauche 6 | # 7 | # Components: 8 | # automation 9 | # group 10 | # notify 11 | # 12 | # License: 13 | # MIT 14 | # 15 | # Author: 16 | # Dale Higgs <@dale3h> 17 | # 18 | # PLEASE NOTE: THIS CONFIGURATION IS UNTESTED AND MAY CONTAIN ERRORS 19 | 20 | automation: 21 | - alias: notify_sensor_change_away 22 | trigger: 23 | - platform: event 24 | event_type: state_changed 25 | condition: 26 | - condition: state 27 | entity_id: group.all_devices 28 | state: 'not_home' 29 | - condition: template 30 | value_template: "{{ (trigger.event.data is not none) and (trigger.event.data.entity_id is not none) and (trigger.event.data.old_state is not none) and (trigger.event.data.new_state is not none) }}" 31 | - condition: template 32 | value_template: "{{ (trigger.event.data.old_state.state == 'off') and (trigger.event.data.new_state.state == 'on') }}" 33 | - condition: template 34 | value_template: "{{ (states.group is not none) and (states.group.notify_sensors is not none) and (states.group.notify_sensors.attributes is not none) and (states.group.notify_sensors.attributes.entity_id is not none) }}" 35 | - condition: template 36 | value_template: "{{ trigger.event.data.entity_id in states.group.notify_sensors.attributes.entity_id }}" 37 | action: 38 | - service: notify.html5_scott_phone 39 | data_template: 40 | title: "Alarm!" 41 | message: "The {{ trigger.event.data.new_state.name }} was changed to {{ trigger.event.data.new_state.state }} while no one is home. - {{ as_timestamp(now())|timestamp_custom('%I:%M:%S %p %d%b%Y', true) }}" 42 | -------------------------------------------------------------------------------- /examples/@soggypretzels/default_toggle_brightness.yaml: -------------------------------------------------------------------------------- 1 | alias: Default Light On Brightness 2 | trigger: 3 | platform: event 4 | event_type: light_toggle 5 | event_data: 6 | entity_id: light.bedroom 7 | condition: 8 | condition: state 9 | entity_id: light.bedroom 10 | state: 'on' 11 | action: 12 | service: light.turn_on 13 | entity_id: light.bedroom 14 | data: 15 | brightness: 255 16 | -------------------------------------------------------------------------------- /examples/@thundergreen/logincheck.php: -------------------------------------------------------------------------------- 1 | document.location = "Login.php"; ' ); 10 | } 11 | } 12 | 13 | $passwordsettings = parse_ini_file( "/home/pi/RaspberryIPCamera/secret/RaspberryIPCamera.secret" ); 14 | 15 | session_start(); 16 | 17 | $username = null; 18 | $password = null; 19 | 20 | if ( isset( $_SERVER['PHP_AUTH_USER'] ) && isset( $_SERVER['PHP_AUTH_PW'] ) ) { 21 | $username = $_SERVER['PHP_AUTH_USER']; 22 | $password = $_SERVER['PHP_AUTH_PW']; 23 | } elseif ( isset( $_REQUEST['username'] ) && isset( $_REQUEST['password'] ) ) { 24 | $username = $_REQUEST['username']; 25 | $password = $_REQUEST['password']; 26 | } 27 | 28 | $username_valid = $username && ( $username === $passwordsettings['AdminUsername'] ); 29 | $password_valid = $password && password_verify( $password, $passwordsettings['AdminPassword'] ); 30 | 31 | if ( $username_valid && $password_valid ) { 32 | $_SESSION['login_user'] = $username; 33 | } 34 | 35 | unset( $username, $password, $username_valid, $password_valid ); 36 | 37 | authenticate(); 38 | -------------------------------------------------------------------------------- /examples/@w1ll1am23/basking_tank.yaml: -------------------------------------------------------------------------------- 1 | binary_sensor: 2 | - platform: template 3 | sensors: 4 | tank_basking_threshold: 5 | value_template: "{{ states('sensor.tank_basking')|int <= 80 }}" 6 | entity_id: sensor.tank_basking 7 | 8 | automation: 9 | - alias: check_bulbs 10 | trigger: 11 | - platform: state 12 | entity_id: binary_sensor.tank_basking_threshold 13 | state: 'on' 14 | for: 15 | minutes: 30 16 | action: 17 | - service: notify.sms_billy 18 | data_template: 19 | message: "Check basking bulbs! {{ states('sensor.tank_basking') }}" 20 | -------------------------------------------------------------------------------- /examples/@wyznerd/include_dir_list.md: -------------------------------------------------------------------------------- 1 | `configuration.yaml` 2 | 3 | ```yaml 4 | automation: 5 | - alias: Automation 1 6 | trigger: 7 | platform: state 8 | entity_id: device_tracker.iphone 9 | to: 'home' 10 | action: 11 | service: light.turn_on 12 | entity_id: light.entryway 13 | - alias: Automation 2 14 | trigger: 15 | platform: state 16 | entity_id: device_tracker.iphone 17 | from: 'home' 18 | action: 19 | service: light.turn_off 20 | entity_id: light.entryway 21 | ``` 22 | 23 | can be turned into: 24 | 25 | `configuration.yaml` 26 | 27 | ```yaml 28 | automation: !include_dir_list automation/presence/ 29 | ``` 30 | 31 | `automation/presence/automation1.yaml` 32 | 33 | ```yaml 34 | alias: Automation 1 35 | trigger: 36 | platform: state 37 | entity_id: device_tracker.iphone 38 | to: 'home' 39 | action: 40 | service: light.turn_on 41 | entity_id: light.entryway 42 | ``` 43 | 44 | `automation/presence/automation2.yaml` 45 | 46 | ```yaml 47 | alias: Automation 2 48 | trigger: 49 | platform: state 50 | entity_id: device_tracker.iphone 51 | from: 'home' 52 | action: 53 | service: light.turn_off 54 | entity_id: light.entryway 55 | ``` 56 | 57 | It is important to note that each file must contain only **one** entry when using `!include_dir_list`. -------------------------------------------------------------------------------- /examples/@wyznerd/include_dir_merge_list.md: -------------------------------------------------------------------------------- 1 | `configuration.yaml` 2 | 3 | ```yaml 4 | automation: 5 | - alias: Automation 1 6 | trigger: 7 | platform: state 8 | entity_id: device_tracker.iphone 9 | to: 'home' 10 | action: 11 | service: light.turn_on 12 | entity_id: light.entryway 13 | - alias: Automation 2 14 | trigger: 15 | platform: state 16 | entity_id: device_tracker.iphone 17 | from: 'home' 18 | action: 19 | service: light.turn_off 20 | entity_id: light.entryway 21 | ``` 22 | 23 | can be turned into: 24 | 25 | `configuration.yaml` 26 | 27 | ```yaml 28 | automation: !include_dir_merge_list automation/ 29 | ``` 30 | 31 | `automation/presence.yaml` 32 | 33 | ```yaml 34 | - alias: Automation 1 35 | trigger: 36 | platform: state 37 | entity_id: device_tracker.iphone 38 | to: 'home' 39 | action: 40 | service: light.turn_on 41 | entity_id: light.entryway 42 | 43 | - alias: Automation 2 44 | trigger: 45 | platform: state 46 | entity_id: device_tracker.iphone 47 | from: 'home' 48 | action: 49 | service: light.turn_off 50 | entity_id: light.entryway 51 | ``` 52 | 53 | It is important to note that when using `!include_dir_merge_list`, you must include a list in each file (each list item is denoted with a hyphen [-]). Each file may contain one or more entries. -------------------------------------------------------------------------------- /examples/@wyznerd/include_dir_merge_named.md: -------------------------------------------------------------------------------- 1 | `configuration.yaml` 2 | 3 | ```yaml 4 | group: 5 | bedroom: 6 | name: Bedroom 7 | entities: 8 | - light.bedroom_lamp 9 | - light.bedroom_overhead 10 | hallway: 11 | name: Hallway 12 | entities: 13 | - light.hallway 14 | - thermostat.home 15 | front_yard: 16 | name: Front Yard 17 | entities: 18 | - light.front_porch 19 | - light.security 20 | - light.pathway 21 | - sensor.mailbox 22 | - camera.front_porch 23 | ``` 24 | 25 | can be turned into: 26 | 27 | `configuration.yaml` 28 | 29 | ```yaml 30 | group: !include_dir_merge_named group/ 31 | ``` 32 | 33 | `group/interior.yaml` 34 | 35 | ```yaml 36 | bedroom: 37 | name: Bedroom 38 | entities: 39 | - light.bedroom_lamp 40 | - light.bedroom_overhead 41 | hallway: 42 | name: Hallway 43 | entities: 44 | - light.hallway 45 | - thermostat.home 46 | ``` 47 | 48 | `group/exterior.yaml` 49 | 50 | ```yaml 51 | front_yard: 52 | name: Front Yard 53 | entities: 54 | - light.front_porch 55 | - light.security 56 | - light.pathway 57 | - sensor.mailbox 58 | - camera.front_porch 59 | ``` 60 | -------------------------------------------------------------------------------- /examples/@wyznerd/include_dir_named.md: -------------------------------------------------------------------------------- 1 | `configuration.yaml` 2 | 3 | ```yaml 4 | alexa: 5 | intents: 6 | LocateIntent: 7 | action: 8 | service: notify.pushover 9 | data: 10 | message: Your location has been queried via Alexa. 11 | speech: 12 | type: plaintext 13 | text: > 14 | {%- for state in states.device_tracker -%} 15 | {%- if state.name.lower() == User.lower() -%} 16 | {{ state.name }} is at {{ state.state }} 17 | {%- endif -%} 18 | {%- else -%} 19 | I am sorry. Pootie! I do not know where {{User}} is. 20 | {%- endfor -%} 21 | WhereAreWeIntent: 22 | speech: 23 | type: plaintext 24 | text: > 25 | {%- if is_state('device_tracker.iphone', 'home') -%} 26 | iPhone is home. 27 | {%- else -%} 28 | iPhone is not home. 29 | {% endif %} 30 | ``` 31 | 32 | can be turned into: 33 | 34 | `configuration.yaml` 35 | 36 | ```yaml 37 | alexa: 38 | intents: !include_dir_named alexa/ 39 | ``` 40 | 41 | `alexa/LocateIntent.yaml` 42 | 43 | ```yaml 44 | action: 45 | service: notify.pushover 46 | data: 47 | message: Your location has been queried via Alexa. 48 | speech: 49 | type: plaintext 50 | text: > 51 | {%- for state in states.device_tracker -%} 52 | {%- if state.name.lower() == User.lower() -%} 53 | {{ state.name }} is at {{ state.state }} 54 | {%- endif -%} 55 | {%- else -%} 56 | I am sorry. Pootie! I do not know where {{User}} is. 57 | {%- endfor -%} 58 | ``` 59 | 60 | `alexa/WhereAreWeIntent.yaml` 61 | 62 | ```yaml 63 | speech: 64 | type: plaintext 65 | text: > 66 | {%- if is_state('device_tracker.iphone', 'home') -%} 67 | iPhone is home. 68 | {%- else -%} 69 | iPhone is not home. 70 | {% endif %} 71 | ``` 72 | -------------------------------------------------------------------------------- /examples/bootstrap/automation/easy.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Automation / Easy Stuff 3 | ################################################################ 4 | 5 | - alias: easy_stuff_on 6 | trigger: 7 | - platform: state 8 | entity_id: input_boolean.easy_toggle, input_boolean.easier_toggle 9 | to: 'on' 10 | condition: 11 | - condition: state 12 | entity_id: input_boolean.easy_toggle 13 | state: 'on' 14 | - condition: state 15 | entity_id: input_boolean.easier_toggle 16 | state: 'on' 17 | action: 18 | - service: persistent_notification.create 19 | data: 20 | message: Both easy input booleans are on! 21 | notification_id: easy_notify 22 | title: Easy On Notification 23 | 24 | - alias: easy_stuff_off 25 | trigger: 26 | - platform: state 27 | entity_id: input_boolean.easy_toggle, input_boolean.easier_toggle 28 | to: 'off' 29 | condition: 30 | - condition: state 31 | entity_id: input_boolean.easy_toggle 32 | state: 'off' 33 | - condition: state 34 | entity_id: input_boolean.easier_toggle 35 | state: 'off' 36 | action: 37 | - service: persistent_notification.create 38 | data: 39 | message: Both easy input booleans are off! 40 | notification_id: easy_notify 41 | title: Easy Off Notification 42 | -------------------------------------------------------------------------------- /examples/bootstrap/automation/peasy.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Automation / Peasy Things 3 | ################################################################ 4 | 5 | - alias: peasy_things_on 6 | trigger: 7 | - platform: state 8 | entity_id: input_boolean.peasy_cheese, input_boolean.peasy_example 9 | to: 'on' 10 | condition: 11 | - condition: state 12 | entity_id: input_boolean.peasy_cheese 13 | state: 'on' 14 | - condition: state 15 | entity_id: input_boolean.peasy_example 16 | state: 'on' 17 | action: 18 | - service: persistent_notification.create 19 | data: 20 | message: Both peasy input booleans are on! 21 | notification_id: peasy_notify 22 | title: Peasy On Notification 23 | 24 | - alias: peasy_things_off 25 | trigger: 26 | - platform: state 27 | entity_id: input_boolean.peasy_cheese, input_boolean.peasy_example 28 | to: 'off' 29 | condition: 30 | - condition: state 31 | entity_id: input_boolean.peasy_cheese 32 | state: 'off' 33 | - condition: state 34 | entity_id: input_boolean.peasy_example 35 | state: 'off' 36 | action: 37 | - service: persistent_notification.create 38 | data: 39 | message: Both peasy input booleans are off! 40 | notification_id: peasy_notify 41 | title: Peasy Off Notification 42 | -------------------------------------------------------------------------------- /examples/bootstrap/configuration.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Configuration 3 | ################################################################ 4 | 5 | homeassistant: 6 | name: Home 7 | latitude: !secret home_latitude 8 | longitude: !secret home_longitude 9 | elevation: !secret home_elevation 10 | time_zone: America/Chicago 11 | unit_system: imperial 12 | customize: !include customize.yaml 13 | 14 | discovery: 15 | frontend: 16 | history: 17 | logbook: 18 | sun: 19 | updater: 20 | 21 | ################################################ 22 | ## Components (Non-Includes) 23 | ################################################ 24 | 25 | http: 26 | api_password: !secret http_api_password 27 | 28 | mqtt: 29 | broker: !secret mqtt_broker 30 | port: !secret mqtt_port 31 | username: !secret mqtt_username 32 | password: !secret mqtt_password 33 | 34 | # recorder: 35 | # purge_days: 7 36 | 37 | ################################################ 38 | ## Component Includes (Merge List) 39 | ################################################ 40 | 41 | automation: !include_dir_merge_list automation 42 | # binary_sensor: !include_dir_merge_list binary_sensor 43 | # camera: !include_dir_merge_list camera 44 | # cover: !include_dir_merge_list cover 45 | # device_tracker: !include_dir_merge_list device_tracker 46 | # light: !include_dir_merge_list light 47 | # media_player: !include_dir_merge_list media_player 48 | # notify: !include_dir_merge_list notify 49 | # scene: !include_dir_merge_list scene 50 | # sensor: !include_dir_merge_list sensor 51 | # switch: !include_dir_merge_list switch 52 | # zone: !include_dir_merge_list zone 53 | 54 | ################################################ 55 | ## Component Includes (Merge Named) 56 | ################################################ 57 | 58 | # group: !include_dir_merge_named group 59 | input_boolean: !include_dir_merge_named input_boolean 60 | # input_select: !include_dir_merge_named input_select 61 | # input_slider: !include_dir_merge_named input_slider 62 | # script: !include_dir_merge_named script 63 | # shell_command: !include_dir_merge_named shell_command 64 | -------------------------------------------------------------------------------- /examples/bootstrap/customize.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Customize 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Automation 7 | ################################################ 8 | 9 | automation.easy_stuff_n: 10 | friendly_name: Easy Stuff is On 11 | icon: mdi:cube 12 | 13 | automation.easy_stuff_off: 14 | friendly_name: Easy Stuff is Off 15 | icon: mdi:cube-outline 16 | 17 | automation.peasy_things_on: 18 | friendly_name: Peasy Things are On 19 | icon: mdi:bell 20 | 21 | automation.peasy_things_off: 22 | friendly_name: Peasy Things are Off 23 | icon: mdi:bell-outline 24 | 25 | ################################################ 26 | ## Input Boolean 27 | ################################################ 28 | 29 | input_boolean.easy_toggle: 30 | friendly_name: Easy Toggle 31 | icon: mdi:apple 32 | 33 | input_boolean.easier_toggle: 34 | friendly_name: Easier Toggle 35 | icon: mdi:amazon 36 | 37 | input_boolean.peasy_cheese: 38 | friendly_name: Peasy Cheese 39 | icon: mdi:server-security 40 | 41 | input_boolean.peasy_example: 42 | friendly_name: Peasy Example 43 | icon: mdi:chip 44 | -------------------------------------------------------------------------------- /examples/bootstrap/input_boolean/easy.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Input Boolean / Easy Toggle 3 | ################################################################ 4 | 5 | easy_toggle: 6 | initial: off 7 | 8 | easier_toggle: 9 | initial: on 10 | -------------------------------------------------------------------------------- /examples/bootstrap/input_boolean/peasy.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Input Boolean / Peasy Example 3 | ################################################################ 4 | 5 | peasy_cheese: 6 | initial: on 7 | 8 | peasy_example: 9 | initial: off 10 | -------------------------------------------------------------------------------- /examples/bootstrap/secrets.sample.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Secrets 3 | ################################################################ 4 | 5 | home_latitude: 41.840047 6 | home_longitude: -87.6574727 7 | home_elevation: 179 8 | 9 | http_api_password: 'password' 10 | 11 | mqtt_broker: 'localhost' 12 | mqtt_port: 1883 13 | mqtt_username: 'raspberry' 14 | mqtt_password: 'pi' 15 | -------------------------------------------------------------------------------- /examples/broadlink_input_select.yaml: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Broadlink RM Input Select work around for fan speed selection 3 | # 4 | # Written for: 5 | # @torn8o01_twitter 6 | # 7 | # Components: 8 | # automation 9 | # input_select 10 | # switch 11 | # 12 | # License: 13 | # MIT 14 | # 15 | # Author: 16 | # Dale Higgs <@dale3h> 17 | # 18 | # PLEASE NOTE: THIS CONFIGURATION IS UNTESTED AND MAY CONTAIN ERRORS 19 | 20 | automation: 21 | - alias: fan_speed_selected 22 | trigger: 23 | - platform: state 24 | entity_id: input_select.fan_speed 25 | condition: 26 | - condition: template 27 | value_template: "{{ trigger.to_state.state != 'Select an option...' }}" 28 | action: 29 | # Turn the corresponding switch on to send the fan speed command 30 | - service: switch.turn_on 31 | data_template: 32 | entity_id: "switch.fan_speed_{{ trigger.to_state.state|lower|replace(' ', '_') }}" 33 | # Reset the Input Select to "Select an option..." 34 | - service: input_select.select_option 35 | data_template: 36 | entity_id: "{{ trigger.to_state.entity_id }}" 37 | option: Select an option... 38 | 39 | input_select: 40 | fan_speed: 41 | initial: Select an option... 42 | options: 43 | - Select an option... 44 | - Off 45 | - Low 46 | - Medium 47 | - High 48 | 49 | switch: 50 | - platform: broadlink 51 | host: !secret broadlink_host 52 | mac: !secret broadlink_mac 53 | switches: 54 | fan_speed_off: 55 | friendly_name: Fan Speed Off 56 | command_on: 'oooOOOOOOOO' 57 | command_off: 'oooOOOOOOOO' 58 | 59 | fan_speed_low: 60 | friendly_name: Fan Speed Low 61 | command_on: 'lllLLLLLLLL' 62 | command_off: 'lllLLLLLLLL' 63 | 64 | fan_speed_Medium: 65 | friendly_name: Fan Speed Medium 66 | command_on: 'mmmMMMMMMMM' 67 | command_off: 'mmmMMMMMMMM' 68 | 69 | fan_speed_High: 70 | friendly_name: Fan Speed High 71 | command_on: 'hhhHHHHHHHH' 72 | command_off: 'hhhHHHHHHHH' 73 | -------------------------------------------------------------------------------- /examples/configuration.demo.yaml: -------------------------------------------------------------------------------- 1 | # Port of demo config: 2 | # https://github.com/home-assistant/home-assistant/blob/master/homeassistant/components/demo.py 3 | 4 | homeassistant: 5 | name: Home 6 | latitude: 32.87336 7 | longitude: 117.22743 8 | temperature_unit: C 9 | 10 | conversation: 11 | frontend: 12 | history: 13 | logbook: 14 | sun: 15 | introduction: 16 | 17 | alarm_control_panel: 18 | platform: demo 19 | 20 | binary_sensor: 21 | platform: demo 22 | 23 | camera: 24 | platform: demo 25 | 26 | device_tracker: 27 | platform: demo 28 | 29 | garage_door: 30 | platform: demo 31 | 32 | hvac: 33 | platform: demo 34 | 35 | light: 36 | platform: demo 37 | 38 | lock: 39 | platform: demo 40 | 41 | media_player: 42 | platform: demo 43 | 44 | notify: 45 | platform: demo 46 | 47 | rollershutter: 48 | platform: demo 49 | 50 | sensor: 51 | platform: demo 52 | 53 | switch: 54 | platform: demo 55 | 56 | thermostat: 57 | platform: demo 58 | 59 | group: 60 | living_room: 61 | name: Living Room 62 | entities: 63 | - light.table_lamp 64 | - light.ceiling 65 | - light.tv_back_light 66 | - switch.ac 67 | - media_player.living_room 68 | - input_select.living_room_preset 69 | - rollershutter.living_room_window 70 | - scene.romantic_lights 71 | 72 | bedroom: 73 | name: Bedroom 74 | entities: 75 | - light.bed_light 76 | - switch.decorative_lights 77 | - rollershutter.bedroom_window 78 | - input_slider.noise_allowance 79 | 80 | kitchen: 81 | name: Kitchen 82 | entities: 83 | - rollershutter.kitchen_window 84 | - lock.kitchen_door 85 | 86 | doors: 87 | name: Doors 88 | entities: 89 | - lock.front_door 90 | - lock.kitchen_door 91 | - garage_door.right_garage_door 92 | - garage_door.left_garage_door 93 | 94 | automations: 95 | name: Automations 96 | entities: 97 | - input_select.who_cooks 98 | - input_boolean.notify 99 | 100 | people: 101 | name: People 102 | entities: 103 | - device_tracker.demo_anne_therese 104 | - device_tracker.demo_home_boy 105 | - device_tracker.demo_paulus 106 | 107 | thermostats: 108 | name: Thermostats 109 | entities: 110 | - thermostat.nest 111 | - thermostat.thermostat 112 | 113 | downstairs: 114 | name: Downstairs 115 | view: yes 116 | entities: 117 | - group.living_room 118 | - group.kitchen 119 | - scene.romantic_lights 120 | - rollershutter.kitchen_window 121 | - rollershutter.living_room_window 122 | - group.doors 123 | - thermostat.nest 124 | 125 | upstairs: 126 | name: Upstairs 127 | view: yes 128 | entities: 129 | - thermostat.thermostat 130 | - group.bedroom 131 | -------------------------------------------------------------------------------- /examples/google_tts.yaml: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Google TTS script for media_player 3 | # 4 | # Components: 5 | # automation 6 | # media_player 7 | # script 8 | # shell_command 9 | # 10 | # License: 11 | # MIT 12 | # 13 | # Author: 14 | # Dale Higgs <@dale3h> 15 | # 16 | # Script installation: 17 | # sudo curl -o /usr/local/bin/speak https://raw.githubusercontent.com/dale3h/homeassistant-config/master/shell_scripts/speak && sudo chmod +x /usr/local/bin/speak 18 | 19 | script: 20 | speak: 21 | sequence: 22 | - service: shell_command.speak 23 | data_template: 24 | message: "{{ message }}" 25 | - service: media_player.play_media 26 | data_template: 27 | entity_id: "{{ entity_id }}" 28 | media_content_id: 'http://XXX.XXX.XXX.XXX:8123/local/speak.mp3' 29 | media_content_type: music 30 | 31 | shell_command: 32 | speak: 'speak -q "{{ message }}"' 33 | 34 | automation: 35 | - alias: speech_test 36 | trigger: 37 | - platform: state 38 | entity_id: binary_sensor.garage_door 39 | to: 'on' 40 | action: 41 | - service: script.speak 42 | data: 43 | entity_id: media_player.dining_room_chromecast 44 | message: The garage door is open 45 | -------------------------------------------------------------------------------- /examples/human_time.j2: -------------------------------------------------------------------------------- 1 | {% macro human_time(seconds) -%} 2 | {%- set seconds = seconds|int -%} 3 | {%- set comma = joiner(', ') -%} 4 | {%- set intervals = { 5 | 'weeks': 60 * 60 * 24 * 7, 6 | 'days': 60 * 60 * 24, 7 | 'hours': 60 * 60, 8 | 'minutes': 60, 9 | 'seconds': 1, 10 | } -%} 11 | 12 | {%- set weeks = seconds // intervals.weeks -%} 13 | {%- set seconds = seconds % intervals.weeks -%} 14 | {{- comma() ~ weeks ~ ' week' ~ ('s' if weeks != 1) if weeks -}} 15 | 16 | {%- set days = seconds // intervals.days -%} 17 | {%- set seconds = seconds % intervals.days -%} 18 | {{- comma() ~ days ~ ' day' ~ ('s' if days != 1) if days -}} 19 | 20 | {%- set hours = seconds // intervals.hours -%} 21 | {%- set seconds = seconds % intervals.hours -%} 22 | {{- comma() ~ hours ~ ' hour' ~ ('s' if hours != 1) if hours -}} 23 | 24 | {%- set minutes = seconds // intervals.minutes -%} 25 | {{- comma() ~ minutes ~ ' minute' ~ ('s' if minutes != 1) if minutes -}} 26 | 27 | {%- set seconds = seconds % intervals.minutes -%} 28 | {{- comma() ~ seconds ~ ' second' ~ ('s' if seconds != 1) if seconds -}} 29 | {%- endmacro %} 30 | 31 | 59251 seconds in readable format: {{ human_time(59251) }} 32 | -------------------------------------------------------------------------------- /examples/packages/low_charge_sms.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | for number in "$@"; do 4 | echo "I am dying, please plug in Stuart's iPhone so it doesn't die!" | /usr/bin/gammu sendsms TEXT $number 5 | done 6 | -------------------------------------------------------------------------------- /examples/packages/low_charge_sms.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / Low Charge SMS 3 | ################################################################ 4 | 5 | homeassistant: 6 | customize: 7 | automation.low_charge_sms: 8 | friendly_name: "Geraldine's Low Battery SMS" 9 | 10 | device_tracker.geraldine: 11 | phone_number: !secret number_geraldine 12 | 13 | automation: 14 | - alias: low_charge_sms 15 | trigger: 16 | - platform: numeric_state 17 | entity_id: sensor.geraldine_iphone_battery 18 | below: 30 19 | action: 20 | - service: shell_command.low_charge_sms 21 | data_template: 22 | numbers: >- 23 | {% set space = joiner(' ') %} 24 | {% for entity in states.device_tracker if entity.attributes.phone_number is defined and is_state(entity.entity_id, 'home') -%} 25 | {{ space() }}{{ entity.attributes.phone_number }} 26 | {%- endfor %} 27 | 28 | shell_command: 29 | low_charge_sms: >- 30 | /home/homeassistant/.homeassistant/shell_scripts/low_charge_sms.sh {{ numbers }} 31 | -------------------------------------------------------------------------------- /examples/packages/mqtt_publish.yaml: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Publish all sensor states to MQTT broker 3 | # 4 | # Written for: 5 | # @thundergreen 6 | # 7 | # Components: 8 | # automation 9 | # binary_sensor 10 | # mqtt 11 | # sensor 12 | # 13 | # License: 14 | # MIT 15 | # 16 | # Author: 17 | # Dale Higgs <@dale3h> 18 | # 19 | # THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED 20 | # IN ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. 21 | # 22 | # PLEASE NOTE: THIS CONFIGURATION IS UNTESTED AND MAY CONTAIN ERRORS 23 | 24 | ################################################################ 25 | ## Packages / MQTT - Publish Sensors 26 | ################################################################ 27 | 28 | automation: 29 | - alias: mqtt_publish_sensors 30 | hide_entity: true 31 | initial_state: 'on' 32 | trigger: 33 | - platform: event 34 | event_type: state_changed 35 | condition: 36 | - condition: template 37 | value_template: "{{ trigger is not none }}" 38 | - condition: template 39 | value_template: "{{ trigger.event is not none }}" 40 | - condition: template 41 | value_template: "{{ trigger.event.data is not none }}" 42 | - condition: template 43 | value_template: "{{ trigger.event.data.entity_id is not none }}" 44 | - condition: template 45 | value_template: "{{ trigger.event.data.new_state is not none }}" 46 | - condition: or 47 | conditions: 48 | - condition: template 49 | value_template: "{{ trigger.event.data.entity_id.split('.')[0] == 'binary_sensor' }}" 50 | - condition: template 51 | value_template: "{{ trigger.event.data.entity_id.split('.')[0] == 'sensor' }}" 52 | - condition: or 53 | conditions: 54 | - condition: template 55 | value_template: "{{ trigger.event.data.old_state is none }}" 56 | - condition: template 57 | value_template: "{{ trigger.event.data.new_state.state != trigger.event.data.old_state.state }}" 58 | action: 59 | - service: mqtt.publish 60 | data_template: 61 | topic: "home-assistant/{{ trigger.event.data.entity_id|replace('.', '/') }}" 62 | payload: "{{ trigger.event.data.new_state.state }}" 63 | retain: true 64 | -------------------------------------------------------------------------------- /examples/packages/pill_tracker.yaml: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Pill tracker script and binary sensor to use with Dasher. 3 | # 4 | # Written for: 5 | # @clemon79 6 | # 7 | # Components: 8 | # binary_sensor 9 | # logbook 10 | # script 11 | # 12 | # License: 13 | # MIT 14 | # 15 | # Author: 16 | # Dale Higgs <@dale3h> 17 | # 18 | # PLEASE NOTE: THIS CONFIGURATION IS UNTESTED AND MAY CONTAIN ERRORS 19 | 20 | binary_sensor: 21 | - platform: template 22 | sensors: 23 | took_my_pills: 24 | friendly_name: "Took My Pills" 25 | value_template: >- 26 | {% set script = states.script.took_my_pills %} 27 | {% set reset = 60 * 60 * 4 %} 28 | 29 | {% if script and script.attributes.last_triggered %} 30 | {% set time_now = utcnow().strftime('%s')|int %} 31 | {% set time_ran = script.attributes.last_triggered.strftime('%s')|int %} 32 | 33 | {{ time_now - time_ran < reset }} 34 | {% else %} 35 | {{ false }} 36 | {% endif %} 37 | 38 | script: 39 | took_my_pills: 40 | alias: "Took My Pills" 41 | sequence: 42 | - service: logbook.log 43 | data: 44 | name: My Pills 45 | message: were taken. 46 | 47 | ################################################ 48 | ## Dasher Config Example 49 | ################################################ 50 | # 51 | # {"buttons":[ 52 | # { 53 | # "name": "Took My Pills", 54 | # "address": "00:11:22:33:44:55", 55 | # "url": "http://yourdomain.com:8123/api/services/script/took_my_pills", 56 | # "method": "POST", 57 | # "headers": { 58 | # "x-ha-access": "YOUR_HASS_PASSWORD" 59 | # }, 60 | # "json": true 61 | # } 62 | # ]} 63 | -------------------------------------------------------------------------------- /examples/packages/restart_mqtt.yaml: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Example of how to restart MQTT broker from within Home Assistant. 3 | # 4 | # Written for: 5 | # @torn8o 6 | # 7 | # Components: 8 | # script 9 | # shell_command 10 | # 11 | # License: 12 | # MIT 13 | # 14 | # Author: 15 | # Dale Higgs <@dale3h> 16 | # 17 | # PLEASE NOTE: THIS CONFIGURATION IS UNTESTED AND MAY CONTAIN ERRORS 18 | 19 | ################################################################ 20 | ## Packages / Restart MQTT 21 | ################################################################ 22 | 23 | ################################################ 24 | ## Customize 25 | ################################################ 26 | 27 | homeassistant: 28 | customize: 29 | script.restart_mqtt: 30 | friendly_name: "Restart MQTT Broker" 31 | icon: mdi:bomb 32 | 33 | ################################################ 34 | ## Script 35 | ################################################ 36 | 37 | script: 38 | restart_mqtt: 39 | sequence: 40 | - service: shell_command.restart_mqtt 41 | 42 | ################################################ 43 | ## Shell Command 44 | ################################################ 45 | 46 | shell_command: 47 | restart_mqtt: >- 48 | sudo /bin/systemctl restart mosquitto.service 49 | -------------------------------------------------------------------------------- /examples/packages/tts_alerts.yaml: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Allow the alert component to be used for other things, like TTS 3 | # 4 | # Written for: 5 | # @dale3h 6 | # 7 | # Components: 8 | # alert 9 | # automation 10 | # input_boolean 11 | # notify 12 | # tts 13 | # 14 | # License: 15 | # MIT 16 | # 17 | # Author: 18 | # Dale Higgs <@dale3h> 19 | # 20 | # THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED 21 | # IN ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. 22 | # 23 | # PLEASE NOTE: THIS CONFIGURATION IS UNTESTED AND MAY CONTAIN ERRORS 24 | 25 | ################################################################ 26 | ## Packages / TTS Alerts 27 | ################################################################ 28 | 29 | alert: 30 | garage_door_1: 31 | name: garage_door_open_1 32 | entity_id: input_boolean.garage_door_1 33 | state: 'on' 34 | repeat: 1 35 | can_acknowledge: true 36 | skip_first: false 37 | notifiers: 38 | - tts_alerts 39 | 40 | garage_door_2: 41 | name: garage_door_open_2 42 | entity_id: input_boolean.garage_door_2 43 | state: 'on' 44 | repeat: 1 45 | can_acknowledge: true 46 | skip_first: false 47 | notifiers: 48 | - tts_alerts 49 | 50 | garage_door_3: 51 | name: garage_door_open_3 52 | entity_id: input_boolean.garage_door_3 53 | state: 'on' 54 | repeat: 1 55 | can_acknowledge: true 56 | skip_first: false 57 | notifiers: 58 | - tts_alerts 59 | 60 | unmapped_alert: 61 | name: This alert name will be spoken if the automation does not recognize it. 62 | entity_id: input_boolean.unmapped_alert 63 | state: 'on' 64 | repeat: 1 65 | can_acknowledge: true 66 | skip_first: false 67 | notifiers: 68 | - tts_alerts 69 | 70 | automation: 71 | - alias: alert_triggered 72 | trigger: 73 | - platform: event 74 | event_type: call_service 75 | event_data: 76 | domain: notify 77 | service: tts_alerts 78 | action: 79 | - service: tts.google_say 80 | data_template: 81 | message: >- 82 | {% set alert_name = trigger.event.data.service_data.message %} 83 | {% set alert_map = { 84 | 'garage_door_open_1': 'The first garage door is open.', 85 | 'garage_door_open_2': 'The second garage door is open.', 86 | 'garage_door_open_3': 'The third garage door is open.' 87 | } %} 88 | {{ alert_map[alert_name]|default(alert_name) }} 89 | 90 | 91 | input_boolean: 92 | garage_door_1: 93 | initial: off 94 | 95 | garage_door_2: 96 | initial: off 97 | 98 | garage_door_3: 99 | initial: off 100 | 101 | unmapped_alert: 102 | initial: off 103 | 104 | notify: 105 | - platform: file 106 | name: tts_alerts 107 | filename: tts_alerts.log 108 | 109 | tts: 110 | - platform: google 111 | -------------------------------------------------------------------------------- /examples/select_timer.yaml: -------------------------------------------------------------------------------- 1 | automation: 2 | alias: Turn Zone 1 On 3 | trigger: 4 | platform: time 5 | after: '07:30:00' 6 | action: 7 | service: script.zone_1_on 8 | 9 | script: 10 | zone_1_on: 11 | alias: Zone 1 On 12 | sequence: 13 | - service: switch.turn_on 14 | entity_id: switch.zone_1 15 | - service: script.zone_1_timer_5m 16 | - service: script.zone_1_timer_10m 17 | - service: script.zone_1_timer_15m 18 | - service: script.zone_1_timer_20m 19 | - service: script.zone_1_timer_25m 20 | - service: script.zone_1_timer_30m 21 | 22 | zone_1_off: 23 | alias: Zone 1 Off 24 | sequence: 25 | - service: script.turn_off 26 | entity_id: script.zone_1_timer_5m 27 | - service: script.turn_off 28 | entity_id: script.zone_1_timer_10m 29 | - service: script.turn_off 30 | entity_id: script.zone_1_timer_15m 31 | - service: script.turn_off 32 | entity_id: script.zone_1_timer_20m 33 | - service: script.turn_off 34 | entity_id: script.zone_1_timer_25m 35 | - service: script.turn_off 36 | entity_id: script.zone_1_timer_30m 37 | - service: switch.turn_off 38 | entity_id: switch.zone_1 39 | 40 | zone_1_timer_5m: 41 | alias: Zone 1 Timer (5 Minutes) 42 | sequence: 43 | - condition: state 44 | entity_id: input_select.zone_1_time_on 45 | state: '00:05' 46 | - delay: 47 | minutes: 5 48 | - service: script.zone_1_off 49 | 50 | zone_1_timer_10m: 51 | alias: Zone 1 Timer (10 Minutes) 52 | sequence: 53 | - condition: state 54 | entity_id: input_select.zone_1_time_on 55 | state: '00:10' 56 | - delay: 57 | minutes: 10 58 | - service: script.zone_1_off 59 | 60 | zone_1_timer_15m: 61 | alias: Zone 1 Timer (15 Minutes) 62 | sequence: 63 | - condition: state 64 | entity_id: input_select.zone_1_time_on 65 | state: '00:15' 66 | - delay: 67 | minutes: 15 68 | - service: script.zone_1_off 69 | 70 | zone_1_timer_20m: 71 | alias: Zone 1 Timer (20 Minutes) 72 | sequence: 73 | - condition: state 74 | entity_id: input_select.zone_1_time_on 75 | state: '00:20' 76 | - delay: 77 | minutes: 20 78 | - service: script.zone_1_off 79 | 80 | zone_1_timer_25m: 81 | alias: Zone 1 Timer (25 Minutes) 82 | sequence: 83 | - condition: state 84 | entity_id: input_select.zone_1_time_on 85 | state: '00:25' 86 | - delay: 87 | minutes: 25 88 | - service: script.zone_1_off 89 | 90 | zone_1_timer_30m: 91 | alias: Zone 1 Timer (30 Minutes) 92 | sequence: 93 | - delay: 94 | minutes: 30 95 | - service: script.zone_1_off 96 | -------------------------------------------------------------------------------- /examples/services/home-assistant.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Home Assistant 3 | After=network.target 4 | 5 | [Service] 6 | Type=simple 7 | User=homeassistant 8 | Environment=HASS_CONFIG=/home/homeassistant/.homeassistant 9 | ExecStart=/srv/homeassistant/bin/hass -c "$HASS_CONFIG" 10 | ExecReload=/srv/homeassistant/bin/hass -c "$HASS_CONFIG" --script check_config 11 | ExecReload=/bin/kill -HUP $MAINPID 12 | SendSIGKILL=yes 13 | TimeoutStopSec=15 14 | 15 | [Install] 16 | WantedBy=multi-user.target 17 | -------------------------------------------------------------------------------- /examples/services/ozwcp.service: -------------------------------------------------------------------------------- 1 | # Open Z-Wave Control Panel Service File 2 | # ====================================== 3 | # To install this service file run the following commands: 4 | # sudo wget https://raw.githubusercontent.com/dale3h/homeassistant-config/master/examples/services/ozwcp.service -O /etc/systemd/system/ozwcp.service 5 | # sudo systemctl daemon-reload 6 | # sudo systemctl enable ozwcp.service 7 | # sudo systemctl start ozwcp.service 8 | # 9 | # To link your Z-Wave configuration files: 10 | # cd /srv/hass/src/open-zwave-control-panel 11 | # sudo rename -v 's/\.xml$/\.xml.backup/' zw*.xml 12 | # sudo ln -s /home/hass/.homeassistant/zwcfg_(PRESS TAB AND THEN ENTER) 13 | # sudo ln -s /home/hass/.homeassistant/zwscene.xml 14 | # sudo chown hass:hass zw*.xml 15 | # 16 | # Now check the logs to ensure that it is running without errors: 17 | # sudo journalctl -fu ozwcp.service 18 | 19 | [Unit] 20 | Description=OpenZWave Control Panel 21 | After=network.target 22 | 23 | [Service] 24 | Type=simple 25 | User=hass 26 | WorkingDirectory=/srv/hass/src/open-zwave-control-panel 27 | ExecStart=/srv/hass/src/open-zwave-control-panel/ozwcp 28 | Restart=on-failure 29 | 30 | [Install] 31 | WantedBy=multi-user.target 32 | -------------------------------------------------------------------------------- /examples/services/virtualenv/home-assistant.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Home Assistant 3 | After=network.target 4 | 5 | [Service] 6 | Type=simple 7 | User=homeassistant 8 | ExecStart=/srv/homeassistant/bin/hass 9 | SendSIGKILL=yes 10 | TimeoutStopSec=60 11 | 12 | [Install] 13 | WantedBy=multi-user.target 14 | -------------------------------------------------------------------------------- /examples/slow_dim_lights.yaml: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Dim lights 1/3 brightness each second 3 | # 4 | # Written for: 5 | # @JesseWebDotCom 6 | # 7 | # Components: 8 | # automation 9 | # light 10 | # script 11 | # 12 | # License: 13 | # MIT 14 | # 15 | # Author: 16 | # Dale Higgs <@dale3h> 17 | # 18 | # PLEASE NOTE: THIS CONFIGURATION IS UNTESTED AND MAY CONTAIN ERRORS 19 | 20 | automation: 21 | - alias: slow_dim_lights 22 | trigger: 23 | ... 24 | action: 25 | - service: script.slow_dim_lights 26 | data: 27 | entity_id: light.living_room 28 | 29 | script: 30 | slow_dim_lights: 31 | alias: 'Slow Dim Lights' 32 | sequence: 33 | - service: light.turn_on 34 | data_template: 35 | entity_id: "{{ entity_id }}" 36 | brightness: "{{ (states[entity_id.split('.')[0]][entity_id.split('.')[1]].attributes.brightness|int * (2 / 3))|int }}" 37 | - delay: 38 | seconds: 1 39 | - service: light.turn_on 40 | data_template: 41 | entity_id: "{{ entity_id }}" 42 | brightness: "{{ ((states[entity_id.split('.')[0]][entity_id.split('.')[1]].attributes.brightness|int / (2 / 3))|int * (1 / 3))|int }}" 43 | - delay: 44 | seconds: 1 45 | - service: light.turn_off 46 | data_template: 47 | entity_id: "{{ entity_id }}" 48 | - service: script.turn_off 49 | entity_id: script.slow_dim_lights 50 | -------------------------------------------------------------------------------- /examples/sunset_light_ramping.yaml: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Light ramping at sunset 3 | # 4 | # Written for: 5 | # @hwikene 6 | # 7 | # Components: 8 | # automation 9 | # light 10 | # sun 11 | # 12 | # License: 13 | # MIT 14 | # 15 | # Original Authors: 16 | # @hwikene 17 | # @arsaboo 18 | # 19 | # Supporting Author: 20 | # Dale Higgs <@dale3h> 21 | # 22 | # THE ABOVE NOTICE SHALL BE INCLUDED IN ALL COPIES OR SUBSTANTIAL 23 | # PORTIONS OF THE SOFTWARE. 24 | # 25 | # PLEASE NOTE: THIS CONFIGURATION IS UNTESTED AND MAY CONTAIN ERRORS 26 | 27 | automation: 28 | - alias: sol_lys_1 29 | trigger: 30 | - platform: sun 31 | event: sunset 32 | action: 33 | - service: light.turn_on 34 | data: 35 | entity_id: light.qubino_zmnhdd1_flush_dimmer_level_2_0 36 | brightness: 15 37 | - service: automation.turn_on 38 | data: 39 | entity_id: automation.sol_lys_6 40 | 41 | - alias: sol_lys_6 42 | trigger: 43 | - platform: time 44 | minutes: '/5' 45 | seconds: 00 46 | condition: 47 | - condition: state 48 | entity_id: light.qubino_zmnhdd1_flush_dimmer_level_2_0 49 | state: 'on' 50 | action: 51 | - service: light.turn_on 52 | data_template: 53 | entity_id: light.qubino_zmnhdd1_flush_dimmer_level_2_0 54 | brightness: "{{ states.light.qubino_zmnhdd1_flush_dimmer_level_2_0.attributes.brightness|int + 24 }}" 55 | - condition: template 56 | value_template: "{{ (states.light.qubino_zmnhdd1_flush_dimmer_level_2_0.attributes|default({})).brightness|default(0) >= 250 }}" 57 | - service: automation.turn_off 58 | data: 59 | entity_id: automation.sol_lys_6 60 | -------------------------------------------------------------------------------- /examples/sync_media_player_volume.yaml: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Keep Input Slider and Media Player volume in sync 3 | # 4 | # Written for: 5 | # @mattthhdp 6 | # 7 | # Components: 8 | # automation 9 | # input_slider 10 | # media_player 11 | # 12 | # License: 13 | # MIT 14 | # 15 | # Author: 16 | # Dale Higgs <@dale3h> 17 | # 18 | # Notes: 19 | # It may be possible to reduce this to just one automation. 20 | # 21 | # PLEASE NOTE: THIS CONFIGURATION IS UNTESTED AND MAY CONTAIN ERRORS 22 | 23 | homeassistant: 24 | customize: 25 | automation.set_kodi_salon_volume: 26 | friendly_name: Set Kodi Salon Volume 27 | 28 | automation.sync_kodi_salon_volume: 29 | friendly_name: Sync Kodi Salon Volume 30 | 31 | input_slider.kodi_salon_volume: 32 | friendly_name: Kodi Salon Volume 33 | 34 | media_player.kodi_salon: 35 | friendly_name: Kodi Salon 36 | 37 | automation: 38 | - alias: set_kodi_salon_volume 39 | trigger: 40 | - platform: state 41 | entity_id: input_slider.kodi_salon_volume 42 | action: 43 | - service: media_player.volume_set 44 | data_template: 45 | entity_id: media_player.kodi_salon 46 | volume_level: "{{ trigger.to_state.state }}" 47 | 48 | - alias: sync_kodi_salon_volume 49 | trigger: 50 | - platform: state 51 | entity_id: media_player.kodi_salon 52 | condition: 53 | - condition: template 54 | value_template: "{{ trigger.to_state.attributes is not none }}" 55 | - condition: template 56 | value_template: "{{ trigger.to_state.attributes.volume_level is not none }}" 57 | - condition: template 58 | value_template: "{{ trigger.to_state.attributes.volume_level|float != states('input_slider.kodi_salon_volume')|float }}" 59 | action: 60 | - service: automation.turn_off 61 | data: 62 | entity_id: automation.set_kodi_salon_volume 63 | - service: input_slider.select_value 64 | data_template: 65 | entity_id: input_slider.kodi_salon_volume 66 | value: '{{ trigger.to_state.attributes.volume_level }}' 67 | - service: automation.turn_on 68 | data: 69 | entity_id: automation.set_kodi_salon_volume 70 | 71 | input_slider: 72 | kodi_salon_volume: 73 | initial: 0.3 74 | min: 0 75 | max: 1 76 | step: 0.1 77 | 78 | media_player: 79 | - platform: kodi 80 | name: kodi_salon 81 | host: 'http://192.168.1.100' 82 | -------------------------------------------------------------------------------- /examples/zwave_link.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | OZWCP_PATH=/srv/hass/src/open-zwave-control-panel 4 | HASS_PATH=/home/hass/.homeassistant 5 | 6 | sudo mkdir $OZWCP_PATH/.backup 7 | sudo mv $OZWCP_PATH/zw*.xml $OZWCP_PATH/.backup 8 | sudo ln -s $HASS_PATH/zw*.xml $OZWCP_PATH/ 9 | -------------------------------------------------------------------------------- /packages/alarm.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / Alarm 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'alarm' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## Alarm Control Panel 26 | ################################################ 27 | 28 | alarm_control_panel.alarm_system: 29 | <<: *customize 30 | friendly_name: "Alarm System" 31 | 32 | ################################################ 33 | ## Group 34 | ################################################ 35 | 36 | group.alarm_system: 37 | <<: *customize 38 | friendly_name: "Alarm System" 39 | 40 | ################################################ 41 | ## Switch 42 | ################################################ 43 | 44 | switch.dining_room_siren_switch: 45 | <<: *customize 46 | friendly_name: "Dining Room Siren" 47 | 48 | switch.master_bedroom_siren_switch: 49 | <<: *customize 50 | friendly_name: "Master Bedroom Siren" 51 | 52 | ################################################ 53 | ## Group 54 | ################################################ 55 | 56 | group: 57 | alarm_system: 58 | control: hidden 59 | entities: 60 | - alarm_control_panel.alarm_system 61 | - switch.dining_room_siren_switch 62 | - sensor.dining_room_siren_battery 63 | - switch.master_bedroom_siren_switch 64 | - sensor.master_bedroom_siren_battery 65 | 66 | ################################################ 67 | ## Alarm Control Panel 68 | ################################################ 69 | 70 | alarm_control_panel: 71 | - platform: manual 72 | name: alarm_system 73 | code: !secret alarm_code 74 | -------------------------------------------------------------------------------- /packages/apple_tv.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / Apple TV 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'apple_tv' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## Media Player 26 | ################################################ 27 | 28 | media_player.apple_tv_living_room: 29 | <<: *customize 30 | friendly_name: "Apple TV (Living Room)" 31 | icon: mdi:apple 32 | 33 | media_player.apple_tv_master_bedroom: 34 | <<: *customize 35 | friendly_name: "Apple TV (Master Bedroom)" 36 | icon: mdi:apple 37 | 38 | ################################################ 39 | ## Remote 40 | ################################################ 41 | 42 | remote.apple_tv_living_room: 43 | <<: *customize 44 | friendly_name: "Apple TV (Living Room)" 45 | icon: mdi:apple 46 | 47 | remote.apple_tv_master_bedroom: 48 | <<: *customize 49 | friendly_name: "Apple TV (Master Bedroom)" 50 | icon: mdi:apple 51 | 52 | ################################################ 53 | ## Apple TV 54 | ################################################ 55 | 56 | apple_tv: 57 | - name: apple_tv_living_room 58 | host: !secret apple_tv_living_room_host 59 | login_id: !secret apple_tv_living_room_login_id 60 | start_off: true 61 | # credentials: !secret apple_tv_living_room_credentials 62 | 63 | # - name: apple_tv_master_bedroom 64 | # host: !secret apple_tv_master_bedroom_host 65 | # login_id: !secret apple_tv_master_bedroom_login_id 66 | # start_off: true 67 | # # credentials: !secret apple_tv_master_bedroom_credentials 68 | -------------------------------------------------------------------------------- /packages/asuswrt.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / AsusWRT 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'asuswrt' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## Device Tracker 26 | ################################################ 27 | 28 | device_tracker: 29 | - platform: asuswrt 30 | host: !secret asuswrt_host 31 | protocol: ssh 32 | mode: router 33 | username: !secret asuswrt_username 34 | ssh_key: !secret asuswrt_ssh_key 35 | -------------------------------------------------------------------------------- /packages/climate.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / Climate 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'climate' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## Climate 26 | ################################################ 27 | 28 | climate.kitchen: 29 | <<: *expose 30 | friendly_name: "Kitchen" 31 | 32 | climate.living_room: 33 | <<: *expose 34 | friendly_name: "Living Room" 35 | 36 | climate.master_bathroom: 37 | <<: *expose 38 | friendly_name: "Bathroom" 39 | 40 | climate.master_bedroom: 41 | <<: *expose 42 | friendly_name: "Bedroom" 43 | 44 | climate.master_closet: 45 | <<: *expose 46 | friendly_name: "Closet" 47 | 48 | ################################################ 49 | ## Input Boolean 50 | ################################################ 51 | 52 | input_boolean.climate_dummy: 53 | <<: *customize 54 | friendly_name: "Climate Dummy Switch" 55 | hidden: true 56 | 57 | ################################################ 58 | ## Input Boolean 59 | ################################################ 60 | 61 | input_boolean: 62 | climate_dummy: 63 | initial: off 64 | 65 | ################################################ 66 | ## Climate 67 | ################################################ 68 | 69 | climate: 70 | - platform: generic_thermostat 71 | name: kitchen 72 | heater: input_boolean.climate_dummy 73 | target_sensor: sensor.kitchen_temperature 74 | 75 | - platform: generic_thermostat 76 | name: living_room 77 | heater: input_boolean.climate_dummy 78 | target_sensor: sensor.living_room_temperature 79 | 80 | - platform: generic_thermostat 81 | name: master_bathroom 82 | heater: input_boolean.climate_dummy 83 | target_sensor: sensor.master_bathroom_temperature 84 | 85 | - platform: generic_thermostat 86 | name: master_bedroom 87 | heater: input_boolean.climate_dummy 88 | target_sensor: sensor.master_bedroom_temperature 89 | 90 | - platform: generic_thermostat 91 | name: master_closet 92 | heater: input_boolean.climate_dummy 93 | target_sensor: sensor.closet_door_temperature 94 | -------------------------------------------------------------------------------- /packages/configurator.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / Configurator Panel 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'configurator' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## Panel Iframe 26 | ################################################ 27 | 28 | panel_iframe: 29 | configurator: 30 | title: 'Configurator' 31 | url: !secret panel_configurator_url 32 | icon: mdi:wrench 33 | -------------------------------------------------------------------------------- /packages/customizer.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / Customizer 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'customizer' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## Customize Glob 26 | ################################################ 27 | 28 | # customize_glob: 29 | # "*.*": 30 | # custom_ui_state_card: custom-ui 31 | 32 | customizer: 33 | custom_ui: hosted 34 | -------------------------------------------------------------------------------- /packages/drop-in/curl.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / cURL 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Configuration: 7 | ## 8 | ## url: string (Required) 9 | ## args: string (Optional) default is '-sS' 10 | ## method: string (Optional) default is 'get' 11 | ## headers: dict (Optional) default is empty 12 | ## payload: dict (Optional) default is empty 13 | ## stream: string (Optional) default is '/dev/null' 14 | ## 15 | ## Example Usage: 16 | ## 17 | ## automation: 18 | ## trigger: 19 | ## - ...your trigger(s) here... 20 | ## condition: 21 | ## - ...your condition(s) here... 22 | ## action: 23 | ## - service: shell_command.curl 24 | ## data: 25 | ## url: http://your.website.com/api/endpoint 26 | ## method: post 27 | ## headers: 28 | ## Content-Type: application/json 29 | ## Another-Header: header value 30 | ## payload: 31 | ## key1: value1 32 | ## key2: value2 33 | ################################################ 34 | 35 | ################################################ 36 | ## Shell Command 37 | ################################################ 38 | 39 | shell_command: 40 | curl: >- 41 | /usr/bin/curl {{ args|default('-sS') }} -X {{ method|default('get')|upper }} {%- for k in headers %} -H "{{ k }}: {{ headers[k] }}"{% endfor %} {{- (' -d \'' ~ payload|tojson ~ '\'') if payload }} {{ url }} > {{ stream|default('/dev/null') }} 42 | -------------------------------------------------------------------------------- /packages/drop-in/secrets_container.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / Secrets Container 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'secrets_container' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## Sensor 26 | ################################################ 27 | 28 | sensor.secrets: 29 | <<: *customize 30 | friendly_name: "Secrets" 31 | hidden: true 32 | icon: mdi:file-lock 33 | eventghost_url: !secret eventghost_url 34 | secret_of_yours: !secret secret_of_yours 35 | secret_of_mine: !secret secret_of_mine 36 | 37 | ################################################ 38 | ## Sensor 39 | ################################################ 40 | 41 | sensor: 42 | - platform: template 43 | sensors: 44 | secrets: 45 | value_template: "Secrets Container" 46 | -------------------------------------------------------------------------------- /packages/drop-in/tts_alerts.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / TTS Alerts 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'tts_alerts' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## Automation 26 | ################################################ 27 | 28 | automation.alert_triggered: 29 | <<: *customize 30 | friendly_name: "Alert Triggered" 31 | 32 | ################################################ 33 | ## Automation 34 | ################################################ 35 | 36 | automation: 37 | - alias: alert_triggered 38 | initial_state: 'on' 39 | trigger: 40 | - platform: event 41 | event_type: call_service 42 | event_data: 43 | domain: notify 44 | service: tts_alerts 45 | action: 46 | - service: script.say 47 | data_template: 48 | message: >- 49 | {% set entity_id = trigger.event.data.service_data.message %} 50 | {{ (states.alert[entity_id].attributes|default).speech|default(entity_id|replace('_', ' ')) }} 51 | 52 | ################################################ 53 | ## Notify 54 | ################################################ 55 | 56 | notify: 57 | - platform: file 58 | name: tts_alerts 59 | filename: tts_alerts.log 60 | timestamp: true 61 | -------------------------------------------------------------------------------- /packages/ecobee.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / ecobee 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'ecobee' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## Binary Sensor 26 | ################################################ 27 | 28 | binary_sensor.guest_bedroom_occupancy: 29 | <<: *expose 30 | friendly_name: "Guest Bedroom Occupancy" 31 | device_class: occupancy 32 | 33 | binary_sensor.ecobee3_occupancy: 34 | <<: *expose 35 | friendly_name: "Hallway Occupancy" 36 | device_class: occupancy 37 | 38 | binary_sensor.living_room_occupancy: 39 | <<: *expose 40 | friendly_name: "Living Room Occupancy" 41 | device_class: occupancy 42 | 43 | binary_sensor.master_bedroom_occupancy: 44 | <<: *expose 45 | friendly_name: "Master Bedroom Occupancy" 46 | device_class: occupancy 47 | 48 | ################################################ 49 | ## Climate 50 | ################################################ 51 | 52 | climate.ecobee3: 53 | <<: *expose 54 | friendly_name: "ecobee3" 55 | icon: mdi:nest-thermostat 56 | 57 | ################################################ 58 | ## Sensor 59 | ################################################ 60 | 61 | sensor.guest_bedroom_temperature: 62 | <<: *expose 63 | friendly_name: "Guest Bedroom Temperature" 64 | icon: mdi:thermometer 65 | 66 | sensor.ecobee3_humidity: 67 | <<: *expose 68 | friendly_name: "Hallway Humidity" 69 | icon: mdi:water-percent 70 | 71 | sensor.ecobee3_temperature: 72 | <<: *expose 73 | friendly_name: "Hallway Temperature" 74 | icon: mdi:thermometer 75 | 76 | sensor.living_room_temperature: 77 | <<: *expose 78 | friendly_name: "Living Room Temperature" 79 | icon: mdi:thermometer 80 | 81 | sensor.master_bedroom_temperature: 82 | <<: *expose 83 | friendly_name: "Master Bedroom Temperature" 84 | icon: mdi:thermometer 85 | 86 | ################################################ 87 | ## ecobee 88 | ################################################ 89 | 90 | ecobee: 91 | api_key: !secret ecobee_api_key 92 | hold_temp: true 93 | -------------------------------------------------------------------------------- /packages/ffmpeg.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / FFmpeg 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'ffmpeg' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## FFmpeg 26 | ################################################ 27 | 28 | ffmpeg: 29 | ffmpeg_bin: /usr/bin/ffmpeg 30 | -------------------------------------------------------------------------------- /packages/floorplan.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / Floorplan 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'floorplan' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## Panel Custom 26 | ################################################ 27 | 28 | panel_custom: 29 | - name: floorplan 30 | sidebar_title: Floorplan 31 | sidebar_icon: mdi:home 32 | url_path: floorplan 33 | config: !include floorplan.conf 34 | -------------------------------------------------------------------------------- /packages/flux_led.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / Flux LED 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'flux_led' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## Light 26 | ################################################ 27 | 28 | light.rack_light: 29 | <<: *expose 30 | friendly_name: "Rack Light" 31 | persistent: true 32 | 33 | ################################################ 34 | ## Light 35 | ################################################ 36 | 37 | light: 38 | - platform: flux_led 39 | devices: 40 | !secret flux_led_rack_light_host: 41 | name: rack_light 42 | protocol: 'ledenet' 43 | mode: 'rgb' 44 | -------------------------------------------------------------------------------- /packages/google_cast.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / Google Cast 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'google_cast' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## Media Player 26 | ################################################ 27 | 28 | media_player.bedroom_speakers: 29 | <<: *customize 30 | friendly_name: "Bedroom Speakers" 31 | icon: mdi:google-chrome 32 | 33 | media_player.dining_room_home: 34 | <<: *customize 35 | friendly_name: "Dining Room Home" 36 | icon: mdi:google-chrome 37 | 38 | media_player.living_room_speakers: 39 | <<: *customize 40 | friendly_name: "Living Room Speakers" 41 | icon: mdi:google-chrome 42 | 43 | ################################################ 44 | ## Media Player 45 | ################################################ 46 | 47 | media_player: 48 | - platform: cast 49 | name: dining_room_home 50 | host: !secret google_cast_dining_room_host 51 | 52 | - platform: cast 53 | name: living_room_speakers 54 | host: !secret google_cast_living_room_host 55 | 56 | - platform: cast 57 | name: master_bedroom_speakers 58 | host: !secret google_cast_master_bedroom_host 59 | 60 | - platform: cast 61 | -------------------------------------------------------------------------------- /packages/grafana.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / Grafana 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'grafana' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## Script 26 | ################################################ 27 | 28 | script.grafana_webhook: 29 | <<: *customize 30 | friendly_name: "Grafana Webhook" 31 | hidden: true 32 | icon: mdi:webhook 33 | 34 | ################################################ 35 | ## InfluxDB 36 | ################################################ 37 | 38 | influxdb: 39 | host: !secret influxdb_host 40 | port: !secret influxdb_port 41 | username: !secret influxdb_username 42 | password: !secret influxdb_password 43 | database: !secret influxdb_database 44 | default_measurement: state 45 | 46 | ################################################ 47 | ## Panel Iframe 48 | ################################################ 49 | 50 | panel_iframe: 51 | grafana: 52 | title: 'Grafana' 53 | url: !secret panel_grafana_url 54 | icon: mdi:chart-pie 55 | 56 | ################################################ 57 | ## Script 58 | ################################################ 59 | 60 | script: 61 | grafana_webhook: 62 | sequence: 63 | - condition: template 64 | value_template: >- 65 | {{ state != 'ok' and state != 'no_data' }} 66 | - service: notify.syslog 67 | data_template: 68 | message: > 69 | ruleId="{{ ruleId }}", 70 | title="{{ title }}", 71 | ruleUrl="{{ ruleUrl }}", 72 | imageUrl="{{ imageUrl }}", 73 | state="{{ state }}", 74 | message="{{ message }}", 75 | ruleName="{{ ruleName }}", 76 | evalMatches="{{ evalMatches|pprint }}" 77 | - service: notify.telegram 78 | data_template: 79 | message: >- 80 | {{ ruleName }} is {{ state }}. 81 | {% for match in evalMatches %} 82 | {{ match.metric }}: {{ match.value }} 83 | {% endfor %} 84 | -------------------------------------------------------------------------------- /packages/groups/automation_override.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / Groups / Automation Override 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'groups/automation_override' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## Group 26 | ################################################ 27 | 28 | group.automation_override: 29 | <<: *customize 30 | friendly_name: "Automation Override" 31 | 32 | ################################################ 33 | ## Group 34 | ################################################ 35 | 36 | group: 37 | automation_override: 38 | control: hidden 39 | entities: 40 | - automation.morning_lighting 41 | - automation.kitchen_motion 42 | - automation.laundry_room_motion 43 | - automation.master_bathroom_motion 44 | - automation.master_bedroom_motion 45 | - automation.garage_lighting 46 | - automation.garage_door_lighting 47 | - automation.media_lighting 48 | - input_boolean.shower_mode 49 | -------------------------------------------------------------------------------- /packages/groups/batteries2.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / Groups / Batteries 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'groups/batteries' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## Group 26 | ################################################ 27 | 28 | group.batteries: 29 | <<: *customize 30 | friendly_name: "Batteries" 31 | 32 | ################################################ 33 | ## Sensor 34 | ################################################ 35 | 36 | sensor.iphone_battery_level: 37 | <<: *customize 38 | friendly_name: "iPhone Battery Level" 39 | hidden: true 40 | icon: mdi:battery 41 | 42 | sensor.iphone_battery_state: 43 | <<: *customize 44 | friendly_name: "iPhone Battery State" 45 | hidden: true 46 | icon: mdi:battery-charging 47 | 48 | ################################################ 49 | ## Group 50 | ################################################ 51 | 52 | group: 53 | batteries: 54 | control: hidden 55 | entities: 56 | - sensor.front_door_lock_battery 57 | - sensor.front_door_sensor_battery 58 | - sensor.kitchen_motion_battery 59 | - sensor.master_bathroom_motion_battery 60 | - sensor.closet_door_battery 61 | - sensor.garage_entry_battery 62 | - sensor.iphone_battery 63 | - sensor.master_bedroom_battery 64 | - sensor.parker_closet_door_battery 65 | - sensor.network_cabinet_battery 66 | - sensor.ups_battery 67 | - sensor.dining_room_siren_battery 68 | - sensor.master_bedroom_siren_battery 69 | -------------------------------------------------------------------------------- /packages/groups/media_components.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / Groups / Media Components 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'groups/media_components' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## Group 26 | ################################################ 27 | 28 | group.media_components: 29 | <<: *customize 30 | friendly_name: "Media Components" 31 | 32 | group.media_players: 33 | <<: *customize 34 | friendly_name: "Media Players" 35 | 36 | ################################################ 37 | ## Group 38 | ################################################ 39 | 40 | group: 41 | media_components: 42 | control: hidden 43 | entities: 44 | - switch.apple_tv 45 | - switch.chromecast 46 | - switch.fire_tv 47 | - switch.xbox 48 | 49 | media_players: 50 | control: hidden 51 | entities: 52 | - media_player.apple_tv_living_room 53 | - remote.apple_tv_living_room 54 | - media_player.apple_tv_master_bedroom 55 | - remote.apple_tv_master_bedroom 56 | - media_player.bedroom_speakers 57 | - media_player.dining_room_home 58 | - media_player.living_room_speakers 59 | -------------------------------------------------------------------------------- /packages/groups/motion.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / Groups / Motion 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'groups/motion' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## Group 26 | ################################################ 27 | 28 | group.motion: 29 | <<: *customize 30 | friendly_name: "Motion" 31 | 32 | ################################################ 33 | ## Group 34 | ################################################ 35 | 36 | group: 37 | motion: 38 | control: hidden 39 | entities: 40 | - binary_sensor.master_bathroom_sensor 41 | - binary_sensor.kitchen_sensor 42 | - binary_sensor.master_bedroom_motion 43 | - binary_sensor.amcrest_ptz_cam_motion 44 | - binary_sensor.backyard_cam_motion 45 | - binary_sensor.driveway_cam_motion 46 | - binary_sensor.front_yard_cam_motion 47 | - binary_sensor.garage_cam_motion 48 | - binary_sensor.kitchen_cam_motion 49 | - binary_sensor.living_room_cam_motion 50 | - binary_sensor.living_room_fd_cam_motion 51 | - binary_sensor.master_bedroom_cam_motion 52 | - binary_sensor.parker_bedroom_cam_motion 53 | - !secret binary_sensor_laundry_room_motion 54 | - binary_sensor.guest_bathroom_motion 55 | - binary_sensor.front_porch_cam_motion 56 | - binary_sensor.safe_cam_motion 57 | -------------------------------------------------------------------------------- /packages/groups/occupancy.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / Groups / Occupancy 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'groups/occupancy' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## Group 26 | ################################################ 27 | 28 | group.occupancy: 29 | <<: *customize 30 | friendly_name: "Occupancy" 31 | 32 | ################################################ 33 | ## Group 34 | ################################################ 35 | 36 | group: 37 | occupancy: 38 | control: hidden 39 | entities: 40 | - binary_sensor.master_bedroom_occupancy 41 | - binary_sensor.guest_bedroom_occupancy 42 | - binary_sensor.ecobee3_occupancy 43 | - binary_sensor.living_room_occupancy 44 | -------------------------------------------------------------------------------- /packages/groups/people.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / Groups / People 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'groups/people' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## Device Tracker 26 | ################################################ 27 | 28 | device_tracker.dale_iphone: 29 | <<: *customize 30 | friendly_name: "Dale (iPhone)" 31 | icon: mdi:cellphone-iphone 32 | 33 | device_tracker.dale_iphone_bt: 34 | <<: *customize 35 | friendly_name: "Dale (BT)" 36 | icon: mdi:cellphone-iphone 37 | 38 | device_tracker.dale_iphone_ios: 39 | <<: *customize 40 | friendly_name: "Dale (iOS)" 41 | icon: mdi:cellphone-iphone 42 | 43 | device_tracker.meagan_android: 44 | <<: *customize 45 | friendly_name: "Meagan (Android)" 46 | icon: mdi:cellphone-android 47 | 48 | ################################################ 49 | ## Group 50 | ################################################ 51 | 52 | group.guests: 53 | <<: *customize 54 | friendly_name: "Guests" 55 | icon: mdi:human-male-female 56 | 57 | group.person_dale: 58 | <<: *customize 59 | friendly_name: "Dale" 60 | icon: mdi:human-male 61 | 62 | group.person_meagan: 63 | <<: *customize 64 | friendly_name: "Meagan" 65 | icon: mdi:human-female 66 | 67 | ################################################ 68 | ## Group 69 | ################################################ 70 | 71 | group: 72 | guests: 73 | control: hidden 74 | entities: 75 | - group.person_meagan 76 | 77 | person_dale: 78 | control: hidden 79 | entities: 80 | - device_tracker.dale_iphone 81 | - device_tracker.dale_iphone_bt 82 | - device_tracker.dale_iphone_ios 83 | 84 | person_meagan: 85 | control: hidden 86 | entities: 87 | - device_tracker.meagan_android 88 | -------------------------------------------------------------------------------- /packages/groups/temperature.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / Groups / Temperature 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'groups/temperature' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## Group 26 | ################################################ 27 | 28 | group.temperature: 29 | <<: *customize 30 | friendly_name: "Temperature" 31 | icon: mdi:thermometer 32 | 33 | ################################################ 34 | ## Group 35 | ################################################ 36 | 37 | group: 38 | temperature: 39 | control: hidden 40 | entities: 41 | - sensor.closet_door_temperature 42 | - sensor.garage_entry_temperature 43 | - sensor.guest_bedroom_temperature 44 | - sensor.guest_bathroom_temperature 45 | - sensor.ecobee3_temperature 46 | - sensor.kitchen_temperature 47 | - sensor.living_room_temperature 48 | - sensor.master_bathroom_temperature 49 | - sensor.master_bedroom_motion_temperature 50 | - sensor.master_bedroom_temperature 51 | - sensor.network_cabinet_temperature 52 | - sensor.parker_closet_door_temperature 53 | - sensor.broadlink_sensor_temperature 54 | 55 | - sensor.ecobee3_humidity 56 | - sensor.kitchen_relative_humidity 57 | - sensor.master_bathroom_relative_humidity 58 | -------------------------------------------------------------------------------- /packages/haaska.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Package / HAASKA 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize_domain: 11 | alert: 12 | haaska_hidden: false 13 | 14 | # automation: 15 | # haaska_hidden: true 16 | 17 | # camera: 18 | # haaska_hidden: true 19 | 20 | # climate: 21 | # haaska_hidden: true 22 | 23 | cover: 24 | haaska_hidden: false 25 | 26 | # fan: 27 | # haaska_hidden: true 28 | 29 | # group: 30 | # haaska_hidden: true 31 | 32 | # input_boolean: 33 | # haaska_hidden: true 34 | 35 | # input_slider: 36 | # haaska_hidden: true 37 | 38 | # light: 39 | # haaska_hidden: true 40 | 41 | lock: 42 | haaska_hidden: false 43 | 44 | media_player: 45 | haaska_hidden: false 46 | 47 | # scene: 48 | # haaska_hidden: true 49 | 50 | # script: 51 | # haaska_hidden: true 52 | 53 | # switch: 54 | # haaska_hidden: true 55 | -------------------------------------------------------------------------------- /packages/hagraph.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / HA Graph 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'hagraph' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## Script 26 | ################################################ 27 | 28 | script.generate_graph: 29 | <<: *customize 30 | friendly_name: "Generate Graph" 31 | icon: mdi:vector-polyline 32 | 33 | ################################################ 34 | ## Script 35 | ################################################ 36 | 37 | script: 38 | generate_graph: 39 | sequence: 40 | - service: shell_command.generate_graph 41 | 42 | ################################################ 43 | ## Shell Command 44 | ################################################ 45 | 46 | shell_command: 47 | generate_graph: >- 48 | python3 -m hagraph -i $HASS_CONFIG/configuration.yaml -o $HASS_CONFIG/www/img/graph.svg 49 | -------------------------------------------------------------------------------- /packages/haveibeenpwned.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / Have I Been Pwned 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'haveibeenpwned' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## Group 26 | ################################################ 27 | 28 | group.haveibeenpwned: 29 | <<: *customize 30 | friendly_name: "Email Breaches" 31 | icon: mdi:email-alert 32 | 33 | ################################################ 34 | ## Sensor 35 | ################################################ 36 | 37 | !secret haveibeenpwned_personal_sensor: 38 | <<: *customize 39 | friendly_name: "Breaches (Personal)" 40 | icon: mdi:email-alert 41 | 42 | !secret haveibeenpwned_work_sensor: 43 | <<: *customize 44 | friendly_name: "Breaches (Work)" 45 | icon: mdi:email-alert 46 | 47 | ################################################ 48 | ## Group 49 | ################################################ 50 | 51 | group: 52 | haveibeenpwned: 53 | control: hidden 54 | entities: 55 | - !secret haveibeenpwned_personal_sensor 56 | - !secret haveibeenpwned_work_sensor 57 | 58 | ################################################ 59 | ## Sensor 60 | ################################################ 61 | 62 | sensor: 63 | platform: haveibeenpwned 64 | email: 65 | - !secret haveibeenpwned_personal 66 | - !secret haveibeenpwned_work 67 | -------------------------------------------------------------------------------- /packages/homebridge.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Package / Homebridge 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize_domain: 11 | binary_sensor: 12 | homebridge_hidden: true 13 | 14 | climate: 15 | homebridge_hidden: true 16 | 17 | cover: 18 | homebridge_hidden: false 19 | 20 | device_tracker: 21 | homebridge_hidden: true 22 | 23 | fan: 24 | homebridge_hidden: true 25 | 26 | group: 27 | homebridge_hidden: true 28 | 29 | input_boolean: 30 | homebridge_hidden: true 31 | 32 | light: 33 | homebridge_hidden: true 34 | 35 | lock: 36 | homebridge_hidden: false 37 | 38 | media_player: 39 | homebridge_hidden: true 40 | 41 | scene: 42 | homebridge_hidden: true 43 | 44 | sensor: 45 | homebridge_hidden: true 46 | 47 | switch: 48 | homebridge_hidden: true 49 | -------------------------------------------------------------------------------- /packages/http.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / HTTP 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'http' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## HTTP 26 | ################################################ 27 | 28 | http: 29 | api_password: !secret http_api_password 30 | base_url: !secret http_base_url 31 | use_x_forwarded_for: true 32 | ip_ban_enabled: true 33 | login_attempts_threshold: 3 34 | -------------------------------------------------------------------------------- /packages/limitless_led.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / LimitlessLED 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'limitless_led' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## Light 26 | ################################################ 27 | 28 | light: 29 | - platform: limitlessled 30 | bridges: 31 | - host: !secret limitlessled_host 32 | version: 5 33 | port: 8899 34 | groups: 35 | - number: 1 36 | type: rgbw 37 | name: garage_light 38 | -------------------------------------------------------------------------------- /packages/logbook.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / Logbook 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'logbook' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## Logbook 26 | ################################################ 27 | 28 | logbook: 29 | exclude: 30 | entities: 31 | - sensor.time 32 | - sensor.date 33 | - sensor.ups_status_date 34 | domains: 35 | - sun 36 | -------------------------------------------------------------------------------- /packages/logger.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / Logger 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'logger' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## Logger 26 | ################################################ 27 | 28 | # Log Severities: notset, debug, info, warn, warning, error, fatal, critical 29 | logger: 30 | default: debug 31 | logs: 32 | # debug 33 | homeassistant.components.sensor.darksky: debug 34 | 35 | # info 36 | bellows: info 37 | homeassistant.bootstrap: info 38 | homeassistant.components.websocket_api: info 39 | homeassistant.core: info 40 | homeassistant.helpers.script: info 41 | 42 | # warn 43 | botocore: warn 44 | dlipower: warn 45 | homeassistant.components.alarm_control_panel: warn 46 | homeassistant.components.alert: warn 47 | homeassistant.components.api: warn 48 | homeassistant.components.automation: warn 49 | homeassistant.components.binary_sensor: warn 50 | homeassistant.components.camera: warn 51 | homeassistant.components.climate: warn 52 | homeassistant.components.cover: warn 53 | homeassistant.components.device_tracker: warn 54 | homeassistant.components.ecobee: warn 55 | homeassistant.components.http: warn 56 | homeassistant.components.light: warn 57 | homeassistant.components.lock: warn 58 | homeassistant.components.media_player: warn 59 | homeassistant.components.mqtt: warn 60 | homeassistant.components.notify: warn 61 | homeassistant.components.recorder: warn 62 | homeassistant.components.remote: warn 63 | homeassistant.components.sensor: warn 64 | homeassistant.components.switch: warn 65 | homeassistant.components.telegram_bot: warn 66 | homeassistant.components.usps: warn 67 | homeassistant.components.xiaomi: warn 68 | homeassistant.helpers: warn 69 | homeassistant.loader: warn 70 | myusps: warn 71 | libopenzwave: warn 72 | openzwave: warn 73 | phue: warn 74 | plexapi: warn 75 | pyatv: warn 76 | pychromecast: warn 77 | pyecobee: warn 78 | pytradfri: warn 79 | PyXiaomiGateway: warn 80 | root: warn 81 | telegram: warn 82 | urllib3: warn 83 | 84 | # error 85 | homeassistant.components.zwave: error 86 | -------------------------------------------------------------------------------- /packages/media_lights.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / Media Lights 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'media_lights' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## Automation 26 | ################################################ 27 | 28 | automation.media_lighting: 29 | <<: *expose 30 | friendly_name: "Media Lighting" 31 | icon: mdi:movie-roll 32 | 33 | ################################################ 34 | ## Binary Sensor 35 | ################################################ 36 | 37 | binary_sensor.media_lights_expected_state: 38 | <<: *customize 39 | friendly_name: "Media Lights Expected State" 40 | device_class: light 41 | hidden: true 42 | 43 | ################################################ 44 | ## Group 45 | ################################################ 46 | 47 | group.media_lights: 48 | <<: *customize 49 | friendly_name: "Media Lights" 50 | icon: mdi:lightbulb 51 | 52 | ################################################ 53 | ## Automation 54 | ################################################ 55 | 56 | automation: 57 | - alias: media_lighting 58 | trigger: 59 | - platform: state 60 | entity_id: binary_sensor.media_lights_expected_state 61 | action: 62 | - service: script.light_control 63 | data: 64 | entity_id: group.media_lights 65 | 66 | ################################################ 67 | ## Group 68 | ################################################ 69 | 70 | group: 71 | media_lights: 72 | entities: 73 | - light.entry_lamp 74 | - light.living_room 75 | - light.dining_room 76 | 77 | ################################################ 78 | ## Binary Sensor 79 | ################################################ 80 | 81 | binary_sensor: 82 | - platform: template 83 | sensors: 84 | media_lights_expected_state: 85 | value_template: >- 86 | {{ not is_state('media_player.apple_tv_living_room', 'playing') }} 87 | -------------------------------------------------------------------------------- /packages/morning_lights.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / Morning Lights 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'morning_lights' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## Automation 26 | ################################################ 27 | 28 | automation.morning_lighting: 29 | <<: *expose 30 | friendly_name: "Morning Lighting" 31 | icon: mdi:weather-sunset-up 32 | 33 | ################################################ 34 | ## Group 35 | ################################################ 36 | 37 | group.morning_lights: 38 | <<: *expose 39 | friendly_name: "Morning Lights" 40 | icon: mdi:weather-sunset-up 41 | 42 | ################################################ 43 | ## Group 44 | ################################################ 45 | 46 | group: 47 | morning_lights: 48 | entities: 49 | - light.dining_room 50 | - light.entry_lamp 51 | - light.master_bedroom 52 | 53 | ################################################ 54 | ## Automation 55 | ################################################ 56 | 57 | automation: 58 | - alias: morning_lighting 59 | initial_state: 'on' 60 | trigger: 61 | - platform: time 62 | at: '06:30:00' 63 | condition: 64 | - condition: state 65 | entity_id: group.person_dale 66 | state: 'home' 67 | action: 68 | - service: script.light_control 69 | data: 70 | entity_id: group.morning_lights 71 | state: 'on' 72 | brightness: 255 73 | color_temp: 154 74 | transition: 900 75 | -------------------------------------------------------------------------------- /packages/mqtt.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / MQTT 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'mqtt' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## MQTT 26 | ################################################ 27 | 28 | mqtt: 29 | broker: !secret mqtt_broker 30 | port: !secret mqtt_port 31 | username: !secret mqtt_username 32 | password: !secret mqtt_password 33 | -------------------------------------------------------------------------------- /packages/nap_time.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / Nap Time 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'nap_time' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## Script 26 | ################################################ 27 | 28 | script.nap_time: 29 | <<: *customize 30 | friendly_name: "Nap Time" 31 | icon: mdi:sleep 32 | 33 | ################################################ 34 | ## Script 35 | ################################################ 36 | 37 | script: 38 | nap_time: 39 | sequence: 40 | - service: remote.send_command 41 | data: 42 | entity_id: remote.living_room 43 | device: 38739413 44 | command: 'Pause' 45 | - service: script.say 46 | data_template: 47 | message: >- 48 | {% if is_state('switch.apple_tv', 'on') %} 49 | It is time to take a nap. Please turn off the Apple TV and go lie down. 50 | {% else %} 51 | It is time to take a nap. Please go lie down and take a nap. 52 | {% endif %} 53 | - delay: '00:01:00' 54 | - condition: state 55 | entity_id: switch.apple_tv 56 | state: 'on' 57 | - service: script.say 58 | data: 59 | message: "I am now turning off the Apple TV for you. Enjoy your nap!" 60 | - service: switch.turn_off 61 | data: 62 | entity_id: switch.apple_tv 63 | -------------------------------------------------------------------------------- /packages/notify.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / Notify 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'notify' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## Notify 26 | ################################################ 27 | 28 | notify: 29 | - platform: ecobee 30 | name: ecobee 31 | 32 | - platform: pushover 33 | name: pushover 34 | api_key: !secret pushover_api_key 35 | user_key: !secret pushover_user_key 36 | 37 | - platform: syslog 38 | name: syslog 39 | facility: syslog 40 | option: pid 41 | priority: 4 42 | -------------------------------------------------------------------------------- /packages/ozwcp.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / Open Z-Wave Control Panel 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'ozwcp' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## Panel Iframe 26 | ################################################ 27 | 28 | panel_iframe: 29 | ozwcp: 30 | title: 'Open Z-Wave' 31 | url: !secret panel_ozwcp_url 32 | icon: mdi:radio-tower 33 | -------------------------------------------------------------------------------- /packages/plex.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / Plex 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'plex' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## Media Player 26 | ################################################ 27 | 28 | media_player.plex_living_room: 29 | <<: *customize 30 | friendly_name: "Living Room (Plex)" 31 | icon: mdi:plex 32 | 33 | ################################################ 34 | ## Sensor 35 | ################################################ 36 | 37 | sensor.plex_activity: 38 | <<: *customize 39 | friendly_name: "Plex Activity" 40 | hidden: true 41 | 42 | ################################################ 43 | ## Media Player 44 | ################################################ 45 | 46 | media_player: 47 | - platform: plex 48 | entity_namespace: 'plex' 49 | include_non_clients: false 50 | scan_interval: 5 51 | show_all_controls: false 52 | use_custom_entity_ids: false 53 | use_episode_art: true 54 | 55 | ################################################ 56 | ## Sensor 57 | ################################################ 58 | 59 | sensor: 60 | - platform: plex 61 | name: plex_activity 62 | host: !secret plex_host 63 | port: !secret plex_port 64 | username: !secret plex_username 65 | password: !secret plex_password 66 | -------------------------------------------------------------------------------- /packages/recorder.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / Recorder 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'recorder' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## Recorder 26 | ################################################ 27 | 28 | recorder: 29 | purge_days: 14 30 | db_url: !secret recorder_db_url 31 | exclude: 32 | domains: 33 | - camera 34 | - media_player 35 | - sun 36 | entities: 37 | - sensor.kitchen_luminance 38 | - sensor.kitchen_moisture 39 | - sensor.master_bathroom_luminance 40 | - automation.persistence_enable_automations 41 | - automation.persistence_publish 42 | - automation.persistence_subscribe_binary 43 | - automation.persistence_subscribe_select_option 44 | - automation.persistence_subscribe_select_value 45 | - automation.startup_notification 46 | - sensor.date 47 | - sensor.ha_github_version 48 | - sensor.ha_pypi_version 49 | - sensor.ha_startup_time 50 | - sensor.ha_version 51 | - sensor.secrets 52 | - sensor.time 53 | - sensor.ups_status_date 54 | - sensor.ups_time_left 55 | -------------------------------------------------------------------------------- /packages/sabnzbd.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / SABnzbd 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'sabnzbd' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## Group 26 | ################################################ 27 | 28 | group.sabnzbd: 29 | <<: *customize 30 | friendly_name: "SABnzbd" 31 | icon: mdi:download 32 | 33 | ################################################ 34 | ## Sensor 35 | ################################################ 36 | 37 | sensor.sabnzbd_disk: 38 | <<: *customize 39 | friendly_name: "SABnzbd Disk" 40 | 41 | sensor.sabnzbd_disk_free: 42 | <<: *customize 43 | friendly_name: "SABnzbd Disk Free" 44 | 45 | sensor.sabnzbd_left: 46 | <<: *customize 47 | friendly_name: "SABnzbd Left" 48 | 49 | sensor.sabnzbd_queue: 50 | <<: *customize 51 | friendly_name: "SABnzbd Queue" 52 | 53 | sensor.sabnzbd_speed: 54 | <<: *customize 55 | friendly_name: "SABnzbd Speed" 56 | 57 | sensor.sabnzbd_status: 58 | <<: *customize 59 | friendly_name: "SABnzbd Status" 60 | 61 | ################################################ 62 | ## Group 63 | ################################################ 64 | 65 | group: 66 | sabnzbd: 67 | control: hidden 68 | entities: 69 | - sensor.sabnzbd_disk 70 | - sensor.sabnzbd_disk_free 71 | - sensor.sabnzbd_left 72 | - sensor.sabnzbd_queue 73 | - sensor.sabnzbd_speed 74 | - sensor.sabnzbd_status 75 | 76 | ################################################ 77 | ## Sensor 78 | ################################################ 79 | 80 | sensor: 81 | - platform: sabnzbd 82 | host: !secret sabnzbd_host 83 | api_key: !secret sabnzbd_api_key 84 | monitored_variables: 85 | - 'current_status' 86 | - 'speed' 87 | - 'queue_size' 88 | - 'queue_remaining' 89 | - 'disk_size' 90 | - 'disk_free' 91 | -------------------------------------------------------------------------------- /packages/speech.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / Speech 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'speech' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## Script 26 | ################################################ 27 | 28 | script.say: 29 | <<: *customize 30 | friendly_name: "Say" 31 | hidden: true 32 | icon: mdi:microphone 33 | 34 | ################################################ 35 | ## Script 36 | ################################################ 37 | 38 | script: 39 | say: 40 | sequence: 41 | - service_template: >- 42 | tts.{{ platform|default('amazon_polly') }}_say 43 | data_template: 44 | entity_id: >- 45 | {{ entity_id|default('media_player.dining_room_home') }} 46 | message: >- 47 | {{ message }} 48 | -------------------------------------------------------------------------------- /packages/sun.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / Sun 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'sun' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## Sun 26 | ################################################ 27 | 28 | sun.sun: 29 | <<: *customize 30 | friendly_name: "Sun" 31 | 32 | ################################################ 33 | ## Sun 34 | ################################################ 35 | 36 | sun: 37 | elevation: !secret home_elevation 38 | -------------------------------------------------------------------------------- /packages/switchmate.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / Switchmate 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'switchmate' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## Switch 26 | ################################################ 27 | 28 | switch.kitchen_overhead: 29 | <<: *expose 30 | friendly_name: "Kitchen Overhead" 31 | icon: mdi:lightbulb 32 | 33 | ################################################ 34 | ## Switch 35 | ################################################ 36 | 37 | switch: 38 | - platform: command_line 39 | switches: 40 | kitchen_overhead: 41 | command_on: >- 42 | python3 $HASS_CONFIG/shell_scripts/switchmate/switchmate.py $SM_KITCHEN_OVERHEAD $SM_KITCHEN_OVERHEAD_AUTH switch on > /dev/null 2>&1 43 | command_off: >- 44 | python3 $HASS_CONFIG/shell_scripts/switchmate/switchmate.py $SM_KITCHEN_OVERHEAD $SM_KITCHEN_OVERHEAD_AUTH switch off > /dev/null 2>&1 45 | command_state: >- 46 | python3 $HASS_CONFIG/shell_scripts/switchmate/switchmate.py status $SM_KITCHEN_OVERHEAD | grep on | wc -l 47 | value_template: >- 48 | {{ value == '1' }} 49 | -------------------------------------------------------------------------------- /packages/tts.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / TTS 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'tts' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## TTS 26 | ################################################ 27 | 28 | tts: 29 | - platform: google 30 | 31 | - platform: amazon_polly 32 | aws_access_key_id: !secret aws_access_key_id 33 | aws_secret_access_key: !secret aws_secret_access_key 34 | region_name: !secret aws_region_name 35 | voice: !secret aws_voice 36 | -------------------------------------------------------------------------------- /packages/usps.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / USPS 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'usps' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## Camera 26 | ################################################ 27 | 28 | camera.usps_mail: 29 | <<: *customize 30 | friendly_name: "USPS Mail" 31 | hidden: true 32 | 33 | ################################################ 34 | ## Group 35 | ################################################ 36 | 37 | group.usps_mail: 38 | <<: *customize 39 | friendly_name: "USPS Mail" 40 | icon: mdi:mailbox 41 | 42 | ################################################ 43 | ## Sensor 44 | ################################################ 45 | 46 | sensor.usps_mail: 47 | <<: *customize 48 | friendly_name: "USPS Mail" 49 | 50 | sensor.usps_packages: 51 | <<: *customize 52 | friendly_name: "USPS Packages" 53 | 54 | ################################################ 55 | ## Group 56 | ################################################ 57 | 58 | group: 59 | usps_mail: 60 | entities: 61 | - sensor.usps_mail 62 | - sensor.usps_packages 63 | 64 | ################################################ 65 | ## USPS 66 | ################################################ 67 | 68 | usps: 69 | username: !secret usps_username 70 | password: !secret usps_password 71 | -------------------------------------------------------------------------------- /packages/web_power_switch.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / Web Power Switch 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'web_power_switch' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## Group 26 | ################################################ 27 | 28 | group.web_power_switch: 29 | <<: *customize 30 | friendly_name: "Web Power Switch" 31 | icon: mdi:power-settings 32 | 33 | ################################################ 34 | ## Switch 35 | ################################################ 36 | 37 | switch.rack_cable_modem: 38 | <<: *customize 39 | friendly_name: "Cable Modem" 40 | icon: mdi:switch 41 | 42 | switch.rack_media_server: 43 | <<: *customize 44 | friendly_name: "Media Server" 45 | icon: mdi:filmstrip 46 | 47 | switch.rack_ikea_tradfri: 48 | <<: *customize 49 | friendly_name: "IKEA Tradfri" 50 | icon: mdi:lightbulb 51 | 52 | switch.rack_printer: 53 | <<: *customize 54 | friendly_name: "Printer" 55 | icon: mdi:printer 56 | 57 | switch.rack_projector: 58 | <<: *customize 59 | friendly_name: "Projector" 60 | icon: mdi:projector 61 | 62 | switch.rack_router: 63 | <<: *customize 64 | friendly_name: "Router" 65 | icon: mdi:router-wireless 66 | 67 | switch.rack_usb_panel: 68 | <<: *customize 69 | friendly_name: "USB Panel" 70 | icon: mdi:usb 71 | 72 | switch.rack_yamaha_avr: 73 | <<: *customize 74 | friendly_name: "Yamaha AVR" 75 | icon: mdi:music-box 76 | 77 | ################################################ 78 | ## Group 79 | ################################################ 80 | 81 | group: 82 | web_power_switch: 83 | control: hidden 84 | entities: 85 | - switch.rack_cable_modem 86 | - switch.rack_media_server 87 | - switch.rack_ikea_tradfri 88 | - switch.rack_printer 89 | - switch.rack_projector 90 | - switch.rack_router 91 | - switch.rack_usb_panel 92 | - switch.rack_yamaha_avr 93 | 94 | ################################################ 95 | ## Switch 96 | ################################################ 97 | 98 | switch: 99 | - platform: digitalloggers 100 | name: rack 101 | host: !secret digitalloggers_host 102 | username: !secret digitalloggers_username 103 | password: !secret digitalloggers_password 104 | -------------------------------------------------------------------------------- /packages/windy.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / Windy 3 | ################################################################ 4 | 5 | panel_iframe: 6 | windy: 7 | title: 'Windy' 8 | url: !secret panel_windy_url 9 | icon: mdi:weather-windy 10 | -------------------------------------------------------------------------------- /packages/xbox_live.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / Xbox Live 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'xbox_live' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## Sensor 26 | ################################################ 27 | 28 | sensor.gremlinjku: 29 | <<: *customize 30 | friendly_name: "GremlinJKU" 31 | 32 | ################################################ 33 | ## Sensor 34 | ################################################ 35 | 36 | sensor: 37 | - platform: xbox_live 38 | api_key: !secret xbox_live_api_key 39 | xuid: 40 | - !secret xbox_live_xuid 41 | -------------------------------------------------------------------------------- /packages/zones.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Packages / Zones 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Customize 7 | ################################################ 8 | 9 | homeassistant: 10 | customize: 11 | ################################################ 12 | ## Node Anchors 13 | ################################################ 14 | 15 | package.node_anchors: 16 | customize: &customize 17 | package: 'zones' 18 | 19 | expose: &expose 20 | <<: *customize 21 | haaska_hidden: false 22 | homebridge_hidden: false 23 | 24 | ################################################ 25 | ## Zone 26 | ################################################ 27 | 28 | zone.home: 29 | <<: *customize 30 | friendly_name: "Home" 31 | 32 | zone.office: 33 | <<: *customize 34 | friendly_name: "Office" 35 | icon: mdi:city 36 | 37 | zone.parents: 38 | <<: *customize 39 | friendly_name: "Parents" 40 | icon: mdi:cow 41 | 42 | ################################################ 43 | ## Zone 44 | ################################################ 45 | 46 | zone: 47 | - name: office 48 | latitude: !secret office_latitude 49 | longitude: !secret office_longitude 50 | 51 | - name: parents 52 | latitude: !secret parents_latitude 53 | longitude: !secret parents_longitude 54 | -------------------------------------------------------------------------------- /phrases/bedtime_story.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Go The Fuck To Sleep 3 | ## https://gist.github.com/lance/967267 4 | ################################################################ 5 | 6 | > 7 | The cats nestle close to their kittens now. 8 | The lambs have laid down with the sheep. 9 | You're cozy and warm in your bed, my dear. 10 | Please go the fuck to sleep. 11 | 12 | The windows are dark in the town, child. 13 | The whales huddle down in the deep. 14 | I'll read you one very last book if you swear 15 | You'll go the fuck to sleep. 16 | 17 | The eagles who soar through the sky are at rest 18 | And the creatures who crawl, run, and creep. 19 | I know you're not thirsty. That's bullshit. Stop lying. 20 | Lie the fuck down, my darling, and sleep. 21 | 22 | The wind whispers soft through the grass, hon. 23 | The field mice, they make not a peep. 24 | It's been thirty-eight minutes already. 25 | Jesus Christ, what the fuck? Go to sleep. 26 | 27 | All the kids from day care are in dreamland. 28 | The froggie has made his last leap. 29 | Hell no, you can't go to the bathroom. 30 | You know where you can go? The fuck to sleep. 31 | 32 | The owls fly forth from the treetops. 33 | Through the air, they soar and they sweep. 34 | A hot crimson rage fills my heart, love. 35 | For real, shut the fuck up and sleep. 36 | 37 | The cubs and the lions are snoring, 38 | Wrapped in a big snuggly heap. 39 | How is it you can do all this other great shit 40 | But you can't lie the fuck down and sleep? 41 | 42 | The seeds slumber beneath the earth now 43 | And the crops that the farmers will reap. 44 | No more questions. This interview's over. 45 | I've got two words for you, kid: fucking sleep. 46 | 47 | The tiger reclines in the simmering jungle. 48 | The sparrow has silenced her cheep. 49 | Fuck your stuffed bear, I'm not getting you shit. 50 | Close your eyes. Cut the crap. Sleep. 51 | 52 | The flowers doze low in the meadows 53 | And high on the mountains so steep. 54 | My life is a failure, I'm a shitty-ass parent. 55 | Stop fucking with me, please, and sleep. 56 | 57 | The giant pangolins of Madagascar are snoozing. 58 | As I lie here and openly weep. 59 | Sure, fine, whatever, I'll bring you some milk. 60 | Who the fuck cares? You're not gonna sleep. 61 | 62 | This room is all I can remember. 63 | The furniture crappy and cheap. 64 | You win. You escape. You run down the hall. 65 | As I nod the fuck off, and sleep. 66 | 67 | Bleary and dazed I awaken 68 | To find your eyes shut, so I keep 69 | My fingers crossed tight as I tiptoe away 70 | And pray that you're fucking asleep. 71 | 72 | We're finally watching our movie. 73 | Popcorn's in the microwave. Beep. 74 | Oh shit. Goddamn it. You've gotta be kidding. 75 | Come on, go the fuck back to sleep. 76 | -------------------------------------------------------------------------------- /phrases/good_night.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Random Good Night Phrases 3 | ################################################################ 4 | 5 | > 6 | {{ [ 7 | "I hope you have sweet dreams.", 8 | "Good night and sweet dreams.", 9 | "Get some rest, you'll need it to be superman tomorrow." 10 | ]|random }} 11 | -------------------------------------------------------------------------------- /python_scripts/hello_world.py: -------------------------------------------------------------------------------- 1 | name = data.get('name', 'world') 2 | logger.info("Hello {}".format(name)) 3 | hass.bus.fire(name, { "wow": "from a Python script!" }) 4 | -------------------------------------------------------------------------------- /secrets.sample.env: -------------------------------------------------------------------------------- 1 | HASS_CONFIG=/home/homeassistant/.homeassistant 2 | VIRTUAL_ENV=/srv/homeassistant 3 | 4 | EVENTGHOST_URL=http://XXX.XXX.XXX.XXX:XXXX/ 5 | 6 | SM_KITCHEN_OVERHEAD=XX:XX:XX:XX:XX:XX 7 | SM_KITCHEN_OVERHEAD_AUTH=XXXXXXXX 8 | -------------------------------------------------------------------------------- /shell_scripts/backup_config.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | CONFIG_DIR=/etc/homeassistant 4 | BACKUP_FILE=/srv/homeassistant/backup/homeassistant_$(date +"%Y%m%d_%H%M").zip 5 | 6 | pushd $CONFIG_DIR >/dev/null 7 | zip -9 -q -r $BACKUP_FILE . -x"components/*" -x"deps/*" -x"home-assistant.db" -x"home-assistant_v2.db" -x"home-assistant.log" 8 | popd >/dev/null 9 | 10 | echo Backup complete: $BACKUP_FILE 11 | -------------------------------------------------------------------------------- /shell_scripts/gitupdate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Check Home Assistant config and push changes to git repo 4 | # ======================================================== 5 | # License: MIT 6 | # Author: Dale Higgs <@dale3h> 7 | # Original Author: Carlo Costanzo <@CCOSTAN> 8 | # 9 | # Usage: 10 | # HASS_USER=hass \ 11 | # HASS_CONFIG=/home/hass/.homeassistant \ 12 | # HASS_VENV=/srv/hass/hass_venv \ 13 | # ./gitupdate.sh 14 | 15 | # These variables can be overridden by environment variables 16 | HASS_USER=${HASS_USER:-homeassistant} 17 | HASS_CONFIG=${HASS_CONFIG:-/home/homeassistant/.homeassistant} 18 | HASS_VENV=${HASS_VENV:-${VIRTUAL_ENV:-/srv/homeassistant}} 19 | 20 | check_config() { 21 | # Initialize an empty variable 22 | CHECK_CMD= 23 | 24 | if [[ "$ACTIVATE_VENV" == "1" ]]; then 25 | # Activate venv command 26 | CHECK_CMD="source $HASS_VENV/bin/activate; " 27 | fi 28 | 29 | # Config check command 30 | CHECK_CMD="${CHECK_CMD}hass --script check_config -c $HASS_CONFIG" 31 | 32 | if [[ "$(whoami)" != "$HASS_USER" ]]; then 33 | # Run as Home Assistant user 34 | CHECK_OUTPUT=$(echo "$CHECK_CMD" | sudo -u $HASS_USER -H /bin/bash -) 35 | else 36 | # Run as current user 37 | CHECK_OUTPUT=$($CHECK_CMD) 38 | fi 39 | 40 | # Return an error code if any failures are present 41 | [[ ! "$CHECK_OUTPUT" =~ "Failed config" ]] && 42 | [[ ! "$CHECK_OUTPUT" =~ "Config does not exist" ]] && 43 | [[ ! "$CHECK_OUTPUT" =~ "Invalid config" ]] 44 | } 45 | 46 | # Check to see if we are already inside of the venv 47 | if [[ ! -z "$VIRTUAL_ENV" ]]; then 48 | ACTIVATE_VENV=0 49 | else 50 | # Check to see if the venv directory exists 51 | [[ ! -d "$HASS_VENV" ]] 52 | ACTIVATE_VENV=$? 53 | fi 54 | 55 | # Run the config check function 56 | check_config 57 | 58 | # If the config check failed, show the output and exit 59 | if [[ "$?" != "0" ]]; then 60 | echo "$CHECK_OUTPUT" 61 | exit 1 62 | fi 63 | 64 | # Change to config directory 65 | pushd $HASS_CONFIG >/dev/null 66 | 67 | # Add all files to repo 68 | git add . 69 | 70 | # Show current status (after add) 71 | git status 72 | 73 | if [[ ! -z "$1" ]]; then 74 | # Take commit message from command line argument 75 | COMMIT_MSG="$1" 76 | else 77 | # Prompt user for commit message 78 | echo -n "Enter a commit message: " 79 | read COMMIT_MSG 80 | fi 81 | 82 | # Commit files to repo 83 | git commit -m "${COMMIT_MSG}" 84 | 85 | # Push changes to origin 86 | git push origin master 87 | 88 | # Take the user back to their previous directory 89 | popd >/dev/null 90 | 91 | # Exit with no error code 92 | exit 0 93 | -------------------------------------------------------------------------------- /shell_scripts/pm2ctl.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Change these to suit your needs 4 | PM2=/usr/bin/pm2 5 | PM2_USER=pi 6 | PM2_COMMANDS="start|stop|restart" 7 | PM2_APPS="homebridge|dasher|smartthings-mqtt-bridge" 8 | 9 | # Check for root privs 10 | if [[ $UID != 0 ]]; then 11 | echo "Please run this script with sudo:" 12 | echo " sudo $0 $*" 13 | exit 1 14 | fi 15 | 16 | # Function to show usage 17 | usage() { 18 | echo "usage: $(basename $0) setup" 2>&1 19 | echo "usage: $(basename $0) {$PM2_COMMANDS} {$PM2_APPS}" 2>&1 20 | exit 1 21 | } 22 | 23 | # Show usage if no arguments given 24 | if [[ $# -lt 1 ]]; then 25 | usage 26 | fi 27 | 28 | # Use extended globbing 29 | shopt -s extglob 30 | 31 | # Check for valid argument(s) 32 | case "$1" in 33 | @($PM2_COMMANDS)) 34 | case "$2" in 35 | @($PM2_APPS)) 36 | su $PM2_USER -c "$PM2 $1 $2" 37 | ;; 38 | *) 39 | usage 40 | ;; 41 | esac 42 | ;; 43 | 44 | setup) 45 | SUDOERS_LINE="homeassistant ALL=(ALL) NOPASSWD: $(realpath $0)" 46 | 47 | if grep -xq "$SUDOERS_LINE" /etc/sudoers; then 48 | echo "This script already appears to have proper privileges." 49 | exit 0 50 | fi 51 | 52 | echo "Please run 'sudo visudo' and add the following line at the bottom:" 53 | echo "$SUDOERS_LINE" 54 | 55 | exit 1 56 | ;; 57 | 58 | # If no valid arguments found, show usage 59 | *) 60 | usage 61 | ;; 62 | esac 63 | -------------------------------------------------------------------------------- /shell_scripts/switchmate.py: -------------------------------------------------------------------------------- 1 | /srv/homeassistant/src/switchmate/switchmate.py -------------------------------------------------------------------------------- /shell_scripts/update_hass.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Path variables 4 | HASS_SERVICE=${HASS_SERVICE:-home-assistant.service} 5 | HASS_CONFIG=${HASS_CONFIG:-/etc/homeassistant} 6 | VIRTUAL_ENV=${VIRTUAL_ENV:-/srv/homeassistant} 7 | 8 | # This is for log purposes 9 | echo 10 | echo "[$(date)] Update script starting" 11 | 12 | # Show package information 13 | $VIRTUAL_ENV/bin/pip3 search homeassistant 14 | 15 | # Run the backup script 16 | $HASS_CONFIG/shell_scripts/backup_config.sh 17 | 18 | # Upgrade Home Assistant 19 | $VIRTUAL_ENV/bin/pip3 install --upgrade homeassistant 20 | 21 | # Restart Home Assistant 22 | # This requires a modification using `sudo visudo`: 23 | # homeassistant ALL=(ALL) NOPASSWD: /bin/systemctl restart home-assistant.service 24 | # Make sure to change `home-assistant.service` to the correct service name 25 | sudo systemctl restart "$HASS_SERVICE" 26 | -------------------------------------------------------------------------------- /themes/dark-orange.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Themes / Dark Orange 3 | ## 4 | ## Author: @ludeeus 5 | ## Original: https://github.com/ludeeus/hass-config/blob/Configuration/packages/frontend_themes.yaml 6 | ################################################################ 7 | 8 | font-size: '4px' 9 | disabled-text-color: 'rgba(255, 255, 255, 0.5)' 10 | divider-color: 'rgba(255, 255, 255, 0.12)' 11 | paper-card-background-color: '#424242' 12 | paper-card-header-color: '#ffffff' 13 | paper-grey-200: '#616161' 14 | paper-item-icon-color: '#ffa500' 15 | paper-listbox-background-color: '#424242' 16 | paper-listbox-color: '#ffffff' 17 | paper-slider-active-color: '#ffa500' 18 | paper-slider-knob-color: '#ffa500' 19 | paper-slider-knob-start-color: '#ffa500' 20 | paper-slider-pin-color: '#ffa500' 21 | paper-slider-secondary-color: '#33f2d8' 22 | paper-toggle-button-checked-bar-color: '#ffa500' 23 | paper-toggle-button-checked-button-color: '#ffa500' 24 | paper-toggle-button-checked-ink-color: '#ffa500' 25 | primary-background-color: '#303030' 26 | primary-color: '#ffa500' 27 | primary-text-color: '#ffffff' 28 | secondary-background-color: '#303030' 29 | secondary-text-color: 'rgba(255, 255, 255, 0.7)' 30 | -------------------------------------------------------------------------------- /themes/pink.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Themes / Pink 3 | ## 4 | ## Author: @ludeeus 5 | ## Original: https://github.com/ludeeus/hass-config/blob/Configuration/packages/frontend_themes.yaml 6 | ################################################################ 7 | 8 | primary-color: pink 9 | -------------------------------------------------------------------------------- /wizard/mosquitto-wizard.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Install by running: 4 | # wget -Nnv https://raw.githubusercontent.com/dale3h/homeassistant-config/master/wizard/mosquitto-wizard.sh && sudo bash mosquitto-wizard.sh 5 | 6 | echo "Mosquitto Quick Installer for Raspberry Pi" 7 | echo "Copyright(c) 2016 Dale Higgs " 8 | echo 9 | 10 | echo "Adding mosquitto user" 11 | useradd mosquitto 12 | 13 | echo "Creating pid file" 14 | touch /var/run/mosquitto.pid 15 | chown mosquitto:mosquitto /var/run/mosquitto.pid 16 | 17 | echo "Creating data directory" 18 | mkdir -p /var/lib/mosquitto 19 | chown mosquitto:mosquitto /var/lib/mosquitto 20 | 21 | echo "Installing repo key" 22 | cd /srv/hass/src 23 | wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key 24 | apt-key add mosquitto-repo.gpg.key 25 | 26 | echo "Adding repo" 27 | cd /etc/apt/sources.list.d 28 | wget http://repo.mosquitto.org/debian/mosquitto-jessie.list 29 | 30 | echo "Installing mosquitto" 31 | apt-get update 32 | apt-cache search mosquitto 33 | apt-get install -y mosquitto mosquitto-clients 34 | 35 | echo "Writing default configuration" 36 | cd /etc/mosquitto 37 | mv mosquitto.conf mosquitto.conf.backup 38 | wget https://raw.githubusercontent.com/dale3h/homeassistant-config/master/wizard/assets/mosquitto.conf.asset 39 | mv mosquitto.conf.asset mosquitto.conf 40 | chown mosquitto:mosquitto mosquitto.conf 41 | 42 | echo "Initializing password file" 43 | touch passwd 44 | chown mosquitto:mosquitto passwd 45 | chmod 0600 passwd 46 | 47 | echo 48 | echo "Please take a moment to setup your first MQTT user" 49 | echo 50 | 51 | echo -n "Username: " 52 | read mqtt_username 53 | if [ ! "$mqtt_username" ]; then 54 | mqtt_username=pi 55 | fi 56 | 57 | echo -n "Password: " 58 | read -s mqtt_password 59 | echo 60 | if [ ! "$mqtt_password" ]; then 61 | mqtt_password=raspberry 62 | fi 63 | 64 | echo "Creating password entry for user $mqtt_username" 65 | mosquitto_passwd -b passwd "$mqtt_username" "$mqtt_password" 66 | 67 | echo "Restarting mosquitto service" 68 | systemctl restart mosquitto.service 69 | 70 | ip_address=$(ifconfig | awk -F':' '/inet addr/&&!/127.0.0.1/{split($2,_," ");print _[1]}') 71 | 72 | echo 73 | echo "Done!" 74 | echo 75 | echo "Your MQTT broker is running at $ip_address:1883" 76 | echo 77 | echo "If you have issues with this script, please contact @dale3h on gitter.im" 78 | echo 79 | -------------------------------------------------------------------------------- /wizard/openresty-wizard.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | VERSION="1.11.2.2" 4 | 5 | apt-get update && \ 6 | apt-get install -y unzip \ 7 | ca-certificates \ 8 | build-essential \ 9 | vim-tiny \ 10 | curl \ 11 | telnet \ 12 | libreadline-dev \ 13 | libncurses5-dev \ 14 | libpcre3-dev \ 15 | libssl-dev \ 16 | luarocks \ 17 | libgeoip-dev \ 18 | nano \ 19 | perl \ 20 | wget \ 21 | make 22 | 23 | wget https://openresty.org/download/openresty-$VERSION.tar.gz && \ 24 | tar -xzvf openresty-*.tar.gz && \ 25 | rm -f openresty-*.tar.gz && \ 26 | cd openresty-* && \ 27 | sed -ie 's/DEFAULT_ENCODE_EMPTY_TABLE_AS_OBJECT 1/DEFAULT_ENCODE_EMPTY_TABLE_AS_OBJECT 0/g' bundle/lua-cjson-*/lua_cjson.c && \ 28 | ./configure \ 29 | --with-luajit \ 30 | --with-pcre-jit \ 31 | --sbin-path=/usr/sbin/nginx \ 32 | --conf-path=/etc/nginx/nginx.conf \ 33 | --error-log-path=/var/log/nginx/error.log \ 34 | --http-client-body-temp-path=/var/lib/nginx/body \ 35 | --http-fastcgi-temp-path=/var/lib/nginx/fastcgi \ 36 | --http-log-path=/var/log/nginx/access.log \ 37 | --http-proxy-temp-path=/var/lib/nginx/proxy \ 38 | --http-scgi-temp-path=/var/lib/nginx/scgi \ 39 | --http-uwsgi-temp-path=/var/lib/nginx/uwsgi \ 40 | --lock-path=/var/lock/nginx.lock \ 41 | --pid-path=/run/nginx.pid \ 42 | --with-http_gzip_static_module \ 43 | --with-http_stub_status_module \ 44 | --with-http_geoip_module \ 45 | --with-http_ssl_module \ 46 | --with-http_sub_module \ 47 | --with-ipv6 \ 48 | --with-mail \ 49 | --with-mail_ssl_module \ 50 | --with-http_secure_link_module \ 51 | --with-http_v2_module \ 52 | --with-http_auth_request_module \ 53 | -j2 54 | make && \ 55 | make install && \ 56 | make clean && \ 57 | cd .. && \ 58 | rm -rf openresty-* && \ 59 | ldconfig 60 | 61 | wget https://github.com/pintsized/lua-resty-http/archive/master.zip && \ 62 | unzip master.zip && \ 63 | cp lua-resty-http-master/lib/resty/*.lua /usr/local/openresty/lualib/resty/ && \ 64 | rm -rf master.zip lua-resty-http-master 65 | -------------------------------------------------------------------------------- /wizard/openzwave-hassbian.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Install by running: 4 | # wget -Nnv https://raw.githubusercontent.com/dale3h/homeassistant-config/master/wizard/openzwave-hassbian.sh && sudo bash openzwave-hassbian.sh 5 | 6 | echo "Open Z-Wave Installer for Hassbian" 7 | echo "Copyright(c) 2016 Dale Higgs " 8 | echo 9 | 10 | echo "Running apt-get preparation" 11 | apt-get update 12 | apt-get upgrade -y 13 | apt-get install -y git make 14 | 15 | echo "Installing latest version of cython" 16 | pip3 install --upgrade cython 17 | 18 | echo "Creating source directory" 19 | mkdir -p /srv/homeassistant/src 20 | chown -R homeassistant:homeassistant /srv/homeassistant/src 21 | 22 | echo "Cloning python-openzwave" 23 | cd /srv/homeassistant/src 24 | git clone --branch v0.3.1 https://github.com/OpenZWave/python-openzwave.git 25 | 26 | echo "Building python-openzwave" 27 | chown homeassistant:homeassistant python-openzwave 28 | cd python-openzwave 29 | git checkout python3 30 | make build 31 | make install 32 | 33 | echo "Creating libmicrohttpd directory" 34 | cd /srv/homeassistant/src 35 | mkdir libmicrohttpd 36 | chown homeassistant:homeassistant libmicrohttpd 37 | 38 | echo "Downloading libmicrohttpd-0.9.19" 39 | wget ftp://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.19.tar.gz 40 | chown homeassistant:homeassistant libmicrohttpd-0.9.19.tar.gz 41 | tar zxvf libmicrohttpd-0.9.19.tar.gz 42 | chown homeassistant:homeassistant libmicrohttpd-0.9.19 43 | 44 | echo "Building libmicrohttpd-0.9.19" 45 | cd libmicrohttpd-0.9.19 46 | ./configure 47 | make 48 | make install 49 | 50 | echo "Cloning open-zwave-control-panel" 51 | cd /srv/homeassistant/src 52 | git clone https://github.com/OpenZWave/open-zwave-control-panel.git 53 | chown -R homeassistant:homeassistant open-zwave-control-panel 54 | 55 | echo "Building open-zwave-control-panel" 56 | cd open-zwave-control-panel 57 | wget https://raw.githubusercontent.com/home-assistant/fabric-home-assistant/master/Makefile 58 | chown homeassistant:homeassistant Makefile 59 | make 60 | 61 | echo "Linking ozwcp config directory" 62 | ln -sd /srv/homeassistant/lib/python3.*/site-packages/libopenzwave-0.3.1-*-linux*.egg/config 63 | chown -R homeassistant:homeassistant /srv/homeassistant/src 64 | 65 | echo 66 | echo "Done!" 67 | echo 68 | echo "If you have issues with this script, please contact @dale3h on gitter.im" 69 | echo 70 | -------------------------------------------------------------------------------- /wizard/openzwave-wizard.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | sudo su -s /bin/bash hass 4 | source /srv/hass/hass_venv/bin/activate 5 | 6 | pip3 install --upgrade cython 7 | 8 | cd /srv/hass/src 9 | git clone --branch v0.3.1 https://github.com/OpenZWave/python-openzwave.git 10 | cd python-openzwave 11 | git checkout python3 12 | make build 13 | make install 14 | 15 | # Might need to deactivate the virtualenv at this point 16 | deactivate 17 | 18 | cd /srv/hass/src 19 | sudo mkdir libmicrohttpd 20 | sudo chown hass:hass libmicrohttpd 21 | sudo wget ftp://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.19.tar.gz 22 | sudo chown hass:hass libmicrohttpd-0.9.19.tar.gz 23 | sudo tar zxvf libmicrohttpd-0.9.19.tar.gz 24 | 25 | cd libmicrohttpd-0.9.19 26 | sudo ./configure 27 | sudo make 28 | sudo make install 29 | 30 | cd /srv/hass/src 31 | sudo git clone https://github.com/OpenZWave/open-zwave-control-panel.git 32 | sudo chown -R hass:hass open-zwave-control-panel 33 | 34 | cd open-zwave-control-panel 35 | sudo wget https://raw.githubusercontent.com/home-assistant/fabric-home-assistant/master/Makefile 36 | sudo chown hass:hass -R Makefile 37 | sudo make 38 | sudo ln -sd /srv/hass/hass_venv/lib/python3.*/site-packages/libopenzwave-0.3.1-*-linux*.egg/config 39 | sudo chown -R hass:hass /srv/hass/src/open-zwave-control-panel 40 | -------------------------------------------------------------------------------- /wizard/perm-wizard.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Install by running: 4 | # wget -Nnv https://raw.githubusercontent.com/dale3h/homeassistant-config/master/wizard/perm-wizard.sh && sudo bash perm-wizard.sh 5 | 6 | echo "Home Assistant Config Permissions Wizard" 7 | echo "Copyright(c) 2017 Dale Higgs <@dale3h>" 8 | echo 9 | 10 | if [[ $UID != 0 ]]; then 11 | echo "Please run this script with sudo:" 12 | echo " sudo $0 $*" 13 | exit 1 14 | fi 15 | 16 | HASS_CONFIG="${HASS_CONFIG:-/home/homeassistant/.homeassistant}" 17 | HASS_USER="${HASS_USER:-homeassistant}" 18 | HASS_GROUP="${HASS_GROUP:-$HASS_USER}" 19 | 20 | read -e -i "$HASS_CONFIG" -p "Enter your Home Assistant config directory: " HASS_CONFIG 21 | if [[ ! -d "$HASS_CONFIG" ]]; then 22 | echo "$HASS_CONFIG: no such directory" 23 | exit 1 24 | fi 25 | 26 | read -e -i "$HASS_USER" -p "Enter your Home Assistant user: " HASS_USER 27 | if [[ $(id -u "$HASS_USER" 2>&1 >/dev/null) ]]; then 28 | echo "$HASS_USER: no such user" 29 | exit 1 30 | fi 31 | 32 | read -e -i "$HASS_GROUP" -p "Enter your Home Assistant group: " HASS_GROUP 33 | if [[ ! $(getent group $HASS_GROUP) ]]; then 34 | echo "$HASS_GROUP: no such group" 35 | exit 1 36 | fi 37 | 38 | ME="$(/usr/bin/logname)" 39 | 40 | echo 41 | echo "Adding user to '$HASS_GROUP' group" 42 | usermod -a -G $HASS_GROUP $ME 43 | 44 | echo "Setting group to '$HASS_GROUP'" 45 | chown -R $HASS_USER:$HASS_GROUP "$HASS_CONFIG" 46 | 47 | echo "Adding sticky bit" 48 | find "$HASS_CONFIG" -type d -exec chmod g+s {} \; 49 | 50 | echo "Removing public permissions" 51 | chmod -R o-rwx "$HASS_CONFIG" 52 | 53 | echo "Setting file permissions" 54 | find "$HASS_CONFIG" -type f -exec chmod 660 {} \; 55 | 56 | echo "Setting directory permissions" 57 | find "$HASS_CONFIG" -type d -exec chmod 770 {} \; 58 | 59 | echo "Setting default facl mask" 60 | setfacl -R -d -m u::rwx "$HASS_CONFIG" 61 | setfacl -R -d -m g::rwx "$HASS_CONFIG" 62 | setfacl -R -d -m o::000 "$HASS_CONFIG" 63 | 64 | echo 65 | echo "Done!" 66 | echo 67 | echo "If you have issues with this script, please contact @dale3h on gitter.im" 68 | -------------------------------------------------------------------------------- /wizard/pm2-wizard.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Install by running: 4 | # wget -Nnv https://raw.githubusercontent.com/dale3h/homeassistant-config/master/wizard/pm2-wizard.sh && bash pm2-wizard.sh 5 | 6 | me=$(whoami) 7 | 8 | USER_HOME=/home/$me 9 | 10 | echo "Node+PM2 Quick Installer" 11 | echo "Copyright(c) 2016 Dale Higgs " 12 | echo 13 | 14 | echo "Running apt-get preparation" 15 | sudo apt-get update 16 | sudo apt-get upgrade 17 | 18 | echo "Installing Node.js 6.x" 19 | curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - 20 | sudo apt-get install -y nodejs 21 | 22 | echo "Installing PM2 process manager" 23 | sudo npm install -g pm2 24 | sudo su -c "env PATH=$PATH:/usr/local/bin pm2 startup systemd -u $me --hp $USER_HOME" 25 | 26 | node_version=$(node --version) 27 | npm_version=$(npm --version) 28 | pm2_version=$(pm2 --version) 29 | 30 | echo 31 | echo "node version: $node_version" 32 | echo "npm version: $npm_version" 33 | echo "pm2 version: $pm2_version" 34 | 35 | echo 36 | echo "Troubleshooting:" 37 | echo 38 | echo "* To view pm2 logs: pm2 logs app-name" 39 | echo "* To stop a pm2 process: pm2 stop app-name" 40 | echo "* To start a pm2 process: pm2 start app-name" 41 | echo "* To restart a pm2 process: pm2 restart app-name" 42 | echo "* To monitor pm2 processes: pm2 monit" 43 | echo 44 | echo "If you have issues with this script, please contact @dale3h on gitter.im" 45 | echo 46 | -------------------------------------------------------------------------------- /wizard/venv-alias.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Install by running: 4 | # curl -sL https://raw.githubusercontent.com/dale3h/homeassistant-config/master/wizard/venv-alias.sh | bash - 5 | # 6 | # You can also set the Home Assistant username and virtualenv path using: 7 | # curl -sL https://raw.githubusercontent.com/dale3h/homeassistant-config/master/wizard/venv-alias.sh | \ 8 | # HASS_USER=hass \ 9 | # VIRTUAL_ENV=/srv/hass/hass_venv \ 10 | # bash - 11 | 12 | 13 | HASS_USER=${HASS_USER:-homeassistant} 14 | VIRTUAL_ENV=${VIRTUAL_ENV:-/srv/homeassistant} 15 | 16 | ALIAS_FILE=$HOME/.bash_aliases 17 | PROFILE_FILE=/home/$HASS_USER/.profile 18 | 19 | add_venv_alias() { 20 | printf "\nalias venv='sudo su -s /bin/bash - $HASS_USER'\n" >> $ALIAS_FILE 21 | 22 | sudo -u $HASS_USER -i /bin/bash <> $PROFILE_FILE 24 | EOF 25 | 26 | source $ALIAS_FILE 27 | } 28 | 29 | add_venv_alias 30 | -------------------------------------------------------------------------------- /zwave_device_config.yaml: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | ## Z-Wave / Device Config 3 | ################################################################ 4 | 5 | ################################################ 6 | ## Front Door Lock 7 | ################################################ 8 | 9 | sensor.front_door_alarm_level_2: 10 | ignored: true 11 | 12 | sensor.front_door_alarm_type_2: 13 | ignored: true 14 | 15 | ################################################ 16 | ## Front Door Sensor 17 | ################################################ 18 | 19 | sensor.front_door_access_control: 20 | ignored: true 21 | 22 | sensor.front_door_alarm_level: 23 | ignored: true 24 | 25 | sensor.front_door_alarm_type: 26 | ignored: true 27 | 28 | sensor.front_door_burglar: 29 | ignored: true 30 | 31 | sensor.front_door_sourcenodeid: 32 | ignored: true 33 | 34 | ################################################ 35 | ## Kitchen Motion Sensor 36 | ################################################ 37 | 38 | sensor.kitchen_alarm_level: 39 | ignored: true 40 | 41 | sensor.kitchen_alarm_type: 42 | ignored: true 43 | 44 | sensor.kitchen_burglar: 45 | ignored: true 46 | 47 | sensor.kitchen_dew_point: 48 | ignored: true 49 | 50 | sensor.kitchen_general: 51 | ignored: true 52 | 53 | sensor.kitchen_moisture: 54 | ignored: true 55 | 56 | sensor.kitchen_power: 57 | ignored: true 58 | 59 | sensor.kitchen_seismic_magnitude: 60 | ignored: true 61 | 62 | sensor.kitchen_sourcenodeid: 63 | ignored: true 64 | 65 | sensor.kitchen_tank_capacity: 66 | ignored: true 67 | 68 | sensor.kitchen_ultraviolet: 69 | ignored: true 70 | 71 | ################################################ 72 | ## Master Bathroom Motion Sensor 73 | ################################################ 74 | 75 | sensor.master_bathroom_alarm_level: 76 | ignored: true 77 | 78 | sensor.master_bathroom_alarm_type: 79 | ignored: true 80 | 81 | sensor.master_bathroom_burglar: 82 | ignored: true 83 | 84 | sensor.master_bathroom_dew_point: 85 | ignored: true 86 | 87 | sensor.master_bathroom_general: 88 | ignored: true 89 | 90 | sensor.master_bathroom_moisture: 91 | ignored: true 92 | 93 | sensor.master_bathroom_power: 94 | ignored: true 95 | 96 | sensor.master_bathroom_seismic_magnitude: 97 | ignored: true 98 | 99 | sensor.master_bathroom_sourcenodeid: 100 | ignored: true 101 | 102 | sensor.master_bathroom_tank_capacity: 103 | ignored: true 104 | 105 | sensor.master_bathroom_ultraviolet: 106 | ignored: true 107 | --------------------------------------------------------------------------------