A working hour meter for NodeRed.
npm install @mschaeffler/node-red-hourmeterA working hour meter for NodeRed.
```
$ npm install @mschaeffler/node-red-hourmeter
The counter is started / stopped according to the value of the payload:
|type|value|counter is|
|:---|:----|:--------------|
|bool|false|stopped|
||true|started|
|number|0|stopped|
||1|started|
|string|false|stopped|
||0|stopped|
||off|stopped|
||stop|stopped|
||true|started|
||1|started|
||on|started|
||start|started|
A local filesystem context store is needed to store the internal data.
|msg. | type | description |
|:-------|:-------|:----------------------------------|
|payload | | Starts or stopps the counting. |
|reset |boolean |If true, resets the counter to 0.|
|set |boolean |If true, sets the counter to payload`.|
|query |boolean |If true, just querries the state of the counter.|
#### boolean value
|msg. | type | description |
|:-------|:-------|:----------------------------------|
|payload | boolean| Is counting active?|
|reason | string | Reason of the message output.|
#### hour counter
|msg. | type | description |
|:-------|:-------|:----------------------------------|
|payload | number | Value of the hour counter.|
|reason | string | Reason of the message output.|
|config| type | description |
|:-----|:-------|:----------------------------------|
|topic| string | Topic to send output values with.|
|cycle| number |Cyclic time of output; 0 is only at state change.|
|Contextstore|context store| context store for storing the values.|
|Status|boolean| the actual value as a node status.|
LGPL-2.1