fiatlux/peripherals/cc48x6/esphome.yaml
2026-10-10 02:32:27 +02:00

70 lines
1.3 KiB
YAML

# Board: NodeMCU v2 (ESP8266) (NodeMCU)
# Definition: definitions/boards/nodemcuv2/manifest.yaml
esphome:
name: trabantlux-1
friendly_name: TrabantLux-1
on_boot:
priority: 30
then:
- light.turn_on:
id: light_white
brightness: 33%
esp8266:
board: nodemcuv2
logger:
api:
encryption:
key: "JMbOQuANui4S5yDzat0wWVXrhmUO6cpBW2pjBsjRBO4="
ota:
- platform: esphome
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
ssid: TrabantLux-1 Fallback Hotspot
password: "oftmAcVPECTy"
uart:
tx_pin: GPIO2
baud_rate: 115200
id: lamp_uart
light:
- platform: monochromatic
name: "Lampe"
id: light_white
output: lamp_output
gamma_correct: 1.0
# - platform: esp32_rmt_led_strip
- platform: neopixelbus
type: GRBW
variant: WS2812
pin: GPIO4
num_leds: 240
name: "NeoPixel Light"
output:
- platform: template
id: lamp_output
type: float
write_action:
- lambda: |-
static int last_value = 0xffff;
uint16_t value = (uint16_t)(state * 255.0f);
if (value == last_value) return;
last_value = value;
uint8_t hi = (value >> 8) & 0xFF;
uint8_t lo = value & 0xFF;
uint8_t data[] = {0x80, lo, 0x00};
id(lamp_uart).write_array(data, sizeof(data));