Yaml errors that i cannot fix

Dear Home Assistant forum,
I bought a HA green and attempted to follow a guide from ‘Ucatchmydrift’ to configure Home assistant to read data from a Epever UP Hi 3000 solar charge/inverter.
Part of this guide involved pasting his hard work in to the configuration.yaml file on the HA green and this is where i get errors and try as i might i cannot see why although i have never had dealings with a .yaml script before.
I hope someone can find the time to give me some advice please to save me having to stop the project to learn yaml.
Kind regards
Ade
I have posted the error below:

end of the stream or a document separator is expected (31:1)

28 | input_type: input
29 | scale: 0.01
30 | precision: 2
31 | - name: “Grid Current”
------^
32 | unit_of_measurement: A
33 | slave: 10

And the full configuration.yaml file here. I’m sorry i do not know how to format this code, if i did i could probably fix the error myself.


# Loads default set of integrations. Do not remove.
default_config:

# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

modbus:
- name: epever
type: rtuovertcp
host: 192.168.0.188
port: 8088
delay: 5
timeout: 10
close_comm_on_error: false
retry_on_empty: true
retries: 20
sensors:
# Utility
- name: "Grid Voltage"
unit_of_measurement: V
slave: 10
address: 0x3500
input_type: input
scale: 0.01
precision: 2
- name: "Grid Current"
unit_of_measurement: A
slave: 10
address: 0x3501
input_type: input
scale: 0.01
precision: 2
- name: "Grid State"
# 0:Normal, 1:Low input; 2:High input, 3: No connected
slave: 10
address: 0x3511
input_type: input
- name: "Grid Total"
unit_of_measurement: kWh
slave: 10
address: 0x350F
input_type: input
scale: 0.01
precision: 2
data_type: int32
swap: word
count: 2
# PV Array
- name: "PV Voltage"
unit_of_measurement: V
slave: 10
address: 0x3549
input_type: input
scale: 0.01
precision: 2
- name: "PV Current"
unit_of_measurement: A
slave: 10
address: 0x354A
input_type: input
scale: 0.01
precision: 2
- name: "PV Power"
unit_of_measurement: W
slave: 10
address: 0x354B
input_type: input
scale: 0.01
precision: 2
data_type: int32
swap: word
count: 2
- name: "PV Total"
unit_of_measurement: kWh
slave: 10
address: 0x3557
input_type: input
scale: 0.01
precision: 2
data_type: int32
swap: word
count: 2
# Load
- name: "Load Voltage"
unit_of_measurement: V
slave: 10
address: 0x3521
input_type: input
scale: 0.01
precision: 2
- name: "Load Current"
unit_of_measurement: A
slave: 10
address: 0x3522
input_type: input
scale: 0.01
precision: 2
- name: "Load Total"
unit_of_measurement: kWh
slave: 10
address: 0x3530
input_type: input
scale: 0.01
precision: 2
data_type: int32
swap: word
count: 2
# Battery
- name: "Battery Voltage"
unit_of_measurement: V
slave: 10
address: 0x3580
input_type: input
scale: 0.01
precision: 2
- name: "Battery Current"
unit_of_measurement: A
slave: 10
address: 0x3581
input_type: input
scale: 0.01
precision: 2
- name: "Battery Capacity"
unit_of_measurement: "%"
slave: 10
address: 0x3586
input_type: input
scale: 1
- name: "Battery Temp"
#ElectricChrgBatteryTemp
unit_of_measurement: "°C"
slave: 10
address: 0x3512
input_type: input
scale: 0.01
- name: "Battery State"
# 0:Normal, 1:Overvoltage, 2:Undervoltage, 3:Undervoltage Disconnect, 4:Fault
slave: 10
address: 0x3589
input_type: input
- name: "Charging Mode"
# 1:Solar Priority, 2:Utility & Solar, 3:Solar
slave: 10
address: 0x9607
input_type: holding
- name: "Inverter Mode"
# 0:Inverter priority, 1:Utility Priority
slave: 10
address: 0x9608
input_type: holding
- name: "Inverter Temp"
#LoadHeatSink2Temp
unit_of_measurement: "°C"
slave: 10
address: 0x3533
input_type: input
scale: 0.01
template:
sensor:
- name: "Grid Power"
unit_of_measurement: W
device_class: power
state: "{{((states('sensor.grid_current')| float(0) * states('sensor.grid_voltage')| float(0))) | round(2) }}"

- name: "Power into batt"
state: "{{ states('sensor.grid_power') | float + states('sensor.pv_power') | float }}"
unit_of_measurement: W
device_class: power

- name: "House Load"
unit_of_measurement: W
device_class: power
state: "{{((states('sensor.load_current')| float(0) * states('sensor.load_voltage')| float(0))) | round(2) }}"
sensor:
- platform: integration
source: sensor.house_load
name: energy_used
unit_prefix: k
round: 2

Nevermind, did some reading on yaml formatting and typed it in by hand and now have a green check mark :slight_smile:

Correct indentation is very important in yaml.

1 Like

Thanks Tom,
I am learning slowly :slight_smile:
Ade

1 Like

Good job reading up about yaml and discovering your problem.
Here is a yaml “checker / validator” for future that is linked from the HA documentation.

Thank you pcwii

1 Like