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

Add support for Airzone Aidoo Zigbee - AZAI6ZBEMHI #7636

Merged
merged 21 commits into from
Jun 20, 2024
Merged
Changes from 13 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
66 changes: 66 additions & 0 deletions src/devices/AirzoneAidoo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import {Definition, Device, Endpoint, Logger} from 'zigbee-herdsman-converters';

Check failure on line 1 in src/devices/AirzoneAidoo.ts

View workflow job for this annotation

GitHub Actions / ci

Cannot find module 'zigbee-herdsman-converters' or its corresponding type declarations.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import {Definition, Device, Endpoint, Logger} from 'zigbee-herdsman-converters';
import {Definition, Device, Endpoint, Logger} from '../lib/types';

import * as exposes from '../lib/exposes';
import fz from '../converters/fromZigbee';
import tz from '../converters/toZigbee';
import * as reporting from '../lib/reporting';

const e = exposes.presets;
const ea = exposes.access;

const definition: Definition = {
zigbeeModel: ['Aidoo Zigbee'],
model: 'Aidoo Zigbee AZAI6ZBEMHI',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
model: 'Aidoo Zigbee AZAI6ZBEMHI',
model: 'AZAI6ZBEMHI',

vendor: 'Airzone',
description: 'Gateway for two-way control and integration of AirCon Units.AZAI6ZBEMHI for Mitsubishi Heavy',
fromZigbee: [fz.thermostat, fz.on_off, fz.fan],
toZigbee: [
tz.thermostat_local_temperature,
tz.thermostat_occupied_heating_setpoint,
tz.thermostat_occupied_cooling_setpoint,
tz.thermostat_system_mode,
tz.on_off,
tz.fan_mode,
],
exposes: [
e.local_temperature(),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use e.climate() instead (search this repo for examples)

e.numeric('occupied_heating_setpoint', ea.ALL)
.withUnit('°C')
.withDescription('Occupied heating setpoint'),
e.numeric('occupied_cooling_setpoint', ea.ALL)
.withUnit('°C')
.withDescription('Specifies the cooling mode setpoint when the room is occupied.'),
e.enum('system_mode', ea.ALL, ['off', 'auto', 'cool', 'heat', 'fan_only', 'dry'])
.withDescription('Specifies the current operating mode of the thermostat. Supported values are:\n- 0x00 = OFF\n- 0x01 = Auto\n- 0x03 = Cool\n- 0x04 = Heat\n- 0x07 = Fan Only\n- 0x08 = Dry'),
e.binary('switch', ea.ALL),

Check failure on line 34 in src/devices/AirzoneAidoo.ts

View workflow job for this annotation

GitHub Actions / ci

Expected 4 arguments, but got 2.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
e.binary('switch', ea.ALL),
e.switch(),

e.enum('fan_mode', ea.ALL, ['off', 'low', 'medium', 'high', 'on', 'auto'])
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
e.enum('fan_mode', ea.ALL, ['off', 'low', 'medium', 'high', 'on', 'auto'])
e.fan().withModes(['off', 'low', 'medium', 'high', 'on', 'auto'])

.withDescription('Fan mode'),
],
endpoint: (device: Device): { [key: string]: number } => {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be removed

return { 'system': 1 };
},
meta: { configureKey: 1 } as any,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be removed

configure: async (device: Device, coordinatorEndpoint: Endpoint, logger: Logger): Promise<void> => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['hvacThermostat', 'hvacFanCtrl', 'genOnOff'], logger);

Check failure on line 44 in src/devices/AirzoneAidoo.ts

View workflow job for this annotation

GitHub Actions / ci

Expected 3 arguments, but got 4.
await reporting.thermostatTemperature(endpoint, logger);
await reporting.thermostatOccupiedHeatingSetpoint(endpoint, logger);
await reporting.thermostatOccupiedCoolingSetpoint(endpoint, logger);
await reporting.onOff(endpoint, logger);
await reporting.fanMode(endpoint, logger);
},
device: {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not used, can be removed

type: 'climate',
features: [
e.climate()
.withLocalTemperature()
.withSystemMode(['off', 'auto', 'cool', 'heat', 'fan_only', 'dry'])
.withRunningState(['idle', 'heat', 'cool'])
.withFanMode(['off', 'low', 'medium', 'high', 'on', 'auto'])
.withSetpoint('occupied_heating_setpoint', 5, 30, 0.5)
.withSetpoint('occupied_cooling_setpoint', 5, 30, 0.5)
]
},
ha_category: 'climate'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not used, can be removed

};

export default definition;
Loading