Hello All,
Thanks for alle the info and instructions. I have managed to connect my MC6 with Home assistant, like Domaray did and I used his scripts and Node-Red flows.
I made some additions to use the away option without and helper. I also want to use the low temperature, but than the love-lace card is failing and reported the bug. So if that is fixed, I will use that to. And finaly I addit a read after write trigger, so it only ones every 30 seconds and immidialy after a write of a value to the MC6.
This is my HA configuration:
- platform: mqtt
name: Kamer Thermostaat
unique_id: climate_kamerthermostaat
modes:
- "heat"
- "cool"
- "auto"
temperature_command_topic: "home/termostato/temperature_setpoint/set"
temperature_state_topic: "home/termostato/temperature_setpoint/state"
temperature_state_template: "{{ value_json|float / 10 }}"
current_temperature_topic: "home/termostato/current_temperature/state"
current_temperature_template: "{{ value_json|float / 10 }}"
# temperature_high_command_topic: "home/termostato/high_temperature/set"
# temperature_high_state_topic: "home/termostato/high_temperature/state"
# temperature_high_state_template: "{{ value_json|float / 10 }}"
# temperature_low_command_topic: "home/termostato/away_temperature/set"
# temperature_low_state_topic: "home/termostato/away_temperature/state"
# temperature_low_state_template: "{{ value_json|float / 10 }}"
action_topic: "home/termostato/action/state"
mode_state_topic: "home/termostato/mode/state"
away_mode_command_topic: "home/termostato/away/set"
away_mode_state_topic: "home/termostato/away/state"
temperature_unit: c
max_temp: 30
min_temp: 15
temp_step: 0.5
retain: 1
And the Note-RED flows I use:
[
{
"id": "56deb452.46025c",
"type": "tab",
"label": "Termostato",
"disabled": false,
"info": ""
},
{
"id": "f7a4d443.826638",
"type": "server",
"name": "Home Assistant",
"legacy": false,
"addon": true,
"rejectUnauthorizedCerts": true,
"ha_boolean": "y|yes|true|on|home|open",
"connectionDelay": true,
"cacheJson": true
},
{
"id": "99ab3ff6.4455d",
"type": "mqtt-broker",
"name": "MQTT HA Server",
"broker": "10.0.10.240",
"port": "1883",
"clientid": "",
"usetls": false,
"compatmode": false,
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"willTopic": "",
"willQos": "0",
"willPayload": ""
},
{
"id": "36e9f5f4.01499a",
"type": "modbus-client",
"name": "Termostato",
"clienttype": "tcp",
"bufferCommands": true,
"stateLogEnabled": false,
"queueLogEnabled": false,
"tcpHost": "10.0.10.211",
"tcpPort": "502",
"tcpType": "DEFAULT",
"serialPort": "/dev/ttyUSB",
"serialType": "RTU-BUFFERD",
"serialBaudrate": "9600",
"serialDatabits": "8",
"serialStopbits": "1",
"serialParity": "none",
"serialConnectionDelay": "100",
"unit_id": 1,
"commandDelay": 1,
"clientTimeout": 1000,
"reconnectOnTimeout": true,
"reconnectTimeout": 2000,
"parallelUnitIdsAllowed": true
},
{
"id": "dff7d6f1.187718",
"type": "ui_base",
"theme": {
"name": "theme-light",
"lightTheme": {
"default": "#0094CE",
"baseColor": "#0094CE",
"baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif",
"edited": true,
"reset": false
},
"darkTheme": {
"default": "#097479",
"baseColor": "#097479",
"baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif",
"edited": false
},
"customTheme": {
"name": "Untitled Theme 1",
"default": "#4B7930",
"baseColor": "#4B7930",
"baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"
},
"themeState": {
"base-color": {
"default": "#0094CE",
"value": "#0094CE",
"edited": false
},
"page-titlebar-backgroundColor": {
"value": "#0094CE",
"edited": false
},
"page-backgroundColor": {
"value": "#fafafa",
"edited": false
},
"page-sidebar-backgroundColor": {
"value": "#ffffff",
"edited": false
},
"group-textColor": {
"value": "#1bbfff",
"edited": false
},
"group-borderColor": {
"value": "#ffffff",
"edited": false
},
"group-backgroundColor": {
"value": "#ffffff",
"edited": false
},
"widget-textColor": {
"value": "#111111",
"edited": false
},
"widget-backgroundColor": {
"value": "#0094ce",
"edited": false
},
"widget-borderColor": {
"value": "#ffffff",
"edited": false
},
"base-font": {
"value": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"
}
},
"angularTheme": {
"primary": "indigo",
"accents": "blue",
"warn": "red",
"background": "grey"
}
},
"site": {
"name": "Node-RED Dashboard",
"hideToolbar": "false",
"allowSwipe": "false",
"lockMenu": "false",
"allowTempTheme": "true",
"dateFormat": "DD/MM/YYYY",
"sizes": {
"sx": 48,
"sy": 48,
"gx": 6,
"gy": 6,
"cx": 6,
"cy": 6,
"px": 0,
"py": 0
}
}
},
{
"id": "c7ae10d2.116ce",
"type": "mqtt out",
"z": "56deb452.46025c",
"name": "Get Current Temperature",
"topic": "home/termostato/current_temperature/state",
"qos": "0",
"retain": "true",
"broker": "99ab3ff6.4455d",
"x": 1070,
"y": 252,
"wires": []
},
{
"id": "64a0672c.6b54c8",
"type": "mqtt in",
"z": "56deb452.46025c",
"name": "Set Temperature Setpoint",
"topic": "home/termostato/temperature_setpoint/set",
"qos": "2",
"datatype": "auto",
"broker": "99ab3ff6.4455d",
"x": 250,
"y": 1060,
"wires": [
[
"13520fdf.ee69a"
]
]
},
{
"id": "967c846b.4ec788",
"type": "modbus-write",
"z": "56deb452.46025c",
"name": "Set Temperature Setpoint",
"showStatusActivities": false,
"showErrors": false,
"unitid": "",
"dataType": "MHoldingRegisters",
"adr": "64",
"quantity": "1",
"server": "36e9f5f4.01499a",
"emptyMsgOnFail": false,
"keepMsgProperties": false,
"x": 990,
"y": 1060,
"wires": [
[],
[]
]
},
{
"id": "a4fd90ac.9d17b",
"type": "mqtt out",
"z": "56deb452.46025c",
"name": "Get Temperature Setpoint",
"topic": "home/termostato/temperature_setpoint/state",
"qos": "0",
"retain": "true",
"broker": "99ab3ff6.4455d",
"x": 1070,
"y": 412,
"wires": []
},
{
"id": "582f3cd6.0433b4",
"type": "json",
"z": "56deb452.46025c",
"name": "",
"property": "payload",
"action": "",
"pretty": false,
"x": 790,
"y": 1060,
"wires": [
[
"967c846b.4ec788"
]
]
},
{
"id": "13520fdf.ee69a",
"type": "function",
"z": "56deb452.46025c",
"name": "",
"func": "msg.payload*=10;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 480,
"y": 1060,
"wires": [
[
"bf5397e8.9daf18"
]
]
},
{
"id": "bf5397e8.9daf18",
"type": "template",
"z": "56deb452.46025c",
"name": "",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "[{{ payload }}]",
"output": "str",
"x": 640,
"y": 1060,
"wires": [
[
"582f3cd6.0433b4"
]
]
},
{
"id": "93c8a67f.ff0818",
"type": "mqtt out",
"z": "56deb452.46025c",
"name": "Get Current Mode",
"topic": "home/termostato/mode/state",
"qos": "",
"retain": "",
"broker": "99ab3ff6.4455d",
"x": 1330,
"y": 480,
"wires": []
},
{
"id": "cbde474c.988668",
"type": "mqtt out",
"z": "56deb452.46025c",
"name": "Get Current Status",
"topic": "home/termostato/status/state",
"qos": "",
"retain": "",
"broker": "99ab3ff6.4455d",
"x": 1050,
"y": 520,
"wires": []
},
{
"id": "861d0968.494578",
"type": "mqtt in",
"z": "56deb452.46025c",
"name": "Set Status",
"topic": "home/termostato/status/set",
"qos": "2",
"datatype": "auto",
"broker": "99ab3ff6.4455d",
"x": 200,
"y": 960,
"wires": [
[
"5257703f.d5da3"
]
]
},
{
"id": "5257703f.d5da3",
"type": "template",
"z": "56deb452.46025c",
"name": "",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "[{{ payload }}]",
"output": "str",
"x": 500,
"y": 960,
"wires": [
[
"8685cea6.1935c"
]
]
},
{
"id": "8685cea6.1935c",
"type": "json",
"z": "56deb452.46025c",
"name": "",
"property": "payload",
"action": "",
"pretty": false,
"x": 650,
"y": 960,
"wires": [
[
"940d1c82.2b838"
]
]
},
{
"id": "940d1c82.2b838",
"type": "modbus-write",
"z": "56deb452.46025c",
"name": "Set Status",
"showStatusActivities": false,
"showErrors": false,
"unitid": "",
"dataType": "MHoldingRegisters",
"adr": "61",
"quantity": "1",
"server": "36e9f5f4.01499a",
"emptyMsgOnFail": false,
"keepMsgProperties": false,
"x": 830,
"y": 960,
"wires": [
[],
[]
]
},
{
"id": "1e7e7c1a.ced034",
"type": "mqtt out",
"z": "56deb452.46025c",
"name": "Get Current Humidity",
"topic": "home/termostato/humidity/state",
"qos": "0",
"retain": "true",
"broker": "99ab3ff6.4455d",
"x": 1060,
"y": 332,
"wires": []
},
{
"id": "1b9065ba.078dfa",
"type": "modbus-flex-getter",
"z": "56deb452.46025c",
"name": "",
"showStatusActivities": false,
"showErrors": false,
"logIOActivities": false,
"server": "36e9f5f4.01499a",
"useIOFile": false,
"ioFile": "",
"useIOForPayload": false,
"emptyMsgOnFail": false,
"keepMsgProperties": false,
"x": 430,
"y": 520,
"wires": [
[
"c57738f6.fa7538",
"5db36dd8.ca6654",
"b7d029fb.83d3c8",
"cd0f13e3.29767",
"786c5bfa.4bc754",
"d2b898da.19e338",
"efaf078c.272528",
"aa692ff8.52a98"
],
[]
]
},
{
"id": "5d5a96ab.394ab8",
"type": "function",
"z": "56deb452.46025c",
"name": "Prepare Request",
"func": "var newMsg = { payload: msg.payload.length,\n topic: \"\"\n};\nvar ts = new Date();\n\nnewMsg.payload = {\n 'value': ts.getTime(),\n 'fc': 3,\n 'unitid': 1,\n 'address': 0,\n 'quantity': 86\n};\n\nreturn newMsg;\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 430,
"y": 280,
"wires": [
[
"1b9065ba.078dfa"
]
]
},
{
"id": "e372074b.8e3c48",
"type": "inject",
"z": "56deb452.46025c",
"name": "Read",
"props": [
{
"p": "payload"
}
],
"repeat": "30",
"crontab": "",
"once": true,
"onceDelay": "5",
"topic": "",
"payload": "",
"payloadType": "num",
"x": 170,
"y": 240,
"wires": [
[
"5d5a96ab.394ab8"
]
]
},
{
"id": "c57738f6.fa7538",
"type": "function",
"z": "56deb452.46025c",
"name": "Get Temperature Setpoint",
"func": "const register = 64;\nmsg.payload = msg.payload[register]; \nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 770,
"y": 412,
"wires": [
[
"a4fd90ac.9d17b"
]
]
},
{
"id": "5db36dd8.ca6654",
"type": "function",
"z": "56deb452.46025c",
"name": "Get Current Temperature",
"func": "const register = 0;\nmsg.payload = msg.payload[register]; \nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 770,
"y": 252,
"wires": [
[
"c7ae10d2.116ce"
]
]
},
{
"id": "b7d029fb.83d3c8",
"type": "function",
"z": "56deb452.46025c",
"name": "Get Current Humidity",
"func": "const register = 2;\nmsg.payload = msg.payload[register]; \nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 760,
"y": 332,
"wires": [
[
"1e7e7c1a.ced034"
]
]
},
{
"id": "cd0f13e3.29767",
"type": "function",
"z": "56deb452.46025c",
"name": "Get Current Status",
"func": "const register = 9;\nmsg.payload = msg.payload[register]; \nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 750,
"y": 480,
"wires": [
[
"cbde474c.988668",
"2ad7f0fc.1f337"
]
]
},
{
"id": "9e3883bc.20f2f",
"type": "mqtt out",
"z": "56deb452.46025c",
"name": "Get Away",
"topic": "home/termostato/away/state",
"qos": "0",
"retain": "true",
"broker": "99ab3ff6.4455d",
"x": 1020,
"y": 640,
"wires": []
},
{
"id": "8b43d44f.8e86d8",
"type": "mqtt in",
"z": "56deb452.46025c",
"name": "Set Away",
"topic": "home/termostato/away/set",
"qos": "2",
"datatype": "auto",
"broker": "99ab3ff6.4455d",
"x": 200,
"y": 1200,
"wires": [
[
"ff4fe9ae.ce4008"
]
]
},
{
"id": "ed1dcdf0.e0036",
"type": "template",
"z": "56deb452.46025c",
"name": "",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "[{{ payload }}]",
"output": "str",
"x": 580,
"y": 1200,
"wires": [
[
"7e11cc31.21bb64"
]
]
},
{
"id": "7e11cc31.21bb64",
"type": "json",
"z": "56deb452.46025c",
"name": "",
"property": "payload",
"action": "",
"pretty": false,
"x": 730,
"y": 1200,
"wires": [
[
"42acd1a3.fe872"
]
]
},
{
"id": "42acd1a3.fe872",
"type": "modbus-write",
"z": "56deb452.46025c",
"name": "Set Away",
"showStatusActivities": false,
"showErrors": false,
"unitid": "",
"dataType": "MHoldingRegisters",
"adr": "65",
"quantity": "1",
"server": "36e9f5f4.01499a",
"emptyMsgOnFail": false,
"keepMsgProperties": false,
"x": 900,
"y": 1200,
"wires": [
[],
[]
]
},
{
"id": "786c5bfa.4bc754",
"type": "function",
"z": "56deb452.46025c",
"name": "Get Away Status",
"func": "const register = 65;\nmsg.payload = msg.payload[register]; \nif(msg.payload == 0){\n msg.payload = \"OFF\";\n} else {\n msg.payload = \"ON\";\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 740,
"y": 640,
"wires": [
[
"9e3883bc.20f2f"
]
]
},
{
"id": "d2b898da.19e338",
"type": "function",
"z": "56deb452.46025c",
"name": "Get Away Temperature",
"func": "const register = 66;\nmsg.payload = msg.payload[register]; \nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 760,
"y": 720,
"wires": [
[
"db204ee4.0e90e"
]
]
},
{
"id": "db204ee4.0e90e",
"type": "mqtt out",
"z": "56deb452.46025c",
"name": "Get Away Temperature",
"topic": "home/termostato/away_temperature/state",
"qos": "0",
"retain": "true",
"broker": "99ab3ff6.4455d",
"x": 1060,
"y": 720,
"wires": []
},
{
"id": "d52e398c.c77878",
"type": "mqtt in",
"z": "56deb452.46025c",
"name": "Set Away Temperature",
"topic": "home/termostato/away_temperature/set",
"qos": "2",
"datatype": "auto",
"broker": "99ab3ff6.4455d",
"x": 240,
"y": 1300,
"wires": [
[
"e60ef55e.9670d8"
]
]
},
{
"id": "9c1ed787.ad97f8",
"type": "modbus-write",
"z": "56deb452.46025c",
"name": "Set Away Temperature",
"showStatusActivities": false,
"showErrors": false,
"unitid": "",
"dataType": "MHoldingRegisters",
"adr": "66",
"quantity": "1",
"server": "36e9f5f4.01499a",
"emptyMsgOnFail": false,
"keepMsgProperties": false,
"x": 980,
"y": 1300,
"wires": [
[],
[]
]
},
{
"id": "e60ef55e.9670d8",
"type": "json",
"z": "56deb452.46025c",
"name": "",
"property": "payload",
"action": "",
"pretty": false,
"x": 790,
"y": 1300,
"wires": [
[
"9c1ed787.ad97f8"
]
]
},
{
"id": "ff4fe9ae.ce4008",
"type": "change",
"z": "56deb452.46025c",
"name": "",
"rules": [
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "ON",
"fromt": "str",
"to": "1",
"tot": "num"
},
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "OFF",
"fromt": "str",
"to": "0",
"tot": "num"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 400,
"y": 1200,
"wires": [
[
"ed1dcdf0.e0036"
]
]
},
{
"id": "efaf078c.272528",
"type": "function",
"z": "56deb452.46025c",
"name": "Get Action Status",
"func": "const register = 9;\nmsg.payload = msg.payload[register]; \nif(msg.payload == 0){\n msg.payload = \"Idle\";\n} else {\n msg.payload = \"Heat\";\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 750,
"y": 800,
"wires": [
[
"1da278e0.f0bf57"
]
]
},
{
"id": "1da278e0.f0bf57",
"type": "mqtt out",
"z": "56deb452.46025c",
"name": "Get Action",
"topic": "home/termostato/action/state",
"qos": "0",
"retain": "true",
"broker": "99ab3ff6.4455d",
"x": 1030,
"y": 800,
"wires": []
},
{
"id": "e137c7af.c3f1e8",
"type": "complete",
"z": "56deb452.46025c",
"name": "Read After Write",
"scope": [
"582f3cd6.0433b4",
"8685cea6.1935c",
"7e11cc31.21bb64",
"e60ef55e.9670d8",
"d0da21f6.aa5f8"
],
"uncaught": false,
"x": 180,
"y": 320,
"wires": [
[
"5d5a96ab.394ab8"
]
]
},
{
"id": "2ad7f0fc.1f337",
"type": "change",
"z": "56deb452.46025c",
"name": "",
"rules": [
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "1",
"fromt": "num",
"to": "heat",
"tot": "str"
},
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "0",
"fromt": "num",
"to": "auto",
"tot": "str"
},
{
"t": "set",
"p": "savedMode",
"pt": "global",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1040,
"y": 480,
"wires": [
[
"93c8a67f.ff0818"
]
]
},
{
"id": "aa692ff8.52a98",
"type": "function",
"z": "56deb452.46025c",
"name": "Get High Temperature",
"func": "const register = 83;\nmsg.payload = msg.payload[register]; \nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 760,
"y": 580,
"wires": [
[
"98315422.966b58"
]
]
},
{
"id": "98315422.966b58",
"type": "mqtt out",
"z": "56deb452.46025c",
"name": "Get High Temperature",
"topic": "home/termostato/high_temperature/state",
"qos": "0",
"retain": "true",
"broker": "99ab3ff6.4455d",
"x": 1060,
"y": 580,
"wires": []
},
{
"id": "95012301.598cb",
"type": "mqtt in",
"z": "56deb452.46025c",
"name": "Set High Temperature",
"topic": "home/termostato/high_temperature/set",
"qos": "2",
"datatype": "auto",
"broker": "99ab3ff6.4455d",
"x": 240,
"y": 1380,
"wires": [
[
"d0da21f6.aa5f8"
]
]
},
{
"id": "bee68bfb.331f28",
"type": "modbus-write",
"z": "56deb452.46025c",
"name": "Set High Temperature",
"showStatusActivities": false,
"showErrors": false,
"unitid": "",
"dataType": "MHoldingRegisters",
"adr": "83",
"quantity": "1",
"server": "36e9f5f4.01499a",
"emptyMsgOnFail": false,
"keepMsgProperties": false,
"x": 980,
"y": 1380,
"wires": [
[],
[]
]
},
{
"id": "d0da21f6.aa5f8",
"type": "json",
"z": "56deb452.46025c",
"name": "",
"property": "payload",
"action": "",
"pretty": false,
"x": 790,
"y": 1380,
"wires": [
[
"bee68bfb.331f28"
]
]
}
]
I just installed the Note-Red from the Addon-store in HA.
And the Humidity sensor, It’s alraedy in the Nodered script.
#==============================================================================
# Kamer termostaat humidity
#==============================================================================
- platform: mqtt
state_topic: "home/termostato/humidity/state"
unique_id: "MC6_Kamer_Humidity"
name: "Kamer Humidity"
device_class: humidity
Thanks, Frans