Skip to content

Instantly share code, notes, and snippets.

- id: '************'
alias: Christmas tree
trigger:
- entity_id: switch.sonoff8
from: 'off'
platform: state
to: 'on'
condition: []
action:
- data:
@pauly7300
pauly7300 / gist:dc6041b7432a70a3145a7d132c49ce5a
Created December 21, 2018 05:21
alexa local light parser
if (typeof msg.on !== 'undefined') {
var cmd = (msg.on ? "on" : "off");
var brightness = -1;
// logic for brightness
if (msg.on) {
if (msg.bri > 0) {
brightness = msg.bri;
var t = 0;
t = Math.floor(brightness * 2.55);
if (t == 254) { t = 255; }
@pauly7300
pauly7300 / gist:1015fc4cb6fa0fa007011362bcc3b9b5
Created December 21, 2018 05:34
alexa turn light on for X minutes then turn off.
[
{
"id": "4757e9d9.e3b448",
"type": "alexa-local",
"z": "e4a40a49.615548",
"devicename": "Office fan",
"inputtrigger": false,
"x": 658,
"y": 526,
"wires": [
esphomeyaml:
name: quin2
platform: ESP32
board: mhetesp32devkit
wifi:
ssid: '*********'
password: '**********'
mqtt:
@pauly7300
pauly7300 / kitchen.yaml
Created January 22, 2019 16:19
esphomyaml for lights/switch/motion
esphomeyaml:
name: kitchen_main
platform: ESP32
board: mhetesp32devkit
wifi:
ssid: 'SSID'
password: 'password'
manual_ip:
esphomeyaml:
name: drzz_quin
platform: ESP32
board: mhetesp32devkit
wifi:
ssid: '*********'
password: '**********'
mqtt:
esphomeyaml:
name: drzz_quin
platform: ESP32
board: mhetesp32devkit
wifi:
ssid: '*********'
password: '**********'
mqtt:
switch:
- platform: gpio
name: "printer_onboard_light"
id: printer_onboard_light
inverted: ON
pin: 2
- platform: gpio
name: "dummy_click"
retain: false
@pauly7300
pauly7300 / fade_w_button.yaml
Last active March 27, 2019 21:54
fadeup/down on button press
# Define Global variable
globals:
- id: my_global
type: bool
restore_value: no
initial_value: 'true'
# Define momentary button for use with the on_press
binary_sensor:
- platform: gpio
@pauly7300
pauly7300 / esp32_touch.yaml
Created April 16, 2019 21:26
esp32_touch light example
esphome:
name: aaa
platform: ESP32
board: mhetesp32devkit
wifi:
ssid: "wifi_ssid"
password: "wifipassword"
# Enable logging