I’ve recently had solar panels installed at my house. When choosing the system, I made sure to get a system with good statistics capabilities and an app. I also want to integrate it with home assistant for notifications and custom automations. The default integration is cloud only and is limited to 300 API calls a day, which in reality is useless for real time usage. Luckily there is a HACS integration to read the SolarEdge Modbus data over the network.

  • This assumes that you already have a solar edge inverter with network setup and the app working
  • You have Home assistant with HACS installed
  • You have the IP of your Inverter (Check your router or use Advanced IP scanner). The MAC address of the system is on the right-hand side of the inverter

Enable Modbus over TCP

  1. You will need to connect to your inverters commissioning web page. On your inverter, move the toggle switch to P for about 2 seconds. This will enable the WIFI network. The WIFI password will be on the right side of your inverter. Connect to this WIFI network. 
  2. Go to the page -> Site Communication -> Select Modbus TCP, select enable and leave the default port

Setup Home Assistant Integration

  1. Go to HACS and select Integrations
  2. Press the Explore and Download Repositories button
  3. Search for SolarEdge Modbus
  4. Select it, then select the 3 dots in the right-hand corner
  5. Select download and then restart home assistant using the navigate button.
  6. After restarting, head to Settings -> Devices and Services
  7. Select Add Integration
  8. Search for SolarEdge Modbus and select it. Now enter the IP address of your inverter and port 1502. Then Select submit. (For most single phase meters, select Read meter 1 data)
  9. Now the SolarEdge system should be added to your home assistant installation. You may need to wait around 30 seconds to see data.
  10. Once in you will see about 86 attributes. You can disable most of these, the ones I would recommend leaving would be the following.
  11. The main ones here for real time data are (AC POWER) – this is how much the solar array is producing in watts. The second is (M1 AC Power A) – This is how much you are exporting or importing in watts

Custom Entities and kW

While Watts is okay, I really wanted kW. I also wanted to calculate how much the house is consuming. This can be done with some simple custom entities. This gives you a kW output for Solar Generation, House Consumption, Import/Export and a yes/no sensor that is yes when you are generating more than you are consuming. I find it makes things easier to use in dashboards and automations.

  - sensor:
      - name: "Solar Positive"
        state: >
          {% if (states("sensor.se_generation") | float > states("sensor.se_consumption") | float) %}
          {% else %}
          {% endif %}
  - sensor:
      - name: "SE - Consumption"
        unit_of_measurement: "kW"
        state_class: total_increasing
        device_class: "energy"
        state: '{{ (states("sensor.solaredge_ac_power") |float - states("sensor.solaredge_m1_ac_power_a") | float) / 1000 }}'
  - sensor:
      - name: "SE - Export/Import"
        unit_of_measurement: "kW"
        state_class: total_increasing
        device_class: "energy"
        state: '{{ (states("sensor.solaredge_m1_ac_power_a") | float) / 1000}}'
  - sensor:
      - name: "SE - Generation"
        unit_of_measurement: "kW"
        state_class: total_increasing
        device_class: "energy"
        state: '{{ (states("sensor.solaredge_ac_power") | float) / 1000}}'
  1. Simply add the code above to your configuration.yaml file using VS Code. (Can be installed from the Add-Ons store)
  2. Then Restart Home Assistant from the developer tools page

Optional: Tesla Style Solar Power Card

If you are using Lovelace, the Tesla Style Power Card from HACS is a really nice widget.

  1. Go back to HACS and select Frontends
  2. Search for Tesla Style Solar Power Card, use the 3 dots in the top right to install the frontend.
  3. Then Reload HACS to apply the change, so you can use the frontend integration
  4. Go to one of your Lovelace dashboards, select add and search for solar
  5. Enter the code below (Will only work if you added the custom kW entities). You should see an overview of your solar system.
type: custom:power-flow-card
  grid: sensor.se_export_import
  solar: sensor.se_generation
inverted_entities: battery, grid

Useful Links