Giter Club home page Giter Club logo

Comments (3)

GitCharlieHub avatar GitCharlieHub commented on July 17, 2024

Hello again,

Managed to get help from ChatGPT!

Here's the working code:

const {} = require('zigbee-herdsman-converters/lib/modernExtend');
// Add the lines below
const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const ota = require('zigbee-herdsman-converters/lib/ota');
const utils = require('zigbee-herdsman-converters/lib/utils');
const globalStore = require('zigbee-herdsman-converters/lib/store');
const e = exposes.presets;
const ea = exposes.access;

const definition = {
zigbeeModel: ['Aidoo Zigbee'],
model: 'Aidoo Zigbee',
vendor: 'Airzone',
description: 'Aidoo Zigbee Controller',
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(),
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.'),
exposes.enum('system_mode', ea.ALL, ['off', 'auto', 'cool', 'heat', 'fan_only', 'dry'])
.withDescription('Specifies the current operating mode of the thermostat.'),
e.switch(),
exposes.enum('fan_mode', ea.ALL, ['off', 'low', 'medium', 'high', 'on', 'auto']).withDescription('Fan mode'),
],
endpoint: (device) => {
return { 'system': 1 };
},
meta: { configureKey: 1 },
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['hvacThermostat', 'hvacFanCtrl', 'genOnOff']);
await reporting.thermostatTemperature(endpoint);
await reporting.thermostatOccupiedHeatingSetpoint(endpoint);
await reporting.onOff(endpoint);
await reporting.fanMode(endpoint);
},
};

module.exports = definition;

from zigbee2mqtt.

GitCharlieHub avatar GitCharlieHub commented on July 17, 2024

Hello,
Changes to make it a climate type device and a few other tweaks:

const {} = require('zigbee-herdsman-converters/lib/modernExtend');
// Add the lines below
const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const ota = require('zigbee-herdsman-converters/lib/ota');
const utils = require('zigbee-herdsman-converters/lib/utils');
const globalStore = require('zigbee-herdsman-converters/lib/store');
const e = exposes.presets;
const ea = exposes.access;

const definition = {
zigbeeModel: ['Aidoo Zigbee'],
model: 'Aidoo Zigbee 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.climate()
.withLocalTemperature()
.withSystemMode(['off', 'auto', 'cool', 'heat', 'fan_only', 'dry'])
.withFanMode(['off', 'low', 'medium', 'high', 'on', 'auto'])
.withSetpoint('occupied_heating_setpoint', 5, 30, 0.5)
.withSetpoint('occupied_cooling_setpoint', 5, 30, 0.5),
e.switch(),
],
endpoint: (device) => {
return { 'system': 1 };
},
meta: { configureKey: 1 },
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['hvacThermostat', 'hvacFanCtrl', 'genOnOff']);
await reporting.thermostatTemperature(endpoint);
await reporting.thermostatOccupiedHeatingSetpoint(endpoint);
await reporting.onOff(endpoint);
await reporting.fanMode(endpoint);
},
};

module.exports = definition;

from zigbee2mqtt.

Koenkk avatar Koenkk commented on July 17, 2024

Lets continue in your PR

from zigbee2mqtt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.