Skip to content

Instantly share code, notes, and snippets.

@esbenr
esbenr / connectedcars2tracker.json
Created April 30, 2021 10:13
Mapping the data from my NR subflow to a device_tracker in HA
[
{
"id": "5702eca4.c373e4",
"type": "api-call-service",
"z": "93e5dfe8.6683b",
"name": "Device tracker",
"server": "84d7c1be.d21e3",
"version": 1,
"debugenabled": false,
"service_domain": "device_tracker",
@esbenr
esbenr / Crash at midnight 2021-04-19
Created April 19, 2021 06:12
Z2M loosing connection to adapter (ZZH)
Zigbee2MQTT:info 2021-04-18 23:52:28: MQTT publish: topic 'zigbee2mqtt/Entrance Ceiling light 2', payload '{"brightness":26,"linkquality":81,"state":"OFF","update":{"state":"available"},"update_available":true}'
Zigbee2MQTT:error 2021-04-19 00:00:06: Publish 'set' 'state' to 'Carport Wall light entrance door right' failed: 'Error: Command 0x000d6ffffea7eb82/1 genOnOff.off({}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (SRSP - AF - dataRequest after 6000ms)'
info 2021-04-18 22:58:44: MQTT publish: topic 'zigbee2mqtt/Living room Ceiling light 1', payload '{"brightness":191,"linkquality":90,"state":"ON","update":{"state":"available"},"update_available":true}'
info 2021-04-18 22:58:44: MQTT publish: topic 'zigbee2mqtt/Living room Purple floor lamp', payload '{"brightness":191,"linkquality":57,"state":"ON","update":{"state":
@esbenr
esbenr / dht11-plant-sensor.yaml
Created April 16, 2021 20:37
Ali Express ESP32+DHT11 soil moist plant sensor
esphome:
name: flower01
platform: ESP32
board: esp32dev
wifi:
ssid: "[WIFI SSID]"
password: "[WIFI password]"
# Enable fallback hotspot (captive portal) in case wifi connection fails
@esbenr
esbenr / keypad01.yaml
Created April 15, 2021 12:55
ESP32 connected keypad in ESPHome adding single digit and code sensor to HA
esphome:
name: keypad01
platform: ESP32
board: esp32dev
includes:
- keypad_textsensor.h
- keypad_sensor.h
libraries:
- "Keypad"
@esbenr
esbenr / Zigbee2MQTT smooth dimming in Node-Red.json
Created April 14, 2021 06:44
Zigbee2MQTT smooth dimming in Node-Red
[
{
"id": "c0a0e0.ae6cbf2",
"type": "subflow",
"name": "Zigbee2MQTT dim & toggle",
"info": "",
"category": "",
"in": [
{
"x": 480,
@esbenr
esbenr / MiFloraHost
Created April 7, 2021 11:25
ESPHome configuration for MiFlora BT -> WIFI gateway
esphome:
name: miflorahost
platform: ESP32
board: esp32dev
wifi:
ssid: "your wifi ssid"
password: "your wifi password"
# Enable fallback hotspot (captive portal) in case wifi connection fails
@esbenr
esbenr / color-templates.txt
Last active March 19, 2021 23:10
Parsing and extracting values from array in jinja templates
----- We have an input_number sensor with the currently selected index -----
states.input_number.color_index_garden.state = 1.0
input_number:
color_index_garden:
name: Valgt farveindex i haven
initial: 0
max: 255
min: 0
@esbenr
esbenr / scenes.json
Last active March 16, 2021 13:06
Scenes and Colors for Home Assistant
{
"terrace":{
"entity":"light.terrace",
"scenes":[
"scene.terrace_low",
"scene.terrace_medium",
"scene.terrace_high"
],
"colors":[
[
@esbenr
esbenr / ParsingConnectedCarsJsonSubflow
Created February 23, 2021 08:50
Node-RED nodes for parsing JSON from connectedcars.io subflow
[
{
"id":"5702eca4.c373e4",
"type":"api-call-service",
"z":"93e5dfe8.6683b",
"name":"Device tracker",
"server":"84d7c1be.d21e3",
"version":1,
"debugenabled":false,
"service_domain":"device_tracker",
@esbenr
esbenr / car.yaml
Last active February 23, 2021 07:29
Car picture-element card example
type: picture-elements
image: /local/images/touran.png
state_filter:
"home": brightness(100%)
"not_home": brightness(50%)
elements:
- type: state-label
entity: device_tracker.vw_touran
icon: mdi:home
style: