53 lines
1.1 KiB
YAML
53 lines
1.1 KiB
YAML
esphome:
|
|
name: blinds
|
|
|
|
project:
|
|
name: dasfoo.blinds
|
|
version: "1.0"
|
|
|
|
includes:
|
|
- somfy.h
|
|
|
|
packages:
|
|
device_base: !include templates/esp8266.yaml
|
|
mqtt: !include templates/mqtt.yaml
|
|
|
|
globals:
|
|
- id: somfy_remote_id_base
|
|
type: int
|
|
# Can be retrieved from MQTT server. Take the key with lowest integer value
|
|
# from /rolling_code/ path.
|
|
initial_value: !secret somfy_remote_id_base
|
|
|
|
cover:
|
|
- platform: custom
|
|
lambda: |-
|
|
auto rfPin = D2;
|
|
std::vector<esphome::cover::Cover*> blinds;
|
|
|
|
for (int i = 0; i < 13; ++i) {
|
|
auto cover = new SomfyRTS(
|
|
rfPin,
|
|
id(somfy_remote_id_base) + i,
|
|
id(mqtt_homeassistant));
|
|
blinds.push_back(cover);
|
|
App.register_component(cover);
|
|
}
|
|
|
|
return blinds;
|
|
|
|
covers:
|
|
- name: "Office window"
|
|
- name: "Bedroom"
|
|
- name: "Living Room side"
|
|
- name: "Wardrobe"
|
|
- name: "Child West door"
|
|
- name: "Child West window"
|
|
- name: "Hallway Stairs window"
|
|
- name: "Kitchen window"
|
|
- name: "Kitchen door"
|
|
- name: "Living Room door"
|
|
- name: "Living Room window"
|
|
- name: "Guest East window"
|
|
- name: "Guest East door"
|