home_assistant_solarman icon indicating copy to clipboard operation
home_assistant_solarman copied to clipboard

Solis data logger interval time and calculations

Open q-bhatti opened this issue 2 years ago • 4 comments

Hi.

I'm maybe being a bit stupid here but I need to know how to do the following:

  1. There is no string power - I get current and voltage..how to make a sensor multiplying these in ha?
  2. How do I set the refresh time to 1sec? Using visual code server I get to custom components and I can see a folder called solarman and another called inverter definitions...where do I put the sensor: but and scan_interval

q-bhatti avatar Jul 23 '22 08:07 q-bhatti

Here are my template variables to do just that. Change the sensor names to match yours.

- trigger:
  - platform: state
    entity_id: sensor.solis_status_lastupdate
  sensor:
  - name: PV1 DC Power
    unit_of_measurement: kW
    device_class: power
    state: >-
      {% set v = states('sensor.solis_pv1_voltage') %}
      {% set a = states('sensor.solis_pv1_current') %}
      {% if is_number(v) and is_number(a) %}
      {{ (v|float * a|float / 1000) | round(3) }}
      {% endif %}

- trigger:
  - platform: state
    entity_id: sensor.solis_status_lastupdate
  sensor:
  - name: PV2 DC Power
    unit_of_measurement: kW
    device_class: power
    state: >-
      {% set v = states('sensor.solis_pv2_voltage') %}
      {% set a = states('sensor.solis_pv2_current') %}
      {% if is_number(v) and is_number(a) %}
      {{ (v|float * a|float / 1000) | round(3) }}
      {% endif %}

gedger avatar Jul 23 '22 15:07 gedger

The minimum polling is 30 seconds, not sure why though. Can change the code if you want to try something shorter, look in solarman.py for the line below but you're on you own if it goes horribly wrong....

@Throttle (MIN_TIME_BETWEEN_UPDATES)

gedger avatar Jul 23 '22 15:07 gedger

  • trigger:
    • platform: state entity_id: sensor.solis_status_lastupdate sensor:
    • name: PV1 DC Power unit_of_measurement: kW device_class: power state: >- {% set v = states('sensor.solis_pv1_voltage') %} {% set a = states('sensor.solis_pv1_current') %} {% if is_number(v) and is_number(a) %} {{ (v|float * a|float / 1000) | round(3) }} {% endif %}

Sorry for the dumb question, but where do I put this?

mx4k avatar Sep 07 '22 08:09 mx4k

it's called a template sensor and goes into your configuration.yaml file or a file that included into it.

See. https://www.home-assistant.io/integrations/template

gedger avatar Sep 09 '22 14:09 gedger