Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save cubapp/f13eb4635445db9d6878fc262052f653 to your computer and use it in GitHub Desktop.
Save cubapp/f13eb4635445db9d6878fc262052f653 to your computer and use it in GitHub Desktop.
Home Assistant REST to sunnymap.net using GoodWe
# How to add your FVE (PhotoVoltaicPlant) to the sunnymap.net with:
# * HomeAssistant
# * REST API
# * GoodWe integration
#
# First: register your FVE and get API key via: https://sunnymap.net/token_request
# Second: edit the files: configuration.yaml, automations.yaml
# Third: in Developers Tools (/developer-tools/yaml):
# - check the configuration
# - restart configuration
#
# FILE: /config/configuration.yaml
# sunnymap.net integration with automation.yaml
rest_command:
sunnymap_post:
url: "https://sunnymap.net/send_generation_data"
method: POST
headers:
accept: "application/json, text/html"
payload: '{"tokenHash": "abcd0123APIKEY", "currentProduction": "{{states("sensor.pv_power") | float(0) * 0.001 }}","todayProduction": "{{ states("sensor.today_s_pv_generation") }}"}'
content_type: 'application/json; charset=utf-8'
# FILE: /config/automations.yaml
###### pro https://sunnymap.net/
- id: '1675932841499'
alias: Data4sunnymap.net
description: "FVE2sunnymap.net"
trigger:
- platform: time_pattern
seconds: /30
condition: []
action:
- service: rest_command.sunnymap_post
data: {}
mode: single
# REMEMBER: check the configuration and restart the configuration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment