homebridge-myplace 2.0.2 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,4 +1,6 @@
1
1
  ### Homebridge-myplace - An independent plugin for Homebridge bringing Advantage Air MyPlace system, its smaller siblings (E-zone, MyAir, MyAir4, etc) and its cousins (e.g. Fujitsu AnywAir) to Homekit
2
- ##### v2.0.2 (2024-09-18)
2
+ ##### v2.0.3 (2024-09-27)
3
+
4
+ ###### (1) Bug fixes to ConfigCreator.sh and CheckConfig.sh
5
+ ###### (2) Minor update to README.md
3
6
 
4
- ###### (1) Re-coded ConfigCreator to use jq to create all config and enabled updating of devices info in config.json even when it is run from terminal.
package/CheckConfig.sh CHANGED
@@ -1,22 +1,13 @@
1
1
  #!/bin/bash
2
2
  #
3
- # This script is to check the Cmd5 configuration file for myplace plugin
3
+ # This script is to check the MyPlace configuration file for myplace plugin
4
4
  #
5
5
  # Usage ./CheckConfig.sh
6
6
  #
7
7
 
8
- # define the possible names for MyPlace platform
9
- cmd5Platform1="\"platform\": \"MyPlace\""
10
- cmd5Platform2="\"platform\": \"homebridge-myplace\""
11
-
12
- # define some file variables
13
- homebridgeConfigJson="" # homebridge config.json
14
- configJson="config.json.copy" # a working copy of homebridge config.json
15
-
16
8
  # fun color stuff
17
9
  BOLD=$(tput bold)
18
10
  TRED=$(tput setaf 1)
19
- #TGRN=$(tput setaf 2)
20
11
  TYEL=$(tput setaf 3)
21
12
  TPUR=$(tput setaf 5)
22
13
  TLBL=$(tput setaf 6)
@@ -27,13 +18,14 @@ function readHomebridgeConfigJson()
27
18
  INPUT=""
28
19
  homebridgeConfigJson=""
29
20
  getHomebridgeConfigJsonPath
30
- if [ "${fullPath}" != "" ]; then homebridgeConfigJson="${fullPath}"; fi
31
-
32
- # if no config.json file found, ask user to input the full path
33
- if [ -z "${homebridgeConfigJson}" ]; then
34
- homebridgeConfigJson=""
21
+ if [ "${fullPath}" != "" ]; then
22
+ homebridgeConfigJson="${fullPath}"
23
+ echo "${TLBL}INFO: Valid Homebridge config.json found: ${homebridgeConfigJson}${TNRM}"
24
+ echo ""
25
+ else
26
+ # if no valid config.json file found, ask user to manually specify the full path
35
27
  echo ""
36
- echo "${TPUR}WARNING: No valid Homebridge config.json file located by the script!${TNRM}"
28
+ echo "${TPUR}WARNING: No valid Homebridge config.json located by the script!${TNRM}"
37
29
  echo ""
38
30
  until [ -n "${INPUT}" ]; do
39
31
  echo "${TYEL}Please enter the full path of your Homebridge config.json file,"
@@ -41,7 +33,6 @@ function readHomebridgeConfigJson()
41
33
  read -r -p "${BOLD}> ${TNRM}" INPUT
42
34
  if [ -z "${INPUT}" ]; then
43
35
  echo "${TPUR}WARNING: No Homebridge config.json file specified"
44
- cleanUp
45
36
  exit 1
46
37
  elif expr "${INPUT}" : '[./a-zA-Z0-9]*/config.json$' >/dev/null; then
47
38
  if [ -f "${INPUT}" ]; then
@@ -60,29 +51,21 @@ function readHomebridgeConfigJson()
60
51
  INPUT=""
61
52
  fi
62
53
  done
63
- fi
64
- if [ -f "${homebridgeConfigJson}" ]; then
65
- if [ -z "${INPUT}" ]; then
66
- echo "${TLBL}INFO: The Homebridge config.json found: ${homebridgeConfigJson}${TNRM}"
54
+ # check that this specified config.json is valid - has "MyPlace" platform in it.
55
+ fullPath="${homebridgeConfigJson}"
56
+ checkForMyPlacePlatformInFile
57
+ if [ -z "${myPlacePlatformFound}" ]; then
67
58
  echo ""
59
+ echo "${TRED}ERROR: MyPlace Config specified in \"${homebridgeConfigJson}\" is invalid. Please ensure that homebridge-myplace plugin is installed and configured${TNRM}"
60
+ exit 1
68
61
  else
69
62
  echo ""
70
- echo "${TLBL}INFO: The Homebridge config.json specified: ${homebridgeConfigJson}${TNRM}"
63
+ echo "${TLBL}INFO: Valid Homebridge config.json specified: ${homebridgeConfigJson}${TNRM}"
71
64
  echo ""
72
65
  fi
73
- # expand the json just in case it is in compact form
74
- jq --indent 4 '.' "${homebridgeConfigJson}" > "${configJson}"
75
- checkForPlatformCmd5InHomebridgeConfigJson
76
- if [ -z "${validFile}" ]; then
77
- echo ""
78
- echo "${TRED}ERROR: no Cmd5 Config found in \"${homebridgeConfigJson}\"! Please ensure that Homebridge-MyPlace plugin is installed${TNRM}"
79
- cleanUp
80
- exit 1
81
- fi
82
66
  fi
83
67
  }
84
68
 
85
-
86
69
  function getGlobalNodeModulesPathForFile()
87
70
  {
88
71
  file="$1"
@@ -170,8 +153,8 @@ function getHomebridgeConfigJsonPath()
170
153
  if [ -n "${Hoobs}" ]; then
171
154
  fullPath="${MYPLACE_SH_PATH%/*/*/*}/config.json"
172
155
  if [ -f "${fullPath}" ]; then
173
- checkForCmd5PlatformNameInFile
174
- if [ -z "${cmd5PlatformNameFound}" ]; then
156
+ checkForMyPlacePlatformInFile
157
+ if [ -z "${myPlacePlatformFound}" ]; then
175
158
  fullPath=""
176
159
  fi
177
160
  return
@@ -183,8 +166,8 @@ function getHomebridgeConfigJsonPath()
183
166
  1)
184
167
  fullPath="/var/lib/homebridge/config.json"
185
168
  if [ -f "${fullPath}" ]; then
186
- checkForCmd5PlatformNameInFile
187
- if [ -n "${cmd5PlatformNameFound}" ]; then
169
+ checkForMyPlacePlatformInFile
170
+ if [ -n "${myPlacePlatformFound}" ]; then
188
171
  return
189
172
  else
190
173
  fullPath=""
@@ -194,8 +177,8 @@ function getHomebridgeConfigJsonPath()
194
177
  2)
195
178
  fullPath="$HOME/.homebridge/config.json"
196
179
  if [ -f "${fullPath}" ]; then
197
- checkForCmd5PlatformNameInFile
198
- if [ -n "${cmd5PlatformNameFound}" ]; then
180
+ checkForMyPlacePlatformInFile
181
+ if [ -n "${myPlacePlatformFound}" ]; then
199
182
  return
200
183
  else
201
184
  fullPath=""
@@ -208,8 +191,8 @@ function getHomebridgeConfigJsonPath()
208
191
  for ((i = 1; i <= noOfInstances; i ++)); do
209
192
  fullPath=$(echo "${foundPath}"|sed -n "${i}"p)
210
193
  if [ -f "${fullPath}" ]; then
211
- checkForCmd5PlatformNameInFile
212
- if [ -n "${cmd5PlatformNameFound}" ]; then
194
+ checkForMyPlacePlatformInFile
195
+ if [ -n "${myPlacePlatformFound}" ]; then
213
196
  return
214
197
  else
215
198
  fullPath=""
@@ -223,8 +206,8 @@ function getHomebridgeConfigJsonPath()
223
206
  for ((i = 1; i <= noOfInstances; i ++)); do
224
207
  fullPath=$(echo "${foundPath}"|sed -n "${i}"p)
225
208
  if [ -f "${fullPath}" ]; then
226
- checkForCmd5PlatformNameInFile
227
- if [ -n "${cmd5PlatformNameFound}" ]; then
209
+ checkForMyPlacePlatformInFile
210
+ if [ -n "${myPlacePlatformFound}" ]; then
228
211
  return
229
212
  else
230
213
  fullPath=""
