GithubHelp home page GithubHelp logo

empierre / domoticz_linky-deprecated Goto Github PK

View Code? Open in Web Editor NEW
15.0 9.0 16.0 94 KB

Get Linky smart meter index to Domoticz

Home Page: https://easydomoticz.com/forum/viewtopic.php?p=45583#p45583

License: GNU General Public License v3.0

JavaScript 33.85% Shell 3.36% Python 60.34% Batchfile 2.45%
linky smart meter python nodejs domoticz

domoticz_linky-deprecated's Introduction

domoticz_linky

Get Linky smart meter data and push it to domoticz

If you appreciate this software, please show it off ! PayPal donate button

pre-requisite: activate load curve recording on Enedis website

enable your enedis account (https://espace-client-particuliers.enedis.fr/group/espace-particuliers/) and the data collection ("Consommation" > "Gérer ma courbe de charge" > "Activer ma courbe de charge")

create a device in Domoticz

  • In Domoticz, go to hardware, create a virtual "rfx meter counter" or "Dummy".
  • Then in Devices, add it to the devices. (mark down the Idx for later, not the ID).
  • When in Utility, edit the device and change it to Electric (instant+counter) type .

modules to install

sudo apt-get install sqlite3 node npm
sudo apt-get install python3 python3-numpy python3-dateutil python3-requests

deploy

cd <whereyouwant> ie. /home/pi/domoticz/plugins/
git clone https://github.com/empierre/domoticz_linky.git
cd domoticz_linky
npm install [email protected]

rename configuration file, change login/pass/id

cp _domoticz_linky.cfg domoticz_linky.cfg
nano domoticz_linky.cfg

and change:

LINKY_USERNAME="[email protected]"
LINKY_PASSWORD="password"
DOMOTICZ_ID=547

Where DOMOTICZ_ID is Idx device on domoticz.

Configuration file will not be deleted in future updates

testing before launch

Manually launch

./domoticz_linky.sh

N.B. If login is not ok, you'll get a nodejs error on console for data will be missing (will be changed).

Then check the login credential if they are ok:

domoticz_linky.log

If this is good, you'll get several json files in the directory

Add to your cron tab (with crontab -e):

30 7,17 * * * /home/pi/domoticz_linky/domoticz_linky.sh

Getting back history

It is possible to get back history months giving the relative month to get. Parameter is how many month back from today. Limitation: works only on same year at this time.

./domoticz_linky.sh 3

On example, 3 months before.

domoticz_linky-deprecated's People

Contributors

arigaud avatar empierre avatar fredvi avatar guillaumezin avatar jibaku avatar ludovicrousseau avatar singinglarvae avatar wolfblader avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

domoticz_linky-deprecated's Issues

Problem with hourly data

Hi,

I use this plugin since yesterday.
When I run ./domoticz_linky.sh the output is the following:

Error: near line 1: near "Exception": syntax error
Error: near line 34: cannot commit - no transaction is active
Error: near line 35: near "Exception": syntax error
Error: near line 68: cannot commit - no transaction is active

When looking to the command logs, I have the right data. But the hourly data displayed in domoticz is wrong. No issue with daily, monthly, or yearly data.
For instance, here is the data I get in the logs when I execute the command in the terminal:

{
	"time": "22:00",
	"conso": 0.57
}, {
	"time": "22:30",
	"conso": 2.534
}, {
	"time": "23:00",
	"conso": 2.796
}, {
	"time": "23:30",
	"conso": 2.246
}

and that's coherent with data in my enedis acount as you can see:
enedis
but not with what's in domoticz:
domoticz

Any idea what's the issue?
I'm running commit eeecbd8b38f2b799b2e8657463b58819a1b5b786 under Ubuntu 16.04 LTS and domoticz v4.9701.

Thanks a lot.

Problem with Winston ?

Hi,

I've some troubles to get the script working.
Indeed, I correctly receive data from Enedis because I can see them into the differents export_* files. However nothing appears in the dummy device in Domoticz, and I get this error when I run ./domoticz_linky.sh

/home/pi/domoticz/plugins/domoticz_linky/node_modules/winston/node_modules/winston-transport/legacy.js:18
    throw new Error('Invalid transport, must be an object with a log method.');
    ^

Error: Invalid transport, must be an object with a log method.
    at new LegacyTransportStream (/home/pi/domoticz/plugins/domoticz_linky/node_modules/winston/node_modules/winston-transport/legacy.js:18:11)
    at DerivedLogger.add (/home/pi/domoticz/plugins/domoticz_linky/node_modules/winston/lib/winston/logger.js:270:9)
    at Object.winston.(anonymous function).args [as add] (/home/pi/domoticz/plugins/domoticz_linky/node_modules/winston/lib/winston.js:101:55)
    at Object.<anonymous> (/home/pi/domoticz/plugins/domoticz_linky/domoticz_linky.js:205:8)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Function.Module.runMain (module.js:693:10)

Do you think it could be the new version of Winston that is not fit for the script ?

Thanks

adding tests

I would like to add tests but I currently does not have a Linky. Is it possible to add some files from each endpoints of Enedis API ?

Splitting package in 2 parts

Hello,

I will in a few months move to a place with an linky counter. And I planning on using the API to fetch my data. I was thinking if it would help for maintenant to split domoticz_linky
into 2 packages with for example the linky part available on PyPI ?

And do you know about ENEDIS test accounts, to be able to use the API without having it.?

Timezone

Hello,

I have a difference of two hours for the consumption.

Is it possible to add timezone into script ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.