-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathexample-t-can485.yaml
More file actions
251 lines (223 loc) · 8.54 KB
/
Copy pathexample-t-can485.yaml
File metadata and controls
251 lines (223 loc) · 8.54 KB
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
# Example Tigo Monitor Configuration using the LilyGO T-CAN485
#
# This is the "Home Assistant only" profile: no web UI, no REST API, no on-flash
# history. Every value goes to Home Assistant over the native ESPHome API.
#
# The hardware base (esp32-lilygo-t-can485.yaml) provides:
# - the ESP32 / 4MB flash / ESP-IDF framework setup, with no PSRAM
# - the three GPIOs that power up and enable the RS485 transceiver
# - the UART on GPIO21/22 and the tigo_monitor hub itself
# so this file only layers on WiFi credentials, sensors, and app config.
#
# ---------------------------------------------------------------------------
# FINDING YOUR PANELS (this is the part the web UI would normally do for you)
# ---------------------------------------------------------------------------
# Panel addresses are discovered from the bus at runtime, so you cannot know
# them before the first flash. The workflow:
#
# 1. Flash this file as-is. The system-wide sensors below start working
# immediately — total power, energy, and device count need no addresses.
# 2. Let it listen for 10-15 minutes so the node table fills in, then watch
# the logs: esphome logs boards/example-t-can485.yaml
# 3. Press the "Generate YAML Config" button (it appears in Home Assistant).
# It prints a ready-to-paste `sensor:` block, one entry per discovered
# panel, with the real addresses filled in.
# 4. Paste the entries you want under `sensor:` below and re-flash. Trim the
# per-panel values you do not care about — see the commented example at the
# bottom of the sensor list.
#
# "Print Device Mappings" dumps the same node table in a more compact form if
# you just want to eyeball what has been seen.
packages:
board: !include esp32-lilygo-t-can485.yaml
# External components.
#
# Only `tigo_monitor` is pulled in — `tigo_server` is deliberately absent, since
# the web server requires PSRAM this board does not have. Listing it explicitly
# means ESPHome never even considers it.
#
# `refresh: 0s` re-checks the branch on every build. Drop it (or pin `ref:` to a
# tag) once you are no longer tracking a moving branch.
external_components:
- source:
type: git
url: https://github.com/RAR/esphome-tigomonitor
ref: main
components: [tigo_monitor]
refresh: 0s
wifi:
ssid: "YOUR_WIFI_SSID"
password: "YOUR_WIFI_PASSWORD"
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Tigo-Monitor Fallback Hotspot"
password: "12345678"
captive_portal:
# Onboard led, useful for debugging and simple state display
light:
- platform: esp32_rmt_led_strip
rgb_order: GRB
pin:
number: 4
num_leds: 1
chipset: ws2812
name: "Onboard RGB LED"
id: onboard_led
icon: mdi:led-on
# Enable logging.
#
# Unlike the AtomS3R config, do NOT set `baud_rate: 0` here. The RS485 bus is on
# GPIO21/22, a different hardware UART from the USB console on GPIO1/3, so USB
# logging costs the Tigo bus nothing — and it is how you read the output of the
# "Generate YAML Config" button.
#
# Keep this at INFO or lower; the button logs at INFO.
logger:
level: INFO
# Enable Home Assistant API — this is how every value below reaches HA.
api:
# Strongly recommended. Generate one at https://esphome.io/components/api.html
# encryption:
# key: "YOUR_BASE64_KEY"
ota:
- platform: esphome
password: "YOUR_OTA_PASSWORD"
# Tigo Monitor control buttons — your discovery tooling on a board with no web UI.
button:
- platform: tigo_monitor
name: "Generate YAML Config"
id: generate_yaml_button
tigo_monitor_id: tigo_hub
button_type: yaml_generator
- platform: tigo_monitor
name: "Print Device Mappings"
id: device_mappings_button
tigo_monitor_id: tigo_hub
button_type: device_mappings
- platform: tigo_monitor
name: "Reset Node Table"
id: reset_node_table_button
tigo_monitor_id: tigo_hub
button_type: reset_node_table
# Re-runs the CCA query on demand. Only useful with `cca_ip` set below.
- platform: tigo_monitor
name: "Sync from CCA"
id: sync_from_cca_button
tigo_monitor_id: tigo_hub
button_type: sync_from_cca
sensor:
# --- System totals (work immediately, no addresses needed) ----------------
# Aggregate sensors carry no `address:` — the component picks their type from
# keywords in the name, so keep the names' keywords intact if you rename them.
- platform: tigo_monitor
tigo_monitor_id: tigo_hub
name: "Total Solar Power"
id: total_solar_power
filters:
- sliding_window_moving_average:
window_size: 5
send_every: 1
- platform: tigo_monitor
tigo_monitor_id: tigo_hub
name: "Total System Energy"
id: total_system_energy
- platform: tigo_monitor
tigo_monitor_id: tigo_hub
name: "Discovered Devices Count"
id: discovered_devices_count
# --- Health -------------------------------------------------------------
- platform: tigo_monitor
tigo_monitor_id: tigo_hub
name: "Stale Panel Count"
id: stale_panel_count
- platform: tigo_monitor
tigo_monitor_id: tigo_hub
name: "Missed Frame Count"
id: missed_frame_count
# The number to watch on this board. There is no PSRAM to fall back on, so
# internal heap is the whole memory budget. A healthy install sits well above
# 100KB and stays flat; a steady decline means something is leaking.
# (Do not add a "PSRAM Free" sensor here — it would always read 0.)
- platform: tigo_monitor
tigo_monitor_id: tigo_hub
name: "Internal RAM Free"
id: internal_ram_free
- platform: tigo_monitor
tigo_monitor_id: tigo_hub
name: "Internal RAM Minimum"
id: internal_ram_min
# --- Board diagnostics ---------------------------------------------------
- platform: wifi_signal
name: "Tigo Monitor WiFi Signal"
id: wifi_rssi
update_interval: 60s
- platform: uptime
name: "Tigo Monitor Uptime"
id: uptime_sensor
# --- Per-panel sensors ---------------------------------------------------
# Paste the output of the "Generate YAML Config" button here. Each block looks
# like the following — `address` is the 4-character short address from the bus.
# Delete the value lines you do not want; every one you keep becomes its own
# Home Assistant entity, so 20 panels x 8 values is 160 entities.
#
# - platform: tigo_monitor
# tigo_monitor_id: tigo_hub
# address: "A1B2"
# name: "Panel 1"
# power_in: {}
# voltage_in: {}
# voltage_out: {}
# power_out: {}
# current_in: {}
# current_out: {}
# temperature: {}
# rssi: {}
text_sensor:
- platform: wifi_info
ip_address:
name: "Tigo Monitor IP Address"
ssid:
name: "Tigo Monitor Connected SSID"
- platform: version
name: "Tigo Monitor ESPHome Version"
binary_sensor:
- platform: status
name: "Tigo Monitor Status"
# True once the bus has been quiet long enough to call it night — useful for
# suppressing "no production" alerts after sunset.
- platform: tigo_monitor
tigo_monitor_id: tigo_hub
night_mode:
name: "Tigo Night Mode"
switch:
- platform: restart
name: "Tigo Monitor Restart"
# Optional: gives the component a clock for daily energy rollover.
time:
- platform: homeassistant
id: ha_time
# Deep-merges into the `tigo_monitor:` block defined in the board package rather
# than replacing it, so the uart_id and device count set there are preserved.
tigo_monitor:
time_id: ha_time
# --- Panel names from the CCA (optional but recommended) -----------------
# Uncomment and set your CCA's IP to get real panel names, string labels and
# MPPT/inverter grouping instead of bare barcodes. This is plain HTTP from the
# component to the CCA — it needs no PSRAM and no web server, so it works fine
# on this board.
#
# The component GETs http://<ip>/cgi-bin/summary_config with the CCA's default
# credentials (Tigo:$olar, hardcoded), then fuzzy-matches the barcodes it finds
# against the addresses discovered on the bus.
#
# Note this is NOT what the BLE CCA bridge does — that only fetches CCA device
# and network info (DEVICE_PING / DEVICE_INFO) and never touches panel layout.
# If your CCA runs firmware 4.0.4+ it may refuse this endpoint, in which case
# layout has to come from the Tigo cloud import, which needs the web UI.
#
# Verify the endpoint answers before enabling — note the SINGLE quotes, or the
# shell eats `$olar`:
# curl -s -u 'Tigo:$olar' http://YOUR-CCA-IP/cgi-bin/summary_config | head
#
# cca_ip: "192.168.1.50"
# sync_cca_on_startup: true # default; syncs ~15s after boot