-
Notifications
You must be signed in to change notification settings - Fork 23
/
lilygo-t-can485.yaml
90 lines (76 loc) · 2.18 KB
/
lilygo-t-can485.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
esphome:
name: nibegw
comment: Nibegw
platform: ESP32
board: esp32dev
# General ESPHome setup
api:
reboot_timeout: 0s
ota:
- platform: esphome
password: !secret OTA_PASSWORD
logger:
wifi:
ssid: !secret WIFI_SSID
password: !secret WIFI_PASSWORD
fast_connect: true # Fast connect to connect to my hidden network
# It is recommended to disable powersave mode on wifi, to make sure the device does not miss UDP requests sent.
power_save_mode: none
# The device needs a static IP. Either do that here with the manual_ip node, or do it via another way (router)
# Load nibe component
external_components:
- source: github://elupus/esphome-nibe
# Set pins required for LilyGo T-CAN485 board
output:
- platform: gpio
id: ENABLE_PIN # Enable the chip
pin:
number: GPIO19
inverted: true
- platform: gpio
id: SE_PIN # Enable autodirection
pin:
number: GPIO17
inverted: true
- platform: gpio
id: ENABLE_5V_PIN # Enable 5V pin for RS485 chip
pin:
number: GPIO16
inverted: true
# Configure uart that will be used
uart:
rx_pin: GPIO21
tx_pin: GPIO22
baud_rate: 9600
# Configure NibeGW
nibegw:
udp:
# The target address(s) to send data to. May be a multicast address.
# When using Home Assistant: this is your Home Assistant IP.
target:
- ip: 192.168.255.254
port: 9999 #The Nibe Home Assistant integration listens to 9999 by default
# List of source address to accept data from, may be empty for no filter
source:
- 192.168.255.254
# Optional port this device will listen to to receive read requests. Defaults to 9999
# read_port: 9999
# Optional port this device will listen to to receive write request. Defaults to 10000
# write_port: 10000
acknowledge:
- MODBUS40
# Constant replies to certain requests cabe made
constants:
- address: MODBUS40
token: ACCESSORY
data: [
0x0A, # MODBUS version low
0x00, # MODBUS version high
0x01, # MODBUS address?
]
# Some helper functions to restart ESPHome from HA
button:
- platform: restart
name: Nibegw Restart
- platform: safe_mode
name: Nibegw Safe Mode Boot