107 lines
2.1 KiB
YAML
107 lines
2.1 KiB
YAML
esphome:
|
|
name: seeed-studio
|
|
friendly_name: seeed studio
|
|
|
|
esp32:
|
|
board: esp32-s3-devkitc-1
|
|
framework:
|
|
type: arduino
|
|
|
|
# Enable logging
|
|
logger:
|
|
level: DEBUG
|
|
|
|
# Enable Home Assistant API
|
|
api:
|
|
encryption:
|
|
key: "1tRYVfsGzt8mFr+ay9hE24pdPd8IACedduh9tLWg4xs="
|
|
|
|
ota:
|
|
- platform: esphome
|
|
password: "d68060a1d18b9d61354434595717070c"
|
|
|
|
wifi:
|
|
ssid: !secret wifi_ssid
|
|
password: !secret wifi_password
|
|
|
|
uart:
|
|
id: mod_bus_id
|
|
tx_pin: GPIO44 # Il faut les inverser !!!!
|
|
rx_pin: GPIO43
|
|
baud_rate: 4800
|
|
# debug:
|
|
# direction: BOTH
|
|
# dummy_receiver: false
|
|
# after:
|
|
# delimiter: "\n"
|
|
# sequence:
|
|
# - lambda: UARTDebug::log_string(direction, bytes);
|
|
|
|
modbus:
|
|
id: modbus1
|
|
uart_id: mod_bus_id
|
|
|
|
modbus_controller:
|
|
- id: modbus_controller1
|
|
address: 1
|
|
modbus_id: modbus1
|
|
setup_priority: -10
|
|
command_throttle: 2s
|
|
update_interval: 4s
|
|
- id: modbus_controller2
|
|
address: 2
|
|
modbus_id: modbus1
|
|
setup_priority: -10
|
|
command_throttle: 2s
|
|
update_interval: 4s
|
|
|
|
sensor:
|
|
- platform: modbus_controller
|
|
id: sensor1
|
|
modbus_controller_id: modbus_controller1
|
|
name: "Wind speed"
|
|
register_type: read
|
|
address: 0
|
|
value_type: U_WORD
|
|
accuracy_decimals: 0
|
|
filters:
|
|
- max:
|
|
window_size: 1
|
|
send_every: 1
|
|
- min:
|
|
window_size: 1
|
|
send_every: 1
|
|
on_value:
|
|
then:
|
|
- mqtt.publish:
|
|
topic: "rbo2"
|
|
payload: !lambda 'return "Vent (x 10 en m/s) --> " + to_string(x);'
|
|
- platform: modbus_controller
|
|
modbus_controller_id: modbus_controller2
|
|
name: "Wind direction gear"
|
|
register_type: read
|
|
address: 0
|
|
value_type: U_WORD
|
|
accuracy_decimals: 0
|
|
filters:
|
|
- max:
|
|
window_size: 1
|
|
send_every: 1
|
|
- min:
|
|
window_size: 1
|
|
send_every: 1
|
|
on_value:
|
|
then:
|
|
- mqtt.publish:
|
|
topic: "rbo2"
|
|
payload: !lambda 'return "Sens --> " + to_string(x);'
|
|
|
|
mqtt:
|
|
broker: "pc-raymond.home"
|
|
id: mqtt1
|
|
log_topic: null
|
|
username: admin
|
|
password: !secret mqtt
|
|
birth_message:
|
|
topic: rbo
|
|
payload: 'Nouvelle connexion MQTT...' |