Recording maximum watts per solar panel string with Home Assistant - Update

Previously I wrote a post about Recording maximum watts per solar panel string with Home Assistant. I have now updated this to add the maximum wattage for the day. I have also switched to a radialBar apexcharts-card

The cards look like this

A radialBar apexcharts-card showing the live, yearly maximum and daily maximum wattage of the solar strings

A radialBar apexcharts-card showing the live, yearly maximum and daily maximum wattage of the solar strings combined

This is the YAML for the front panels card. I have 8*400 watts panels, hence the 3200 watts

type: custom:apexcharts-card
header:
  show: true
  title: Front Panels
  show_states: true
  colorize_states: true
chart_type: radialBar
apex_config:
  chart:
    height: 300px
series:
  - entity: sensor.lux_solar_output_array_2_live
    name: Front Live
    unit: watts
    max: 3200
  - entity: sensor.maximum_incoming_watts_front
    name: Front Max
    max: 3200
    unit: watts
  - entity: sensor.maximum_daily_incoming_watts_front
    name: Today's Max
    max: 3200
    unit: watts

This is the YAML for the back panels card. I have 6*400 watts panels, hence the 2400 watts

type: custom:apexcharts-card
header:
  show: true
  title: Back Panels
  show_states: true
  colorize_states: true
chart_type: radialBar
apex_config:
  chart:
    height: 300px
series:
  - entity: sensor.lux_solar_output_array_1_live
    name: Back Live
    max: 2400
    unit: watts
  - entity: sensor.maximum_incoming_watts_back
    name: Back Max
    max: 2400
    unit: watts
  - entity: sensor.maximum_daily_incoming_watts_back
    name: Today's Max
    max: 2400
    unit: watts

This is the YAML for the combined panels card. 3200 + 2400, hence the 5600. It will never hit this, but it is the maximum

type: custom:apexcharts-card
header:
  show: true
  title: Combined Panels
  show_states: true
  colorize_states: true
chart_type: radialBar
apex_config:
  chart:
    height: 200px
series:
  - entity: sensor.lux_solar_output_live
    name: Combined Live
    max: 5600
    unit: watts
  - entity: sensor.maximum_incoming_watts_combined
    name: Combined Max
    max: 5600
    unit: watts
  - entity: sensor.maximum_daily_incoming_watts_combined
    name: Today's Max
    max: 5600
    unit: watts

These are the sensors that I added to the config.yaml file. You can see the daily sensor reset at 1 minute past midnight.

The yearly sensors are reset by input_datetime.solar_panel_watt_reset. This is a date/time Helper. You can create that under, Settings, Device and Services. You can set the date and time in the helper. That sensor will then reset to zero at that time and date

Date and/or Time helper to reset yearly sensor

Setting the date and time of the reset

template:
  - sensor:              
# Watt input from both strings and combined
   # Watt input from the both strings with reset date and time
   # The date and time is under the Helper section
  - trigger:
      - platform: state
        entity_id:
          - sensor.lux_solar_output_live
          - sensor.maximum_incoming_watts_combined
      - platform: time
        at: input_datetime.solar_panel_watt_reset  # Specify the desired date and time
    sensor:
      - name: "Maximum Incoming Watts Combined"
        unique_id: maximum_incoming_watts_combined
        state: >-
          {% if trigger.platform == 'time' %}
          0
          {% else %}
           {{ [states('sensor.maximum_incoming_watts_combined')|float(0), states('sensor.lux_solar_output_live')|float(0)] | max }}
          {% endif %}
          
# Watt input today from both strings and combined
   # Watt input from the both strings with reset date and time
  - trigger:
      - platform: state
        entity_id:
          - sensor.lux_solar_output_live
          - sensor.maximum_daily_incoming_watts_combined
      - platform: time
        at: '00:01:00'
    sensor:
      - name: "Maximum Daily Incoming Watts Combined"
        unique_id: maximum_daily_incoming_watts_combined
        state: >-
          {% if trigger.platform == 'time' %}
          0
          {% else %}
           {{ [states('sensor.maximum_daily_incoming_watts_combined')|float(0), states('sensor.lux_solar_output_live')|float(0)] | max }}
          {% endif %}
   
   # Watt input from the front string with reset date and time
   # The date and time is under the Helper section
  - trigger:
      - platform: state
        entity_id:
          - sensor.lux_solar_output_array_2_live
          - sensor.maximum_incoming_watts_front
      - platform: time
        at: input_datetime.solar_panel_watt_reset  # Specify the desired date and time
    sensor:
      - name: "Maximum Incoming Watts Front"
        unique_id: maximum_incoming_watts_front
        state: >-
          {% if trigger.platform == 'time' %}
          0
          {% else %}
           {{ [states('sensor.maximum_incoming_watts_front')|float(0), states('sensor.lux_solar_output_array_2_live')|float(0)] | max }}
          {% endif %}
          
   # Watt input today from the front string with reset date and time
  - trigger:
      - platform: state
        entity_id:
          - sensor.lux_solar_output_array_2_live
          - sensor.maximum_daily_incoming_watts_front
      - platform: time
        at: '00:01:00'
    sensor:
      - name: "Maximum Daily Incoming Watts Front"
        unique_id: maximum_daily_incoming_watts_front
        state: >-
          {% if trigger.platform == 'time' %}
          0
          {% else %}
           {{ [states('sensor.maximum_daily_incoming_watts_front')|float(0), states('sensor.lux_solar_output_array_2_live')|float(0)] | max }}
          {% endif %}
  
  # Watt input from the back string with reset date and time
  # The date and time is under the Helper section
  - trigger:
      - platform: state
        entity_id:
          - sensor.lux_solar_output_array_1_live
          - sensor.maximum_daily_incoming_watts_back
      - platform: time
        at: '00:01:00'
    sensor:
      - name: "Maximum Daily Incoming Watts Back"
        unique_id: maximum_daily_incoming_watts_back
        state: >-
          {% if trigger.platform == 'time' %}
          0
          {% else %}
           {{ [states('sensor.maximum_daily_incoming_watts_back')|float(0), states('sensor.lux_solar_output_array_1_live')|float(0)] | max }}
          {% endif %}
  
  # Watt input today from the back string with reset date and time
  - trigger:
      - platform: state
        entity_id:
          - sensor.lux_solar_output_array_1_live
          - sensor.maximum_incoming_watts_back
      - platform: time
        at: input_datetime.solar_panel_watt_reset  # Specify the desired date and time
    sensor:
      - name: "Maximum Incoming Watts Back"
        unique_id: maximum_incoming_watts_back
        state: >-
          {% if trigger.platform == 'time' %}
          0
          {% else %}
           {{ [states('sensor.maximum_incoming_watts_back')|float(0), states('sensor.lux_solar_output_array_1_live')|float(0)] | max }}
          {% endif %}
 
Michael Curtis

My introduction to computers started at my middle school in 1981 when our maths teacher brought in a ZX80. That led the computer club being founded and using a Research Machine 380Z

My first computer was a 48K ZX Spectrum which I loved to programme. Once I left school I worked as a photocopier engineer, then a fax engineer and finally moving on the Apple computers.

For the next 30 years I worked as a system administrator. I now work in the cyber security industry as a Sophos Professional Services consultant

https://www.bazmac.me
Previous
Previous

March Solar Generation and Export Numbers

Next
Next

Home Assistant Dashboard card daily energy cost