Skip to content

Commit

Permalink
1.1.1 version added Mi Smart Humidifier
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxmudjon committed Jan 13, 2020
1 parent 68cb11f commit ca2d574
Show file tree
Hide file tree
Showing 78 changed files with 1,266 additions and 283 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Added support for Mi Gateways child devices.

## Version 1.1.0 - Supported devices:
## Version 1.1.1 - Supported devices:

### Zigbee subdevices Xiaomi Gateway

Expand Down Expand Up @@ -124,6 +124,11 @@ Added support for Mi Gateways child devices.

## Version logs

### 1.1.1 (14.01.2020)

1. added Mi ClearGlass Air Detector.
2. minor fixes.

### 1.1.0 (27.12.2019)

1. fixed Mi Air Purifier (MJXFJ-300-G1) set favorite speed and settings.
Expand Down
268 changes: 265 additions & 3 deletions app.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "com.maxmudjon.mihomey",
"version": "1.1.0",
"version": "1.1.1",
"compatibility": ">=2.0.0",
"sdk": 2,
"name": {
Expand Down Expand Up @@ -1818,7 +1818,7 @@
{
"name": "device",
"type": "device",
"filter": "driver_id=mi_humidifier_v1|mi_humidifier_ca1"
"filter": "driver_id=mi_humidifier_v1|mi_humidifier_ca1|deerma_humidifier_mjjsq"
}
]
},
Expand All @@ -1831,7 +1831,7 @@
{
"name": "device",
"type": "device",
"filter": "driver_id=mi_humidifier_v1|mi_humidifier_ca1"
"filter": "driver_id=mi_humidifier_v1|mi_humidifier_ca1|deerma_humidifier_mjjsq"
}
]
},
Expand Down Expand Up @@ -1915,6 +1915,49 @@
}
]
},
{
"id": "humidifier_deerma_mode",
"title": {
"en": "Set humidifier mode"
},
"args": [
{
"name": "device",
"type": "device",
"filter": "driver_id=deerma_humidifier_mjjsq"
},
{
"type": "dropdown",
"name": "modes",
"values": [
{
"id": "low",
"label": {
"en": "Low"
}
},
{
"id": "medium",
"label": {
"en": "Medium"
}
},
{
"id": "high",
"label": {
"en": "High"
}
},
{
"id": "humidity",
"label": {
"en": "Humidity"
}
}
]
}
]
},
{
"id": "send_ir_code",
"title": {
Expand Down Expand Up @@ -2461,6 +2504,43 @@
"getable": true,
"setable": true
},
"humidifier_deerma_mode": {
"type": "enum",
"title": {
"en": "Humidifier Mode"
},
"desc": {
"en": "Humidifier Mode"
},
"values": [
{
"id": "low",
"title": {
"en": "Low"
}
},
{
"id": "medium",
"title": {
"en": "Medium"
}
},
{
"id": "high",
"title": {
"en": "High"
}
},
{
"id": "humidity",
"title": {
"en": "Humidity"
}
}
],
"getable": true,
"setable": true
},
"measure_voc": {
"title": {
"en": "VOC",
Expand Down Expand Up @@ -10001,6 +10081,116 @@
}
]
},
{
"id": "deerma_humidifier_mjjsq",
"name": {
"en": "Mi Smart Humidifier"
},
"class": "sensor",
"capabilities": ["onoff", "dim", "humidifier_deerma_mode", "measure_temperature", "measure_humidity", "alarm_water", "alarm_motion.tank"],
"capabilitiesOptions": {
"onoff": {
"title": {
"en": "Power"
}
},
"dim": {
"title": {
"en": "Set humidity"
}
},
"alarm_water": {
"title": {
"en": "Water level"
}
},
"alarm_motion.tank": {
"title": {
"en": "Water tank status"
}
}
},
"settings": [
{
"type": "group",
"label": {
"en": "Mi Smart Humidifier settings"
},
"children": [
{
"id": "deviceIP",
"type": "text",
"value": "192.168.xxx.xxx",
"label": {
"en": "IP Address"
}
},
{
"id": "deviceToken",
"type": "text",
"value": "",
"label": {
"en": "Device Token"
}
},
{
"id": "updateTimer",
"type": "number",
"value": 60,
"attr": {
"min": 5,
"max": 3600
},
"label": {
"en": "Device update timer"
}
}
]
},
{
"type": "group",
"label": {
"en": "Extra settings"
},
"children": [
{
"id": "led",
"type": "checkbox",
"value": true,
"label": {
"en": "LED"
}
},
{
"id": "buzzer",
"type": "checkbox",
"value": true,
"label": {
"en": "Buzzer"
}
}
]
}
],
"images": {
"large": "/drivers/deerma_humidifier_mjjsq/assets/images/large.png",
"small": "/drivers/deerma_humidifier_mjjsq/assets/images/small.png"
},
"pair": [
{
"id": "xiaomi",
"navigation": {
"next": "done"
}
},
{
"id": "done",
"navigation": {
"prev": "xiaomi"
}
}
]
},
{
"id": "zhimi_airfresh_va2",
"name": {
Expand Down Expand Up @@ -10221,6 +10411,78 @@
}
]
},
{
"id": "cgllc_airmonitor_s1",
"name": {
"en": "Mi ClearGlass Air Detector",
"nl": ""
},
"class": "sensor",
"capabilities": ["measure_temperature", "measure_humidity", "measure_pm25", "measure_co2", "measure_voc", "measure_battery", "alarm_battery"],
"energy": {
"batteries": ["OTHER"]
},
"settings": [
{
"type": "group",
"label": {
"en": "Mi ClearGlass Air Detector settings",
"nl": ""
},
"children": [
{
"id": "deviceIP",
"type": "text",
"value": "192.168.xxx.xxx",
"label": {
"en": "IP Address",
"nl": ""
}
},
{
"id": "deviceToken",
"type": "text",
"value": "",
"label": {
"en": "Device Token",
"nl": ""
}
},
{
"id": "updateTimer",
"type": "number",
"value": 60,
"attr": {
"min": 5,
"max": 3600
},
"label": {
"en": "Device update timer",
"nl": ""
}
}
]
}
],
"images": {
"large": "/drivers/cgllc_airmonitor_s1/assets/images/large.png",
"small": "/drivers/cgllc_airmonitor_s1/assets/images/small.png"
},
"pair": [
{
"id": "xiaomi",
"navigation": {
"next": "done"
}
},
{
"id": "done",
"navigation": {
"prev": "xiaomi"
}
}
]
},
{
"id": "ir_remote",
"name": {
Expand Down
6 changes: 3 additions & 3 deletions drivers/button_switch.aq2/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class AqaraButtonSwitch extends Homey.Device {
this.driver = this.getDriver();
this.data = this.getData();
this.initialize();
this.log("Mi Homey device init | " + "name: " + this.getName() + " - " + "class: " + this.getClass() + " - " + "data: " + JSON.stringify(this.data));
this.log("Mi Homey device init | name: " + this.getName() + " - class: " + this.getClass() + " - data: " + JSON.stringify(this.data));
}

async initialize() {
Expand Down Expand Up @@ -76,10 +76,10 @@ class AqaraButtonSwitch extends Homey.Device {
if (this.getCapabilityValue(name) != value) {
this.setCapabilityValue(name, value)
.then(() => {
this.log("[" + this.data.sid + "]" + " [" + name + "] [" + value + "] Capability successfully updated");
this.log("[" + this.data.sid + "] [" + name + "] [" + value + "] Capability successfully updated");
})
.catch(error => {
this.log("[" + this.data.sid + "]" + " [" + name + "] [" + value + "] Capability not updated because there are errors: " + error.message);
this.log("[" + this.data.sid + "] [" + name + "] [" + value + "] Capability not updated because there are errors: " + error.message);
});
this.triggerFlow(trigger, name, value);
}
Expand Down
6 changes: 3 additions & 3 deletions drivers/button_switch.aq3/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class AqaraButtonSwitch extends Homey.Device {
this.driver = this.getDriver();
this.data = this.getData();
this.initialize();
this.log("Mi Homey device init | " + "name: " + this.getName() + " - " + "class: " + this.getClass() + " - " + "data: " + JSON.stringify(this.data));
this.log("Mi Homey device init | name: " + this.getName() + " - class: " + this.getClass() + " - data: " + JSON.stringify(this.data));
}

async initialize() {
Expand Down Expand Up @@ -84,10 +84,10 @@ class AqaraButtonSwitch extends Homey.Device {
if (this.getCapabilityValue(name) != value) {
this.setCapabilityValue(name, value)
.then(() => {
this.log("[" + this.data.sid + "]" + " [" + name + "] [" + value + "] Capability successfully updated");
this.log("[" + this.data.sid + "] [" + name + "] [" + value + "] Capability successfully updated");
})
.catch(error => {
this.log("[" + this.data.sid + "]" + " [" + name + "] [" + value + "] Capability not updated because there are errors: " + error.message);
this.log("[" + this.data.sid + "] [" + name + "] [" + value + "] Capability not updated because there are errors: " + error.message);
});
this.triggerFlow(trigger, name, value);
}
Expand Down
Loading

0 comments on commit ca2d574

Please sign in to comment.