Skip to content

Instantly share code, notes, and snippets.

@anarro
anarro / motion_light_sunset_plus.yaml
Last active September 14, 2021 17:57
blueprint light motion sunset plus
blueprint:
name: Motion-activated Light On at Sunset Plus
description: Turn on a light when motion is detected On At Sunset.
domain: automation
source_url: https://gist.github.com/anarro/512138f39ebc579f821195449b15d833
# Blueprint Inputs
input:
motion_entity:
name: Motion Sensor
@anarro
anarro / Philips Hue Candle Effect
Created April 15, 2016 02:43 — forked from jamesabruce/Philips Hue Candle Effect
High speed, flickering candle bulb effect for any number of Philips Hue bulbs
set HUB to "192.168.1.216" --change for your bridge IP
set USER to "newdeveloper"
repeat
repeat with bulb from 1 to 2 -- Change if you have more bulbs or want to use a subset
set hue to (random number from 5000 to 12750)
set sat to (random number from 150 to 255)
set bri to (random number from 50 to 255)
set transitiontime to (random number from 1 to 3) -- Increase range for slower transitions
set query to "{\"sat\":" & sat & ",\"hue\":" & hue & ",\"bri\":" & bri & ",\"transitiontime\":" & transitiontime & "}"
set command to "curl --request PUT --data '" & query & "' http://" & HUB & "/api/" & USER & "/lights/" & bulb & "/state/ --connect-timeout 5"