From 5f658a7122cb6ead87ea4ded58ad35d20a756d8e Mon Sep 17 00:00:00 2001 From: Maurice Makaay Date: Fri, 15 Oct 2021 01:48:14 +0200 Subject: [PATCH] Created core config package to be distributed from GitHub. --- packages/core.yaml | 88 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 packages/core.yaml diff --git a/packages/core.yaml b/packages/core.yaml new file mode 100644 index 0000000..a62f14e --- /dev/null +++ b/packages/core.yaml @@ -0,0 +1,88 @@ +# -------------------------------------------------------------------------- +# Xiaomi Mija Bedside Lamp 2 core configuration +# -------------------------------------------------------------------------- + +substitutions: + name: bedside-lamp + friendly_name: Bedside Lamp + light_name: ${friendly_name} RGBWW Light + light_mode_text_sensor_name: ${friendly_name} Light Mode + default_transition_length: 800ms + +esphome: + name: ${name} + +esp32: + board: esp32doit-devkit-v1 + framework: + type: esp-idf + sdkconfig_options: + CONFIG_FREERTOS_UNICORE: y + advanced: + ignore_efuse_mac_crc: true + +# Retrieve the code for the xiaomi_bslamp2 platform from GitHub. +external_components: + - source: github://mmakaay/esphome-xiaomi_bslamp2@2021.10.0 + refresh: 60 + +# Disable the reboot timeout. By default, the lamp reboots after 15 +# minutes without any client connections (e.g. when home assistant is off +# line, or when the WiFi is broken). Reboots are annoying though, because +# the RGBWW LEDs will turn off during the reboot, causing the light to +# flicker. +api: + reboot_timeout: 0s + +# ---------------------------------------------------------------------- +# Hardware configuration +# ---------------------------------------------------------------------- + +i2c: + id: front_panel_i2c + sda: GPIO21 + scl: GPIO19 + scan: true + +output: + - platform: ledc + id: output_red + pin: GPIO13 + frequency: 3000 + channel: 0 + - platform: ledc + id: output_green + pin: GPIO14 + frequency: 3000 + channel: 1 + - platform: ledc + id: output_blue + pin: GPIO5 + frequency: 3000 + channel: 2 + - platform: ledc + id: output_white + pin: GPIO12 + frequency: 10000 + channel: 4 + - platform: gpio + id: output_master1 + pin: GPIO33 + - platform: gpio + id: output_master2 + pin: + number: GPIO4 + mode: OUTPUT + +xiaomi_bslamp2: + light: + red: output_red + green: output_green + blue: output_blue + white: output_white + master1: output_master1 + master2: output_master2 + front_panel: + i2c: front_panel_i2c + address: 0x2C + trigger_pin: GPIO16