Totally stuck with Energy integration, and frustrated too

I have solarpanels, and when the Enery integration came out, I thought this would be nice to see how much the panels generate and what my consumption is. I bought a p1-meter (slimmelezer) to get the usage data
I can only see the output of the solarpanels through the website of the supplier. the panels are connected directly into the electricitygrid, panels on the front side are connected to fase2 of the home powergrid, panels at the backside are connected to fase3 of the home powergrid. So power generated through my solarpanels is used directly, and what is left is returned to the general powergrid.

The problem however is that is cannot separate the solar data, I only see the following:

My question is, if anyone can answer it, how to get the data from fase2 and fase3, which is available, and turn it into usable data so I can finally see what is used and what is sent back from the solarpanels.

And yes, you guessed right, I am kind of a noob :wink:

1 Like

You describe an interessing solar config. Do you have more info or even better a drawing of the config.
What inverter integration are you using ?
If the data of fase2 and fase3 is available in HA but not in the energy setup, you could create a template sensor that adds up the powers of the phases to 1 value and use that in the energy setup.

Hi Bertreb,
It’s a system from APsystems
I have 24 solarpanels in total, with APS YC 1000 Converters, on which you can connect max 4 solarpanels per converter. The data is sent to a small router, which is connected to my network, and every 5 minutes data is sent

the data of fase2 and fase 3 is available through the esp integration,
The problem is that after many many hours of reading I still haven’t figured out how to create my own sensors. i am not a stupid guy but I am also not a developer :wink:

Just to get an idea of the setup / available data: So you have the data you want to show in the HA Energy statistics already in HA (fase2 & fase3), but it does not show up in the Energy dropdown?

If so, what are the two sensors called and what units do they have?

I’ve lately worked a lot with the HA Energy and built a few custom sensors out of my available sensors from my solar panels and battery :slight_smile: so I may be able to help, but first I need to understand the issue at hand.

I noticed that you have a purple link at the bottom of your dropdown list, meaning you clicked on the provided link. Did you report the issue for the integration that creates fase2 and fase3? If those sensors are not appearing in the list, the integration that is creating them is not creating them with the necessary information needed to make it appear in the energy configuration dropdown.

You can manually add these attributes through customize.yaml. But the attributes will change depending on what style sensor they are.

The link in the dropdown also leads to a page with more information about the attributes that are needed, but it can be quite complicated, especially if you don’t know how your sensor behaves.

Hi Dr-chef
in the picture you can see all individual values:

In HA i can see entities:
sensor.power_consumed_phase_1
sensor.power_consumed_phase_2
sensor.power_consumed_phase_3
sensor.power_produced_phase_2
sensor.power_produced_phase_2
sensor.power_produced_phase_3

is this enough data?

So you are expecting power produced phase 1 through 3 and power consumed phase 1-3 to show up in your dropdown as well?

Assuming that is correct, what integration is creating those sensors?

Hi Petro, I have clicked multiple times on that link :wink: it didn’t lead me to an answer I could work with.

the answer is that it’s a bug in the integration you’re using. That’s what the paragraph is stating.

I think I do, because those values are I think the true values.

Ok, but you still have not answered my question. I’ve asked it multiple times now.

What integration is creating those sensors?

the integration is ESPHOME

As far I understand the Grid is using the P1 data (consumed and produced). The solar energy is coming from your AP-systems installation. (via Web or direct connection) Therefore you need to have sensors in place that will collect your Solar Energie. For APsystems there is no standard integration, but via HACS you can install a custom integration (web or direct connection) that will create the sensors for you.
In your energy configuration you can then select your APsystems sensors at the solar config. HA will then calculate your solar energy internal usage based on the total solar production minus the amount sent to the grid.
If you really want to know what is sent to fase 2 and fase 3 you have to create your own sensors type energy for this, but as far I understand this will not show up as sepeerate entities in the standard grafical overview.

In the screenshot below you have to choose your installed HACS APsystem integration instead of my SolarEdge integration as an example.


Ok, then your ESPHOME configuration is not correct and you aren’t providing the correct information.

Can you provide the ESPHome yaml used for each of those sensors?

The phase 1 till 3 are power sensors (Kw) not energy sensors (Kwh) and thus will not show up in your energy dashboard.

1 Like

and to expand on what @Janneman is saying, there’s a sensor that you can use in ESPHome that creates the necessary sensor in home assistant

@petro

do you mean my esphome yaml?

Yes, the yaml that creates the sensors in ESPHome.


The yaml that appears when you click the EDIT button

@petro

substitutions:
  device_name: slimmelezer
  device_description: "DIY P1 module to read your smart meter"
     
