Commit 534108db authored by Simon Mellerin's avatar Simon Mellerin
Browse files

Doc - read the docs setup

parent 59dd59c4
......@@ -19,75 +19,5 @@ There's no API (or maybe there's one but any documentation can't be found) to pr
I want to thanks [KibOost](https://github.com/KiboOst/) for [the retroengineering he has done](https://github.com/KiboOst/php-LinkyAPI).
## Interface
A dashboard with several tabs :
* Current consumption state
* Electricity consumption graphics
* Meteo (T°, Nebulosity, Rain, Humidity)
* Meteo vs Electricity consumption
### Current consumption state
![pilea index](docs/index_pilea.png)
### Electricity consumption graphics
![pilea electricity](docs/electricity_pilea.png)
### DJU vs Electricity consumption
[DJU (Degré jour unifié or Degree day in english) [fr]](https://fr.wikipedia.org/wiki/Degr%C3%A9_jour_unifi%C3%A9) defines the gap between outdoor temperature and a reference temperature (18°C).
It's used to define rigor of a winter. Basicly, the more there are DJU during a day, the colder it gets outside.
![pilea dju x electricity](docs/dju_x_conso_pilea.png)
### Meteo
![pilea meteo](docs/meteo_pilea.png)
## Data
Data are daily collected, we get:
* Electricity consumption data from your Linky via Enedis API (inspired by [php-LnkyAPI](https://github.com/KiboOst/php-LinkyAPI))
* Weather observation data from [Meteo France Synop data](https://donneespubliques.meteofrance.fr/?fond=produit&id_produit=90&id_rubrique=32)
## Install
First of all:
* You'll need a Linky (obviously) and a [Enedis account](https://espace-client-connexion.enedis.fr/auth/UI/Login?realm=particuliers)
* Logged in your Enedis account, you have to activate option *Courbe de charge* in order to get your hourly consumption
### Easy way - Using YunoHost
* Get a [YunoHost](https://yunohost.org/) instance
* Install Pilea with its [package](https://github.com/SimonMellerin/pilea_ynh)
[![Install pilea with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=pilea)
### Hard way - Doing it all by hand
**Requirements:**
* PHP 7.3 or higher
* MySQL 5.5 or higher
(PostgreSQL & SQLite should work but you'll have to adapt `.env` & `config/packages/doctrine.yaml`)
**Installation:**
* Get [the repo](https://github.com/SimonMellerin/Pilea)
* Set Database name, user and password in `.env` file
* Install [Composer](https://getcomposer.org/) dependencies: `composer install`
* Run install script: `bin/console pilea:install`
* Add a first user: `bin/console pilea:user:add username password`
* Grant him admin role: `bin/console pilea:user:grant username`
* Set up cron: `echo "*/10 * * * * [user] /[app_folder]/bin/console pilea:fetch-data false" > /etc/cron.d/pilea`
(replace *[user]* and *[app_floder]* with your config)
* Config [NGINX](https://symfony.com/doc/current/setup/web_server_configuration.html#web-server-nginx) or [Apache](https://symfony.com/doc/current/setup/web_server_configuration.html) as you would do for any Symfony 4 application
## Todo
- [ ] Add a *compare period* tab
- [ ] Add possibility to re-fetch a day data
- [ ] Handle other kind of feeds for other energies (Generic CSV ?)
**For more informations, see `Pilea's documentation on Read the Docs<https://pilea.readthedocs.io/fr/latest/>`_**
(sorry it's in french cause this project is based on Linky and Enedis, main users will be french)
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = python -msphinx
SPHINXPROJ = Pilea
SOURCEDIR = .
BUILDDIR = _build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
\ No newline at end of file
Documentation administrateur
##############################
A venir
\ No newline at end of file
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Pilea documentation build configuration file, created by
# sphinx-quickstart on Wed Aug 2 13:28:48 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
import sphinx_rtd_theme
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.todo']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = 'Pilea'
copyright = '2019, Simon Mellerin'
author = 'Simon Mellerin'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = ''
# The full version, including alpha/beta/rc tags.
release = ''
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# This is required for the alabaster theme
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
html_sidebars = {
'**': [
'about.html',
'navigation.html',
'relations.html', # needs 'show_related': True theme option to display
'searchbox.html',
'donate.html',
]
}
# -- Options for HTMLHelp output ------------------------------------------
# Output file base name for HTML help builder.
htmlhelp_basename = 'pilea'
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'pilea.tex', 'Pilea Documentation',
author, 'manual'),
]
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'Pilea', 'Pilea Documentation',
[author], 1)
]
# -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'Pilea', 'Pilea Documentation',
author, 'Pilea', 'A little dashboard to analyse your electricity consumption data from Linky.',
'Miscellaneous'),
]
[extensions]
todo_include_todos=True
Documentation développeur
##########################
A venir
\ No newline at end of file
Pilea
########
Introduction
============
`Pilea <https://github.com/SimonMellerin/Pilea/>`_ est un petit tableau de bord permettant d'analyser sa
consommation d'électricité à partir des données d'un Linky.
L'idée derrière Pilea est de permettre à l'utilsateur de pouvoir, au travers de quelques tableaux de bord :
* Mieux comprendre sa consommation d'énergie
* Analyser sa consommation en fonction de données météorologiques
.. note::
**Cette application n'est pas une tentative pour prouver que les compteurs Linky sont cool.**
Je ne suis pas fan des compteurs Linky et vous pourrez comprendre pourquoi en lisant `ce dossier
du site Reporterre <https://reporterre.net/Linky-n-est-pas-un-ami-la-grande-enquete-de-Reporterre>`_.
Maintenant, Linky est présent chez nous alors, autant l'utiliser.
Et malgré ce qu'essaye de nous vendre Enedis:
"Linky c'est génial, les utilisateurs pourront reprendre en main leurs données et réduire leur consommation... blablabla.."
Rien n'est apparement fait pour aider les particuliers à récupérer leur données de manière automatique via une API (ou alors
je n'ai pas réussi à trouver la documentation). Rien n'est fournit pour récupérer facilement ses données.
J'en porfite pour remercier KibOost pour `le travail de rétroengineering <https://github.com/KiboOst/php-LinkyAPI>`_ dont je me suis pas mal inspiré !
.. toctree::
:maxdepth: 2
:caption: Contents:
install
utilisateur
administrateur
developpeur
Todo List
=========
* Ajouter un onglet pour comparer des périodeset des compteurs
* Prendre en compte d'autres sources de données (comme un fichier CSV)
Support
=======
Please ask questions on the `Github issues page <https://github.com/SimonMellerin/Pilea/issues/>`_.
\ No newline at end of file
Installation
##############
Tout d'abord pour utiliser Pilea,
* Vous devez avoir accès à un Linky et à un `compte Enedis <https://espace-client-connexion.enedis.fr/auth/UI/Login?realm=particuliers>`_
* Via ce compte, vous devez activer l'option *Courbe de charge* pour pouvoir avoir accès à votre consommation horaire
La manière facile - via YunoHost
=================================
* Obtenir une instance `YunoHost<https://yunohost.org/>`_
* Installer Pilea via son `paquet<https://github.com/SimonMellerin/pilea_ynh>`_
.. image:: https://install-app.yunohost.org/install-with-yunohost.png
:target: https://install-app.yunohost.org/?app=pilea
La manière un peu moins facile - installation à la main
=======================================================
**Prérequis:**
* PHP 7.3 ou plus
* MySQL 5.5 ou plus
(PostgreSQL & SQLite should work but you'll have to adapt `.env` & `config/packages/doctrine.yaml`)
**Installation:**
* Télécharger `le dépot <https://github.com/SimonMellerin/Pilea>`_
* Créer un base de donnés puis renseigner son nom, l'utilisateur et le mot de passe dans le ficheir `.env`
* Installer les dépendance `Composer <https://getcomposer.org/>` : `composer install`
* Lancer le script d'installation : `bin/console pilea:install`
* Ajouter une premier utilisateur : `bin/console pilea:user:add username password`
* Lui donner les droits administrateur: `bin/console pilea:user:grant username`
* Mettre en place le cron : `echo "*/10 * * * * [user] /[app_folder]/bin/console pilea:fetch-data false" > /etc/cron.d/pilea`
(remplacer *[user]* et *[app_floder]* en fonction de votre configuration)
* Configurer `NGINX<https://symfony.com/doc/current/setup/web_server_configuration.html#web-server-nginx>`_ ou
`Apache <https://symfony.com/doc/current/setup/web_server_configuration.html>`_ comme pour une application Symfony 4 classique
\ No newline at end of file
Documentation utilisateur
##########################
A venir
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment