Skip to content

Instantly share code, notes, and snippets.

@LarsBergqvist
LarsBergqvist / LightItem.js
Created November 26, 2017 13:35
A React component with a toggle and a slider for controlling a Philips Hue light
import React from 'react';
import Toggle from 'material-ui/Toggle';
import Slider from 'material-ui/Slider';
const LightItem = (props) => (
<div className='items'>
<div className='item toggle'>
<Toggle
toggled={props.isOn}
label={props.name}
@LarsBergqvist
LarsBergqvist / LightsView.js
Created November 26, 2017 13:31
A React component for rendering a set of LightItem components for Philip Hue lights
import React, { Component } from 'react';
import LightItem from './LightItem';
import Config from './config';
class LightsView extends Component {
constructor(props) {
super(props);
this.requestFailed = false;
this.data = null;
@LarsBergqvist
LarsBergqvist / automations.yaml
Created November 24, 2017 11:08
Home Assistant automation for Philips Hue garage light group
- id: automation1
alias: Turn on garage lights when sun sets
initial_state: true
hide_entity: false
trigger:
- event: sunset
offset: 00:25:00
platform: sun
action:
- data:
@LarsBergqvist
LarsBergqvist / groups.yaml
Last active November 24, 2017 17:50
Garage group configuration for Home Assistant
garage_group:
name: Garage
entities:
- sensor.garage_temp
- sensor.garage_humidity
- light.garage
default_view:
view: yes
entities:
- group.groundfloor
@LarsBergqvist
LarsBergqvist / phue.conf
Created November 24, 2017 10:06
Philips Hue configuration example for Home Assistant
{"192.168.1.232": {"username": "abEJiR9bcFAISEcg-RO93RPZXZ2zXfSG-pKWc6in"}}
@LarsBergqvist
LarsBergqvist / groups.yaml
Created November 24, 2017 09:59
Show the Philips Hue configurator in Home Assistant
default_view:
view: yes
entities:
- configurator.philips_hue
@LarsBergqvist
LarsBergqvist / configuration.yaml
Created November 24, 2017 09:58
Turning on the discovery component in Home Assistant
discovery:
@LarsBergqvist
LarsBergqvist / automation.yaml
Last active November 10, 2017 17:50
Home Assistant automation rule with sound for a notification
automation:
alias: Notify Lars when door is opened
trigger:
platform: state
entity_id: sensor.front_door_opened
action:
service: notify.ios_larsiphone
data:
message: The front door has been opened!
data:
@LarsBergqvist
LarsBergqvist / configuration.yaml
Created November 10, 2017 08:20
Activate the ios component in Home Assistant
ios:
@LarsBergqvist
LarsBergqvist / automation.yaml
Last active November 10, 2017 17:51
A Home Assistant automation rule with a condition
automation:
alias: Notify Lars when door is opened
trigger:
platform: state
entity_id: sensor.front_door_opened
condition:
condition: state
entity_id: device_tracker.larsiphone
state: not_home
action: