1.2.2 • Published 2 years ago
node-red-contrib-iberdrola v1.2.2
node-red-contrib-iberdrola
A Node-RED node which reads the consumption and generation data of your contracts in Iberdrola I-DE.
Install
Run the following command in the root directory of your Node-RED install
npm install node-red-contrib-iberdrola or directly from Node-red paletteUsage
- Gets the information of the import consumption and export generation data of your contrac on the data specified on
msg.payload - You may override the user set in the configuration by passing in a value in
msg.user. - You can also override the password set in the configuration by passing in a value in
msg.password. - There are two available commands you can indicate in
msg.action:- 'contratos' - It will return a list of available contracts for the user
- 'readings' - It will provide the readings (consumption and generation) of the corresponding contract selected by the user.
- (In case you do not define the property
msg.actionthe 'readings' one will be selected by default)
- (In case you do not define the property
You can also select the contract by setting the
msg.contractto a valid contract code.- (In case you do not define the property
msg.contractthen teh first contract of the list of available ones for the user will be selected)
- (In case you do not define the property
Ouput
- There are two different kinds of outputs (may vary in case of error conditions). The output is always returned as key properties of
msg.payloadobject:Action = 'contratos'- contracts: Array with the list of contracts available for the user
- result: Object containing the result information / error codes
Action = 'readings'- contract: Contract code corresponding to the readings
- Dia: Date selected for readings
- Import: Array with the 24 hours consumption readings
- Export: Array with the 24 hours generation readings
- Count: Number of type of readings left to be provided (-2 - both left, -1 - one left, 0 - all provided)
- result: Object containing the result information / error codes
- Error codes are reported in the result object. It has the following key properties:
- code: result code
0- Success1- Consumption data not read2- Generation data not read3- Date not available4- Unable to get date limits for current contract5- Unable to select the contract6- Unable to get list of contracts7- Credentials not valid8- No contract available9- Unexpected error10- Date with no valid format11- Contract not found in the list of available ones
- desc: description of the result code
- msg: (only when code <> 0) Information of
msg.payloadwhen error occurred
- code: result code
- In case of
error code 3then the following object will be undermsg.payload.result.msg:- limits: object indicating the max and min available dates of the selected contract. No readings available out of that range.
Todo
None