Giter VIP home page Giter VIP logo

node-red-contrib-opentherm's Introduction

OpenTherm decoder for Node-RED

These nodes will decode messages from an OpenTherm central heating system.

The decoded messages can be used to monitor your heating system or control other systems (e.g. switch floor heating pump on when the system is heating). Currently only decoding of messages is implemented, so you cannot use it to control a heating system.

It has been developed & tested using an OTGW gateway which has its own format of representing OpenTherm messages. A node is included to extract msgtype, dataid and datavalue from the OTGW output into regular OpenTherm data. When using a different OpenTherm interface, just make sure the appropriate message properties are set and you're good to go!

Topics

The OpenTherm standard (this decoder should be compatible with version 2.2) defines just a number of parameters without a clear structure or classification. I tried to group items into topics, e.g:

OpenTherm Decoded topic
0, HB, bit 0 - Master status CH enable master/status/ch
0, HB, bit 1 - Master status DHW enable master/status/dhw
0, LB, bit 0 - Slave status fualt indication slave/status/fault
16 - Room setpoint room/setpoint
124 - OpenTherm version Master master/opentherm_version
125 - OpenTherm version Slave slave/opentherm_version
etc. etc.

For the complete list of topics refer to the Map array in the code.

The topic/value output of the openthermdec node perfectly fits further processing with MQTT.

Example

The following flow will read OpenTherm messages from an OTGW connected to a local serial port. If first decodes the messages, then filters on READ- and WRITE_ACK's. The messages that pass are converted to an opentherm topic and value. This output is written to a textual logfile for further analysis.

Example-flow

[{"id":"cb0827f2.488e4","type":"openthermdec","z":"9b23cf80.97f2f8","name":"","x":721,"y":365,"wires":[["c0dc8166.e91428","d7de2302.0eedb8"]]},{"id":"c0dc8166.e91428","type":"debug","z":"9b23cf80.97f2f8","name":"","active":false,"console":"false","complete":"true","x":891,"y":431,"wires":[]},{"id":"ffa96ab5.cff278","type":"otgwdec","z":"9b23cf80.97f2f8","name":"","x":246,"y":372,"wires":[["885646b3.e20638","5760a89d.6b68d8"]]},{"id":"885646b3.e20638","type":"debug","z":"9b23cf80.97f2f8","name":"","active":false,"console":"false","complete":"true","x":420,"y":437,"wires":[]},{"id":"ff05e901.906748","type":"file","z":"9b23cf80.97f2f8","name":"","filename":"/opentherm.log","appendNewline":true,"createDir":true,"overwriteFile":"false","x":1112,"y":367,"wires":[]},{"id":"d7de2302.0eedb8","type":"function","z":"9b23cf80.97f2f8","name":"To CSV","func":"msg.payload =         msg.raw\n              + \",\" + msg.msgtype\n              + \",\" + msg.dataid\n              + \",\" + msg.datavalue\n              + \",\" + msg.topic\n              + \",\" + msg.payload;\nreturn msg;","outputs":1,"noerr":0,"x":934,"y":367,"wires":[["ff05e901.906748"]]},{"id":"5760a89d.6b68d8","type":"switch","z":"9b23cf80.97f2f8","name":"read ack/write ack/else","property":"msgtype","propertyType":"msg","rules":[{"t":"eq","v":"4","vt":"num"},{"t":"eq","v":"5","vt":"num"},{"t":"else"}],"checkall":"true","outputs":3,"x":474,"y":372,"wires":[["cb0827f2.488e4"],["cb0827f2.488e4"],[]]},{"id":"5b74970a.24d1f8","type":"serial in","z":"9b23cf80.97f2f8","name":"","serial":"2987f07e.837b88","x":88,"y":373,"wires":[["ffa96ab5.cff278","f2911419.5696e8"]]},{"id":"f2911419.5696e8","type":"debug","z":"9b23cf80.97f2f8","name":"","active":false,"console":"false","complete":"false","x":222,"y":438,"wires":[]},{"id":"2987f07e.837b88","type":"serial-port","z":"","serialport":"/dev/ttyS0","serialbaud":"9600","databits":"8","parity":"none","stopbits":"1","newline":"\\n","bin":"false","out":"char","addchar":false}]

node-red-contrib-opentherm's People

Contributors

mikes7 avatar yveaux avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

node-red-contrib-opentherm's Issues

tcp ip question

Does your project works in tcp connection to otgw, or only serial connections in node red?

write back

I would really like to pass back the otgw:

  1. A room temperature
  2. A room set point
  3. An outside Temperature
  4. Heating mode
    do you think this would be hard?

Illegal message length

Hi,

When setting this up in Node-Red, I receive an illegal message length error. Any idea what this may be?

Sample output:
BC0110000 T00110000 BC0110000 T90395500 B50395500 T90395500 B50395500 T90101300 B50101300 T90101300 B50101300 T10181328 BF0180000 T10181328 BF0180000 T10010000 BD0010000 T100E0000

[{"id":"3b45b0ce.7cf28","type":"tcp in","z":"d4384ba4.7c6168","name":"","server":"client","host":"192.168.0.140","port":"23","datamode":"stream","datatype":"buffer","newline":"","topic":"","base64":false,"x":100,"y":620,"wires":[["43b56453.5a750c","4d1bc8df.60e278"]]},{"id":"43b56453.5a750c","type":"otgwdec","z":"d4384ba4.7c6168","name":"","x":405,"y":607,"wires":[["e6adfb8.ec37e08","87140a64.86d298"]]},{"id":"87140a64.86d298","type":"switch","z":"d4384ba4.7c6168","name":"read ack/write ack/else","property":"msgtype","propertyType":"msg","rules":[{"t":"eq","v":"4","vt":"num"},{"t":"eq","v":"5","vt":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":633,"y":607,"wires":[["fcd8c46e.1eab78"],["fcd8c46e.1eab78"],[]]},{"id":"e6adfb8.ec37e08","type":"debug","z":"d4384ba4.7c6168","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":579,"y":672,"wires":[]},{"id":"4d1bc8df.60e278","type":"debug","z":"d4384ba4.7c6168","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":440,"y":680,"wires":[]},{"id":"8c002377.64cf1","type":"function","z":"d4384ba4.7c6168","name":"To CSV","func":"msg.payload = msg.raw\n + \",\" + msg.msgtype\n + \",\" + msg.dataid\n + \",\" + msg.datavalue\n + \",\" + msg.topic\n + \",\" + msg.payload;\nreturn msg;","outputs":1,"noerr":0,"x":1093,"y":602,"wires":[["391280ea.61294"]]},{"id":"fcd8c46e.1eab78","type":"openthermdec","z":"d4384ba4.7c6168","name":"","x":880,"y":600,"wires":[["96228059.1c16a","8c002377.64cf1"]]},{"id":"96228059.1c16a","type":"debug","z":"d4384ba4.7c6168","name":"","active":false,"console":"false","complete":"true","x":1050,"y":666,"wires":[]},{"id":"391280ea.61294","type":"file","z":"d4384ba4.7c6168","name":"","filename":"/opentherm.log","appendNewline":true,"createDir":true,"overwriteFile":"false","x":1271,"y":602,"wires":[[]]}]

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.