Skip to content

Instantly share code, notes, and snippets.

@sgvj
Last active November 6, 2023 06:29
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sgvj/69aa731919c695dfb78301295540888b to your computer and use it in GitHub Desktop.
Save sgvj/69aa731919c695dfb78301295540888b to your computer and use it in GitHub Desktop.
My Asakuki Esphome Configuration file
# This fits my needs, some logic could/should be added so let me know if you figure it out
# I deliberarly de-coupled lights and mist
# Most of my useage comes from automations that trigger actions, I have a single mist on/off switch in HomeAssistant UI
substitutions:
devicename: asakuki
esphome:
name: $devicename
platform: ESP8266
board: esp01_1m
# turn off rainbow mode
on_boot:
then:
- uart.write: [0x55, 0xaa, 0x00, 0x06, 0x00, 0x05, 0x6e, 0x04, 0x00, 0x01, 0x01, 0x7E]
wifi:
networks:
- ssid: ""
password: ""
- ssid: ""
password: ""
# enable tuya sensor platform
tuya:
# sense water alert. 0 = fine. 1 = Out of water
# I don't know when this is supposed to reset tho
sensor:
- platform: "tuya"
name: $devicename out of water
sensor_datapoint: 12
switch:
# Turn the mist on and off without affecting LED, I may have some values mixed up here
- platform: template
name: $devicename Diffuser
optimistic: true
turn_on_action:
- uart.write: [0x55, 0xAA, 0x00, 0x06, 0x00, 0x05, 0x67, 0x04, 0x00, 0x01, 0x01, 0x77]
turn_off_action:
- uart.write: [0x55, 0xaa, 0x00, 0x06, 0x00, 0x05, 0x67, 0x04, 0x00, 0x01, 0x02, 0x78]
# Turns mist on (if not on before) (would be nice to have some logic to toggle the above) to high setting, off to low
- platform: template
name: $devicename Turbo
id: turbo
optimistic: true
turn_on_action:
- uart.write: [0x55, 0xAA, 0x00, 0x06, 0x00, 0x05, 0x67, 0x04, 0x00, 0x01, 0x01, 0x77]
turn_off_action:
- uart.write: [0x55, 0xAA, 0x00, 0x06, 0x00, 0x05, 0x67, 0x04, 0x00, 0x01, 0x00, 0x76]
# Defaults to a solid color not rainbows
- platform: template
name: $devicename LED
optimistic: true
turn_on_action:
then:
- if:
condition:
switch.is_on: rainbow
# same goes for is_off
then:
- uart.write: [0x55, 0xaa, 0x00, 0x06, 0x00, 0x05, 0x0b, 0x01, 0x00, 0x01, 0x01, 0x18]
else:
- uart.write: [0x55, 0xaa, 0x00, 0x06, 0x00, 0x05, 0x0b, 0x01, 0x00, 0x01, 0x01, 0x18]
- uart.write: [0x55, 0xaa, 0x00, 0x06, 0x00, 0x05, 0x6e, 0x04, 0x00, 0x01, 0x01, 0x7E]
turn_off_action:
- uart.write: [0x55, 0xAA, 0x00, 0x06, 0x00, 0x05, 0x0B, 0x01, 0x00, 0x01, 0x00, 0x17]
# Get hippy with it. Off keeps it stuck on a given color
- platform: template
name: $devicename Rainbow Mode
id: rainbow
optimistic: true
turn_on_action:
- uart.write: [0x55, 0xaa, 0x00, 0x06, 0x00, 0x05, 0x0b, 0x01, 0x00, 0x01, 0x01, 0x18]
turn_off_action:
- uart.write: [0x55, 0xaa, 0x00, 0x06, 0x00, 0x05, 0x6e, 0x04, 0x00, 0x01, 0x01, 0x7E]
# VITAL diffuser may crash if not set
uart:
baud_rate: 9600
tx_pin: GPIO1
rx_pin: GPIO3
# Enable logging
logger:
baud_rate: 0
# Directly modify the diffuser in automations rather than rely on elegant switches in the UI
api:
services:
- service: all_on #led and diffuser
then:
- uart.write: [0x55, 0xaa, 0x00, 0x06, 0x00, 0x06, 0x01, 0x01, 0x00, 0x01, 0x01, 0x0E]
- service: all_off #led and diffuser
then:
- uart.write: [0x55, 0xaa, 0x00, 0x06, 0x00, 0x05, 0x67, 0x04, 0x00, 0x01, 0x02, 0x78]
- service: wifi_led #not sure if this works
then:
- uart.write: [0x55, 0xaa, 0x00, 0x03, 0x00, 0x01, 0x03, 0x06]
- service: diffuse_fast #led and diffuser
then:
- uart.write: [0x55, 0xAA, 0x00, 0x06, 0x00, 0x05, 0x67, 0x04, 0x00, 0x01, 0x01, 0x77]
- service: diffuse_slow
then:
- uart.write: [0x55, 0xAA, 0x00, 0x06, 0x00, 0x05, 0x67, 0x04, 0x00, 0x01, 0x00, 0x76]
- service: led_on
then:
- uart.write: [0x55, 0xaa, 0x00, 0x06, 0x00, 0x05, 0x0b, 0x01, 0x00, 0x01, 0x01, 0x18]
- service: led_off
then:
- uart.write: [0x55, 0xaa, 0x00, 0x06, 0x00, 0x05, 0x0b, 0x01, 0x00, 0x01, 0x01, 0x18]
- service: led_rainbow
then:
- uart.write: [0x55, 0xaa, 0x00, 0x06, 0x00, 0x05, 0x6e, 0x04, 0x00, 0x01, 0x00, 0x7E]
- service: led_static
then:
- uart.write: [0x55, 0xaa, 0x00, 0x06, 0x00, 0x05, 0x6e, 0x04, 0x00, 0x01, 0x01, 0x7F]
# The color service definitions ensure rainbow mode is off before setting the color
# I looked into the encoding of the colors and it was using some weird encoding of RGB so I gave up, I'm no coder
- service: led_purple
then:
- uart.write: [0x55, 0xaa, 0x00, 0x06, 0x00, 0x05, 0x6e, 0x04, 0x00, 0x01, 0x01, 0x7E]
- delay: 1s
- uart.write: [0x55, 0xaa, 0x00, 0x06, 0x00, 0x12, 0x6c, 0x03, 0x00, 0x0e, 0x64, 0x38, 0x30, 0x30, 0x66, 0x66, 0x30, 0x31, 0x32, 0x32, 0x66, 0x66, 0x66, 0x66, 0xb9]
- service: led_green1
then:
- uart.write: [0x55, 0xaa, 0x00, 0x06, 0x00, 0x05, 0x6e, 0x04, 0x00, 0x01, 0x01, 0x7E]
- delay: 1s
- uart.write: [0x55, 0xaa, 0x00, 0x06, 0x00, 0x12, 0x6c, 0x03, 0x00, 0x0e, 0x37, 0x38, 0x66, 0x66, 0x30, 0x30, 0x30, 0x30, 0x35, 0x63, 0x66, 0x66, 0x66, 0x66, 0xBF]
- service: led_orange
then:
- uart.write: [0x55, 0xaa, 0x00, 0x06, 0x00, 0x05, 0x6e, 0x04, 0x00, 0x01, 0x01, 0x7E]
- delay: 1s
- uart.write: [0x55, 0xaa, 0x00, 0x06, 0x00, 0x12, 0x6c, 0x03, 0x00, 0x0e, 0x66, 0x66, 0x34, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x66, 0x66, 0x66, 0x66, 0x66, 0xb4]
- service: led_yellow
then:
- uart.write: [0x55, 0xaa, 0x00, 0x06, 0x00, 0x05, 0x6e, 0x04, 0x00, 0x01, 0x01, 0x7E]
- delay: 1s
- uart.write: [0x55, 0xaa, 0x00, 0x06, 0x00, 0x12, 0x6c, 0x03, 0x00, 0x0e, 0x66, 0x66, 0x63, 0x30, 0x30, 0x30, 0x30, 0x30, 0x32, 0x64, 0x66, 0x66, 0x66, 0x66, 0xe1]
- service: led_green2
then:
- uart.write: [0x55, 0xaa, 0x00, 0x06, 0x00, 0x05, 0x6e, 0x04, 0x00, 0x01, 0x01, 0x7E]
- delay: 1s
- uart.write: [0x55, 0xaa, 0x00, 0x06, 0x00, 0x12, 0x6c, 0x03, 0x00, 0x0e, 0x30, 0x30, 0x66, 0x66, 0x34, 0x32, 0x30, 0x30, 0x38, 0x37, 0x66, 0x66, 0x66, 0x66, 0x8d]
- service: led_blue
then:
- uart.write: [0x55, 0xaa, 0x00, 0x06, 0x00, 0x05, 0x6e, 0x04, 0x00, 0x01, 0x01, 0x7E]
- delay: 1s
- uart.write: [0x55, 0xaa, 0x00, 0x06, 0x00, 0x12, 0x6c, 0x03, 0x00, 0x0e, 0x30, 0x30, 0x63, 0x33, 0x66, 0x66, 0x30, 0x30, 0x63, 0x33, 0x66, 0x66, 0x66, 0x66, 0xe4]
- service: led_pink
then:
- uart.write: [0x55, 0xaa, 0x00, 0x06, 0x00, 0x05, 0x6e, 0x04, 0x00, 0x01, 0x01, 0x7E]
- delay: 1s
- uart.write: [0x55, 0xaa, 0x00, 0x06, 0x00, 0x12, 0x6c, 0x03, 0x00, 0x0e, 0x66, 0x66, 0x30, 0x30, 0x61, 0x38, 0x30, 0x31, 0x34, 0x31, 0x66, 0x66, 0x66, 0x66, 0xb7]
- service: led_red1
then:
- uart.write: [0x55, 0xaa, 0x00, 0x06, 0x00, 0x05, 0x6e, 0x04, 0x00, 0x01, 0x01, 0x7E]
- delay: 1s
- uart.write: [0x55, 0xaa, 0x00, 0x06, 0x00, 0x12, 0x6c, 0x03, 0x00, 0x0e, 0x66, 0x66, 0x30, 0x30, 0x32, 0x34, 0x30, 0x31, 0x36, 0x30, 0x66, 0x66, 0x66, 0x66, 0x85]
- service: led_red2
then:
- uart.write: [0x55, 0xaa, 0x00, 0x06, 0x00, 0x05, 0x6e, 0x04, 0x00, 0x01, 0x01, 0x7E]
- delay: 1s
- uart.write: [0x55, 0xaa, 0x00, 0x06, 0x00, 0x12, 0x6c, 0x03, 0x00, 0x0e, 0x66, 0x66, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x66, 0x66, 0x66, 0x66, 0x78]
ota:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment