Skip to content
View in the app

A better way to browse. Learn more.

Power Forum - Renewable Energy Discussion

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Home Assistant Tesla Style Power Card

Featured Replies

Are you aware of the energy dashboard build in to HA? My grid is not configured yet, nor my batteries or individual devices.

1432385454_Screenshot2021-10-09at07_57_40.thumb.png.bf9de967cfd6d6d5cb12578ed2a43c10.png

 

What makes up my production.

635408318_Screenshot2021-10-09at07_59_43.thumb.png.2d3065b9dc40ef5e1ffed97ae8197c3c.png

The built in functionality is only for energy usage (kWh). And gives you an idea what happens throughout the day, incl forecasts and where you drew power from (battery/grid/solar)

The tesla style power card allows you to show current power distribution (W)

So different use cases

I prefer the “power distribution card” above the tesla style power card (could never really figure out the math it tries to do with the sensors, and there is a bug with its rendering)

E6C830FC-55C7-4186-A7EE-D85CB9E85370.jpeg

D88238BD-3851-4B5E-8B90-5443D5280F2F.jpeg

DEB580EA-7744-4D2B-BEEF-3BFB3811898F.jpeg

I also prefer the power distribution card. However my favorite card is the apex bar chart I set up to show actual vs forecasted solar production.

 

1005409843_Screenshot2021-10-11at06_25_16.png.30e99008b8056a4aa635f988a4007370.png

The above is what is shows now in the morning.

Yesterday some time during the day it looked like this:

1512048258_Screenshot2021-10-10at10_35_03.png.fb55a1d389b708dbe664064c84cdb905.png

14 hours ago, Sc00bs said:

@Tinuva

That is very cool, could you post the code for it perhaps? 

Sure.

First you will need an account with solcast for the forecast. The free account works fine for this, you get 50 api calls I think for free.
Once you have an account, set up a site with your panels total kW capacity and the angle they mounted as well as the direction. Mine is 3900w mounted directly north at around 45 degree angle.

Once done, grab your site as resource_id and the api key.

Then add this to your yaml somewhere (configuration.yaml): Mine is at https://github.com/tinuva/home-assistant-config/blob/master/packages/goodwe_dod.yaml

rest:
- resource: !secret solcast_forecast_resource
  #resource: https://api.solcast.com.au/rooftop_sites/RESOURCE_ID/forecasts?format=json&api_key=API_KEY&hours=72
  scan_interval: '00:30:00' # RATE LIMIT!
  sensor:
  - name: "Solcast Forecast Data"
    force_update: true
    value_template: "{{ value_json.forecasts[0].pv_estimate|round(2) }}"
    json_attributes:
    - forecasts
  - name: "Solcast Forecast 10"
    force_update: true
    value_template: "{{ value_json.forecasts[0].pv_estimate10|round(2) }}"
  - name: "Solcast Forecast 90"
    force_update: true
    value_template: "{{ value_json.forecasts[0].pv_estimate90|round(2) }}"

Then in the the UI, create a card with the following yaml code to get the graph. Replace the sensor.goodwe_ppv with your own actual solar/pv sensor.

type: custom:apexcharts-card
graph_span: 36h
span:
  start: day
  offset: '-6h'
header:
  show: true
  title: Solar Production vs. forecast
  show_states: true
now:
  show: true
  label: now
apex_config:
  legend:
    show: true
series:
  - entity: sensor.goodwe_ppv
    stroke_width: 2
    show:
      extremas: false
    color: '#FFF700'
    name: Actual
    unit: W
    fill_raw: last
    extend_to_end: false
    group_by:
      func: avg
      duration: 30min
  - entity: sensor.solcast_forecast_data
    stroke_width: 2
    show:
      extremas: false
    color: '#3498DB'
    transform: return x * 1000;
    name: Forecast History
    unit: W
    fill_raw: last
    extend_to_end: false
  - entity: sensor.solcast_forecast_10
    stroke_width: 2
    show:
      extremas: false
      in_header: false
    color: '#797D7F'
    transform: return x * 1000;
    name: Forecast 10 History
    unit: W
    fill_raw: last
    extend_to_end: false
    opacity: 0.4
  - entity: sensor.solcast_forecast_90
    stroke_width: 2
    show:
      extremas: false
      in_header: false
    color: '#797D7F'
    transform: return x * 1000;
    name: Forecast 90 History
    unit: W
    fill_raw: last
    extend_to_end: false
    opacity: 0.4
  - entity: sensor.solcast_forecast_data
    stroke_width: 2
    show:
      extremas: false
      in_header: false
    color: '#E74C3C'
    name: Forecast
    type: line
    extend_to_end: false
    unit: W
    data_generator: |
      return entity.attributes.forecasts.map((entry) => {
         return [new Date(entry.period_end), entry.pv_estimate*1000];
       });
  - entity: sensor.solcast_forecast_data
    stroke_width: 2
    show:
      extremas: false
      in_header: false
    color: '#797D7F'
    name: Forecast 10
    type: line
    extend_to_end: false
    unit: W
    opacity: 0.4
    data_generator: |
      return entity.attributes.forecasts.map((entry) => {
         return [new Date(entry.period_end), entry.pv_estimate10*1000];
       });
  - entity: sensor.solcast_forecast_data
    stroke_width: 2
    show:
      extremas: false
      in_header: false
    color: '#797D7F'
    name: Forecast 90
    type: line
    extend_to_end: false
    unit: W
    opacity: 0.4
    data_generator: |
      return entity.attributes.forecasts.map((entry) => {
         return [new Date(entry.period_end), entry.pv_estimate90*1000];
       });

 

All of this is based on testing and ideas from https://community.home-assistant.io/t/rest-api-command-platform-fails-on-post-to-external-url-solcast/143238/141

  • Author

Thank you for sharing the graph @Tinuva

I actually use the solar forecast so as to decide whether to switch my pool pump on or not with Node Red. 

I haven't been using it to forecast the actual production number as my batteries are usually full by 12:00 so I have quite a lot of solar power I don't use in summer, but rather just to give me an indication as to how much solar radiation we will have available for the day.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.