Home Assistant Quick-Start Guide

Projects related to Solar Power
Post Reply
jonathan
Posts: 237
Joined: Thu Feb 01, 2018 1:12 am

Home Assistant Quick-Start Guide

Post by jonathan »

The Snektek Solar Dashboard can be used as a sensor entity on Home Assistant.
homeassistant_on_snektek_solar_dashboard.PNG
Add this to your configuration.yaml:

Code: Select all

###############################
### Snektek Solar Dashboard ###
###############################

rest:
 - resource: http://192.168.10.30/cur_data
   scan_interval: 5
   sensor:
     - name: "Solar Voltage"
       #unique_id: snektek_solardashboard_solar_voltage
       value_template: '{{ (value_json["pv.v"] | float -0.0 | float) | round (2)}}'
       device_class: voltage
       state_class: measurement
       unit_of_measurement: "V"
     - name: "Solar Power"
       #unique_id: snektek_solardashboard_solar_power
       value_template: '{{ value_json["pv.p"] }}'
       device_class: power
       state_class: measurement
       unit_of_measurement: "W"
     - name: "Solar Current"
       #unique_id: snektek_solardashboard_solar_current
       value_template: '{{ value_json["pv.c"] }}'
       device_class: current
       state_class: measurement
       unit_of_measurement: "A"
     - name: "Battery Voltage"
       #unique_id: snektek_solardashboard_battery_voltage
       value_template: '{{ (value_json["bt.v"] | float +0.04 | float) | round (2)}}'
       device_class: voltage
       state_class: measurement
       unit_of_measurement: "V"
     - name: "Battery Temp"
       #unique_id: snektek_solardashboard_battery_temp
       value_template: '{{ value_json["bt.t"] }}'
       device_class: temperature
       state_class: measurement
       unit_of_measurement: "°C"
     - name: "Battery Current"
       #unique_id: snektek_solardashboard_battery_current
       value_template: '{{ value_json["bt.c"] }}'
       device_class: current
       state_class: measurement
       unit_of_measurement: "A"
     - name: "Load Voltage"
       #unique_id: snektek_solardashboard_load_voltage
       value_template: '{{ (value_json["ld.v"] | float -0.0 | float) | round (2)}}'
       device_class: voltage
       state_class: measurement
       unit_of_measurement: "V"
     - name: "Load Power"
       #unique_id: snektek_solardashboard_load_power
       value_template: '{{ value_json["ld.p"] }}'
       device_class: power
       state_class: measurement
       unit_of_measurement: "W"
     - name: "Load Current"
       #unique_id: snektek_solardashboard_load_current
       value_template: '{{ value_json["ld.c"] }}'
       device_class: current
       state_class: measurement
       unit_of_measurement: "A"
     - name: "Solar Generation Today"
       #unique_id: snektek_solardashboard_gen_today
       value_template: '{{ value_json["genToday"] }}'
       device_class: energy
       state_class: measurement
       unit_of_measurement: "kWh"
     - name: "Solar Generation This Month"
       #unique_id: snektek_solardashboard_gen_month
       value_template: '{{ value_json["genMonth"] }}'
       device_class: energy
       state_class: measurement
       unit_of_measurement: "kWh"
     - name: "Solar Generation This Year"
       #unique_id: snektek_solardashboard_gen_year
       value_template: '{{ value_json["genYear"] }}'
       device_class: energy
       state_class: measurement
       unit_of_measurement: "kWh"
randr
Posts: 18
Joined: Sat Dec 04, 2021 4:51 pm

Re: Home Assistant Quick-Start Guide

Post by randr »

This code works great! thanks Jonathan!!!
randr
Posts: 18
Joined: Sat Dec 04, 2021 4:51 pm

Re: Home Assistant Quick-Start Guide

Post by randr »

here is code in my home assistant dashboard for gauges. You would need to adjust severity values to fit your solar system but gives you an idea of display in HA I have a renogy controller so the Total moth and year sadly dont work.

Code: Select all

type: grid
cards:
  - type: gauge
    entity: sensor.solar_voltage
    min: 0
    max: 54.16
    name: PV Volts
    needle: true
    severity:
      green: 25
      yellow: 7
      red: 0
  - type: gauge
    entity: sensor.solar_current
    min: 0
    max: 20.32
    name: PV Amps
    needle: true
    severity:
      green: 10.16
      yellow: 5
      red: 0
  - type: gauge
    entity: sensor.solar_power
    min: 0
    max: 480
    needle: true
    severity:
      green: 260
      yellow: 115
      red: 1
    name: PV Watts
  - type: gauge
    max: 14.4
    entity: sensor.battery_voltage
    needle: true
    name: Battery Voltage
    severity:
      green: 13
      yellow: 12.5
      red: 10
    min: 12
  - type: gauge
    entity: sensor.solar_generation_today
    min: 0
    max: 2
    name: Today
    needle: true
  - type: gauge
    entity: sensor.battery_current
    needle: true
    min: 0
    max: 50
    severity:
      green: 10
      yellow: 20
      red: 45
  - type: gauge
    entity: sensor.solar_generation_this_month
  - type: gauge
    entity: sensor.solar_generation_this_year
columns: 3
square: false
Attachments
Untitled.png
jonathan
Posts: 237
Joined: Thu Feb 01, 2018 1:12 am

Re: Home Assistant Quick-Start Guide

Post by jonathan »

Thanks for posting the gauges code 👏 I edited your post for formatting
Tomb1956
Posts: 2
Joined: Wed Aug 09, 2023 3:36 pm

Re: Home Assistant Quick-Start Guide

Post by Tomb1956 »

Hi there is within /cur_data several items not used in the example from Jonathon. But I believe they are Maximums from Panel, Battery and Load. Then some I haven't a Idea to there meaning. I was looking for description of the variable names. "pv.v.m":37.3,"pv.c.m":3.36,"pv.p.m":106,"bt.v.m":14.2,"bt.c.m":7.35,"bt.t.m":47,"eq.t.m":50,"ld.c.m":6.58,"ld.v.m":14.2,"ld.p.m":93,"pv.v.mi":19.8,"pv.c.mi":0.64,"pv.p.mi":24,"bt.v.mi":13.1,"bt.c.mi":1.67,"bt.t.mi":46,"eq.t.mi":49,"ld.c.mi":5.66,"ld.v.mi":13.1,"ld.p.mi":74,"
jonathan
Posts: 237
Joined: Thu Feb 01, 2018 1:12 am

Re: Home Assistant Quick-Start Guide

Post by jonathan »

Hi Tom,
.m is maximum since restart
.mi is minimum since restart.
Tomb1956
Posts: 2
Joined: Wed Aug 09, 2023 3:36 pm

Re: Home Assistant Quick-Start Guide

Post by Tomb1956 »

Perfect Thanks
Post Reply