mirror of
https://github.com/RichieCahill/dotfiles.git
synced 2026-04-17 04:58:19 -04:00
349 lines
8.4 KiB
YAML
349 lines
8.4 KiB
YAML
modbus:
|
|
- name: victron_gx
|
|
type: tcp
|
|
host: 192.168.103.30
|
|
port: 502
|
|
timeout: 3
|
|
delay: 2
|
|
lazy_error_count: 10
|
|
sensors:
|
|
# ---- SOLAR CHARGER (Unit ID 226) ----
|
|
- name: Solar Voltage
|
|
slave: 226
|
|
address: 776
|
|
input_type: holding
|
|
data_type: uint16
|
|
scale: 0.01
|
|
precision: 2
|
|
unit_of_measurement: "V"
|
|
device_class: voltage
|
|
state_class: measurement
|
|
|
|
- name: Solar Amperage
|
|
slave: 226
|
|
address: 777
|
|
input_type: holding
|
|
data_type: int16
|
|
scale: 0.1
|
|
precision: 1
|
|
unit_of_measurement: "A"
|
|
device_class: current
|
|
state_class: measurement
|
|
|
|
- name: Solar Wattage
|
|
slave: 226
|
|
address: 789
|
|
input_type: holding
|
|
data_type: uint16
|
|
scale: 0.1
|
|
unit_of_measurement: "W"
|
|
device_class: power
|
|
state_class: measurement
|
|
|
|
- name: Solar Yield Today
|
|
slave: 226
|
|
address: 784
|
|
input_type: holding
|
|
data_type: uint16
|
|
scale: 0.1
|
|
precision: 3
|
|
unit_of_measurement: "kWh"
|
|
device_class: energy
|
|
state_class: total
|
|
|
|
# DC system
|
|
- name: DC Voltage
|
|
slave: 100
|
|
address: 840
|
|
input_type: holding
|
|
data_type: uint16
|
|
scale: 0.1
|
|
precision: 2
|
|
unit_of_measurement: "V"
|
|
device_class: voltage
|
|
state_class: measurement
|
|
unique_id: dc_voltage
|
|
|
|
- name: DC Wattage
|
|
slave: 100
|
|
address: 860
|
|
input_type: holding
|
|
data_type: int16
|
|
scale: 1
|
|
precision: 0
|
|
unit_of_measurement: "W"
|
|
device_class: power
|
|
state_class: measurement
|
|
unique_id: dc_wattage
|
|
|
|
# GPS
|
|
- name: GPS Latitude
|
|
slave: 100
|
|
address: 2800
|
|
input_type: holding
|
|
data_type: int32
|
|
scale: 0.0000001
|
|
precision: 7
|
|
state_class: measurement
|
|
unique_id: gps_latitude
|
|
|
|
- name: GPS Longitude
|
|
slave: 100
|
|
address: 2802
|
|
input_type: holding
|
|
data_type: int32
|
|
scale: 0.0000001
|
|
precision: 7
|
|
state_class: measurement
|
|
unique_id: gps_longitude
|
|
|
|
- name: GPS Course
|
|
slave: 100
|
|
address: 2804
|
|
input_type: holding
|
|
data_type: uint16
|
|
scale: 0.01
|
|
precision: 2
|
|
unit_of_measurement: "°"
|
|
state_class: measurement
|
|
unique_id: gps_course
|
|
|
|
- name: GPS Speed
|
|
slave: 100
|
|
address: 2805
|
|
input_type: holding
|
|
data_type: uint16
|
|
scale: 0.01
|
|
precision: 2
|
|
unit_of_measurement: "m/s"
|
|
state_class: measurement
|
|
unique_id: gps_speed
|
|
|
|
- name: GPS Fix
|
|
slave: 100
|
|
address: 2806
|
|
input_type: holding
|
|
data_type: uint16
|
|
scale: 1
|
|
state_class: measurement
|
|
unique_id: gps_fix
|
|
|
|
- name: GPS Satellites
|
|
slave: 100
|
|
address: 2807
|
|
input_type: holding
|
|
data_type: uint16
|
|
scale: 1
|
|
state_class: measurement
|
|
unique_id: gps_satellites
|
|
|
|
- name: GPS Altitude
|
|
slave: 100
|
|
address: 2808
|
|
input_type: holding
|
|
data_type: int32
|
|
scale: 0.16
|
|
precision: 1
|
|
unit_of_measurement: "m"
|
|
state_class: measurement
|
|
unique_id: gps_altitude
|
|
|
|
# ---- CHARGER (Unit ID 223) ----
|
|
- name: Charger Output 1 Voltage
|
|
slave: 223
|
|
address: 2307
|
|
input_type: holding
|
|
data_type: uint16
|
|
scale: 0.01
|
|
precision: 2
|
|
unit_of_measurement: "V"
|
|
device_class: voltage
|
|
state_class: measurement
|
|
unique_id: charger_output_1_voltage
|
|
|
|
- name: Charger Output 1 Current
|
|
slave: 223
|
|
address: 2308
|
|
input_type: holding
|
|
data_type: int16
|
|
scale: 0.1
|
|
precision: 1
|
|
unit_of_measurement: "A"
|
|
device_class: current
|
|
state_class: measurement
|
|
unique_id: charger_output_1_current
|
|
|
|
- name: Charger Output 1 Temperature
|
|
slave: 223
|
|
address: 2309
|
|
input_type: holding
|
|
data_type: int16
|
|
scale: 0.1
|
|
precision: 1
|
|
unit_of_measurement: "°C"
|
|
device_class: temperature
|
|
state_class: measurement
|
|
unique_id: charger_output_1_temperature
|
|
|
|
- name: Charger AC Current
|
|
slave: 223
|
|
address: 2314
|
|
input_type: holding
|
|
data_type: int16
|
|
scale: 0.1
|
|
precision: 1
|
|
unit_of_measurement: "A"
|
|
device_class: current
|
|
state_class: measurement
|
|
unique_id: charger_ac_current
|
|
|
|
- name: Charger AC Current Limit
|
|
slave: 223
|
|
address: 2316
|
|
input_type: holding
|
|
data_type: int16
|
|
scale: 0.1
|
|
precision: 1
|
|
unit_of_measurement: "A"
|
|
device_class: current
|
|
state_class: measurement
|
|
unique_id: charger_ac_current_limit
|
|
|
|
- name: Charger On Off Raw
|
|
slave: 223
|
|
address: 2317
|
|
input_type: holding
|
|
data_type: uint16
|
|
scale: 1
|
|
state_class: measurement
|
|
unique_id: charger_on_off_raw
|
|
|
|
- name: Charger Charge State Raw
|
|
slave: 223
|
|
address: 2318
|
|
input_type: holding
|
|
data_type: uint16
|
|
scale: 1
|
|
state_class: measurement
|
|
unique_id: charger_charge_state_raw
|
|
|
|
- name: Charger Error Code
|
|
slave: 223
|
|
address: 2319
|
|
input_type: holding
|
|
data_type: uint16
|
|
scale: 1
|
|
state_class: measurement
|
|
unique_id: charger_error_code
|
|
|
|
- name: Charger Relay State
|
|
slave: 223
|
|
address: 2320
|
|
input_type: holding
|
|
data_type: uint16
|
|
scale: 1
|
|
state_class: measurement
|
|
unique_id: charger_relay_state
|
|
|
|
- name: Charger Low Voltage Alarm
|
|
slave: 223
|
|
address: 2321
|
|
input_type: holding
|
|
data_type: uint16
|
|
scale: 1
|
|
state_class: measurement
|
|
unique_id: charger_low_voltage_alarm
|
|
|
|
- name: Charger High Voltage Alarm
|
|
slave: 223
|
|
address: 2322
|
|
input_type: holding
|
|
data_type: uint16
|
|
scale: 1
|
|
state_class: measurement
|
|
unique_id: charger_high_voltage_alarm
|
|
|
|
template:
|
|
- sensor:
|
|
- name: Charger On Off
|
|
state: >-
|
|
{% set v = states('sensor.charger_on_off_raw')|int %}
|
|
{{ {0:'Off',1:'On',2:'Error',3:'Unavailable'}.get(v, 'Unknown') }}
|
|
|
|
- name: Charger Charge State
|
|
state: >-
|
|
{% set v = states('sensor.charger_charge_state_raw')|int %}
|
|
{{ {
|
|
0:'Off',1:'Low Power',2:'Fault',3:'Bulk',4:'Absorption',5:'Float',
|
|
6:'Storage',7:'Equalize/Manual',8:'External Control'
|
|
}.get(v,'Unknown') }}
|
|
|
|
- name: "Charger DC Wattage"
|
|
unique_id: charger_dc_wattage
|
|
unit_of_measurement: "W"
|
|
device_class: power
|
|
state_class: measurement
|
|
state: >-
|
|
{% set v = states('sensor.charger_output_1_voltage')|float(0) %}
|
|
{% set a = states('sensor.charger_output_1_current')|float(0) %}
|
|
{{ (v * a) | round(1) }}
|
|
|
|
- binary_sensor:
|
|
- name: Charger Low Voltage Alarm Active
|
|
state: "{{ states('sensor.charger_low_voltage_alarm')|int == 2 }}"
|
|
- name: Charger High Voltage Alarm Active
|
|
state: "{{ states('sensor.charger_high_voltage_alarm')|int == 2 }}"
|
|
|
|
sensor:
|
|
- platform: integration
|
|
source: sensor.dc_wattage
|
|
name: DC System Energy
|
|
unit_prefix: k
|
|
round: 2
|
|
method: trapezoidal
|
|
max_sub_interval:
|
|
minutes: 5
|
|
|
|
- platform: integration
|
|
source: sensor.solar_wattage
|
|
name: Solar Yield
|
|
unit_prefix: k
|
|
round: 2
|
|
method: trapezoidal
|
|
max_sub_interval:
|
|
minutes: 5
|
|
|
|
- platform: integration
|
|
source: sensor.charger_dc_wattage
|
|
name: DC Charger Energy
|
|
unit_prefix: k
|
|
round: 2
|
|
method: trapezoidal
|
|
max_sub_interval:
|
|
minutes: 5
|
|
|
|
utility_meter:
|
|
dc_load_energy_daily:
|
|
source: sensor.dc_system_energy
|
|
cycle: daily
|
|
|
|
dc_load_energy_monthly:
|
|
source: sensor.dc_system_energy
|
|
cycle: monthly
|
|
|
|
solar_yield_daily:
|
|
source: sensor.solar_yield
|
|
cycle: daily
|
|
|
|
solar_yield_monthly:
|
|
source: sensor.solar_yield
|
|
cycle: monthly
|
|
|
|
charger_dc_wattage_daily:
|
|
source: sensor.dc_charger_energy
|
|
cycle: daily
|
|
|
|
charger_dc_wattage_monthly:
|
|
source: sensor.dc_charger_energy
|
|
cycle: monthly
|