esphome:
  name: ${device_name}
  comment: "${device_description}"
  platform: ESP8266
  esp8266_restore_from_flash: true
  board: d1_mini
  name_add_mac_suffix: false
  project:
    name: zuidwijk.slimmelezer
    version: "1.0"
  on_boot:
    then:
      - if:
          condition:
            lambda: return id(has_key);
          then:
            - lambda: |-
                std::string key(id(stored_decryption_key), 32);
                id(dsmr_instance).set_decryption_key(key);
          else:
            - logger.log:
                level: info
                format: "Not using decryption key. If you need to set a key use Home Assistant service 'ESPHome:  ${device_name}_set_dsmr_key'"

external_components:
  - source:
      type: git
      url: https://github.com/mmakaay/esphome
      ref: fix-dsmr-read-chunk-size
    components: [ "dsmr" ]
    refresh: 60s
      
wifi:
  networks:
    - ssid: 
      password: 
 
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: ${device_name}
    ap_timeout: 15s
 
captive_portal:
 
# Enable logging
logger:
#  baud_rate:0
 
# Enable Home Assistant API
api:
  services:
    service: set_dsmr_key
    variables:
      private_key: string
    then:
      - logger.log:
          format: Setting private key %s. Set to empty string to disable
          args: [private_key.c_str()]
      - globals.set:
          id: has_key
          value: !lambda "return private_key.length() == 32;"
      - lambda: |-
          if (private_key.length() == 32)
            private_key.copy(id(stored_decryption_key), 32);
          id(dsmr_instance).set_decryption_key(private_key);
 
ota:
 
web_server:
  port: 80
 
uart:
  baud_rate: 115200
  rx_pin: D7
  rx_buffer_size: 1500
  
globals:
  - id: has_key
    type: bool
    restore_value: yes
    initial_value: "false"
  - id: stored_decryption_key
    type: char[32]
    restore_value: yes
 
dsmr:
  id: dsmr_instance
  # For Luxembourg users set here your decryption key. 
  # Enable this when using decryption for Luxembourg;
  # key looks like '00112233445566778899AABBCCDDEEFF'
  #decryption_key: !secret decryption_key 
 
sensor:
  - platform: dsmr
    energy_delivered_tariff1:
      name: "Energy Consumed Tariff 1"
      state_class: total_increasing
    energy_delivered_tariff2:
      name: "Energy Consumed Tariff 2"
      state_class: total_increasing
    energy_returned_tariff1:
      name: "Energy Produced Tariff 1"
      state_class: total_increasing
    energy_returned_tariff2:
      name: "Energy Produced Tariff 2"
      state_class: total_increasing
    power_delivered:
      name: "Power Consumed"
      accuracy_decimals: 3
    power_returned:
      name: "Power Produced"
      accuracy_decimals: 3
    electricity_failures:
      name: "Electricity Failures"
      icon: mdi:alert
    electricity_long_failures:
      name: "Long Electricity Failures"
      icon: mdi:alert
    voltage_l1:
      name: "Voltage Phase 1"
    voltage_l2:
      name: "Voltage Phase 2"
    voltage_l3:
      name: "Voltage Phase 3"
    current_l1:
      name: "Current Phase 1"
    current_l2:
      name: "Current Phase 2"
    current_l3:
      name: "Current Phase 3"
    power_delivered_l1:
      name: "Power Consumed Phase 1"
      accuracy_decimals: 3
    power_delivered_l2:
      name: "Power Consumed Phase 2"
      accuracy_decimals: 3
    power_delivered_l3:
      name: "Power Consumed Phase 3"
      accuracy_decimals: 3
    power_returned_l1:
      name: "Power Produced Phase 1"
      accuracy_decimals: 3
    power_returned_l2:
      name: "Power Produced Phase 2"
      accuracy_decimals: 3
    power_returned_l3:
      name: "Power Produced Phase 3"
      accuracy_decimals: 3
    gas_delivered:
      name: "Gas Consumed"
      state_class: total_increasing
  - platform: uptime
    name: "SlimmeLezer Uptime"
  - platform: wifi_signal
    name: "SlimmeLezer Wi-Fi Signal"
    update_interval: 300s
 
text_sensor:
  - platform: dsmr
    identification:
      name: "DSMR Identification"
    p1_version:
      name: "DSMR Version"
  - platform: wifi_info
    ip_address:
      name: "SlimmeLezer IP Address"
    ssid:
      name: "SlimmeLezer Wi-Fi SSID"
    bssid:
      name: "SlimmeLezer Wi-Fi BSSID"
  - platform: version
    name: "ESPHome Version"
    hide_timestamp: true

Can you please look at the FAQ, Point 11 and properly format your yaml in your post.

i.e. click the pencil (edit this post) on your last post and place 3 back ticks before and after your yaml.

```
yaml
```