2019-02-13 16:54:02 +01:00
|
|
|
esphome:
|
2019-02-13 11:20:22 +01:00
|
|
|
name: $devicename
|
2019-10-14 11:27:07 +02:00
|
|
|
comment: $devicecomment
|
2019-02-13 11:20:22 +01:00
|
|
|
platform: ESP8266
|
2019-04-22 21:56:30 +02:00
|
|
|
board: d1_mini
|
2019-02-13 11:20:22 +01:00
|
|
|
build_path: build/test3
|
2019-04-22 21:56:30 +02:00
|
|
|
on_boot:
|
|
|
|
- wait_until:
|
|
|
|
- api.connected
|
|
|
|
- wifi.connected
|
2019-05-08 11:31:06 +02:00
|
|
|
includes:
|
|
|
|
- custom.h
|
2019-02-13 11:20:22 +01:00
|
|
|
|
|
|
|
substitutions:
|
|
|
|
devicename: test3
|
2019-10-14 11:27:07 +02:00
|
|
|
devicecomment: test3 device
|
2020-06-20 01:59:19 +02:00
|
|
|
min_sub: "0.03"
|
|
|
|
max_sub: "12.0%"
|
2019-02-13 11:20:22 +01:00
|
|
|
|
|
|
|
api:
|
2019-04-22 21:56:30 +02:00
|
|
|
port: 8000
|
|
|
|
password: 'pwd'
|
|
|
|
reboot_timeout: 0min
|
|
|
|
services:
|
|
|
|
- service: hello_world
|
|
|
|
variables:
|
|
|
|
name: string
|
|
|
|
then:
|
|
|
|
- logger.log:
|
|
|
|
format: 'Hello World %s!'
|
|
|
|
args:
|
|
|
|
- name.c_str()
|
|
|
|
- service: empty_service
|
|
|
|
then:
|
|
|
|
- logger.log: 'Service Called'
|
|
|
|
- service: all_types
|
|
|
|
variables:
|
|
|
|
bool_: bool
|
|
|
|
int_: int
|
|
|
|
float_: float
|
|
|
|
string_: string
|
|
|
|
then:
|
|
|
|
- logger.log: 'Something happened'
|
|
|
|
- stepper.set_target:
|
|
|
|
id: my_stepper2
|
|
|
|
target: !lambda 'return int_;'
|
2019-06-18 19:31:22 +02:00
|
|
|
- service: array_types
|
|
|
|
variables:
|
|
|
|
bool_arr: bool[]
|
|
|
|
int_arr: int[]
|
|
|
|
float_arr: float[]
|
|
|
|
string_arr: string[]
|
|
|
|
then:
|
|
|
|
- logger.log:
|
|
|
|
format: 'Bool: %s (%u), Int: %d (%u), Float: %f (%u), String: %s (%u)'
|
|
|
|
args:
|
|
|
|
- YESNO(bool_arr[0])
|
|
|
|
- bool_arr.size()
|
|
|
|
- int_arr[0]
|
|
|
|
- int_arr.size()
|
|
|
|
- float_arr[0]
|
|
|
|
- float_arr.size()
|
|
|
|
- string_arr[0].c_str()
|
|
|
|
- string_arr.size()
|
2019-10-19 21:37:05 +02:00
|
|
|
- service: dfplayer_next
|
|
|
|
then:
|
|
|
|
- dfplayer.play_next:
|
|
|
|
- service: dfplayer_previous
|
|
|
|
then:
|
|
|
|
- dfplayer.play_previous:
|
|
|
|
- service: dfplayer_play
|
|
|
|
variables:
|
|
|
|
file: int
|
|
|
|
then:
|
|
|
|
- dfplayer.play: !lambda 'return file;'
|
|
|
|
- service: dfplayer_play_loop
|
|
|
|
variables:
|
|
|
|
file: int
|
|
|
|
loop_: bool
|
|
|
|
then:
|
|
|
|
- dfplayer.play:
|
|
|
|
file: !lambda 'return file;'
|
|
|
|
loop: !lambda 'return loop_;'
|
|
|
|
- service: dfplayer_play_folder
|
|
|
|
variables:
|
|
|
|
folder: int
|
|
|
|
file: int
|
|
|
|
then:
|
|
|
|
- dfplayer.play_folder:
|
|
|
|
folder: !lambda 'return folder;'
|
|
|
|
file: !lambda 'return file;'
|
|
|
|
|
|
|
|
- service: dfplayer_play_loo_folder
|
|
|
|
variables:
|
|
|
|
folder: int
|
|
|
|
then:
|
|
|
|
- dfplayer.play_folder:
|
|
|
|
folder: !lambda 'return folder;'
|
|
|
|
loop: True
|
|
|
|
|
|
|
|
- service: dfplayer_set_device
|
|
|
|
variables:
|
|
|
|
device: int
|
|
|
|
then:
|
|
|
|
- dfplayer.set_device:
|
|
|
|
device: TF_CARD
|
|
|
|
|
|
|
|
- service: dfplayer_set_volume
|
|
|
|
variables:
|
|
|
|
volume: int
|
|
|
|
then:
|
|
|
|
- dfplayer.set_volume: !lambda 'return volume;'
|
|
|
|
- service: dfplayer_set_eq
|
|
|
|
variables:
|
|
|
|
preset: int
|
|
|
|
then:
|
|
|
|
- dfplayer.set_eq: !lambda 'return static_cast<dfplayer::EqPreset>(preset);'
|
|
|
|
|
|
|
|
- service: dfplayer_sleep
|
|
|
|
then:
|
|
|
|
- dfplayer.sleep
|
|
|
|
|
|
|
|
- service: dfplayer_reset
|
|
|
|
then:
|
|
|
|
- dfplayer.reset
|
|
|
|
|
|
|
|
- service: dfplayer_start
|
|
|
|
then:
|
|
|
|
- dfplayer.start
|
|
|
|
|
|
|
|
- service: dfplayer_pause
|
|
|
|
then:
|
|
|
|
- dfplayer.pause
|
|
|
|
|
|
|
|
- service: dfplayer_stop
|
|
|
|
then:
|
|
|
|
- dfplayer.stop
|
|
|
|
|
|
|
|
- service: dfplayer_random
|
|
|
|
then:
|
|
|
|
- dfplayer.random
|
2019-04-22 21:56:30 +02:00
|
|
|
|
2020-02-16 00:52:20 +01:00
|
|
|
- service: battery_level_percent
|
|
|
|
variables:
|
|
|
|
level_percent: int
|
|
|
|
then:
|
|
|
|
- tm1651.set_level_percent:
|
|
|
|
id: tm1651_battery
|
|
|
|
level_percent: !lambda 'return level_percent;'
|
2019-12-04 13:11:53 +01:00
|
|
|
- service: battery_level
|
|
|
|
variables:
|
|
|
|
level: int
|
|
|
|
then:
|
|
|
|
- tm1651.set_level:
|
|
|
|
id: tm1651_battery
|
|
|
|
level: !lambda 'return level;'
|
|
|
|
- service: battery_brightness
|
|
|
|
variables:
|
|
|
|
brightness: int
|
|
|
|
then:
|
|
|
|
- tm1651.set_brightness:
|
|
|
|
id: tm1651_battery
|
|
|
|
brightness: !lambda 'return brightness;'
|
2020-02-16 00:52:20 +01:00
|
|
|
- service: battery_turn_on
|
|
|
|
then:
|
|
|
|
- tm1651.turn_on:
|
|
|
|
id: tm1651_battery
|
|
|
|
- service: battery_turn_on
|
|
|
|
then:
|
|
|
|
- tm1651.turn_off:
|
|
|
|
id: tm1651_battery
|
2020-07-13 22:30:17 +02:00
|
|
|
- service: pid_set_control_parameters
|
|
|
|
then:
|
|
|
|
- climate.pid.set_control_parameters:
|
|
|
|
id: pid_climate
|
|
|
|
kp: 1.0
|
|
|
|
kd: 1.0
|
|
|
|
ki: 1.0
|
2019-12-04 13:11:53 +01:00
|
|
|
|
2019-04-22 21:56:30 +02:00
|
|
|
wifi:
|
|
|
|
ssid: 'MySSID'
|
|
|
|
password: 'password1'
|
2019-02-13 11:20:22 +01:00
|
|
|
|
|
|
|
i2c:
|
|
|
|
sda: 4
|
|
|
|
scl: 5
|
|
|
|
scan: False
|
|
|
|
|
|
|
|
spi:
|
|
|
|
clk_pin: GPIO12
|
|
|
|
mosi_pin: GPIO13
|
|
|
|
miso_pin: GPIO14
|
|
|
|
|
|
|
|
uart:
|
2020-06-13 01:34:38 +02:00
|
|
|
- tx_pin: GPIO1
|
|
|
|
rx_pin: GPIO3
|
|
|
|
baud_rate: 115200
|
|
|
|
|
|
|
|
- id: adalight_uart
|
|
|
|
rx_pin: GPIO3
|
|
|
|
baud_rate: 115200
|
2019-02-13 11:20:22 +01:00
|
|
|
|
|
|
|
ota:
|
|
|
|
safe_mode: True
|
|
|
|
port: 3286
|
|
|
|
|
|
|
|
logger:
|
|
|
|
hardware_uart: UART1
|
|
|
|
level: DEBUG
|
2019-05-08 11:31:06 +02:00
|
|
|
esp8266_store_log_strings_in_flash: false
|
2019-02-13 11:20:22 +01:00
|
|
|
|
|
|
|
web_server:
|
|
|
|
|
|
|
|
deep_sleep:
|
|
|
|
run_duration: 20s
|
|
|
|
sleep_duration: 50s
|
|
|
|
|
2020-06-13 01:50:09 +02:00
|
|
|
wled:
|
|
|
|
|
2020-06-13 01:34:38 +02:00
|
|
|
adalight:
|
|
|
|
|
2019-02-13 11:20:22 +01:00
|
|
|
sensor:
|
|
|
|
- platform: apds9960
|
|
|
|
type: proximity
|
|
|
|
name: APDS9960 Proximity
|
2020-06-28 23:47:43 +02:00
|
|
|
- platform: vl53l0x
|
|
|
|
name: "VL53L0x Distance"
|
|
|
|
address: 0x29
|
|
|
|
update_interval: 60s
|
2019-02-13 11:20:22 +01:00
|
|
|
- platform: apds9960
|
|
|
|
type: clear
|
|
|
|
name: APDS9960 Clear
|
|
|
|
- platform: apds9960
|
|
|
|
type: red
|
|
|
|
name: APDS9960 Red
|
|
|
|
- platform: apds9960
|
|
|
|
type: green
|
|
|
|
name: APDS9960 Green
|
|
|
|
- platform: apds9960
|
|
|
|
type: blue
|
|
|
|
name: APDS9960 Blue
|
|
|
|
- platform: homeassistant
|
|
|
|
entity_id: sensor.hello_world
|
|
|
|
id: ha_hello_world
|
2020-05-20 02:13:50 +02:00
|
|
|
- platform: aht10
|
2020-03-21 19:31:07 +01:00
|
|
|
temperature:
|
|
|
|
name: "Temperature"
|
|
|
|
humidity:
|
|
|
|
name: "Humidity"
|
2019-05-27 20:00:32 +02:00
|
|
|
- platform: am2320
|
|
|
|
temperature:
|
|
|
|
name: "Temperature"
|
|
|
|
humidity:
|
|
|
|
name: "Humidity"
|
2019-04-22 21:56:30 +02:00
|
|
|
- platform: adc
|
|
|
|
pin: VCC
|
|
|
|
id: my_sensor
|
|
|
|
filters:
|
|
|
|
- offset: 5.0
|
|
|
|
- multiply: 2.0
|
|
|
|
- filter_out: NAN
|
|
|
|
- sliding_window_moving_average:
|
|
|
|
- exponential_moving_average:
|
|
|
|
- lambda: 'return 0;'
|
|
|
|
- delta: 100
|
|
|
|
- throttle: 100ms
|
|
|
|
- debounce: 500s
|
|
|
|
- calibrate_linear:
|
|
|
|
- 0 -> 0
|
|
|
|
- 100 -> 100
|
2019-07-02 13:02:55 +02:00
|
|
|
- calibrate_polynomial:
|
|
|
|
degree: 3
|
|
|
|
datapoints:
|
|
|
|
- 0 -> 0
|
|
|
|
- 100 -> 200
|
|
|
|
- 400 -> 500
|
|
|
|
- -50 -> -1000
|
|
|
|
- -100 -> -10000
|
2019-05-28 16:00:00 +02:00
|
|
|
- platform: resistance
|
|
|
|
sensor: my_sensor
|
|
|
|
configuration: DOWNSTREAM
|
|
|
|
resistor: 10kΩ
|
|
|
|
reference_voltage: 3.3V
|
|
|
|
name: Resistance
|
|
|
|
id: resist
|
|
|
|
- platform: ntc
|
|
|
|
sensor: resist
|
|
|
|
name: NTC Sensor
|
|
|
|
calibration:
|
|
|
|
b_constant: 3950
|
|
|
|
reference_resistance: 10k
|
|
|
|
reference_temperature: 25°C
|
2019-05-28 22:27:39 +02:00
|
|
|
- platform: ntc
|
|
|
|
sensor: resist
|
|
|
|
name: NTC Sensor2
|
|
|
|
calibration:
|
|
|
|
- 10.0kOhm -> 25°C
|
|
|
|
- 27.219kOhm -> 0°C
|
|
|
|
- 14.674kOhm -> 15°C
|
2019-05-29 11:15:08 +02:00
|
|
|
- platform: ct_clamp
|
|
|
|
sensor: my_sensor
|
|
|
|
name: CT Clamp
|
|
|
|
sample_duration: 500ms
|
|
|
|
update_interval: 5s
|
|
|
|
|
2019-04-22 21:56:30 +02:00
|
|
|
- platform: tcs34725
|
|
|
|
red_channel:
|
|
|
|
name: Red Channel
|
|
|
|
green_channel:
|
|
|
|
name: Green Channel
|
|
|
|
blue_channel:
|
|
|
|
name: Blue Channel
|
|
|
|
clear_channel:
|
|
|
|
name: Clear Channel
|
|
|
|
illuminance:
|
|
|
|
name: Illuminance
|
|
|
|
color_temperature:
|
|
|
|
name: Color Temperature
|
|
|
|
integration_time: 700ms
|
|
|
|
gain: 60x
|
2019-05-08 10:56:52 +02:00
|
|
|
- platform: custom
|
|
|
|
lambda: |-
|
2019-05-08 11:31:06 +02:00
|
|
|
auto s = new CustomSensor();
|
|
|
|
App.register_component(s);
|
2019-05-08 10:56:52 +02:00
|
|
|
return {s};
|
|
|
|
sensors:
|
|
|
|
- id: custom_sensor
|
|
|
|
name: Custom Sensor
|
2019-05-28 20:41:10 +02:00
|
|
|
- platform: binary_sensor_map
|
|
|
|
name: Binary Sensor Map
|
|
|
|
type: group
|
|
|
|
channels:
|
|
|
|
- binary_sensor: bin1
|
|
|
|
value: 10.0
|
|
|
|
- binary_sensor: bin2
|
|
|
|
value: 15.0
|
|
|
|
- binary_sensor: bin3
|
|
|
|
value: 100.0
|
2019-10-16 13:19:41 +02:00
|
|
|
- platform: ade7953
|
|
|
|
voltage:
|
|
|
|
name: ADE7953 Voltage
|
|
|
|
current_a:
|
|
|
|
name: ADE7953 Current A
|
|
|
|
current_b:
|
|
|
|
name: ADE7953 Current B
|
|
|
|
active_power_a:
|
|
|
|
name: ADE7953 Active Power A
|
|
|
|
active_power_b:
|
|
|
|
name: ADE7953 Active Power B
|
2019-10-20 19:24:20 +02:00
|
|
|
- platform: pzem004t
|
|
|
|
voltage:
|
|
|
|
name: "PZEM00T Voltage"
|
|
|
|
current:
|
|
|
|
name: "PZEM004T Current"
|
|
|
|
power:
|
|
|
|
name: "PZEM004T Power"
|
|
|
|
- platform: pzemac
|
|
|
|
voltage:
|
|
|
|
name: "PZEMAC Voltage"
|
|
|
|
current:
|
|
|
|
name: "PZEMAC Current"
|
|
|
|
power:
|
|
|
|
name: "PZEMAC Power"
|
2020-03-12 21:37:57 +01:00
|
|
|
energy:
|
|
|
|
name: "PZEMAC Energy"
|
2019-10-20 19:24:20 +02:00
|
|
|
frequency:
|
|
|
|
name: "PZEMAC Frequency"
|
|
|
|
power_factor:
|
|
|
|
name: "PZEMAC Power Factor"
|
|
|
|
- platform: pzemdc
|
|
|
|
voltage:
|
|
|
|
name: "PZEMDC Voltage"
|
|
|
|
current:
|
|
|
|
name: "PZEMDC Current"
|
|
|
|
power:
|
|
|
|
name: "PZEMDC Power"
|
2020-04-06 19:11:41 +02:00
|
|
|
- platform: hm3301
|
|
|
|
pm_1_0:
|
|
|
|
name: "PM1.0"
|
|
|
|
pm_2_5:
|
|
|
|
name: "PM2.5"
|
|
|
|
pm_10_0:
|
|
|
|
name: "PM10.0"
|
2020-06-12 04:14:54 +02:00
|
|
|
aqi:
|
|
|
|
name: "AQI"
|
|
|
|
calculation_type: "AQI"
|
2020-05-20 02:13:50 +02:00
|
|
|
- platform: pmsx003
|
|
|
|
type: PMSX003
|
|
|
|
pm_1_0:
|
|
|
|
name: "PM 1.0 Concentration"
|
|
|
|
pm_2_5:
|
|
|
|
name: "PM 2.5 Concentration"
|
|
|
|
pm_10_0:
|
|
|
|
name: "PM 10.0 Concentration"
|
|
|
|
- platform: pmsx003
|
|
|
|
type: PMS5003T
|
|
|
|
pm_2_5:
|
|
|
|
name: "PM 2.5 Concentration"
|
|
|
|
temperature:
|
|
|
|
name: "PMS Temperature"
|
|
|
|
humidity:
|
|
|
|
name: "PMS Humidity"
|
|
|
|
- platform: pmsx003
|
|
|
|
type: PMS5003ST
|
|
|
|
pm_2_5:
|
|
|
|
name: "PM 2.5 Concentration"
|
|
|
|
temperature:
|
|
|
|
name: "PMS Temperature"
|
|
|
|
humidity:
|
|
|
|
name: "PMS Humidity"
|
|
|
|
formaldehyde:
|
|
|
|
name: "PMS Formaldehyde Concentration"
|
|
|
|
- platform: cse7766
|
|
|
|
voltage:
|
|
|
|
name: "CSE7766 Voltage"
|
|
|
|
current:
|
|
|
|
name: "CSE7766 Current"
|
|
|
|
power:
|
|
|
|
name: "CSE776 Power"
|
2019-02-13 11:20:22 +01:00
|
|
|
|
|
|
|
time:
|
|
|
|
- platform: homeassistant
|
|
|
|
|
|
|
|
apds9960:
|
|
|
|
address: 0x20
|
|
|
|
update_interval: 60s
|
2019-05-08 10:56:52 +02:00
|
|
|
|
2019-02-24 21:48:28 +01:00
|
|
|
mpr121:
|
|
|
|
id: mpr121_first
|
|
|
|
address: 0x5A
|
2019-02-13 11:20:22 +01:00
|
|
|
|
|
|
|
binary_sensor:
|
|
|
|
- platform: apds9960
|
|
|
|
direction: up
|
|
|
|
name: APDS9960 Up
|
2019-04-22 21:56:30 +02:00
|
|
|
device_class: motion
|
|
|
|
filters:
|
|
|
|
- invert
|
|
|
|
- delayed_on: 20ms
|
|
|
|
- delayed_off: 20ms
|
|
|
|
- lambda: 'return false;'
|
|
|
|
on_state:
|
|
|
|
- logger.log: New state
|
|
|
|
id: my_binary_sensor
|
2019-02-13 11:20:22 +01:00
|
|
|
- platform: apds9960
|
|
|
|
direction: down
|
|
|
|
name: APDS9960 Down
|
|
|
|
- platform: apds9960
|
|
|
|
direction: left
|
|
|
|
name: APDS9960 Left
|
|
|
|
- platform: apds9960
|
|
|
|
direction: right
|
|
|
|
name: APDS9960 Right
|
|
|
|
- platform: homeassistant
|
|
|
|
entity_id: binary_sensor.hello_world
|
|
|
|
id: ha_hello_world_binary
|
2019-02-24 21:48:28 +01:00
|
|
|
- platform: mpr121
|
|
|
|
id: touchkey0
|
|
|
|
channel: 0
|
|
|
|
name: "touchkey0"
|
|
|
|
- platform: mpr121
|
|
|
|
channel: 1
|
|
|
|
name: "touchkey1"
|
2019-05-28 20:41:10 +02:00
|
|
|
id: bin1
|
2019-02-24 21:48:28 +01:00
|
|
|
- platform: mpr121
|
|
|
|
channel: 2
|
|
|
|
name: "touchkey2"
|
2019-05-28 20:41:10 +02:00
|
|
|
id: bin2
|
2019-02-24 21:48:28 +01:00
|
|
|
- platform: mpr121
|
|
|
|
channel: 3
|
|
|
|
name: "touchkey3"
|
2019-05-28 20:41:10 +02:00
|
|
|
id: bin3
|
2019-02-24 21:48:28 +01:00
|
|
|
on_press:
|
|
|
|
then:
|
|
|
|
- switch.toggle: mpr121_toggle
|
2019-04-22 21:56:30 +02:00
|
|
|
- platform: ttp229_lsf
|
|
|
|
channel: 1
|
|
|
|
name: TTP229 LSF Test
|
2019-05-10 21:44:02 +02:00
|
|
|
- platform: ttp229_bsf
|
|
|
|
channel: 1
|
|
|
|
name: TTP229 BSF Test
|
2019-05-08 10:56:52 +02:00
|
|
|
- platform: custom
|
|
|
|
lambda: |-
|
2019-05-08 11:31:06 +02:00
|
|
|
auto s = new CustomBinarySensor();
|
|
|
|
App.register_component(s);
|
2019-05-08 10:56:52 +02:00
|
|
|
return {s};
|
2019-05-08 11:31:06 +02:00
|
|
|
binary_sensors:
|
2019-05-08 10:56:52 +02:00
|
|
|
- id: custom_binary_sensor
|
|
|
|
name: Custom Binary Sensor
|
2019-02-13 11:20:22 +01:00
|
|
|
|
2019-06-07 14:26:17 +02:00
|
|
|
globals:
|
|
|
|
- id: my_global_string
|
|
|
|
type: std::string
|
|
|
|
initial_value: '""'
|
|
|
|
|
2019-02-13 11:20:22 +01:00
|
|
|
remote_receiver:
|
|
|
|
pin: GPIO12
|
|
|
|
dump: []
|
|
|
|
|
|
|
|
status_led:
|
|
|
|
pin: GPIO2
|
|
|
|
|
|
|
|
text_sensor:
|
|
|
|
- platform: version
|
2019-02-13 16:54:02 +01:00
|
|
|
name: "ESPHome Version"
|
2019-02-13 11:20:22 +01:00
|
|
|
icon: mdi:icon
|
|
|
|
id: version_sensor
|
|
|
|
on_value:
|
|
|
|
- lambda: !lambda |-
|
|
|
|
ESP_LOGD("main", "The state is %s=%s", x.c_str(), id(version_sensor).state.c_str());
|
|
|
|
- script.execute: my_script
|
2019-10-20 16:15:30 +02:00
|
|
|
- script.wait: my_script
|
|
|
|
- script.stop: my_script
|
2019-02-13 11:20:22 +01:00
|
|
|
- homeassistant.service:
|
|
|
|
service: notify.html5
|
|
|
|
data:
|
|
|
|
title: New Humidity
|
|
|
|
data_template:
|
|
|
|
message: The humidity is {{ my_variable }}%.
|
|
|
|
variables:
|
|
|
|
my_variable: |-
|
|
|
|
return id(version_sensor).state;
|
|
|
|
- platform: template
|
|
|
|
name: "Template Text Sensor"
|
|
|
|
lambda: |-
|
|
|
|
return {"Hello World"};
|
|
|
|
- platform: homeassistant
|
|
|
|
entity_id: sensor.hello_world2
|
|
|
|
id: ha_hello_world2
|
2019-05-08 11:31:06 +02:00
|
|
|
- platform: custom
|
|
|
|
lambda: |-
|
|
|
|
auto s = new CustomTextSensor();
|
|
|
|
App.register_component(s);
|
|
|
|
return {s};
|
|
|
|
text_sensors:
|
|
|
|
- id: custom_text_sensor
|
|
|
|
name: Custom Text Sensor
|
2019-02-13 11:20:22 +01:00
|
|
|
|
|
|
|
script:
|
|
|
|
- id: my_script
|
|
|
|
then:
|
|
|
|
- lambda: 'ESP_LOGD("main", "Hello World!");'
|
|
|
|
|
2019-02-24 21:48:28 +01:00
|
|
|
switch:
|
|
|
|
- platform: template
|
|
|
|
name: "mpr121_toggle"
|
|
|
|
id: mpr121_toggle
|
|
|
|
optimistic: True
|
2019-04-22 21:56:30 +02:00
|
|
|
- platform: gpio
|
|
|
|
id: gpio_switch1
|
|
|
|
pin:
|
2019-10-17 16:18:41 +02:00
|
|
|
mcp23017: mcp23017_hub
|
2019-04-22 21:56:30 +02:00
|
|
|
number: 0
|
|
|
|
mode: OUTPUT
|
2019-10-17 16:18:41 +02:00
|
|
|
interlock: &interlock [gpio_switch1, gpio_switch2, gpio_switch3]
|
2019-04-22 21:56:30 +02:00
|
|
|
- platform: gpio
|
|
|
|
id: gpio_switch2
|
2019-10-17 16:18:41 +02:00
|
|
|
pin:
|
|
|
|
mcp23008: mcp23008_hub
|
|
|
|
number: 0
|
|
|
|
mode: OUTPUT
|
|
|
|
interlock: *interlock
|
|
|
|
- platform: gpio
|
|
|
|
id: gpio_switch3
|
2019-04-22 21:56:30 +02:00
|
|
|
pin: GPIO1
|
|
|
|
interlock: *interlock
|
2019-05-08 10:56:52 +02:00
|
|
|
- platform: custom
|
|
|
|
lambda: |-
|
2019-05-08 11:31:06 +02:00
|
|
|
auto s = new CustomSwitch();
|
2019-05-08 10:56:52 +02:00
|
|
|
return {s};
|
2019-05-08 11:31:06 +02:00
|
|
|
switches:
|
2019-05-08 10:56:52 +02:00
|
|
|
- id: custom_switch
|
|
|
|
name: Custom Switch
|
2019-02-24 21:48:28 +01:00
|
|
|
|
2019-05-08 11:31:06 +02:00
|
|
|
custom_component:
|
|
|
|
lambda: |-
|
|
|
|
auto s = new CustomComponent();
|
|
|
|
s->set_update_interval(15000);
|
|
|
|
return {s};
|
|
|
|
|
2019-02-13 11:20:22 +01:00
|
|
|
stepper:
|
|
|
|
- platform: uln2003
|
|
|
|
id: my_stepper
|
|
|
|
pin_a: GPIO12
|
|
|
|
pin_b: GPIO13
|
|
|
|
pin_c: GPIO14
|
|
|
|
pin_d: GPIO15
|
|
|
|
sleep_when_done: no
|
|
|
|
step_mode: HALF_STEP
|
|
|
|
max_speed: 250 steps/s
|
|
|
|
acceleration: inf
|
|
|
|
deceleration: inf
|
2019-04-22 21:56:30 +02:00
|
|
|
- platform: a4988
|
|
|
|
id: my_stepper2
|
|
|
|
step_pin: GPIO1
|
|
|
|
dir_pin: GPIO2
|
|
|
|
max_speed: 0.1 steps/s
|
|
|
|
acceleration: 10 steps/s^2
|
|
|
|
deceleration: 10 steps/s^2
|
2019-02-13 11:20:22 +01:00
|
|
|
|
|
|
|
interval:
|
|
|
|
interval: 5s
|
|
|
|
then:
|
|
|
|
- logger.log: "Interval Run"
|
2019-04-22 21:56:30 +02:00
|
|
|
- stepper.set_target:
|
|
|
|
id: my_stepper2
|
|
|
|
target: 500
|
|
|
|
- stepper.set_target:
|
|
|
|
id: my_stepper
|
|
|
|
target: !lambda 'return 0;'
|
|
|
|
- stepper.report_position:
|
|
|
|
id: my_stepper2
|
|
|
|
position: 0
|
|
|
|
- stepper.report_position:
|
|
|
|
id: my_stepper
|
|
|
|
position: !lambda 'return 50/100.0;'
|
|
|
|
|
|
|
|
climate:
|
|
|
|
- platform: bang_bang
|
|
|
|
name: Bang Bang Climate
|
|
|
|
sensor: ha_hello_world
|
|
|
|
default_target_temperature_low: 18°C
|
|
|
|
default_target_temperature_high: 24°C
|
|
|
|
idle_action:
|
|
|
|
- switch.turn_on: gpio_switch1
|
|
|
|
cool_action:
|
|
|
|
- switch.turn_on: gpio_switch2
|
|
|
|
heat_action:
|
|
|
|
- switch.turn_on: gpio_switch1
|
|
|
|
away_config:
|
|
|
|
default_target_temperature_low: 16°C
|
|
|
|
default_target_temperature_high: 20°C
|
2020-07-02 03:38:51 +02:00
|
|
|
- platform: thermostat
|
|
|
|
name: Thermostat Climate
|
|
|
|
sensor: ha_hello_world
|
|
|
|
default_target_temperature_low: 18°C
|
|
|
|
default_target_temperature_high: 24°C
|
|
|
|
idle_action:
|
|
|
|
- switch.turn_on: gpio_switch1
|
|
|
|
cool_action:
|
|
|
|
- switch.turn_on: gpio_switch2
|
|
|
|
heat_action:
|
|
|
|
- switch.turn_on: gpio_switch1
|
|
|
|
dry_action:
|
|
|
|
- switch.turn_on: gpio_switch2
|
|
|
|
fan_only_action:
|
|
|
|
- switch.turn_on: gpio_switch1
|
|
|
|
auto_mode:
|
|
|
|
- switch.turn_on: gpio_switch2
|
|
|
|
off_mode:
|
|
|
|
- switch.turn_on: gpio_switch1
|
|
|
|
heat_mode:
|
|
|
|
- switch.turn_on: gpio_switch2
|
|
|
|
cool_mode:
|
|
|
|
- switch.turn_on: gpio_switch1
|
|
|
|
dry_mode:
|
|
|
|
- switch.turn_on: gpio_switch2
|
|
|
|
fan_only_mode:
|
|
|
|
- switch.turn_on: gpio_switch1
|
|
|
|
fan_mode_auto_action:
|
|
|
|
- switch.turn_on: gpio_switch2
|
|
|
|
fan_mode_on_action:
|
|
|
|
- switch.turn_on: gpio_switch1
|
|
|
|
fan_mode_off_action:
|
|
|
|
- switch.turn_on: gpio_switch2
|
|
|
|
fan_mode_low_action:
|
|
|
|
- switch.turn_on: gpio_switch1
|
|
|
|
fan_mode_medium_action:
|
|
|
|
- switch.turn_on: gpio_switch2
|
|
|
|
fan_mode_high_action:
|
|
|
|
- switch.turn_on: gpio_switch1
|
|
|
|
fan_mode_middle_action:
|
|
|
|
- switch.turn_on: gpio_switch2
|
|
|
|
fan_mode_focus_action:
|
|
|
|
- switch.turn_on: gpio_switch1
|
|
|
|
fan_mode_diffuse_action:
|
|
|
|
- switch.turn_on: gpio_switch2
|
|
|
|
swing_off_action:
|
|
|
|
- switch.turn_on: gpio_switch1
|
|
|
|
swing_horizontal_action:
|
|
|
|
- switch.turn_on: gpio_switch2
|
|
|
|
swing_vertical_action:
|
|
|
|
- switch.turn_on: gpio_switch1
|
|
|
|
swing_both_action:
|
|
|
|
- switch.turn_on: gpio_switch2
|
|
|
|
hysteresis: 0.2
|
|
|
|
away_config:
|
|
|
|
default_target_temperature_low: 16°C
|
|
|
|
default_target_temperature_high: 20°C
|
2020-07-13 22:30:17 +02:00
|
|
|
- platform: pid
|
|
|
|
id: pid_climate
|
|
|
|
name: "PID Climate Controller"
|
|
|
|
sensor: ha_hello_world
|
|
|
|
default_target_temperature: 21°C
|
|
|
|
heat_output: my_slow_pwm
|
|
|
|
control_parameters:
|
|
|
|
kp: 0.0
|
|
|
|
ki: 0.0
|
|
|
|
kd: 0.0
|
|
|
|
|
2019-04-22 21:56:30 +02:00
|
|
|
|
|
|
|
cover:
|
|
|
|
- platform: endstop
|
|
|
|
name: Endstop Cover
|
|
|
|
stop_action:
|
|
|
|
- switch.turn_on: gpio_switch1
|
|
|
|
open_endstop: my_binary_sensor
|
|
|
|
open_action:
|
|
|
|
- switch.turn_on: gpio_switch1
|
|
|
|
open_duration: 5min
|
|
|
|
close_endstop: my_binary_sensor
|
|
|
|
close_action:
|
|
|
|
- switch.turn_on: gpio_switch2
|
|
|
|
- output.set_level:
|
|
|
|
id: out
|
|
|
|
level: 50%
|
|
|
|
- output.esp8266_pwm.set_frequency:
|
|
|
|
id: out
|
|
|
|
frequency: 500.0Hz
|
|
|
|
- output.esp8266_pwm.set_frequency:
|
|
|
|
id: out
|
|
|
|
frequency: !lambda 'return 500.0;'
|
|
|
|
- servo.write:
|
|
|
|
id: my_servo
|
|
|
|
level: -100%
|
|
|
|
- servo.write:
|
|
|
|
id: my_servo
|
|
|
|
level: !lambda 'return -1.0;'
|
|
|
|
- delay: 2s
|
|
|
|
- servo.detach: my_servo
|
|
|
|
close_duration: 4.5min
|
|
|
|
max_duration: 10min
|
|
|
|
- platform: time_based
|
|
|
|
name: Time Based Cover
|
|
|
|
stop_action:
|
|
|
|
- switch.turn_on: gpio_switch1
|
|
|
|
open_action:
|
|
|
|
- switch.turn_on: gpio_switch1
|
|
|
|
open_duration: 5min
|
|
|
|
close_action:
|
|
|
|
- switch.turn_on: gpio_switch2
|
|
|
|
close_duration: 4.5min
|
2019-06-18 19:42:36 +02:00
|
|
|
- platform: template
|
|
|
|
name: Template Cover with Tilt
|
|
|
|
tilt_lambda: "return 0.5;"
|
|
|
|
tilt_action:
|
|
|
|
- output.set_level:
|
|
|
|
id: out
|
|
|
|
level: !lambda "return tilt;"
|
2019-11-21 21:57:27 +01:00
|
|
|
position_action:
|
|
|
|
- output.set_level:
|
|
|
|
id: out
|
|
|
|
level: !lambda "return pos;"
|
2019-06-18 19:42:36 +02:00
|
|
|
|
2019-04-22 21:56:30 +02:00
|
|
|
|
|
|
|
output:
|
|
|
|
- platform: esp8266_pwm
|
|
|
|
id: out
|
|
|
|
pin: D3
|
|
|
|
frequency: 50Hz
|
2019-05-27 09:58:55 +02:00
|
|
|
- platform: custom
|
|
|
|
type: binary
|
|
|
|
lambda: |-
|
|
|
|
auto s = new CustomBinaryOutput();
|
|
|
|
App.register_component(s);
|
|
|
|
return {s};
|
|
|
|
outputs:
|
|
|
|
- id: custom_binary
|
|
|
|
- platform: custom
|
|
|
|
type: float
|
|
|
|
lambda: |-
|
|
|
|
auto s = new CustomFloatOutput();
|
|
|
|
App.register_component(s);
|
|
|
|
return {s};
|
|
|
|
outputs:
|
|
|
|
- id: custom_float
|
Add AC Dimmer support (#880)
* Add AC Dimmer support
Fixes https://github.com/esphome/feature-requests/issues/278
* fixes
basically missed the output pin setup and in the switching was switching true true true :P
* Format
* Enable ESP32
* Also setup ZC pin
* Support multiple dimmers sharing ZC pin
* Fix ESP32
* Lint
* off gate on zc detect
* tests pins validation
* Climate Mitsubishi (#725)
* add climate
* Mitsubishi updates
* refactor mitsubishi to use climate_ir
* lint
* fix: only decode when not str already (#923)
Signed-off-by: wilmardo <info@wilmardenouden.nl>
* fix climate-ir bad merge (#935)
* fix climate-ir bad merge
* add mitshubishi test
* http_request: fix memory allocation (#916)
* http_request version fix (#917)
* PID Climate (#885)
* PID Climate
* Add sensor for debugging PID output value
* Add dump_config, use percent
* Add more observable values
* Update
* Set target temperature
* Add autotuner
* Add algorithm explanation
* Add autotuner action, update controller
* Add simulator
* Format
* Change defaults
* Updates
* Use b''.decode() instead of str(b'') (#941)
Handling of request arguments in WizardRequestHandler is not decoding
bytes and rather just doing a str conversion resulting in a value of
"b''" being supplied to the wizard code.
* Adding the espressif 2.6.3 (#944)
* extract and use current version of python 3 (#938)
* Inverted output in neopixelbus (#895)
* Added inverted output
* Added support for inverted output in neopixelbus
* Update esphome/components/neopixelbus/light.py
Co-Authored-By: Otto Winter <otto@otto-winter.com>
* Update light.py
* corrected lint errors
Co-authored-by: Otto Winter <otto@otto-winter.com>
* Added degree symbol for MAX7219 7-segment display. (#764)
The ascii char to use it is "~" (0x7E).
Disclaimer: I didn't test this yet.
* Fix dump/tx of 64 bit codes (#940)
* Fix dump/tx of 64 bit codes
* fixed source format
* Update hdc1080.cpp (#887)
* Update hdc1080.cpp
increase waittime, to fix reading errors
* Fix: Update HDC1080.cpp
i fixed the my change on write_bytes
* add tcl112 support for dry, fan and swing (#939)
* Fix SGP30 incorrect baseline reading/writing (#936)
* Split the SGP30 baseline into 2 values
- According to the SGP30 datasheet, each eCO2 and TVOC baseline is a 2-byte value (MSB first)
- The current implementation ignores the MSB of each of the value
- Update the schema to allow 2 different baseline values (optional, but both need to be specified for the baseline to apply)
* Make both eCO2 and TVOC required if the optional baseline is defined
* Make dump_config() looks better
* Add register_*_effect to allow registering custom effects (#947)
This allows to register custom effect from user components,
allowing for bigger composability of source.
* Bugfix/normalize core comparisons (and Python 3 update fixes) (#952)
* Correct implementation of comparisons to be Pythonic
If a comparison cannot be made return NotImplemented, this allows the
Python interpreter to try other comparisons (eg __ieq__) and either
return False (in the case of __eq__) or raise a TypeError
exception (eg in the case of __lt__).
* Python 3 updates
* Add a more helpful message in exception if platform is not defined
* Added a basic pre-commit check
* Add transmit pioneer (#922)
* Added pioneer_protocol to support transmit_pioneer
* Display tm1637 (#946)
* add TM1637 support
* Support a further variant of Xiaomi CGG1 (#930)
* Daikin climate ir component (#964)
* Daikin ARC43XXX IR remote controller support
* Format and lint fixes
* Check temperature values against allowed min/max
* fix tm1637 missing __init__.py (#975)
* Add AC Dimmer support
Fixes https://github.com/esphome/feature-requests/issues/278
* fixes
basically missed the output pin setup and in the switching was switching true true true :P
* Format
* Enable ESP32
* Also setup ZC pin
* Support multiple dimmers sharing ZC pin
* Fix ESP32
* Lint
* off gate on zc detect
* tests pins validation
* fix esp8266 many dimmers, changed timing
* Increased value resolution, added min power
* use min_power from base class
* fix min_power. add init with half cycle
* added method for trailing pulse, trailing and leading
* fix method name. try filter invalid falling pulse
* renamed to ac_dimmer
* fix ESP32 not configuring zero cross twice
Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>
Co-authored-by: Wilmar den Ouden <wilmardo@users.noreply.github.com>
Co-authored-by: Nikolay Vasilchuk <Anonym.tsk@gmail.com>
Co-authored-by: Tim Savage <tim@savage.company>
Co-authored-by: Vc <37367415+Valcob@users.noreply.github.com>
Co-authored-by: gitolicious <mrjchn@gmail.com>
Co-authored-by: voibit <krestean@gmail.com>
Co-authored-by: Luar Roji <cyberplant@users.noreply.github.com>
Co-authored-by: András Bíró <1202136+andrasbiro@users.noreply.github.com>
Co-authored-by: dmkif <dmkif@users.noreply.github.com>
Co-authored-by: Panuruj Khambanonda (PK) <pk@panurujk.com>
Co-authored-by: Kamil Trzciński <ayufan@ayufan.eu>
Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
Co-authored-by: Mario <4376789+mario-tux@users.noreply.github.com>
Co-authored-by: Héctor Giménez <hector.fwbz@gmail.com>
2020-04-10 05:07:18 +02:00
|
|
|
- platform: ac_dimmer
|
|
|
|
id: dimmer1
|
|
|
|
gate_pin: GPIO5
|
|
|
|
zero_cross_pin: GPIO12
|
2020-07-13 22:30:17 +02:00
|
|
|
- platform: slow_pwm
|
|
|
|
pin: GPIO5
|
|
|
|
id: my_slow_pwm
|
|
|
|
period: 15s
|
|
|
|
|
2019-04-22 21:56:30 +02:00
|
|
|
|
|
|
|
mcp23017:
|
2019-10-17 16:18:41 +02:00
|
|
|
id: mcp23017_hub
|
2019-12-10 11:09:35 +01:00
|
|
|
|
2019-10-17 16:18:41 +02:00
|
|
|
mcp23008:
|
|
|
|
id: mcp23008_hub
|
2019-04-22 21:56:30 +02:00
|
|
|
|
2020-06-13 01:17:13 +02:00
|
|
|
e131:
|
|
|
|
|
2019-04-22 21:56:30 +02:00
|
|
|
light:
|
|
|
|
- platform: neopixelbus
|
|
|
|
name: Neopixelbus Light
|
|
|
|
pin: GPIO1
|
|
|
|
type: GRBW
|
|
|
|
variant: SK6812
|
|
|
|
method: ESP8266_UART0
|
|
|
|
num_leds: 100
|
2020-06-13 01:17:13 +02:00
|
|
|
effects:
|
2020-06-13 01:50:09 +02:00
|
|
|
- wled:
|
2020-06-13 01:34:38 +02:00
|
|
|
- adalight:
|
|
|
|
uart_id: adalight_uart
|
2020-06-13 01:17:13 +02:00
|
|
|
- e131:
|
|
|
|
universe: 1
|
2019-04-22 21:56:30 +02:00
|
|
|
|
|
|
|
servo:
|
|
|
|
id: my_servo
|
|
|
|
output: out
|
2019-11-02 20:56:42 +01:00
|
|
|
restore: true
|
2020-06-20 01:59:19 +02:00
|
|
|
min_level: $min_sub
|
|
|
|
max_level: $max_sub
|
2019-04-22 21:56:30 +02:00
|
|
|
|
|
|
|
ttp229_lsf:
|
2019-05-10 21:44:02 +02:00
|
|
|
|
|
|
|
ttp229_bsf:
|
|
|
|
sdo_pin: D0
|
|
|
|
scl_pin: D1
|
2019-06-17 20:13:52 +02:00
|
|
|
|
|
|
|
sim800l:
|
|
|
|
on_sms_received:
|
|
|
|
- lambda: |-
|
|
|
|
std::string str;
|
|
|
|
str = sender;
|
|
|
|
str = message;
|
|
|
|
- sim800l.send_sms:
|
|
|
|
message: 'hello you'
|
|
|
|
recipient: '+1234'
|
2019-10-19 21:37:05 +02:00
|
|
|
|
|
|
|
dfplayer:
|
|
|
|
on_finished_playback:
|
|
|
|
then:
|
|
|
|
if:
|
|
|
|
condition:
|
|
|
|
not:
|
|
|
|
dfplayer.is_playing
|
|
|
|
then:
|
|
|
|
logger.log: 'Playback finished event'
|
2019-12-04 13:11:53 +01:00
|
|
|
tm1651:
|
|
|
|
id: tm1651_battery
|
|
|
|
clk_pin: D6
|
|
|
|
dio_pin: D5
|
2020-06-28 22:33:06 +02:00
|
|
|
|
2019-12-10 11:09:35 +01:00
|
|
|
rf_bridge:
|
|
|
|
on_code_received:
|
|
|
|
- lambda: |-
|
|
|
|
uint32_t test;
|
|
|
|
test = data.sync;
|
|
|
|
test = data.low;
|
|
|
|
test = data.high;
|
|
|
|
test = data.code;
|
|
|
|
- rf_bridge.send_code:
|
|
|
|
sync: 0x1234
|
|
|
|
low: 0x1234
|
|
|
|
high: 0x1234
|
|
|
|
code: 0x123456
|
|
|
|
- rf_bridge.learn
|
2020-06-28 22:33:06 +02:00
|
|
|
|
|
|
|
display:
|
|
|
|
- platform: max7219digit
|
|
|
|
cs_pin: GPIO15
|
|
|
|
num_chips: 4
|
|
|
|
rotate_chip: 0
|
|
|
|
intensity: 10
|
|
|
|
scroll_mode: 'STOP'
|
|
|
|
id: my_matrix
|
|
|
|
lambda: |-
|
|
|
|
it.printdigit("hello");
|