Giter Club home page Giter Club logo

node-red-contrib-netatmo-energy's Introduction

Node-RED nodes to talk to the Netatmo thermostat

npm version Downloads Build Status

Version 0.9.1 - The client Credentials grant type removal.

Switch to Netatmo OAUTH2 authorization. Netatmo is removing username and password authorization at the end of September 2022 - https://dev.netatmo.com/apidocumentation/oauth#authorization-code. So it was necessary to switch from the "Client credentials grant type" to the "Authorization code grant type" method.

You must obtain a Netatmo API refresh token to make this node work. You can get it manually or use the simple command line program Netatmo Auth CLI.

After setting up the refresh token, the node already obtains and renews the access token itself.

Tested with:

  • Node 16 LTS
  • macOS Monterey
  • Armbian

Install

Run command on Node-RED installation directory:

cd ~/.node-red
npm install node-red-contrib-netatmo-energy 

for global installation:

npm install -g node-red-contrib-netatmo-energy 

Node HOMESDATA

This node returns the user's homes and their topology associated with this netatmo account.

Documentation: https://dev.netatmo.com/resources/technical/reference/energy/homesdata

Homesdata node config

Node config

  • home_id - (Optional) Id of the home
  • gateway_types - (Optional) Array of desired gateway. For Energy app, use NAPlug

Node config can be overwritten by message payload.

Node HOMESTATUS

This node returns current status and data measured for all home devices.

Documentation: https://dev.netatmo.com/resources/technical/reference/energy/homestatus

Homestatus node config

Node config

  • home_id - (required) Id of the home
  • device_types - (Optional) Array of device type, eg. NAPlug

Node config can be overwritten by message payload.

Node GETROOMMEASURE

This node returns the history of data associated to a room.

Documentation: https://dev.netatmo.com/apidocumentation/energy#getroommeasure

Getroommeasure node config

Node config

  • home_id - (required) Id of the home
  • room_id - (required) Id of the room
  • scale - (required) Timeframe between two measurements {30min, 1hour, 3hours, 1day, 1week, 1month}
  • type - (required) Type of data to be returned {temperature, sp_temperature (temperature setpoint)), min_temp, max_temp, date_min_temp, date_max_temp}, date_min_temp & date_max_temp are only available for large scales ({1day, 1week, 1month}).
  • device_types - (Optional) Array of device type, eg. NAPlug

Node config can be overwritten by message payload.

Node SETTHERMMODE

This node set the home heating system to use schedule/ away/ frost guard mode.

Documentation: https://dev.netatmo.com/resources/technical/reference/energy/setthermmode

Setthermmode node config

Node config

  • home_id - (required) Id of the home
  • mode - (required) Heating mode, schedule or away or hg ...
  • endtime - (Optional) End time in seconds, eg. 180

Node config can be overwritten by message payload.

Node SETROOMTHERMPOINT

This node set a manual temperature to a room.

Documentation: https://dev.netatmo.com/resources/technical/reference/energy/setroomthermpoint

Setroomthermpoint node config

Node config

  • home_id - (required) Id of the home
  • room_id - (required) Id of the room
  • mode - (required) The mode you are applying to this room - manual OR home
  • temp - (Optional) Manual temperature to apply
  • endtime - (Optional) End time in second, eg. 180

Node config can be overwritten by message payload.

Node GETROOMMEASURE

This node returns data from a Room.

Documentation: https://dev.netatmo.com/apidocumentation/energy#getroommeasure

Getroommeasure node config

Node config

  • home_id - (required) Id of the home
  • room_id - (required) Id of the room
  • scale - (required) Step between measurements. Values: 30min, 1hour, 3hours, 1day, 1week, 1month, max
  • type - (required) Type of requested measurements. Values: temperature, sp_temperature, min_temp, max_temp, date_min_temp
  • date_begin - (Optional) Timestamp of the first measure to retrieve. Default is null.
  • date_end - (Optional) Timestamp of the last measure to retrieve (default and max are 1024). Default is null.
  • limit - (Optional) Maximum number of measurements (default and max Are 1024)
  • optimize - (Optional) Determines the format of the answer. Default is true. For mobile apps we recommend True and False if bandwidth isn't an issue as it is easier to parse.
  • real_time - (Optional) If scale different than max, timestamps are by default offset + scale/2. To get exact timestamps, use true. Default is false

Node SWITCHHOMESCHEDULE

This node switches the home schedule to the given schedule.

