markusmauch / homeassistant-addons

Add-On Repository for Home Assistant
MIT License
4 stars 1 forks source link

sensor values "unavailable" #1

Closed DFS-90 closed 9 months ago

DFS-90 commented 9 months ago

Hi,

first: Thanks for your efforts and your amazing work! 👍

I've been able to install your HA add-on and configure it according to the information given here. (Maybe you could provide these information in your add-on's README? - e. g. that 'country' has to be inserted as "two letter code" as well as that the MQTT server's ip has to be filled in without "mqtt://".)

Unfortunately, the sensors' values are all "unknown" (see also here.

As I have been using tomquist's "Solix2MQTT" plugin before (via Docker on my UnRAID server), I'd like to share my HA config:

in configuration.yaml:
----------------------
mqtt: !include_dir_merge_named includes/mqtt/

in config/includes/mqtt/Anker_Solix_E1600.yaml:
-------------------------------------------------
sensor:   
  - name: "Anker Solix E1600 - Site-Name"
    state_topic: "solix/site_homepage"
    value_template: "{{ value_json.site_list.0.site_name }}"

  - name: "Anker Solix E1600 - Site-ID"
    state_topic: "solix/site_homepage"
    value_template: "{{ value_json.site_list.0.site_id }}"

  - name: "Anker Solix E1600 - Serien-Nummer"
    state_topic: "solix/site_homepage"
    value_template: "{{ value_json.solarbank_list.0.device_sn }}"

  - name: "Anker Solix E1600 - Lade-Leistung (1)"
    state_topic: "solix/site_homepage"
    unit_of_measurement: "W"
    value_template: >
      {% if value_json.solarbank_list.0.charging_power == '' %}
      0
      {% else %}
      value_json.solarbank_list.0.charging_power
      {% endif %}

  - name: "Anker Solix E1600 - Akku-Stand"
    state_topic: "solix/site/Home/scenInfo"
    unit_of_measurement: "%"
    value_template: "{{ value_json.solarbank_info.solarbank_list.0.battery_power }}"

  - name: "Anker Solix E1600 - Lade-Status"
    state_topic: "solix/site/Home/scenInfo"
    value_template: "{{ value_json.solarbank_info.solarbank_list.0.charging_status }}"

  - name: "Anker Solix E1600 - Lade-Leistung"
    state_topic: "solix/site/Home/scenInfo"
    unit_of_measurement: "W"
    value_template: "{{ value_json.solarbank_info.solarbank_list.0.charging_power }}"

  - name: "Anker Solix E1600 - PV-Leistung"
    state_topic: "solix/site/Home/scenInfo"
    unit_of_measurement: "W"
    value_template: "{{ value_json.solarbank_info.solarbank_list.0.photovoltaic_power }}"

  - name: "Anker Solix E1600 - Ausgabe-Leistung"
    state_topic: "solix/site/Home/scenInfo"
    unit_of_measurement: "W"
    value_template: "{{ value_json.solarbank_info.solarbank_list.0.output_power }}"

  - name: "Anker Solix E1600 - erzeugte Energie"
    state_topic: "solix/site/Home/scenInfo"
    unit_of_measurement: "kWh"
    value_template: "{{ value_json.statistics.0.total }}"

  - name: "Anker Solix E1600 - eingespartes CO2"
    state_topic: "solix/site/Home/scenInfo"
    unit_of_measurement: "kg"
    value_template: "{{ value_json.statistics.1.total }}"

  - name: "Anker Solix E1600 - Gewinn"
    state_topic: "solix/site/Home/scenInfo"
    unit_of_measurement: "EUR"
    value_template: "{{ value_json.statistics.2.total }}"

  - name: "Anker Solix E1600 - zurückgehaltene Leistung"
    state_topic: "solix/site/Home/scenInfo"
    value_template: "{{ value_json.retain_load }}"

  - name: "Anker Solix E1600 - letzte Aktualisierung"
    state_topic: "solix/site/Home/scenInfo"
    value_template: "{{ value_json.updated_time }}"

Maybe this helps you to find and correct the error? I'd be very happy to integrate Solix2MQTT into my HomeAssistant server! :-)

Thank you very much and best regards, David

markusmauch commented 9 months ago

Please try version 1.2.x. It is now possible to specify the mqtt uri as well as a custom state topic.

DFS-90 commented 9 months ago

Please try version 1.2.x. It is now possible to specify the mqtt uri as well as a custom state topic.

I set the topic to "solix" - now it works fine! Thanks for your efforts! 👍