Home solar infrastructure (with Peimar Inverter) monitoring based on Raspberry Pi 3 B+ using Grafana, InfluxDB, Custom Python Collector and Shelly EM.

Overview

raspberry-solar-mon

Home solar infrastructure (with Peimar Inverter) monitoring based on Raspberry Pi 3 B+ using Grafana, InfluxDB, Custom Python Collector and Shelly EM.

My solar infrastructure:

My monitoring system:

  • Shelly EM + 120A Clamp to measure the electrical consumption of my house
  • Raspberry Pi 3 B+ with Raspbian OS
  • Grafana 7.5.5
  • InfluxDB 1.8.5
  • Telegraf 1.18.2
  • Custom python multithread collector for get metrics from Peimar Inverter and Shelly EM (compliant with Python 3)

Inverter Peimar, Shelly EM and Raspberry are connected to wifi network of my house.

EMDev1 EMDev2 Inverter1 Inverter2 EM Analysis1 Analysis2 Analysis3 Analysis4 Trend

Environment installation

  • Install Raspbian OS on your Raspberry Pi 3 B+
  • Install Grafana, InfluxDB and Telegraf on your Raspbian and enable services to starting automatically at system boot.
  • Install Python 3.7 if it's missing on your system.

InfluxDB configuration

  • Login via SSH with username pi.

  • Add to .bashrc of the user pi the following alias: alias influx='influx -precision rfc3339'

  • Reload .bashrc with the following command: source .bashrc

  • Copy configuration file influxdb.conf from repository folder influxdb to /etc/influxdb/ path of your installation.

  • Edit file influxdb.conf and disable authetication in [http] section: auth-enabled = false

  • Restart service and launch influxdb client with following command: influx

  • Create databases and users with grants:

    CREATE DATABASE peimar
    CREATE DATABASE telegraf

    CREATE USER admin WITH PASSWORD p4ssw0rd WITH ALL PRIVILEGES
    CREATE USER peimar WITH PASSWORD p31m4r
    CREATE USER telegraf WITH PASSWORD t3l3gr4f

    GRANT ALL ON peimar TO peimar
    GRANT ALL ON telegraf TO telegraf

    CREATE RETENTION POLICY "one_month" ON "telegraf" DURATION 4w REPLICATION 1
    CREATE RETENTION POLICY "ten_years" ON "peimar" DURATION 520w REPLICATION 1

    ALTER RETENTION POLICY "one_month" ON "telegraf" DURATION 4w REPLICATION 1 DEFAULT
    ALTER RETENTION POLICY "ten_years" ON "peimar" DURATION 520w REPLICATION 1 DEFAULT

  • Edit file influxdb.conf and enable authetication in [http] section: auth-enabled = true

  • Restart InfluxDB service: sudo systemctl restart influxdb.service

The database peimar contains the metrics of the Inverter and Shelly EM.
The database telegraf contains the metrics of Raspberry Pi and weather forecast from OpenWeather.

Telegraf configuration

  • Copy configuration file telegraf.conf from repository folder telegraf to /etc/telegraf/ path of your installation.
  • Copy configuration file openweather.conf from repository folder telegraf/telegraf.d to /etc/telegraf/telegraf.d path of your installation.
  • Register your account on OpenWeather, then insert infrastructure location and your id in openweather.conf.
  • Restart Telegraf service: sudo systemctl restart telegraf.service

Python collector configuration

  • Copy folder peimar from repository folder python_collector to /usr/lib/python3.7 path in your installation.

  • Copy folder shelly from repository folder python_collector to /usr/lib/python3.7 path in your installation.

  • Install python module for connection to Influx databases: sudo pip install influxdb

  • Copy all files from repository folder init.d to /etc/init.d path in your installation.

  • Make the script peimar-inverter in the init.d directory executable by changing its permission: sudo chmod +x peimar-inverter

  • Make the script shelly-em in the init.d directory executable by changing its permission: sudo chmod +x shelly-em

  • Create folder peimar in /var/log path of your installation (owner: pi, group: pi).

  • Create folder shellyem in /var/log path of your installation (owner: pi, group: pi).

  • Enable all daemons at boot system:

    sudo update-rc.d peimar-inverter defaults
    sudo update-rc.d shelly-em defaults

  • Change the IPs of the Inverter and Shelly EM to those of your network in the config.py files:

    /usr/lib/python3.7/peimar/inverter/config.py
    /usr/lib/python3.7/shelly/emeter/config.py

  • Change timezone of your infrastructure in config.py file of peimar daemon:

    timezone = pytz.timezone("Europe/Rome")

  • Reboot system.

For the management of daemons:
/etc/init.d/peimar-inverter {start|stop|forcekill|status|restart|reload}
/etc/init.d/shelly-em {start|stop|forcekill|status|restart|reload}

Grafana configuration

  • Copy configuration file grafana.ini from repository folder grafana to /etc/grafana/ path of your installation.

  • Copy image file how_solar_power_works.png from repository folder grafana/images to /usr/share/grafana/public/img path of your installation.

  • Install Grafana plugins grafana-clock-panel and larona-epict-panel with following command:

    sudo grafana-cli plugins install grafana-clock-panel
    sudo grafana-cli plugins install larona-epict-panel
    cd /var/lib/grafana/plugins/
    sudo chown -R grafana:grafana grafana-clock-panel
    sudo chown -R grafana:grafana larona-epict-panel

  • Restart Grafana service: sudo systemctl restart grafana-server.service

  • Import all dashboards from repository folder grafana/dashboards.

