#230414 V1 substitutions: # !!! Achtung: nicht verändern, name =Netzwerkname!!! name: womo-victron-devices # !!! Achtung: nicht verändern, name = Netzwerkname!!! name0: womo-victron-mppt name1: womo-victron-shunt basetopic: womo-victron-devices device0: victron0 device1: victron1 config_version: "230414.v1" external_components_source0: github://KinDR007/VictronMPPT-ESPHOME@main external_components_source1: github://KinDR007/VictronSmartShunt-ESPHOME@main tx0_pin: GPIO17 rx0_pin: GPIO16 tx1_pin: GPIO19 rx1_pin: GPIO23 accuracy: '2' external_components: - source: ${external_components_source0} refresh: 0s - source: ${external_components_source1} refresh: 0s esphome: name: ${name} esp32: board: wemos_d1_mini32 framework: type: arduino # Enable Home Assistant API api: encryption: key: !secret key_womo_victron_devices ota: password: !secret password_womo_victron_devices wifi: ssid: !secret wifi_ssid_womo password: !secret wifi_password_womo # Enable fallback hotspot (captive portal) in case wifi connection fails ap: ssid: "hierderWLANName" password: "hierdasPassword" mqtt: broker: !secret mqtt_host_womo username: !secret mqtt_username_womo password: !secret mqtt_password_womo birth_message: topic: $basetopic/status payload: online will_message: topic: $basetopic/status payload: offline shutdown_message: topic: $basetopic/status payload: shutdown discovery: true discovery_prefix: homeassistant log_topic: $basetopic/debug topic_prefix: $basetopic captive_portal: # Enable logging logger: uart: - id: uart0 tx_pin: ${tx0_pin} # Not used! The communication is read-only rx_pin: ${rx0_pin} baud_rate: 19200 rx_buffer_size: 256 - id: uart1 tx_pin: ${tx1_pin} # Not used! The communication is read-only rx_pin: ${rx1_pin} baud_rate: 19200 rx_buffer_size: 256 victron: uart_id: uart0 throttle: 10s victron_smart_shunt: uart_id: uart1 sensor: - platform: wifi_signal name: "${name} WiFi Signal Sensor" id: rssi_sensor update_interval: 15s - platform: template name: "Wifi Quality" unit_of_measurement: "%" accuracy_decimals: 0 icon: "mdi:wifi" update_interval: 15s lambda: |- int quality; const int rssi = id(rssi_sensor).state; if (rssi <= -100) { quality = 0;} else if (rssi >= -50) { quality = 100; } else { quality = 2 * (rssi + 100); } return quality; - platform: uptime name: "${name} Uptime" id: uptime_s update_interval: 5s - platform: victron max_power_yesterday: name: "${name0} max power yesterday" max_power_today: name: "${name0} max power today" yield_total: name: "${name0} yield total" yield_yesterday: name: "${name0} yield yesterday" yield_today: name: "${name0} yield today" panel_voltage: name: "${name0} panel voltage" panel_power: name: "${name0} panel power" battery_current: name: "${name0} panel current" battery_voltage: name: "${name0} battery voltage" day_number: name: "${name0} day number" charging_mode_id: name: "${name0} charging mode id" error_code: name: "${name0} error code" tracking_mode_id: name: "${name0} tracking mode id" load_current: name: "${name0} load current" - platform: victron_smart_shunt battery_voltage: name: "${name1} Battery Voltage" id: bv accuracy_decimals: ${accuracy} battery_current: name: "${name1} Battery Current" id: bc accuracy_decimals: ${accuracy} fw_version: name: "fw" id: fw pid: name: "pid" id: pid instantaneous_power: name: "${name1} instantaneous power" id: instantaneous_power accuracy_decimals: ${accuracy} time_to_go: name: "${name1} time to go" id: time_to_go consumed_amp_hours: name: "${name1} consumed amp hours" id: consumed_amp_hours unit_of_measurement: Ah accuracy_decimals: ${accuracy} min_battery_voltage: name: "${name1} Min battery voltage" id: min_battery_voltage accuracy_decimals: ${accuracy} max_battery_voltage: name: "${name1} Max battery voltage" id: max_battery_voltage accuracy_decimals: ${accuracy} amount_of_charged: name: "${name1} Amount of charged" id: amount_of_charged filters: - multiply: 0.001 unit_of_measurement: kWh accuracy_decimals: ${accuracy} bmv_alarm_text: name: "BMV alarm" id: bmv_alarm bmv_text: name: "bmv - text" id: bmv_pid last_full_charge: name: "${name1} Time since last full charge" id: last_full_charge deepest_discharge: name: "${name1} Depth of the deepest discharge" id: deepest_discharge unit_of_measurement: Ah accuracy_decimals: ${accuracy} last_discharge: name: "${name1} Depth of the last discharge" id: last_discharge unit_of_measurement: Ah accuracy_decimals: ${accuracy} discharged_energy: name: "${name1} Amount of discharged energy" id: discharged_energy filters: - multiply: 0.001 unit_of_measurement: kWh accuracy_decimals: ${accuracy} state_of_charge: id: state_of_charge name: "SoC" text_sensor: - platform: victron charging_mode: name: "${name0} charging mode" error: name: "${name0} error" tracking_mode: name: "${name0} tracking mode" firmware_version: name: "${name0} firmware version" device_type: name: "${name0} device type" serial_number: name: "${name0} serial number" - platform: template name: "Config Version" icon: mdi:information-outline lambda: |- return {"${config_version}"}; - platform: version name: "Esphome Version" icon: mdi:information-outline - platform: wifi_info ip_address: name: "${name} IP Address" icon: mdi:ip ssid: name: "${name} Connected SSID" icon: mdi:wifi bssid: name: "${name} Connected BSSID" mac_address: name: "${name} Mac Wifi Address" - platform: template name: "${name} Uptime (formatted)" lambda: |- uint32_t dur = id(uptime_s).state; int dys = 0; int hrs = 0; int mnts = 0; if (dur > 86399) { dys = trunc(dur / 86400); dur = dur - (dys * 86400); } if (dur > 3599) { hrs = trunc(dur / 3600); dur = dur - (hrs * 3600); } if (dur > 59) { mnts = trunc(dur / 60); dur = dur - (mnts * 60); } char buffer[17]; sprintf(buffer, "%ud %02uh %02um %02us", dys, hrs, mnts, dur); return {buffer}; icon: mdi:clock-start update_interval: 5s binary_sensor: - platform: victron load_state: name: "${name0} load state" relay_state: name: "${name0} relay state"