Skip to content

Commit df06e7c

Browse files
committed
Allow the toggle of the front heat pump unit
Some units (primarily Vanleigh RVs) may not have a front Heat Pump or it may be moved to a new location in the coach
1 parent 3d228e8 commit df06e7c

File tree

2 files changed

+137
-30
lines changed

2 files changed

+137
-30
lines changed

roles/coachproxy/files/configurator/cp_config.pl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,11 @@ sub create_habridge_device {
201201
} else {
202202
push @tags, '/furn1-spacer/';
203203
}
204+
if ($configs{'frontheat'} ne 'true') {
205+
push @tags, '/heatpump0/'; # Delete heat pump button
206+
} else {
207+
push @tags, '/heatpump0-spacer/'; # Delete heat pump spacer
208+
}
204209
if ($configs{'midheat'} ne 'true') {
205210
push @tags, '/heatpump1/'; # Delete heat pump button
206211
} else {

roles/coachproxy/files/configurator/flows_coachproxy-template.json

Lines changed: 132 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5871,7 +5871,7 @@
58715871
"name": "",
58725872
"label": "Third Air Conditioner Zone",
58735873
"group": "dd373808.7ec1d8",
5874-
"order": 8,
5874+
"order": 9,
58755875
"width": 0,
58765876
"height": 0,
58775877
"passthru": true,
@@ -5991,7 +5991,7 @@
59915991
"name": "",
59925992
"label": "Second Furnace Zone",
59935993
"group": "dd373808.7ec1d8",
5994-
"order": 9,
5994+
"order": 10,
59955995
"width": 0,
59965996
"height": 0,
59975997
"passthru": true,
@@ -6175,7 +6175,7 @@
61756175
"type": "function",
61766176
"z": "f6c367c2.63b9b8",
61776177
"name": "Set TV Lift",
6178-
"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;",
6178+
"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;",
61796179
"outputs": 1,
61806180
"noerr": 0,
61816181
"x": 510,
@@ -6664,7 +6664,7 @@
66646664
"type": "function",
66656665
"z": "f6c367c2.63b9b8",
66666666
"name": "Save to Database",
6667-
"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...'}];",
6667+
"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...'}];",
66686668
"outputs": 2,
66696669
"noerr": 0,
66706670
"x": 1070,
@@ -7594,7 +7594,7 @@
75947594
"name": "",
75957595
"label": "Mid Zone Heat Pump",
75967596
"group": "dd373808.7ec1d8",
7597-
"order": 10,
7597+
"order": 12,
75987598
"width": 0,
75997599
"height": 0,
76007600
"passthru": true,
@@ -7624,7 +7624,7 @@
76247624
"name": "",
76257625
"label": "Rear Zone Heat Pump",
76267626
"group": "dd373808.7ec1d8",
7627-
"order": 11,
7627+
"order": 13,
76287628
"width": 0,
76297629
"height": 0,
76307630
"passthru": true,
@@ -7701,13 +7701,92 @@
77017701
]
77027702
]
77037703
},
7704+
{
7705+
"id": "d5161853.26c588",
7706+
"type": "change",
7707+
"z": "f6c367c2.63b9b8",
7708+
"name": "Set Saved Front Heat Pump",
7709+
"rules": [
7710+
{
7711+
"t": "set",
7712+
"p": "payload",
7713+
"pt": "msg",
7714+
"to": "payload.frontheat = 'true'",
7715+
"tot": "jsonata"
7716+
}
7717+
],
7718+
"action": "",
7719+
"property": "",
7720+
"from": "",
7721+
"to": "",
7722+
"reg": false,
7723+
"x": 460,
7724+
"y": 1120,
7725+
"wires": [
7726+
[
7727+
"5788c0d8.42cb8"
7728+
]
7729+
]
7730+
},
7731+
{
7732+
"id": "e953ecbb.7cb86",
7733+
"type": "function",
7734+
"z": "f6c367c2.63b9b8",
7735+
"name": "Set Front Heat Pump",
7736+
"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;",
7737+
"outputs": 1,
7738+
"noerr": 0,
7739+
"initialize": "",
7740+
"finalize": "",
7741+
"libs": [],
7742+
"x": 480,
7743+
"y": 1160,
7744+
"wires": [
7745+
[
7746+
"5788c0d8.42cb8"
7747+
]
7748+
]
7749+
},
7750+
{
7751+
"id": "5788c0d8.42cb8",
7752+
"type": "ui_switch",
7753+
"z": "f6c367c2.63b9b8",
7754+
"name": "",
7755+
"label": "Front Zone Heat Pump",
7756+
"tooltip": "",
7757+
"group": "dd373808.7ec1d8",
7758+
"order": 11,
7759+
"width": 0,
7760+
"height": 0,
7761+
"passthru": true,
7762+
"decouple": "false",
7763+
"topic": "frontheat",
7764+
"topicType": "str",
7765+
"style": "",
7766+
"onvalue": "true",
7767+
"onvalueType": "bool",
7768+
"onicon": "",
7769+
"oncolor": "",
7770+
"offvalue": "false",
7771+
"offvalueType": "bool",
7772+
"officon": "",
7773+
"offcolor": "",
7774+
"animate": true,
7775+
"x": 800,
7776+
"y": 1140,
7777+
"wires": [
7778+
[
7779+
"4f256116.a0922"
7780+
]
7781+
]
7782+
},
77047783
{
77057784
"id": "176c91be.746e3e",
77067785
"type": "ui_template",
77077786
"z": "f6c367c2.63b9b8",
77087787
"group": "dd373808.7ec1d8",
77097788
"name": "Config HVAC Header",
7710-
"order": 7,
7789+
"order": 8,
77117790
"width": "6",
77127791
"height": "1",
77137792
"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",
@@ -9666,7 +9745,7 @@
96669745
"name": "",
96679746
"label": "Power Smart Bed",
96689747
"group": "dd373808.7ec1d8",
9669-
"order": 6,
9748+
"order": 7,
96709749
"width": 0,
96719750
"height": 0,
96729751
"passthru": true,
@@ -15506,13 +15585,36 @@
1550615585
]
1550715586
]
1550815587
},
15588+
{
15589+
"id": "265eae7.dc2124",
15590+
"type": "ui_button",
15591+
"z": "5a05b8f3.894b88",
15592+
"name": "Front HPump Spacer /tstat0/heatpump0-spacer/",
15593+
"group": "10afdb4b.d8c455",
15594+
"order": 6,
15595+
"width": "2",
15596+
"height": "1",
15597+
"passthru": false,
15598+
"label": "H.PUMP",
15599+
"color": "#f8f8f8",
15600+
"bgcolor": "#f8f8f8",
15601+
"icon": "",
15602+
"payload": "heat",
15603+
"payloadType": "str",
15604+
"topic": "tstat_front",
15605+
"x": 4220,
15606+
"y": 100,
15607+
"wires": [
15608+
[]
15609+
]
15610+
},
1550915611
{
1551015612
"id": "95d24987.d98258",
1551115613
"type": "ui_button",
1551215614
"z": "5a05b8f3.894b88",
1551315615
"name": "Front Off /tstat0/",
1551415616
"group": "10afdb4b.d8c455",
15515-
"order": 11,
15617+
"order": 12,
1551615618
"width": "2",
1551715619
"height": "1",
1551815620
"passthru": false,
@@ -15539,7 +15641,7 @@
1553915641
"label": "",
1554015642
"place": "",
1554115643
"group": "10afdb4b.d8c455",
15542-
"order": 9,
15644+
"order": 10,
1554315645
"width": "2",
1554415646
"height": "1",
1554515647
"passthru": false,
@@ -15746,7 +15848,7 @@
1574615848
"z": "5a05b8f3.894b88",
1574715849
"name": "Front Fan High /tstat0/",
1574815850
"group": "10afdb4b.d8c455",
15749-
"order": 7,
15851+
"order": 8,
1575015852
"width": "2",
1575115853
"height": "1",
1575215854
"passthru": false,
@@ -15771,7 +15873,7 @@
1577115873
"z": "5a05b8f3.894b88",
1577215874
"name": "Front Fan Low /tstat0/",
1577315875
"group": "10afdb4b.d8c455",
15774-
"order": 10,
15876+
"order": 11,
1577515877
"width": "2",
1577615878
"height": "1",
1577715879
"passthru": false,
@@ -15796,7 +15898,7 @@
1579615898
"z": "5a05b8f3.894b88",
1579715899
"name": "Front Fan Auto /tstat0/",
1579815900
"group": "10afdb4b.d8c455",
15799-
"order": 13,
15901+
"order": 14,
1580015902
"width": "2",
1580115903
"height": "1",
1580215904
"passthru": false,
@@ -15885,7 +15987,7 @@
1588515987
"z": "5a05b8f3.894b88",
1588615988
"name": "Front Furn /furn0/",
1588715989
"group": "10afdb4b.d8c455",
15888-
"order": 8,
15990+
"order": 9,
1588915991
"width": "2",
1589015992
"height": "1",
1589115993
"passthru": false,
@@ -15910,7 +16012,7 @@
1591016012
"z": "5a05b8f3.894b88",
1591116013
"name": "Front Temp Up /tstat0/",
1591216014
"group": "10afdb4b.d8c455",
15913-
"order": 6,
16015+
"order": 7,
1591416016
"width": "2",
1591516017
"height": "1",
1591616018
"passthru": false,
@@ -15935,7 +16037,7 @@
1593516037
"z": "5a05b8f3.894b88",
1593616038
"name": "Front Temp Down /tstat0/",
1593716039
"group": "10afdb4b.d8c455",
15938-
"order": 12,
16040+
"order": 13,
1593916041
"width": "2",
1594016042
"height": "1",
1594116043
"passthru": false,
@@ -15979,7 +16081,7 @@
1597916081
"z": "5a05b8f3.894b88",
1598016082
"name": "Mid Cool /tstat1/",
1598116083
"group": "10afdb4b.d8c455",
15982-
"order": 15,
16084+
"order": 16,
1598316085
"width": "2",
1598416086
"height": "1",
1598516087
"passthru": false,
@@ -16004,7 +16106,7 @@
1600416106
"z": "5a05b8f3.894b88",
1600516107
"name": "Mid HPump /tstat1/heatpump1/",
1600616108
"group": "10afdb4b.d8c455",
16007-
"order": 18,
16109+
"order": 19,
1600816110
"width": "2",
1600916111
"height": "1",
1601016112
"passthru": false,
@@ -16029,7 +16131,7 @@
1602916131
"z": "5a05b8f3.894b88",
1603016132
"name": "Mid Fan High /tstat1/",
1603116133
"group": "10afdb4b.d8c455",
16032-
"order": 21,
16134+
"order": 22,
1603316135
"width": "2",
1603416136
"height": "1",
1603516137
"passthru": false,
@@ -16054,7 +16156,7 @@
1605416156
"z": "5a05b8f3.894b88",
1605516157
"name": "Mid Temp Up /tstat1/",
1605616158
"group": "10afdb4b.d8c455",
16057-
"order": 20,
16159+
"order": 21,
1605816160
"width": "2",
1605916161
"height": "1",
1606016162
"passthru": false,
@@ -16079,7 +16181,7 @@
1607916181
"z": "5a05b8f3.894b88",
1608016182
"name": "Mid Fan Low /tstat1/",
1608116183
"group": "10afdb4b.d8c455",
16082-
"order": 24,
16184+
"order": 25,
1608316185
"width": "2",
1608416186
"height": "1",
1608516187
"passthru": false,
@@ -16104,7 +16206,7 @@
1610416206
"z": "5a05b8f3.894b88",
1610516207
"name": "Mid Off /tstat1/",
1610616208
"group": "10afdb4b.d8c455",
16107-
"order": 25,
16209+
"order": 26,
1610816210
"width": "2",
1610916211
"height": "1",
1611016212
"passthru": false,
@@ -16129,7 +16231,7 @@
1612916231
"z": "5a05b8f3.894b88",
1613016232
"name": "Mid Temp Down /tstat1/",
1613116233
"group": "10afdb4b.d8c455",
16132-
"order": 26,
16234+
"order": 27,
1613316235
"width": "2",
1613416236
"height": "1",
1613516237
"passthru": false,
@@ -16154,7 +16256,7 @@
1615416256
"z": "5a05b8f3.894b88",
1615516257
"name": "Mid Fan Auto /tstat1/",
1615616258
"group": "10afdb4b.d8c455",
16157-
"order": 27,
16259+
"order": 28,
1615816260
"width": "2",
1615916261
"height": "1",
1616016262
"passthru": false,
@@ -16181,7 +16283,7 @@
1618116283
"label": "",
1618216284
"place": "",
1618316285
"group": "10afdb4b.d8c455",
16184-
"order": 23,
16286+
"order": 24,
1618516287
"width": "2",
1618616288
"height": "1",
1618716289
"passthru": false,
@@ -16854,7 +16956,7 @@
1685416956
"z": "5a05b8f3.894b88",
1685516957
"name": "Mid Furn Spacer /tstat1/midfurn-spacer/",
1685616958
"group": "10afdb4b.d8c455",
16857-
"order": 22,
16959+
"order": 23,
1685816960
"width": "2",
1685916961
"height": "1",
1686016962
"passthru": false,
@@ -16908,7 +17010,7 @@
1690817010
"type": "ui_text",
1690917011
"z": "5a05b8f3.894b88",
1691017012
"group": "10afdb4b.d8c455",
16911-
"order": 16,
17013+
"order": 17,
1691217014
"width": "2",
1691317015
"height": "1",
1691417016
"name": "Mid Tstat Spacer /tstat1/",
@@ -16924,7 +17026,7 @@
1692417026
"type": "ui_text",
1692517027
"z": "5a05b8f3.894b88",
1692617028
"group": "10afdb4b.d8c455",
16927-
"order": 17,
17029+
"order": 18,
1692817030
"width": "2",
1692917031
"height": "1",
1693017032
"name": "Mid Fan Label /tstat1/",
@@ -17097,7 +17199,7 @@
1709717199
"z": "5a05b8f3.894b88",
1709817200
"group": "10afdb4b.d8c455",
1709917201
"name": "Thermostat Label - Mid /tstat1/",
17100-
"order": 14,
17202+
"order": 15,
1710117203
"width": "6",
1710217204
"height": "1",
1710317205
"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>",
@@ -17586,7 +17688,7 @@
1758617688
"z": "5a05b8f3.894b88",
1758717689
"name": "Mid HPump Spacer /tstat1/heatpump1-spacer/",
1758817690
"group": "10afdb4b.d8c455",
17589-
"order": 19,
17691+
"order": 20,
1759017692
"width": "2",
1759117693
"height": "1",
1759217694
"passthru": false,

0 commit comments

Comments
 (0)