Sun-Watch Solar Logger

I have a Sun-Watch data logger and would like to integrate it into the energy dashboard. So I polled the solar output with the command line tool.
This is how I did it in the config.yaml:


# Sun Watch
sensor:
  - platform: command_line
    name: Solarertrag
    command: "echo -e 'GETPAR;0;0;E-Total' | nc 192.168.66.5 22222"
    unit_of_measurement: Wh
    value_template: “{{ value | multiply(0.001) | round(2) }}”
    unique_id: mei0001

template:
# Sun Watch
  - sensor:
      - name: "Solareinspeisung"
        unit_of_measurement: kWh
        state_class: total_increasing
        device_class: energy
        state: "{{ (states('sensor.solarertrag')| float /1000)| round(1) }}"
        unique_id: solareinspeisung

I used the total energy only, but you can query all the available data of the Sun-Watch (refer to Sun-Watch Homepage :: Scriptfähigkeit).

Maybe this helps somebody who has a Sun-Watch in use as well.

1 Like

Thanks for sharing Cowley!
With you help, I was able to catch data from sun-watch (part sensor). With one additional line, I could change the value to the correct numbers:
value_template: “{{ value | multiply(0.001) | round(2) }}”

Where I’m struggle, is the template section. I started with your version and tried several ways but I always get status “unavailable”.
Here is my last try:

template:
  - sensor
    - name: Energiebezug_Sunw
      state: states(sensor.energie-in_sunwatch)
      unit_of_measurement: "kWh"
      state_class: total_increasing
      device_class: energy

Any idea what I’m doing wrong?

Hi mlemble,
Sorry I wasn’t here for a while because I was on vacation.

There is a colon missing behind sensor

- sensor:

Thank you for the additional line with “value_template”. I added it to my original post.

Continuing the discussion from Sun-Watch Solar Logger:

Hi Cowley,

thanks for sharing!
Unfortunately I do struggle to get the Energy Dashboard running.
I can read out the values coming from both of my Inverters, but even with using

I cannot select the “Solarertrag” in the Dashboard configuration.
Has anybody a running Sunwatch with a working Energydasboard?

Hi Thomas,

Sorry I wasn’t here for a longer time.

In my initial Post there were 2 lines missing:

        state: "{{ (states('sensor.solarertrag')| float /1000)| round(1) }}"
        unique_id: solareinspeisung

I added it above. Hope it will work now for you.