Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new energy solution in HA 2021.8 #9

Open
FlingersDH7 opened this issue Aug 5, 2021 · 3 comments
Open

new energy solution in HA 2021.8 #9

FlingersDH7 opened this issue Aug 5, 2021 · 3 comments

Comments

@FlingersDH7
Copy link

The new energy solution in Ha 2021.8 can include solarpanels.
But the sensors of the panels needs some properties to be able to be picked up.

See: https://developers.home-assistant.io/docs/core/entity/sensor/#properties

@riddertommie
Copy link

I'm struggling on that, any tips?

@pieterzen
Copy link

pieterzen commented Nov 12, 2021

I switched to the REST implementation and that works out of the box:

#########################################################
#                                                       #
#         SOLAX CLOUD.                                  #
#                                                       #
#########################################################
- platform: rest
  resource: https://www.eu.solaxcloud.com:9443/proxy/api/getRealtimeInfo.do?tokenId=xxxxxxxxxxxxxxxxxxx&sn=xxxxxx`
  name: "Solax"
  json_attributes_path: "$.result"
  json_attributes:
    - yieldtoday
    - yieldtotal
    - acpower
    - uploadTime
    - inverterStatus
  value_template: "1" # dummy value, not used; avoids the "State max length is 255 characters" error
- platform: template
  sensors:
    solax_yield_today:
      friendly_name: "Solax yield today"
      value_template: "{{ state_attr('sensor.solax', 'yieldtoday') }}"
      unit_of_measurement: "KWh"
      device_class: energy
    solax_yield_total:
      friendly_name: "Solax yield total"
      value_template: "{{ state_attr('sensor.solax', 'yieldtotal') }}"
      unit_of_measurement: "KWh"
      device_class: energy
    solax_power_now:
      friendly_name: "Solax power now"
      value_template: "{{ state_attr('sensor.solax', 'acpower') }}"
      unit_of_measurement: "W"
      device_class: power
    solax_yield_delta:
      friendly_name: "Solax yield delta"
      value_template: "{{ state_attr('sensor.solax', 'acpower') /12000 }}"
      unit_of_measurement: "kWh"
      device_class: energy
    solax_upload_time:
      friendly_name: "Solax update time"
      value_template: "{{ state_attr('sensor.solax', 'uploadTime') }}"
    solax_status:
      friendly_name: "Solax status"
      value_template: >
        {% if state_attr('sensor.solax', 'inverterStatus') == '100' %}Wait
        {% elif state_attr('sensor.solax', 'inverterStatus') == '101' %}Check
        {% elif state_attr('sensor.solax', 'inverterStatus') == '102' %}Normal
        {% elif state_attr('sensor.solax', 'inverterStatus') == '103' %}Fault
        {% elif state_attr('sensor.solax', 'inverterStatus') == '104' %}Permanent Fault
        {% elif state_attr('sensor.solax', 'inverterStatus') == '105' %}Update
        {% elif state_attr('sensor.solax', 'inverterStatus') == '106' %}EPS Check
        {% elif state_attr('sensor.solax', 'inverterStatus') == '107' %}EPS
        {% elif state_attr('sensor.solax', 'inverterStatus') == '108' %}Self-test
        {% elif state_attr('sensor.solax', 'inverterStatus') == '109' %}Idle
        {% elif state_attr('sensor.solax', 'inverterStatus') == '110' %}Standby
        {% elif state_attr('sensor.solax', 'inverterStatus') == '111' %}Pv Wake Up Bat
        {% elif state_attr('sensor.solax', 'inverterStatus') == '112' %}Gen Check
        {% elif state_attr('sensor.solax', 'inverterStatus') == '113' %}Gen Run
        {% else %}I dont know{% endif %}
  • I'm not sure where I got this script from; Sorry developer if you read this.

@riddertommie
Copy link

Thanks, if was using separate rest calls. Going to test this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants