-
Notifications
You must be signed in to change notification settings - Fork 1
/
a_tst_mqtt_bridge1.yaml
132 lines (101 loc) · 2.79 KB
/
a_tst_mqtt_bridge1.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#------------------------------
#-- a_tst_mqtt_bridge1.yaml
#-- Petit test pour tester ma nouvelle config MQTT master & slave avec un MQTT en mode bridge
#-- C'est juste pour lui fornir des données pour voir si cela fonctionne le 'bridge'
#-- zf210622.0022
#--
# sources:
#
# IMPORTANT: il faut ponter les pin D1 et D2 afin de pouvoir bénéficier de la pull up interne de D1 pour D2,
# car il n'y a pas de possibilité d'avoir une pull up interne dans un pulse_counter !
esphome:
name: a_tst_mqtt_bridge1
platform: ESP8266
board: d1_mini
# Configuration WIFI
wifi:
networks:
- ssid: !secret wifi_ssid
- password: !secret wifi_password
- ssid: !secret wifi_ssid2
- password: !secret wifi_password2
- ssid: !secret wifi_ssid3
- password: !secret wifi_password3
- ssid: !secret wifi_ssid4
- password: !secret wifi_password4
- ssid: !secret wifi_ssid5
- password: !secret wifi_password5
- ssid: !secret wifi_ssid6
- password: !secret wifi_password6
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "a_tst_mqtt_bridge1 Fallback"
password: !secret ap_wifi_password
captive_portal:
# Enable logging
logger:
# level: VERBOSE
# Enable Home Assistant API
#api:
# password: !secret api_password
# Enable OTA
ota:
password: !secret ota_password
# WEB Server
web_server:
port: 80
# MQTT server
mqtt:
broker: 192.168.0.43
port: !secret mqtt_port_dev
username: !secret mqtt_user_dev
password: !secret mqtt_password_dev
# Définition des Switch's
switch:
- platform: gpio
name: "a_tst_mqtt_bridge1 LED"
inverted: True
id: led
pin: D4
- platform: restart
name: "a_tst_mqtt_bridge1 Restart"
# Définition des binary sensors
binary_sensor:
- platform: gpio
name: "a_tst_mqtt_bridge1 Reed"
pin:
number: D1
mode: INPUT_PULLUP
inverted: True
on_press:
- switch.turn_on: led
- delay: 2s
- switch.turn_off: led
# Définitions des texts sensors
text_sensor:
- platform: wifi_info
ip_address:
name: "a_tst_mqtt_bridge1 IP Address"
id: wifi_ip
ssid:
name: "a_tst_mqtt_bridge1 Connected SSID"
id: wifi_ssid
# Définitions des Sensors
sensor:
- platform: wifi_signal
name: "a_tst_mqtt_bridge1 Signal Wi-Fi"
update_interval: 60s
- platform: uptime
name: "a_tst_mqtt_bridge1 Uptime"
update_interval: 10s
- platform: pulse_counter
name: 'a_tst_mqtt_bridge1 Flow'
id: my_flow_meter
pin: D2
unit_of_measurement: 'l/mn'
update_interval: 60s # Très important car c'est ici que l'on intègre sur une minute !
filters:
- multiply: 0.3 # Facteur de conversion durée impulsion / litres minutes
- sliding_window_moving_average:
window_size: 5
send_every: 5