Owner
cislow
cislow
Port of Uxn to digital hardware in the Logisim simulator

Uxn-Logisim Implements the Uxn instruction set in digital hardware. Very WIP. Contents cpu.circ - The Logisim file microcode.mc - Microcode source fil

DeltaF1 11 Mar 27, 2022
FHEM Connector for FHT Heating devices

home-assistant-fht from: https://github.com/Rsclub22 FHEM Connector for FHT Heating devices (connected via FHEM) Requires FHEM to work You can find FH

5 Dec 01, 2022
A python file which I wrote to allow the Dorna Robots API to draw an Image on a 3D plane

Dorna-Robotics-Internship Code In the directory "Code" is a python file which I wrote to allow the Dorna Robots API to draw an Image on a 3D plane. I

Stephen Otto 2 Dec 06, 2021
Detic ros - A simple ROS wrapper for Detic instance segmentation using pre-trained dataset

Detic ros - A simple ROS wrapper for Detic instance segmentation using pre-trained dataset

Hirokazu Ishida 12 Nov 19, 2022
Lego Mindstorms EV3 and Lego Spike Prime

Lego Mindstorms EV3 and Lego Spike Prime What is FLL? The FIRST LEGO League Challenge Robotics Tournament challenges students from 9 to 16 years old t

Danimar Campos da Costa 1 Nov 14, 2021
A lightweight script for updating custom components for Home Assistant

Updater for Home Assistant This is a lightweight script for updating custom components for Home Assistant. If for some reason you do not want to use H

Alex X 12 Sep 21, 2022
Pylorawan is a Micropython wrapper for lorawan devices from RAK Wireless.

pylorawan Pylorawan is a Micropython wrapper for lorawan devices from RAK Wireless. Tested on a Raspberry PI Pico with a RAK4200(H) Evaluation Board (

Peter Houghton 3 Nov 04, 2022
Bucatini: a soft PIPE PHY for FPGA SerDes

Bucatini: a soft PIPE PHY for FPGA SerDes Bucatini is a noodly gateware layer capable of transforming an FPGA SerDes into a PIPE PHY, allowing you to

Great Scott Gadgets 28 Dec 02, 2022
Smart Tech Automation Remote via Kinematics Gesture control for IoT devices

STARK Smart Tech Automation Remote via Kinematics Gesture control for IoT devices View Demo · Report Bug · Request Feature Table of Contents About The

Juseong (Joe) Kim 1 Jan 29, 2022
Poupool is an overflow swimming pool control software

Poupool - The swimming pool controller Poupool is a swimming pool control software. It is based on Transitions, Pykka and Paho MQTT. The user interfac

Cyril Jaquier 8 Jul 18, 2022
This Home Assistant custom component adding support for controlling Midea dehumidifiers on local network.

This custom component for Home assistant adds support for Midea dehumidifier appliances via the local area network. homeassistant-midea-dehumidifier-l

Nenad Bogojevic 91 Dec 28, 2022
Software framework to enable agile robotic assembly applications.

ConnTact Software framework to enable agile robotic assembly applications. (Connect + Tactile) Overview Installation Development of framework was done

Southwest Research Institute Robotics 29 Dec 01, 2022
Custom component for interacting with Octopus Energy

Home Assistant Octopus Energy ** WARNING: This component is currently a work in progress ** Custom component built from the ground up to bring your Oc

David Kendall 116 Jan 02, 2023
🏡 My Home Assistant Configs. Be sure to 🌟 my repo to follow the updates!

Home Assistant Configuration Here's my Home Assistant configuration. I have installed HA on a Lenovo ThinkCentre M93P Tiny with an Intel Dual-Core i5-

iLyas Bakouch 25 Dec 30, 2022
ArucoFollow - A script for Robot Operating System and it is a part of a project Robot

ArucoFollow ArucoFollow is a script for Robot Operating System and it is a part

5 Jan 25, 2022
Python Wrapper for Homeassistant's REST API

HomeassistantAPI Python Wrapper for Homeassistant's REST API Please ⭐️ the repo if you find this project useful or cool! Here is a quick example. from

Nate 29 Dec 31, 2022
hardware design of the 250mm drone

hardware design of the 250mm drone

ZJU FAST Lab 645 Dec 25, 2022
A dashboard for Raspberry Pi to display environmental weather data, rain radar, weather forecast, etc. written in Python

Weather Clock for Raspberry PI This project is a dashboard for Raspberry Pi to display environmental weather data, rain radar, weather forecast, etc.

Markus Geiger 1 May 01, 2022
A Python program that makes it easy to manage modules on a CircuitPython device!

CircuitPython-Bundle-Manager-v2 A Python program that makes it easy to manage modules on a CircuitPython device! The CircuitPython Bundle Manager v2 i

Ckyiu 1 Dec 18, 2021
A flexible data historian based on InfluxDB, Grafana, MQTT and more. Free, open, simple.

Kotori Telemetry data acquisition and sensor networks for humans. Documentation: https://getkotori.org/ Source Code: https://github.com/daq-tools/koto

83 Nov 26, 2022