Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Front heat pump #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions roles/coachproxy/files/configurator/cp_config.pl
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,11 @@ sub create_habridge_device {
} else {
push @tags, '/furn1-spacer/';
}
if ($configs{'frontheat'} ne 'true') {
push @tags, '/heatpump0/'; # Delete heat pump button
} else {
push @tags, '/heatpump0-spacer/'; # Delete heat pump spacer
}
if ($configs{'midheat'} ne 'true') {
push @tags, '/heatpump1/'; # Delete heat pump button
} else {
Expand Down
162 changes: 132 additions & 30 deletions roles/coachproxy/files/configurator/flows_coachproxy-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -5871,7 +5871,7 @@
"name": "",
"label": "Third Air Conditioner Zone",
"group": "dd373808.7ec1d8",
"order": 8,
"order": 9,
"width": 0,
"height": 0,
"passthru": true,
Expand Down Expand Up @@ -5991,7 +5991,7 @@
"name": "",
"label": "Second Furnace Zone",
"group": "dd373808.7ec1d8",
"order": 9,
"order": 10,
"width": 0,
"height": 0,
"passthru": true,
Expand Down Expand Up @@ -6175,7 +6175,7 @@
"type": "function",
"z": "f6c367c2.63b9b8",
"name": "Set TV Lift",
"func": "// Populate the \"TV Lift\" toggle based on the chosen model.\n\nvar tvlift = ['37_BH', '40_IH', '44_OH', '45_MP', '45_OPP', '45_PZ'];\nvar msg = { topic: '', payload: '' };\n\nmsg.payload = tvlift.includes(flow.get('floorplan'));\n\nreturn msg;",
"func": "// Populate the \"TV Lift\" toggle based on the chosen model.\n\nvar tvlift = ['37_BH', '40_IH', '44_OH', '45_MP', '45_OPP', '45_PZ', '385_RD', '42_RDB'];\nvar msg = { topic: '', payload: '' };\n\nmsg.payload = tvlift.includes(flow.get('floorplan'));\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 510,
Expand Down Expand Up @@ -6664,7 +6664,7 @@
"type": "function",
"z": "f6c367c2.63b9b8",
"name": "Save to Database",
"func": "// Save the global config settings to the database\n\nvar msgs = []; // An array of database query messages\n\nfor (var item of ['year', 'model', 'floorplan', 'aquahot', 'floorheat', 'ceilfan', 'tvlift', 'thirdtstat', 'secondfurnace', 'midheat', 'rearheat', 'busundercoach', 'powerbed', 'shades_interior']) {\n var newmsg = {};\n newmsg.topic = 'INSERT OR REPLACE INTO configs (key, value) VALUES(?, ?)';\n newmsg.payload = [item, String(flow.get(item))];\n msgs.push(newmsg);\n}\n\nreturn [msgs, {payload: 'Saving changes...'}];",
"func": "// Save the global config settings to the database\n\nvar msgs = []; // An array of database query messages\n\nfor (var item of ['year', 'model', 'floorplan', 'aquahot', 'floorheat', 'ceilfan', 'tvlift', 'thirdtstat', 'secondfurnace', 'frontheat', 'midheat', 'rearheat', 'busundercoach', 'powerbed', 'shades_interior']) {\n var newmsg = {};\n newmsg.topic = 'INSERT OR REPLACE INTO configs (key, value) VALUES(?, ?)';\n newmsg.payload = [item, String(flow.get(item))];\n msgs.push(newmsg);\n}\n\nreturn [msgs, {payload: 'Saving changes...'}];",
"outputs": 2,
"noerr": 0,
"x": 1070,
Expand Down Expand Up @@ -7594,7 +7594,7 @@
"name": "",
"label": "Mid Zone Heat Pump",
"group": "dd373808.7ec1d8",
"order": 10,
"order": 12,
"width": 0,
"height": 0,
"passthru": true,
Expand Down Expand Up @@ -7624,7 +7624,7 @@
"name": "",
"label": "Rear Zone Heat Pump",
"group": "dd373808.7ec1d8",
"order": 11,
"order": 13,
"width": 0,
"height": 0,
"passthru": true,
Expand Down Expand Up @@ -7701,13 +7701,92 @@
]
]
},
{
"id": "d5161853.26c588",
"type": "change",
"z": "f6c367c2.63b9b8",
"name": "Set Saved Front Heat Pump",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.frontheat = 'true'",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 460,
"y": 1120,
"wires": [
[
"5788c0d8.42cb8"
]
]
},
{
"id": "e953ecbb.7cb86",
"type": "function",
"z": "f6c367c2.63b9b8",
"name": "Set Front Heat Pump",
"func": "var front_hp = ['Phaeton', 'Allegro_Bus', 'Zephyr', 'VanLeigh_Vilano', 'VanLeigh_Beacon'];\nvar msg = { topic: '', payload: '', enabled: true };\n\nif (flow.get('model')) {\n if (front_hp.includes(flow.get('model'))) {\n msg.payload = true;\n }\n}\n\nif (flow.get('year') < 2018 && flow.get('model').substr(0,8) != 'VanLeigh') {\n msg.enabled = false;\n msg.payload = false;\n}\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 480,
"y": 1160,
"wires": [
[
"5788c0d8.42cb8"
]
]
},
{
"id": "5788c0d8.42cb8",
"type": "ui_switch",
"z": "f6c367c2.63b9b8",
"name": "",
"label": "Front Zone Heat Pump",
"tooltip": "",
"group": "dd373808.7ec1d8",
"order": 11,
"width": 0,
"height": 0,
"passthru": true,
"decouple": "false",
"topic": "frontheat",
"topicType": "str",
"style": "",
"onvalue": "true",
"onvalueType": "bool",
"onicon": "",
"oncolor": "",
"offvalue": "false",
"offvalueType": "bool",
"officon": "",
"offcolor": "",
"animate": true,
"x": 800,
"y": 1140,
"wires": [
[
"4f256116.a0922"
]
]
},
{
"id": "176c91be.746e3e",
"type": "ui_template",
"z": "f6c367c2.63b9b8",
"group": "dd373808.7ec1d8",
"name": "Config HVAC Header",
"order": 7,
"order": 8,
"width": "6",
"height": "1",
"format": "<div style=\"width: 100%; height: 10px; border-bottom: 1px solid black; text-align: center\">\n <span style=\"background-color: #ffffff; padding: 0 10px;\">\n 2018+ Thermostat Controls\n </span>\n</div>\n",
Expand Down Expand Up @@ -9666,7 +9745,7 @@
"name": "",
"label": "Power Smart Bed",
"group": "dd373808.7ec1d8",
"order": 6,
"order": 7,
"width": 0,
"height": 0,
"passthru": true,
Expand Down Expand Up @@ -15506,13 +15585,36 @@
]
]
},
{
"id": "265eae7.dc2124",
"type": "ui_button",
"z": "5a05b8f3.894b88",
"name": "Front HPump Spacer /tstat0/heatpump0-spacer/",
"group": "10afdb4b.d8c455",
"order": 6,
"width": "2",
"height": "1",
"passthru": false,
"label": "H.PUMP",
"color": "#f8f8f8",
"bgcolor": "#f8f8f8",
"icon": "",
"payload": "heat",
"payloadType": "str",
"topic": "tstat_front",
"x": 4220,
"y": 100,
"wires": [
[]
]
},
{
"id": "95d24987.d98258",
"type": "ui_button",
"z": "5a05b8f3.894b88",
"name": "Front Off /tstat0/",
"group": "10afdb4b.d8c455",
"order": 11,
"order": 12,
"width": "2",
"height": "1",
"passthru": false,
Expand All @@ -15539,7 +15641,7 @@
"label": "",
"place": "",
"group": "10afdb4b.d8c455",
"order": 9,
"order": 10,
"width": "2",
"height": "1",
"passthru": false,
Expand Down Expand Up @@ -15746,7 +15848,7 @@
"z": "5a05b8f3.894b88",
"name": "Front Fan High /tstat0/",
"group": "10afdb4b.d8c455",
"order": 7,
"order": 8,
"width": "2",
"height": "1",
"passthru": false,
Expand All @@ -15771,7 +15873,7 @@
"z": "5a05b8f3.894b88",
"name": "Front Fan Low /tstat0/",
"group": "10afdb4b.d8c455",
"order": 10,
"order": 11,
"width": "2",
"height": "1",
"passthru": false,
Expand All @@ -15796,7 +15898,7 @@
"z": "5a05b8f3.894b88",
"name": "Front Fan Auto /tstat0/",
"group": "10afdb4b.d8c455",
"order": 13,
"order": 14,
"width": "2",
"height": "1",
"passthru": false,
Expand Down Expand Up @@ -15885,7 +15987,7 @@
"z": "5a05b8f3.894b88",
"name": "Front Furn /furn0/",
"group": "10afdb4b.d8c455",
"order": 8,
"order": 9,
"width": "2",
"height": "1",
"passthru": false,
Expand All @@ -15910,7 +16012,7 @@
"z": "5a05b8f3.894b88",
"name": "Front Temp Up /tstat0/",
"group": "10afdb4b.d8c455",
"order": 6,
"order": 7,
"width": "2",
"height": "1",
"passthru": false,
Expand All @@ -15935,7 +16037,7 @@
"z": "5a05b8f3.894b88",
"name": "Front Temp Down /tstat0/",
"group": "10afdb4b.d8c455",
"order": 12,
"order": 13,
"width": "2",
"height": "1",
"passthru": false,
Expand Down Expand Up @@ -15979,7 +16081,7 @@
"z": "5a05b8f3.894b88",
"name": "Mid Cool /tstat1/",
"group": "10afdb4b.d8c455",
"order": 15,
"order": 16,
"width": "2",
"height": "1",
"passthru": false,
Expand All @@ -16004,7 +16106,7 @@
"z": "5a05b8f3.894b88",
"name": "Mid HPump /tstat1/heatpump1/",
"group": "10afdb4b.d8c455",
"order": 18,
"order": 19,
"width": "2",
"height": "1",
"passthru": false,
Expand All @@ -16029,7 +16131,7 @@
"z": "5a05b8f3.894b88",
"name": "Mid Fan High /tstat1/",
"group": "10afdb4b.d8c455",
"order": 21,
"order": 22,
"width": "2",
"height": "1",
"passthru": false,
Expand All @@ -16054,7 +16156,7 @@
"z": "5a05b8f3.894b88",
"name": "Mid Temp Up /tstat1/",
"group": "10afdb4b.d8c455",
"order": 20,
"order": 21,
"width": "2",
"height": "1",
"passthru": false,
Expand All @@ -16079,7 +16181,7 @@
"z": "5a05b8f3.894b88",
"name": "Mid Fan Low /tstat1/",
"group": "10afdb4b.d8c455",
"order": 24,
"order": 25,
"width": "2",
"height": "1",
"passthru": false,
Expand All @@ -16104,7 +16206,7 @@
"z": "5a05b8f3.894b88",
"name": "Mid Off /tstat1/",
"group": "10afdb4b.d8c455",
"order": 25,
"order": 26,
"width": "2",
"height": "1",
"passthru": false,
Expand All @@ -16129,7 +16231,7 @@
"z": "5a05b8f3.894b88",
"name": "Mid Temp Down /tstat1/",
"group": "10afdb4b.d8c455",
"order": 26,
"order": 27,
"width": "2",
"height": "1",
"passthru": false,
Expand All @@ -16154,7 +16256,7 @@
"z": "5a05b8f3.894b88",
"name": "Mid Fan Auto /tstat1/",
"group": "10afdb4b.d8c455",
"order": 27,
"order": 28,
"width": "2",
"height": "1",
"passthru": false,
Expand All @@ -16181,7 +16283,7 @@
"label": "",
"place": "",
"group": "10afdb4b.d8c455",
"order": 23,
"order": 24,
"width": "2",
"height": "1",
"passthru": false,
Expand Down Expand Up @@ -16854,7 +16956,7 @@
"z": "5a05b8f3.894b88",
"name": "Mid Furn Spacer /tstat1/midfurn-spacer/",
"group": "10afdb4b.d8c455",
"order": 22,
"order": 23,
"width": "2",
"height": "1",
"passthru": false,
Expand Down Expand Up @@ -16908,7 +17010,7 @@
"type": "ui_text",
"z": "5a05b8f3.894b88",
"group": "10afdb4b.d8c455",
"order": 16,
"order": 17,
"width": "2",
"height": "1",
"name": "Mid Tstat Spacer /tstat1/",
Expand All @@ -16924,7 +17026,7 @@
"type": "ui_text",
"z": "5a05b8f3.894b88",
"group": "10afdb4b.d8c455",
"order": 17,
"order": 18,
"width": "2",
"height": "1",
"name": "Mid Fan Label /tstat1/",
Expand Down Expand Up @@ -17097,7 +17199,7 @@
"z": "5a05b8f3.894b88",
"group": "10afdb4b.d8c455",
"name": "Thermostat Label - Mid /tstat1/",
"order": 14,
"order": 15,
"width": "6",
"height": "1",
"format": "<div style=\"height: 8px;\">&nbsp;</div>\n<div style=\"width: 100%; height: 8px; border-bottom: 1px solid black; text-align: center\">\n <span style=\"font-size: 16px; background-color: #FEFEFE; padding: 0 10px; margin-left: 10px;\">\n {{msg.payload.zone_name}}: <b>{{msg.payload.ambient_temp.toFixed(1)}}</b>&deg; {{msg.payload.unit}}\n </span>\n</div>\n<div style=\"height: 11px;\">&nbsp;</div>",
Expand Down Expand Up @@ -17586,7 +17688,7 @@
"z": "5a05b8f3.894b88",
"name": "Mid HPump Spacer /tstat1/heatpump1-spacer/",
"group": "10afdb4b.d8c455",
"order": 19,
"order": 20,
"width": "2",
"height": "1",
"passthru": false,
Expand Down