Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

xiaomi_aqara:
gateways:
- host: 192.168.X.X
mac: xxxxxxxxxxxx
key: xxxxxxxxxxxxxxxx
@smarthomehobby
smarthomehobby / Demo Component
Created January 12, 2020 10:33
Demo Component
light:
- platform: demo
sunrise:
alias: Sunrise Lamp Script
sequence:
- service: homeassistant.turn_on
entity_id: light.bedroom_lamp
data:
transition: 1
brightness_pct: 1
- delay: 00:00:30
- service: homeassistant.turn_on
#Add to automations.yaml
- id: water_leak_sensor
alias: Water Leak Sensor
initial_state: 'on'
trigger:
platform: state
entity_id: binary_sensor.water_leak_sensor_158d0001bb656c
from: 'off'
to: 'on'
################################################################################
## Double Key Wireless Switch Automations, Scripts, and Bedtime Script Setup
################################################################################
#Put this in configuration.yaml
input_number:
bedtime_trigger:
name: Bedtime Trigger
min: 0
max: 3
################################################
## Gen 2 Button Automations & Scripts
################################################
- id: doorbell
alias: Doorbell
initial_state: 'on'
trigger:
- platform: event
event_type: click
################################################
## Gen 1 Button Automations
################################################
This goes in automations.yaml
- id: bedside_button_single
alias: Bedside Button Single Click
initial_state: 'on'
trigger:
- platform: event
Add to configuration.yaml
history_graph:
temp_compare:
name: Temp Comparison
entities:
- sensor.living_room_temperature
- sensor.temperature_158d0001fa88a5
- sensor.temperature_158d0001f520bf
refresh: 60
# In the configuration.yaml file, use the input_select component
input_select:
front_door_alarm:
name: Front Door Alarm
options:
- "Unarmed"
- "Armed: Silent"
- "Armed"
- "Armed: Alarm and Notification"
# Both of these are scripts and go in scripts.yaml
leave:
alias: Leave
sequence:
- service: homeassistant.turn_off
entity_id:
- switch.tv
- switch.air_conditioner
- wait_template: "{{is_state('binary_sensor.door_window_sensor_158d0001ab56bd', 'on')}}"