Adding energy intergrations in HA

Hi,

I have added solar to my HA config.yml using a site API but im trying to feed this into the energy tab in HA. I have read alot of forums and the Docs but clearly missing something because they are not viable in the energy tab under solar. here is my config.yml info

sensor:

  • platform: rest
    resource: https://www.solaxcloud.com/proxyApp/proxy/api/getRealtimeInfo.do?tokenId=20211018174239611345102&sn=SWWVUTRCWC
    value_template: “{{ ( value_json.result.yieldtotal | round(0) ) | float }}”
    name: “Solax total”
    unit_of_measurement: “KWh”
    device_class: “energy”
    state_class: “total”
    unique_id: “solax_total”

  • platform: rest
    resource: https://www.solaxcloud.com/proxyApp/proxy/api/getRealtimeInfo.do?tokenId=20211018174239611345102&sn=SWWVUTRCWC
    value_template: “{{ ( value_json.result.acpower | round(0) ) | float }}”
    name: “Solax now”
    unit_of_measurement: “W”
    device_class: “energy”
    state_class: “total_increasing”
    unique_id: “solax_now”

  • platform: rest
    resource: as above
    value_template: “{{ value_json.result.yieldtoday | float }}”
    name: “Solax today”
    unit_of_measurement: “KWh”
    device_class: “energy”
    state_class: “total”
    unique_id: “solax_today”

  • platform: rest
    resource: as above
    value_template: “{{ value_json.result.uploadTime }}”
    name: “Solax upload time”
    unique_id: “solax_upload_time”

  • platform: template
    sensors:
    solax_total:
    friendly_name: “Solax Total”
    value_template: “{{ states(‘sensor.solax_total_raw’) | float | round(0) }}”
    unit_of_measurement: “KWh”
    device_class: “energy”

    solax_total_raw:
    friendly_name: “Solax Total (Raw)”
    value_template: “{{ value_json.result.yieldtotal }}”

  • platform: rest
    resource: as above
    value_template: >
    {% if value_json.result.inverterStatus == ‘100’ %}Wait
    {% elif value_json.result.inverterStatus == ‘101’ %}Check
    {% elif value_json.result.inverterStatus == ‘102’ %}Normal
    {% elif value_json.result.inverterStatus == ‘103’ %}Fault
    {% elif value_json.result.inverterStatus == ‘104’ %}Permanent Fault
    {% elif value_json.result.inverterStatus == ‘105’ %}Update
    {% elif value_json.result.inverterStatus == ‘106’ %}EPS Check
    {% elif value_json.result.inverterStatus == ‘107’ %}EPS
    {% elif value_json.result.inverterStatus == ‘108’ %}Self-test
    {% elif value_json.result.inverterStatus == ‘109’ %}Idle
    {% elif value_json.result.inverterStatus == ‘110’ %}Standby
    {% elif value_json.result.inverterStatus == ‘111’ %}Pv Wake Up Bat
    {% elif value_json.result.inverterStatus == ‘112’ %}Gen Check
    {% elif value_json.result.inverterStatus == ‘113’ %}Gen Run
    {% else %}I dont know{% endif %}
    name: “Solax status”
    unique_id: “solax_status”

please help

https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371#oneone-format-it-properly-16

Also if all your rest sensors use the same resource you should use the REST integration rather than the sensor platform.

Ignore the crappy example and use the value_templates, not attributes.