-
Notifications
You must be signed in to change notification settings - Fork 2
/
ac_daikin.yaml
94 lines (76 loc) · 2.49 KB
/
ac_daikin.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
substitutions:
device_name: daikin
upper_devicename: DAIKIN
#===============================================================================
esphome:
name: ${device_name}
platform: ESP8266
board: esp12e
platformio_options:
build_flags:
- '-DESPHOME_LOG_LEVEL=ESPHOME_LOG_LEVEL_INFO'
- '-Wl,-Teagle.flash.4m.ld'
- '-Wno-sign-compare'
- '-Wno-unused-but-set-variable'
- '-Wno-unused-variable'
- '-fno-exceptions'
- '-D_IR_ENABLE_DEFAULT_=false'
- '-DDECODE_DAIKIN64=true'
- '-DSEND_DAIKIN64=true'
- '${common.build_flags}'
includes:
- shared_libs/MQTTSubscribeJsonSensor.h
- shared_libs/PowerTracker.h
- daikin/lib/IRDaikin.h
- daikin/DaikinClimateComponent.h
libraries:
# Настройки Wi-Fi
wifi:
networks:
- ssid: !secret wifi_24_name
password: !secret wifi_24_pass
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "$upper_devicename Fallback Hotspot"
password: !secret esphome_captive_pass
captive_portal:
mqtt:
broker: !secret mqtt_broker
username: !secret mqtt_user
password: !secret mqtt_pass
port: !secret mqtt_broker_port
ota:
password: !secret esphome_pass
web_server:
port: 80
# Отключаем лог
logger:
level: INFO
esp8266_store_log_strings_in_flash: False
#===============================================================================
custom_component:
id: ${device_name}
lambda: |-
uint16_t receiver_pin = D5;
uint16_t transmitter_pin = D2;
std::string current_temperature_sensor_topic = "zigbee2mqtt/sensor_temp_hum_pre_bedroom";
std::string current_temperature_sensor_field = "temperature";
auto daikin_climate = new mqtt_climate::DaikinClimateComponent(receiver_pin, transmitter_pin, "${device_name}");
daikin_climate->set_current_temperature_sensor(current_temperature_sensor_topic, current_temperature_sensor_field);
daikin_climate->set_power_sensor(id(power_sensor));
App.register_component(daikin_climate);
return {daikin_climate};
sensor:
- platform: custom
lambda: |-
auto mqtt_power_sensor = new mqtt_subscribe_json::MQTTSubscribeJsonSensor();
mqtt_power_sensor->set_topic("zigbee2mqtt/air_conditioner_bedroom", "power");
App.register_component(mqtt_power_sensor);
return {mqtt_power_sensor};
sensors:
name: "${device_name}_power"
accuracy_decimals: 2
unit_of_measurement: "W"
icon: "mdi:flash"
id: power_sensor