@@ -238,8 +221,8 @@ function getHomebridgeConfigJsonPath()
238
221
  for ((i = 1; i <= noOfInstances; i ++)); do
239
222
  fullPath=$(echo "${foundPath}"|sed -n "${i}"p)
240
223
  if [ -f "${fullPath}" ]; then
241
- checkForCmd5PlatformNameInFile
242
- if [ -n "${cmd5PlatformNameFound}" ]; then
224
+ checkForMyPlacePlatformInFile
225
+ if [ -n "${myPlacePlatformFound}" ]; then
243
226
  return
244
227
  else
245
228
  fullPath=""
@@ -253,8 +236,8 @@ function getHomebridgeConfigJsonPath()
253
236
  for ((i = 1; i <= noOfInstances; i ++)); do
254
237
  fullPath=$(echo "${foundPath}"|sed -n "${i}"p)
255
238
  if [ -f "${fullPath}" ]; then
256
- checkForCmd5PlatformNameInFile
257
- if [ -n "${cmd5PlatformNameFound}" ]; then
239
+ checkForMyPlacePlatformInFile
240
+ if [ -n "${myPlacePlatformFound}" ]; then
258
241
  return
259
242
  else
260
243
  fullPath=""
@@ -266,60 +249,15 @@ function getHomebridgeConfigJsonPath()
266
249
  done
267
250
  }
268
251
 
269
- function checkForPlatformCmd5InHomebridgeConfigJson()
270
- {
271
- validFile=""
272
- for ((tryIndex = 1; tryIndex <= 2; tryIndex ++)); do
273
- case $tryIndex in
274
- 1)
275
- validFile=$(grep -n "${cmd5Platform1}" "${configJson}"|cut -d":" -f1)
276
- if [ -n "${validFile}" ]; then
277
- return
278
- fi
279
- ;;
280
- 2)
281
- validFile=$(grep -n "${cmd5Platform2}" "${configJson}"|cut -d":" -f1)
282
- if [ -n "${validFile}" ]; then
283
- return
284
- fi
285
- ;;
286
- esac
287
- done
288
- }
289
-
290
- function checkForCmd5PlatformNameInFile()
291
- {
292
- cmd5PlatformNameFound=""
293
-
294
- for ((Index = 1; Index <= 2; Index ++)); do
295
- case $Index in
296
- 1)
297
- cmd5PlatformName=$(echo "${cmd5Platform1}"|cut -d'"' -f4)
298
- cmd5PlatformNameFound=$(grep -n "\"${cmd5PlatformName}\"" "${fullPath}"|cut -d":" -f1)
299
- if [ -n "${cmd5PlatformNameFound}" ]; then
300
- return
301
- fi
302
- ;;
303
- 2)
304
- cmd5PlatformName=$(echo "${cmd5Platform2}"|cut -d'"' -f4)
305
- cmd5PlatformNameFound=$(grep -n "\"${cmd5PlatformName}\"" "${fullPath}"|cut -d":" -f1)
306
- if [ -n "${cmd5PlatformNameFound}" ]; then
307
- return
308
- fi
309
- ;;
310
- esac
311
- done
312
- }
313
-
314
-
315
- function cleanUp()
252
+ function checkForMyPlacePlatformInFile()
316
253
  {
317
- rm -f "${configJson}"
254
+ myPlacePlatformFound=""
255
+ myPlacePlatformFound=$(grep -n "\"MyPlace\"" "${fullPath}" )
318
256
  }
319
257
 
320
258
  # main starts here
321
259
 
322
- echo "${TYEL}This script is to check that the Cmd5 configuration file meets all requirements${TNRM}"
260
+ echo "${TYEL}This script is to check that the MyPlace configuration file meets all requirements${TNRM}"
323
261
  echo ""
324
262
 
325
263
  echo "${TYEL}CheckConfig engine:${TNRM}"
@@ -369,5 +307,4 @@ readHomebridgeConfigJson
369
307
  if [[ -f "${homebridgeConfigJson}" && -f "${MYPLACE_SH_PATH}" ]]; then
370
308
  echo "${TYEL}CheckConfig in progress.......${TNRM}"
371
309
  node "${CHECKCONFIG_PATH}" "$MYPLACE_SH_PATH" "${homebridgeConfigJson}"
372
- cleanUp
373
310
  fi
package/ConfigCreator.sh CHANGED
@@ -56,11 +56,6 @@ TNRM=$(tput sgr0)
56
56
 
57
57
  function myPlaceBasicKeys()
58
58
  {
59
- local debugMyPlace="false"
60
-
61
- if [[ "${AAdebug}" = "true" || "${AAdebug2}" = "true" || "${AAdebug3}" = "true" ]]; then
62
- debugMyPlace="true"
63
- fi
64
59
  myPlaceBasicKeys="{}"
65
60
  myPlaceBasicKeys=$( echo "${myPlaceBasicKeys}" | jq ".title |= \"MyPlace configuration generated by Configuration Creator\"" \
66
61
  | jq ".debug |= ${debugMyPlace}" \
@@ -542,10 +537,9 @@ function updateMyPlaceDevices()
542
537
  function extractMyPlaceConfigFromConfigJson()
543
538
  {
544
539
  noOfPlatforms=$(( $( echo "${config}" | jq ".platforms|keys" | wc -w) - 2 ))
545
- myPlacePlatformName=$(echo "${myPlacePlatform}"|cut -d'"' -f4)
546
540
  for ((i=0; i<noOfPlatforms; i++)); do
547
541
  plaftorm=$( echo "${config}" | jq ".platforms[${i}].platform" )
548
- if [ "${plaftorm}" = "\"${myPlacePlatformName}\"" ]; then
542
+ if [ "${plaftorm}" = "\"${myPlacePlatform}\"" ]; then
549
543
  myPlaceConfig=$( echo "${config}" | jq ".platforms[${i}]" )
550
544
  configMyPlaceLess=$( echo "${config}" | jq "del(.platforms[${i}])" )
551
545
  break
@@ -746,7 +740,7 @@ function getHomebridgeConfigJsonPath()
746
740
  fullPath="${MYPLACE_SH_PATH%/*/*/*}/config.json"
747
741
  if [ -f "${fullPath}" ]; then
748
742
  checkForMyPlacePlatformNameInFile
749
- if [ -z "${myPlacePlatformNameFound}" ]; then
743
+ if [ -z "${myPlacePlatformFound}" ]; then
750
744
  fullPath=""
751
745
  fi
752
746
  return
@@ -760,7 +754,7 @@ function getHomebridgeConfigJsonPath()
760
754
  fullPath="/var/lib/homebridge/config.json"
761
755
  if [ -f "${fullPath}" ]; then
762
756
  checkForMyPlacePlatformNameInFile
763
- if [ -n "${myPlacePlatformNameFound}" ]; then
757
+ if [ -n "${myPlacePlatformFound}" ]; then
764
758
  return
765
759
  else
766
760
  fullPath=""
@@ -772,7 +766,7 @@ function getHomebridgeConfigJsonPath()
772
766
  fullPath="$HOME/.homebridge/config.json"
773
767
  if [ -f "${fullPath}" ]; then
774
768
  checkForMyPlacePlatformNameInFile
775
- if [ -n "${myPlacePlatformNameFound}" ]; then
769
+ if [ -n "${myPlacePlatformFound}" ]; then
776
770
  return
777
771
  else
778
772
  fullPath=""
@@ -786,7 +780,7 @@ function getHomebridgeConfigJsonPath()
786
780
  fullPath=$(echo "${foundPath}"|sed -n "${i}"p)
787
781
  if [ -f "${fullPath}" ]; then
788
782
  checkForMyPlacePlatformNameInFile
789
- if [ -n "${myPlacePlatformNameFound}" ]; then
783
+ if [ -n "${myPlacePlatformFound}" ]; then
790
784
  return
791
785
  else
792
786
  fullPath=""
@@ -801,7 +795,7 @@ function getHomebridgeConfigJsonPath()
801
795
  fullPath=$(echo "${foundPath}"|sed -n "${i}"p)
802
796
  if [ -f "${fullPath}" ]; then
803
797
  checkForMyPlacePlatformNameInFile
804
- if [ -n "${myPlacePlatformNameFound}" ]; then
798
+ if [ -n "${myPlacePlatformFound}" ]; then
805
799
  return
806
800
  else
807
801
  fullPath=""
@@ -816,7 +810,7 @@ function getHomebridgeConfigJsonPath()
816
810
  fullPath=$(echo "${foundPath}"|sed -n "${i}"p)
817
811
  if [ -f "${fullPath}" ]; then
818
812
  checkForMyPlacePlatformNameInFile
819
- if [ -n "${myPlacePlatformNameFound}" ]; then
813
+ if [ -n "${myPlacePlatformFound}" ]; then
820
814
  return
821
815
  else
822
816
  fullPath=""
@@ -831,7 +825,7 @@ function getHomebridgeConfigJsonPath()
831
825
  fullPath=$(echo "${foundPath}"|sed -n "${i}"p)
832
826
  if [ -f "${fullPath}" ]; then
833
827
  checkForMyPlacePlatformNameInFile
834
- if [ -n "${myPlacePlatformNameFound}" ]; then
828
+ if [ -n "${myPlacePlatformFound}" ]; then
835
829
  return
836
830
  else
837
831
  fullPath=""
@@ -868,20 +862,20 @@ function checkForPlatformMyPlaceInHomebridgeConfigJson()
868
862
 
869
863
  function checkForMyPlacePlatformNameInFile()
870
864
  {
871
- myPlacePlatformNameFound=""
865
+ myPlacePlatformFound=""
872
866
 
873
867
  for ((Index = 1; Index <= 2; Index ++)); do
874
868
  case $Index in
875
869
  1)
876
870
 
877
- myPlacePlatformNameFound=$(grep "\"${myPlacePlatform1}\"" "${fullPath}")
878
- if [ -n "${myPlacePlatformNameFound}" ]; then
871
+ myPlacePlatformFound=$(grep "\"${myPlacePlatform1}\"" "${fullPath}")
872
+ if [ -n "${myPlacePlatformFound}" ]; then
879
873
  return
880
874
  fi
881
875
  ;;
882
876
  2)
883
- myPlacePlatformNameFound=$(grep "\"${myPlacePlatform2}\"" "${fullPath}")
884
- if [ -n "${myPlacePlatformNameFound}" ]; then
877
+ myPlacePlatformFound=$(grep "\"${myPlacePlatform2}\"" "${fullPath}")
878
+ if [ -n "${myPlacePlatformFound}" ]; then
885
879
  return
886
880
  fi
887
881
  ;;
@@ -1165,19 +1159,38 @@ for ((n=1; n<=noOfTablets; n++)); do
1165
1159
  fi
1166
1160
  sysType=$(echo "$myAirData" | jq -e ".system.sysType" | sed 's/ /_/g' | sed 's/\"//g')
1167
1161
  tspModel=$(echo "$myAirData" | jq -e ".system.tspModel" | sed 's/ /_/g' | sed 's/\"//g')
1168
- # Create the myPlaceModelQueue for this AA system
1169
- myPlaceModelQueue
1170
1162
 
1171
1163
  hasAircons=$(echo "$myAirData"|jq -e ".system.hasAircons")
1172
1164
  noOfAircons=$(echo "$myAirData"|jq -e ".system.noOfAircons")
1173
1165
  hasLights=$(echo "$myAirData"|jq -e ".system.hasLights")
1174
1166
  hasThings=$(echo "$myAirData"|jq -e ".system.hasThings")
1175
1167
 
1176
- # Create the ${myPlaceBasicKeys}, ${myPlaceConstantsAA} and ${myPlaceQueueTypesAA}
1168
+ # Read the existing Homebridge config.json file
1169
+ readHomebridgeConfigJson
1170
+
1171
+ # Extract MyPlace platform
1172
+ extractMyPlaceConfigFromConfigJson
1173
+
1174
+ # Create the ${myPlaceBasicKeys}
1175
+ # First check whether the original MyPlace platform has its "debug=true" for nonAA system, if so leave that as "true"
1176
+ debugPresence=$( echo "${myPlaceConfig}" | jq ".constants" | grep -v ":2025-debug" | grep "\-debug" )
1177
+ debugMyPlace=false
1178
+ if [ -n "${debugPresence}" ]; then
1179
+ debugMyPlace=true
1180
+ else
1181
+ if [[ "${AAdebug}" = "true" || "${AAdebug2}" = "true" ||"${AAdebug3}" = "true" ]]; then
1182
+ debugMyPlace=true
1183
+ fi
1184
+ fi
1177
1185
  myPlaceBasicKeys
1178
- myPlaceConstants
1186
+
1187
+ # Create the ${myPlaceConstantsAA} and ${myPlaceQueueTypesAA}
1188
+ myPlaceConstants
1179
1189
  myPlaceQueueTypes
1180
1190
 
1191
+ # Create the myPlaceModelQueue for this AA system
1192
+ myPlaceModelQueue
1193
+
1181
1194
  # Create the $myPlaceAccessoriesAA
1182
1195
  # Aircon systems
1183
1196
  if [ "$hasAircons" = true ]; then
@@ -1260,14 +1273,10 @@ for ((n=1; n<=noOfTablets; n++)); do
1260
1273
 
1261
1274
  done
1262
1275
 
1263
- # Read the existing Homebridge config.json file
1264
- readHomebridgeConfigJson
1265
-
1266
- # Extract all non-AA related MyPlace devices
1267
- extractMyPlaceConfigFromConfigJson
1276
+ # Extract all non-AA related MyPlace accessories, constants and queueTypes
1268
1277
  extractNonAAaccessoriesrConstantsQueueTypesMisc
1269
1278
 
1270
- # Extract related "devices" keys
1279
+ # Extract the MyPlace "devices" keys
1271
1280
  extractMyPlaceDevices
1272
1281
  if [ "${UIversion}" = "nonUI" ]; then
1273
1282
  updateMyPlaceDevices
@@ -1276,7 +1285,7 @@ fi
1276
1285
  # Assemble a complete MyPlace configuration file for AA device(s)
1277
1286
  assembleMyPlaceConfigAA
1278
1287
 
1279
- # Assemble a complete MyPlace configuration file for AA devices(s) with the extracted with non-AA devices, if any.
1288
+ # Assemble a complete MyPlace configuration file for AA devices(s) with the extracted non-AA devices (if any).
1280
1289
  assembleMyPlaceConfigAAwithNonAA
1281
1290
 
1282
1291
  # Write the assembled AA + non-AA MyPlace configuration into the Homebridge config.json
package/README.md CHANGED
@@ -28,7 +28,7 @@ An independent plugin bringing [Advantage Air](https://www.advantageair.com.au/)
28
28
  ### Raspbian/HOOBS/macOS/NAS
29
29
  1. Install Homebridge via these instructions for [Raspbian](https://github.com/homebridge/homebridge/wiki/Install-Homebridge-on-Raspbian), [HOOBS](https://support.hoobs.org/docs) or [macOS](https://github.com/homebridge/homebridge/wiki/Install-Homebridge-on-macOS), if you have not already.
30
30
 
31
- 2. Find the `homebridge-myplace` plugin via the Homebridge UI 'Plugins' tab search function, once found, click the blue down arrow at the bottom right to install.
31
+ 2. Find the `homebridge-myplace` plugin via the Homebridge UI 'Plugins' tab search function, once found, click the blue *down-arrow* at the bottom right to install. Once install, click on the three dots at the bottom right and select `JSON Config`, a pop-up box showing a small config in it. Do not edit anything but click `SAVE`. More pop-up boxes may appear, click `SAVE` to all until you are prompted to `RESTART HOMEBRIDGE`. You do not need to restart homebridge but can click `CLOSE` now to move on to the next step.
32
32
 
33
33
  <p align="left">
34
34
  <img width="400px" src="Screenshots/MyPlaceInstall3.png">
@@ -38,10 +38,7 @@ An independent plugin bringing [Advantage Air](https://www.advantageair.com.au/)
38
38
  jq --version
39
39
  curl --version
40
40
  ```
41
- If they are installed, the above command should return a version number.
42
-
43
- 4. If not already, install <B>jq</B> and <B>curl</B> via your Homebridge UI terminal or through ssh:
44
-
41
+ If they are installed, the above command should return a version number. If not, install them:
45
42
  ##### For Raspbian/Hoobs:
46
43
  ```shell
47
44
  sudo apt-get install <jq or curl>
@@ -59,21 +56,23 @@ An independent plugin bringing [Advantage Air](https://www.advantageair.com.au/)
59
56
  apk add <jq or curl>
60
57
  ```
61
58
  #### Important note:
62
- At the time of updating this README, the `apt-get insatall` only allow jq-1.6 to be installed. To install the lastest and **MUCH faster** version of jq-1.7.1, please follow the step-by-step guide below:
59
+ At the time of updating this README, the `apt-get insatall` only allow jq-1.6 to be installed, which is notorously slow! To install the lastest and **MUCH faster** version of jq-1.7.1, please follow the step-by-step guide below:
63
60
  1. Download the Source Code:
64
- You can download the source code "jq-1.7.1.tar.gz" for jq 1.7.1 from the official GitHub releases page (https://github.com/jqlang/jq/releases) or use the link below:
61
+
62
+ You can download the source code "jq-1.7.1.tar.gz" for jq 1.7.1 from the official GitHub releases page (https://github.com/jqlang/jq/releases) or use the link below:
65
63
  ```shell
66
- https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-1.7.1.tar.gz
64
+ wget https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-1.7.1.tar.gz
67
65
  ```
68
66
  2. Install Dependencies:
69
- Ensure you have the necessary build tools and dependencies installed. You can do this by running:
67
+
68
+ Ensure you have the necessary build tools and dependencies installed. You can do this by running:
70
69
  ```shell
71
70
  sudo apt-get update
72
- sudo apt-get install -y autoconf automake
73
- libtool make gcc
71
+ sudo apt-get install -y autoconf automake libtool make gcc
74
72
  ```
75
73
  3. Extract and Build:
76
- Extract the downloaded tarball and navigate to the directory:
74
+
75
+ Extract the downloaded tarball and navigate to the directory:
77
76
  ```shell
78
77
  tar -xvzf jq-1.7.1.tar.gz
79
78
  cd jq-1.7.1
@@ -86,12 +85,13 @@ An independent plugin bringing [Advantage Air](https://www.advantageair.com.au/)
86
85
  sudo make install
87
86
  ```
88
87
  5. Verify Installation:
88
+
89
89
  After installation, you can verify that jq is installed correctly by running:
90
90
  ```shell
91
91
  jq --version
92
92
  ```
93
93
 
94
- 6. Create your Homebridge `config.json`
94
+ 4. Create MyPlace configuration file:
95
95
 
96
96
  Go to the 'Plugins' tab in Homebridge UI, locate your newly installed `Homebridge Myplace` plugin and click the three dots on the bottom right, select `Plugin Config` and it should launch the <B>Configuration Creator and Checker</B> and <B>Device
97
97
  Settings</B> page.
@@ -100,10 +100,12 @@ An independent plugin bringing [Advantage Air](https://www.advantageair.com.au/)
100
100
  </p>
101
101
 
102
102
  In <B>Device Settings</B> area, fill out the `Name`, `IP Address` and `PORT used` fields (default PORT is `2025` for most users, Fujitsu anywAIR users set this to `10211` ) and check/uncheck the checkboxes for `Include extra timers` and `Enable detailed debug log`, then click `SAVE`. This is to save your system parameters. Click `CLOSE` if a pop up urging you to `RESTART HOMEBRIDGE`.
103
-
104
- *Please use only alphanumeric, space, and apostrophe characters for `Name`.*
105
103
 
106
- Go back to `Plugin Config` again and press the `CREATE CONFIGURATION` button to create the required configuration file. On a sucess, click `CHECK CONFIGURATION`to check the configuration file just created is in order. On a success it will say `Passed`; if something is incorrect, an error message will pop up telling you what needs to be fixed. Otherwise, click `SAVE` then restart Homebridge.
104
+ Go back to `Plugin Config` again and press the `CREATE CONFIGURATION` button to create the required configuration file.
105
+
106
+ On a sucess, you may click `CHECK CONFIGURATION`to check the configuration file just created is in order. On a success it will say `Passed`; if something is incorrect, an error message will pop up telling you what needs to be fixed.
107
+
108
+ Otherwise, click `SAVE` then `RESTART HOMEBRIDGE`.
107
109
 
108
110
  **HOOBS** users who do not have access to Homebridge UI (for now!) will have to run the Config Creator on a terminal:
109
111
  ```shell
@@ -137,14 +139,16 @@ Both the <B>Thermostat</B> and <B>Fan</B> switch has associated fan speed contro
137
139
  <img width="240px" src="Screenshots/Timer_homekit_UI.png">
138
140
  </p>
139
141
 
140
- A timer is repurposed from <B>Lightbulb</B> accessory and its <B>%-brightness</B> as proxy for duration configured to represent 6 minutes per 1%. 10%-timer is then a 60-minutes or 1-hour timer and 25%-timer is a 2.5-hours timer. A maximum of 10-hour timer (100%-timer) can be set. This timer will turn ON or OFF the Aircon system.
142
+ A timer is repurposed from <B>Lightbulb</B> accessory and its <B>%-brightness</B> as proxy for timer duration, configured to represent 6 minutes per 1%. So a 10%-timer is a 60-minutes or 1-hour timer and 25%-timer is a 2.5-hours timer. A maximum of 10-hour timer (100%-timer) can be set. This timer will turn ON or OFF the Aircon system.
141
143
 
142
- If <B>Include extra timers</B> is checked during the setup process, 3 more timers would have been created- a <B>Fan Timer</B>, a <B>Cool Timer</B> and a <B>Heat Timer</B>:
144
+ If <B>Include extra timers</B> was selected during the setup process, 3 more timers would have been created- a <B>Fan Timer</B>, a <B>Cool Timer</B> and a <B>Heat Timer</B>:
143
145
  <p align="left">
144
146
  <img width="300px" src="Screenshots/FancyTimers_homekit_tiles.png">
145
147
  </p>
146
148
 
147
- These timers will turn ON the Aircon system in specific mode as their names suggest. *Please note that the icons on the Timer tiles in the example above have been deliberately changed to distinguish them from lights. All timers are repurposed from <B>Lightbulb</B> accessory.*
149
+ These timers will turn ON the Aircon system in specific mode as their names suggest.
150
+
151
+ *Please note that the icons on the Timer tiles in the example above have been deliberately changed to distinguish them from lights.*
148
152
 
149
153
  #### (iii) Zone Control
150
154
  <p align="left">
@@ -154,7 +158,9 @@ These timers will turn ON the Aircon system in specific mode as their names sugg
154
158
 
155
159
  Zone control is repurposed from <B>Fan</B> accessory with its <B>%-rotationSpeed</B> as proxy for zone %-open.
156
160
 
157
- For zones with temperature sensors and with myZone defined, a <B>myZone</B> switch, repurposed from <B>rotationDirection</B> will appear as a round button. Turn this button <B>ON</B> to set this zone as myZone. *Please note that as per Advantage Air system design, myZone cannot be turned <B>OFF</B>. It can only be turned <B>OFF</B> by setting another zone as myZone. Moreover, %-open for these zones cannot be set. It is set automatically by the system.*
161
+ For zones with temperature sensors and with myZone defined, a <B>myZone</B> switch, repurposed from <B>rotationDirection</B> will appear as a round button. Turn this button <B>ON</B> to set this zone as myZone.
162
+
163
+ *Please note that as per Advantage Air system design, myZone cannot be turned <B>OFF</B>. It can only be turned <B>OFF</B> by setting another zone as myZone. Moreover, %-open for zones with temperature sensors cannot be set manually. It is set automatically by the system.*
158
164
 
159
165
  For zone current temperature info, click the setting button.
160
166
 
@@ -1,4 +1,9 @@
1
1
  ### Homebridge-myplace - An independent plugin for Homebridge bringing Advantage Air MyPlace system, its smaller siblings (E-zone, MyAir, MyAir4, etc) and its cousins (e.g. Fujitsu AnywAir) to Homekit
2
+ ##### v2.0.3 (2024-09-27)
3
+
4
+ ###### (1) Bug fixes to ConfigCreator.sh and CheckConfig.sh
5
+ ###### (2) Minor update to README.md
6
+
2
7
  ##### v2.0.2 (2024-09-18)
3
8
 
4
9
  ###### (1) Re-coded ConfigCreator to use jq to create all config and enabled updating of devices info in config.json even when it is run from terminal.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "homebridge-myplace",
3
3
  "description": "Exec Plugin bringing Advanatge Air MyPlace system to Homekit",
4
- "version": "2.0.2",
4
+ "version": "2.0.3",
5
5
  "license": "MIT",
6
6
  "author": {
7
7
  "name": "Ung Sing"