kellerza / pysma

Async library for SMA Solar's WebConnect interface
MIT License
59 stars 51 forks source link

No daily_yield #38

Closed SimonRolin closed 4 years ago

SimonRolin commented 4 years ago

Hi,

The module seems to work fine except that I do not receive the daily_yield.

Here is what I receive :

WARNING:pysma:No values for sensors: daily_yield [6400_00262200],current_consumption [6100_00543100],total_consumption [6400_00543A00]. Response from inverter: {'6380_40452100': {'1': [{'val': 1005}, {'val': 947}]}, '6100_00465700': {'1': [{'val': 4998}]}, '6100_00464900': {'1': [{'val': 23552}]}, '6100_40463600': {'1': [{'val': None}]}, '6100_40263F00': {'1': [{'val': 796}]}, '6400_0046C300': {'1': [{'val': 18080}]}, '6400_00462500': {'1': [{'val': None}]}, '6400_00462400': {'1': [{'val': None}]}, '6180_08214800': {'1': [{'val': [{'tag': 307}]}]}, '6400_00260100': {'1': [{'val': 18080}]}, '6380_40451F00': {'1': [{'val': 41274}, {'val': 42243}]}, '6100_00464800': {'1': [{'val': 23543}]}, '6100_40465500': {'1': [{'val': 1148}]}, '6100_40465300': {'1': [{'val': 1146}]}, '6100_00464A00': {'1': [{'val': 23552}]}, '6100_0046C200': {'1': [{'val': 797}]}, '6100_40465400': {'1': [{'val': 1136}]}, '6100_40463700': {'1': [{'val': None}]}}
               grid_power            796 W
                frequency          49.98 Hz
               voltage_l1         235.43 V
               voltage_l2         235.52 V
               voltage_l3         235.52 V
               current_l1          1.146 A
               current_l2          1.136 A
               current_l3          1.148 A
                 pv_power            797 W
               pv_voltage         412.74 V
               pv_current          1.005 A
             pv_gen_meter          18.08 kWh
              total_yield          18.08 kWh
              daily_yield
      grid_power_supplied
      grid_power_absorbed
         grid_total_yield
      grid_total_absorbed
      current_consumption
        total_consumption
                   status            307

Any idea ?

Thanks a lot in advance !

kellerza commented 4 years ago

If you use Home Assistant, you can use the utility_meter to get a daily yield.

My sma package config:

sensor:
  - platform: sma
    host: 192.168.88.199
    password: !secret sma_password
    scan_interval: 10
    sensors:
      - current_consumption
      - grid_power
      - total_consumption
      - total_yield

  - platform: filter
    name: current consumpmtion 1min
    entity_id: sensor.current_consumption
    #id: sma current consumpmtion 1min
    filters:
      - filter: time_simple_moving_average
        window_size: 00:01

  - platform: filter
    name: grid power 1min
    entity_id: sensor.grid_power
    #id: sma grid power 1min
    filters:
      - filter: time_simple_moving_average
        window_size: 00:01

  - platform: filter
    name: total consumption 5min
    entity_id: sensor.total_consumption
    filters:
      - filter: time_throttle
        window_size: 00:05

  - platform: filter
    name: total yield 5min
    entity_id: sensor.total_yield
    filters:
      - filter: time_throttle
        window_size: 00:05

utility_meter:
  daily_consumption:
    source: sensor.total_consumption
    cycle: daily
  daily_yield:
    source: sensor.total_yield
    cycle: daily
  monthly_consumption:
    source: sensor.total_consumption
    cycle: monthly
  monthly_yield:
    source: sensor.total_yield
    cycle: monthly