Skip to content

Instantly share code, notes, and snippets.

@peyanski
Last active April 1, 2024 20:24
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save peyanski/423c50cd5b946ff798eb01aa4317d536 to your computer and use it in GitHub Desktop.
Save peyanski/423c50cd5b946ff798eb01aa4317d536 to your computer and use it in GitHub Desktop.
substitutions:
name: victron-mppt
external_components_source: github://KinDR007/VictronMPPT-ESPHOME@main
esphome:
name: ${name}
platform: ESP8266
board: d1_mini
external_components:
- source: ${external_components_source}
refresh: 0s
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ota:
api:
logger:
baud_rate: 0
esp8266_store_log_strings_in_flash: false
#mqtt:
# broker: !secret mqtt_host
# username: !secret mqtt_username
# password: !secret mqtt_password
# id: mqtt_client
uart:
id: uart_0
tx_pin: D8 # Not connected! The communication is read-only
rx_pin: D7 # Connect this this GPIO and GND to the MPPT charger
baud_rate: 19200
rx_buffer_size: 256
victron:
uart_id: uart_0
id: victron0
throttle: 10s
sensor:
- platform: victron
victron_id: victron0
max_power_yesterday:
name: "${name} max power yesterday"
max_power_today:
name: "${name} max power today"
yield_total:
name: "${name} yield total"
yield_yesterday:
name: "${name} yield yesterday"
yield_today:
name: "${name} yield today"
panel_voltage:
name: "${name} panel voltage"
panel_power:
name: "${name} panel power"
battery_current:
name: "${name} panel current"
battery_voltage:
name: "${name} battery voltage"
day_number:
name: "${name} day number"
charging_mode_id:
name: "${name} charging mode id"
error_code:
name: "${name} error code"
tracking_mode_id:
name: "${name} tracking mode id"
load_current:
name: "${name} load current"
text_sensor:
- platform: victron
victron_id: victron0
charging_mode:
name: "${name} charging mode"
error:
name: "${name} error"
tracking_mode:
name: "${name} tracking mode"
firmware_version:
name: "${name} firmware version"
device_type:
name: "${name} device type"
serial_number:
name: "${name} serial number"
binary_sensor:
- platform: victron
victron_id: victron0
load_state:
name: "${name} load state"
relay_state:
name: "${name} relay state"
@ltaylor29
Copy link

I couldn't get this to work with uart0, it claimed this was reserved, but found and article which suggested that uart_modbus would work which it does :)

@catalinalb
Copy link

I have tried both with "uart0" and with "uart_modbus"
after flasing the device I get:

"Leaving...
Hard resetting via RTS pin...
INFO Successfully uploaded program.
INFO UART logging is disabled (baud_rate=0). Not starting UART logs."

the victron-mppt is OFFLINE

"WARNING Can't connect to ESPHome API for victron-mppt.local: Error resolving IP address: [Errno -5] No address associated with hostname (APIConnectionError)
INFO Trying to connect to victron-mppt.local in the background"

I guess it is something related to the wifi? I did check the user and password are correct .... ?!?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment