Skip to content

Commit

Permalink
release v2.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
grzegorz914 committed Aug 25, 2024
1 parent 78ee13b commit fc26f05
Show file tree
Hide file tree
Showing 13 changed files with 356 additions and 175 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- After update to v2 from v1 only RESTFull and MQTT config settings need to be updated in config.

## [2.3.0] - (25.08.2024)

## Changes

- removed from config.json `ataDisableAutoMode`, `ataDisableHeatMode`, `ataAutoHeatMode`
- added to config.json `ataHeatDryFanMode`, `ataCoolDryFanMode`, `ataAutoDryFanMode`
- added individual operating mode assingn for `Heat/Cool/Auto`, [#132](https://github.com/grzegorz914/homebridge-melcloud-control/issues/132)
- unfortunatelly disabled operating mode cannot be hiden in HomeKit app due to HomeKit app limitations
- cleanup
- config schema updated

## [2.2.0] - (18.08.2024)

## Changes
Expand Down
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
* Support temperature display units `Celsius/Fahrenheit`.
* Support hide device by `DeviceId`.
* Support control device `Presets`.
* Support direct device control creating extra `Buttons`, applied for all devices of same type in account.
* Support identify all states of device creating `Sensors`, applied for all devices of same type in account.
* Support assing inividual operating mode for `Heat/Cool/Auto`.
* Support direct device control using extra `Buttons`, applied for all devices of same type in account.
* Support detect all device states using extra `Sensors`, applied for all devices of same type in account.
* Support automations, shortcuts and Siri.
* Support external integrations, [RESTFul](https://github.com/grzegorz914/homebridge-melcloud-control?tab=readme-ov-file#restful-integration), [MQTT](https://github.com/grzegorz914/homebridge-melcloud-control?tab=readme-ov-file#mqtt-integration).

Expand All @@ -48,13 +49,12 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
* Swing mode `AUTO/SWING`.
* Physical lock controls `LOCK/UNLOCK`.
* Temperature display unit `°F/°C`.
* If `AUTO/HEAT` or both modes are not supported by device will use `DRY/FAN` or `FAN/DRY` modes instead.
* Thermostat:
* Power `ON/OFF`.
* Operating mode `POWER OFF/HEAT/COOL/AUTO`.
* Temperature `HEATING/COOLING`.
* Temperature display unit `°F/°C`.
* If `AUTO/HEAT` or both modes are not supported by device will use `DRY/FAN` or `FAN/DRY` modes instead.
* Assign operating mode for `HEAT/AUTO`
* Buttons:
* For direct device control.
* Power `ON/OFF`.
Expand Down Expand Up @@ -164,7 +164,6 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
* Run this plugin as a [Child Bridge](https://github.com/homebridge/homebridge/wiki/Child-Bridges) (Highly Recommended), this prevent crash Homebridge if plugin crashes.
* Install and use [Homebridge Config UI X](https://github.com/homebridge/homebridge-config-ui-x/wiki) to configure this plugin (Highly Recommended).
* The `sample-config.json` can be edited and used as an alternative.
* Be sure to always make a backup copy of your config.json file before making any changes to it.

<p align="center">
<a href="https://github.com/grzegorz914/homebridge-melcloud-control"><img src="https://raw.githubusercontent.com/grzegorz914/homebridge-melcloud-control/main/graphics/ustawienia.png" width="840"></a>
Expand All @@ -176,12 +175,12 @@ Homebridge plugin for Air Conditioner, Heat Pump and Energy Recovery Ventilation
| `user` | Here set the MELCloud username. |
| `passwd` | Here set the MELCloud password. |
| `language` | Here select the MELCloud language. |
| `ataDisplayMode` | Here select main control mode `Heater/Cooler`, `Thermostat`. |
| `ataDisplayMode` | Here select device control mode `Heater/Cooler`, `Thermostat`. |
| `ataHeatDryFanMode` | Here select the operatiing mode for `Heat`, if this mode is not supported, it will be disabled. |
| `ataCoolDryFanMode` | Here select the operatiing mode for `Cool`, if this mode is not supported, it will be disabled. |
| `ataAutoDryFanMode` | Here select the operatiing mode for `Auto`, if this mode is not supported, it will be disabled.. |
| `ataTemperatureSensor` | This enable extra `Room` temperature sensors to use with automations in HomeKit app. |
| `ataTemperatureSensorOutdoor` | This enable extra `Outdoor` temperature sensors to use with automations in HomeKit app. |
| `ataDisableAutoMode` | This will disable `Auto` mode even this mode is supported by device. |
| `ataDisableHeatMode` | This will disable `Heat` mode even this mode is supported by device. |
| `ataAutoHeatMode` | Here select operation mode for `Auto/Heat`, if `Auto`, `Heat` or both modes are not supported by device will be used selected modes instead. |
| `ataPresets` | This enable extra buttons for configured presets and display it in HomeKit app. |
| `ataButtons.name` | Here set `Button Name` which You want expose to the `Homebridge/HomeKit`. |
| `ataButtons.mode` | Here select button mode, VH - Vane Horizontal, VV - Vane Horizontal. |
Expand Down
166 changes: 123 additions & 43 deletions config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
"required": true
},
"ataDisplayMode": {
"title": "Control Mode",
"title": "Control",
"type": "integer",
"minimum": 0,
"maximum": 1,
Expand All @@ -224,64 +224,135 @@
]
}
],
"description": "Select main control mode.",
"description": "Select device control mode displayed in HomeKit app.",
"required": true
},
"ataTemperatureSensor": {
"title": "Temperature Sensor Room",
"type": "boolean",
"default": false,
"description": "This enable extra room temperature sensor to use with automations in HomeKit app.",
"required": false
},
"ataTemperatureSensorOutdoor": {
"title": "Temperature Sensor Outdoor",
"type": "boolean",
"default": false,
"description": "This enable extra outdoor temperature sensor to use with automations in HomeKit app.",
"required": false
},
"ataPresets": {
"title": "Presets",
"type": "boolean",
"default": false,
"description": "This enable extra buttons for configured presets and display it in HomeKit app.",
"required": false
},
"ataDisableAutoMode": {
"title": "Disable Auto Mode",
"type": "boolean",
"default": false,
"description": "This will disable Auto mode even if this mode is supported by device.",
"required": false
"ataHeatDryFanMode": {
"title": "Heat",
"type": "integer",
"minimum": 0,
"maximum": 3,
"default": 1,
"oneOf": [
{
"title": "None/Disabled",
"enum": [
0
]
},
{
"title": "Heat",
"enum": [
1
]
},
{
"title": "Dry",
"enum": [
2
]
},
{
"title": "Fan",
"enum": [
3
]
}
],
"description": "Select the operatiing mode for Heat, if this mode is not supported, it will be disabled.",
"required": true
},
"ataDisableHeatMode": {
"title": "Disable Heat Mode",
"type": "boolean",
"default": false,
"description": "This will disable Heat mode even if this mode is supported by device.",
"required": false
"ataCoolDryFanMode": {
"title": "Cool",
"type": "integer",
"minimum": 0,
"maximum": 3,
"default": 1,
"oneOf": [
{
"title": "None/Disabled",
"enum": [
0
]
},
{
"title": "Cool",
"enum": [
1
]
},
{
"title": "Dry",
"enum": [
2
]
},
{
"title": "Fan",
"enum": [
3
]
}
],
"description": "Select the operatiing mode for Cool, if this mode is not supported, it will be disabled.",
"required": true
},
"ataAutoHeatMode": {
"title": "Auto/Heat Mode",
"ataAutoDryFanMode": {
"title": "Auto",
"type": "integer",
"minimum": 0,
"maximum": 3,
"default": 1,
"oneOf": [
{
"title": "Auto - Dry / Heat - Fan",
"title": "None/Disabled",
"enum": [
0
]
},
{
"title": "Auto - Fan / Heat - Dry",
"title": "Auto",
"enum": [
1
]
},
{
"title": "Dry",
"enum": [
2
]
},
{
"title": "Fan",
"enum": [
3
]
}
],
"description": "Operation mode for Auto/Heat option, if Auto, Heat or both modes are not supported by the device this will be used for selected modes instead.",
"description": "Select the operatiing mode for Auto, if this mode is not supported, it will be disabled.",
"required": true
},
"ataPresets": {
"title": "Presets",
"type": "boolean",
"default": false,
"description": "This enable extra buttons for configured presets and display it in HomeKit app.",
"required": false
},
"ataTemperatureSensor": {
"title": "Room",
"type": "boolean",
"default": false,
"description": "This enable extra room temperature sensor to use with automations in HomeKit app.",
"required": false
},
"ataTemperatureSensorOutdoor": {
"title": "Outdoor",
"type": "boolean",
"default": false,
"description": "This enable extra outdoor temperature sensor to use with automations in HomeKit app.",
"required": false
},
"ataButtons": {
"title": "Button / Sensor",
"type": "array",
Expand Down Expand Up @@ -1359,9 +1430,18 @@
"items": [
"accounts[].ataDisplayMode",
"accounts[].ataPresets",
"accounts[].ataDisableAutoMode",
"accounts[].ataDisableHeatMode",
"accounts[].ataAutoHeatMode",
{
"key": "accounts[]",
"type": "section",
"title": "Operation Modes",
"expandable": true,
"expanded": false,
"items": [
"accounts[].ataHeatDryFanMode",
"accounts[].ataCoolDryFanMode",
"accounts[].ataAutoDryFanMode"
]
},
{
"key": "accounts[]",
"type": "section",
Expand Down
20 changes: 13 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ class MelCloudPlatform {
this.accessories = [];
const accountsName = [];

//check if the directory exists, if not then create it
const prefDir = path.join(api.user.storagePath(), 'melcloud');
if (!fs.existsSync(prefDir)) {
fs.mkdirSync(prefDir);
};

api.on('didFinishLaunching', () => {
//loop through accounts
for (const account of config.accounts) {
Expand Down Expand Up @@ -64,9 +58,21 @@ class MelCloudPlatform {
};
const debug1 = enableDebugMode ? log.info(`Account: ${accountName}, Config: ${JSON.stringify(debugData, null, 2)}`) : false;

//set refresh interval
//define directory and file paths
const prefDir = path.join(api.user.storagePath(), 'melcloud');
const accountInfoFile = `${prefDir}/${accountName}_Account`;
const buildingsFile = `${prefDir}/${accountName}_Buildings`;

//create directory if it doesn't exist
try {
//create directory if it doesn't exist
fs.mkdirSync(prefDir, { recursive: true });
} catch (error) {
log.error(`Account: ${accountName}, prepare directory error: ${error.message ?? error}`);
return;
}

//set refresh interval
const refreshInterval = account.refreshInterval * 1000 || 120000;
const deviceRefreshInterval = account.deviceRefreshInterval * 1000 || 5000;

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"displayName": "MELCloud Control",
"name": "homebridge-melcloud-control",
"version": "2.2.2",
"version": "2.3.0",
"description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
"license": "MIT",
"author": "grzegorz914",
Expand Down
8 changes: 4 additions & 4 deletions sample-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
"passwd": "password",
"language": "0",
"ataDisplayMode": 0,
"ataHeatDryFanMode": 1,
"ataCoolDryFanMode": 1,
"ataAutoDryFanMode": 1,
"ataTemperatureSensor": false,
"ataTemperatureSensorOutdoor": false,
"ataDisableAutoMode": false,
"ataDisableHeatMode": false,
"ataAutoHeatMode": 0,
"ataPresets": false,
"ataButtons": [
{
Expand Down Expand Up @@ -108,4 +108,4 @@
]
}
]
}
}
Loading

0 comments on commit fc26f05

Please sign in to comment.