Documentation: https://dev.netatmo.com/apidocumentation/energy#switchhomeschedule

Setthermmode node config

Node config

  • home_id - (required) Id of the home
  • schedule_id - (required) Id of the schedule to switch on

Node config can be overwritten by message payload.

License

Library using forked netatmo library - https://github.com/karbassi/netatmo.

The Apache License, Version 2.0

node-red-contrib-netatmo-energy's People

Contributors

sadmin91 avatar tvecera avatar wonderjacky avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

node-red-contrib-netatmo-energy's Issues

Add node SwitchHomeSchedule

It should be very useful to have a node as per title with only two parameters:

  1. home id
    2 schedule id

here is the page of Netatmo API
Thank You very much for your support.

Schermata 2020-11-30 alle 12 12 39

API doc

support for switchschedule

Is there a possibility when using SETTHERMMODE and choose Schedule that we can also choose which schedule ?

According to the API this should be possible by adding a SCHEDULE_ID parameter.

Or adding support for the SWITCHHOMESCHEDULE API would suit the same purpose.

FW values of thermostat module and relay continuously updating

Updated from the version before 0.9.1 to 0.9.2 and have an issue with the firmware revision. This is continuously updating to different values. The values of 190 and 25 are not correct. However, no idea how it relates to this update. But as it is in the object it should be related to the Node. Strange enough this will (luckily) not happen with all my thermostats.

Capture Netat

John

kill Node Red container when Internet fall

Hello,
I suspect this node to induce an error (not catchable) on my node red container when the internet connection is down. Is it possible to correct that ?

19 Oct 21:48:17 - [error] - [-1] - Authenticate refresh error: No response
19 Oct 21:48:17 - [red] Uncaught Exception:
19 Oct 21:48:17 - [error] TypeError: Cannot read properties of undefined (reading 'statusCode')
at Netatmo.handleRequestError (/data/node_modules/node-red-contrib-netatmo-energy/src/netatmo-energy-api.js:180:22)
at Netatmo. (/data/node_modules/node-red-contrib-netatmo-energy/src/netatmo-energy-api.js:120:29)
at self.callback (/data/node_modules/request/request.js:185:22)
at Request.emit (node:events:527:28)
at Request.onRequestError (/data/node_modules/request/request.js:877:8)
at ClientRequest.emit (node:events:527:28)
at TLSSocket.socketErrorListener (node:_http_client:454:9)
at TLSSocket.emit (node:events:527:28)
at emitErrorNT (node:internal/streams/destroy:157:8)
at emitErrorCloseNT (node:internal/streams/destroy:122:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21)

setthermmode Endtime error if empty

Hallo to everybody and thanks for your great job.
I would like to share with you what I found using this nodes.

In the setthermmode module the field Endtime should be optional, as per Netatmo API and also as described in the guide of module.
Unfortunately if the field Endtime will be left blank, the module will raise an error and the field becomes red.

Schermata 2020-11-23 alle 23 39 00

The error is highlighted also when done button is pressed, adding a red triangle in the flow.

Schermata 2020-11-23 alle 23 50 49

During the upload of sketch Nodered popup with the following warning is raised, anyway confirming the deploy the module setthermmode works without any issue.

Schermata 2020-11-23 alle 23 54 28

My Nodered instance is hosted on Raspberry pi 3 and I'm using Safari 14.0 on my Mac to manage it.

It is not a very big issue but if it is possible to fix it I will very appreciate.
Hope that this could be help.

Thank you for your time

Will the Netatmo security improvements break this Node?

Have you see the announcement from Netatmo for the API use? Is this node already use this method?

Dear Netatmo developer,
To improve the security of our products, we inform you that the Client Credentials grant type method will be completely removed. It will no longer be possible to authenticate with the username and password of the user. The effective date of this update is October 2022.

From this date, the OAuth2 authorization code flow must be followed for authentication.

You can find details on this method on our website:
https://dev.netatmo.com/apidocumentation/oauth#authorization-code

Home & Room id

I'm really sorry for putting this here but I wasn't sure how to get help with this..and have searched everywhere.
Where can I find the Home and Room id's - I just can't seem to locate them!

Thanks so much for the work you've put into this and any help would be great!!

payload

how is it possible to insert a payload to change the temperature at Node SETTHERMMODE?

hvac_action

Hi @tvecera,

Is it possible to recover the "hvac_action" information ?

I'd like to know when my stole is on (or off).

I've no idea how to do this.

Regards.

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.