StephanJoubert / home_assistant_solarman

Home Assistant component for Solarman collectors used with a variety of inverters.
Apache License 2.0
544 stars 198 forks source link

Add Wattage Per Panel (with example) #343

Open JaySNL opened 1 year ago

JaySNL commented 1 year ago

Because deye_2mppt.yaml lacks wattage tracking per panel - there is no sensor - we can manually calculate it as long as we have voltage and current.

Update configuration.yaml:

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
sensor: !include custom-sensors.yaml

Add a new .yaml file in root folder config: /config/custom-sensors.yaml

  sensors:
    pv1_wattage:
      friendly_name: "PV1 Wattage"
      unit_of_measurement: 'W'
      icon_template: 'mdi:solar-power'
      value_template: "{{ states('sensor.deye_pv1_voltage') | float * states('sensor.deye_pv1_current') | float }}"
    pv2_wattage:
      friendly_name: "PV2 Wattage"
      unit_of_measurement: 'W'
      icon_template: 'mdi:solar-power'
      value_template: "{{ states('sensor.deye_pv2_voltage') | float * states('sensor.deye_pv2_current') | float }}"

Check the Yaml config for errors, if no errors, reload and you have two new sensors you can use for your dashboard to see the output per panel. Have multiple panels? Just add more sensor readouts.

image

sir106 commented 7 months ago

great, exactly what I was looking for...