Skip to content

Commit

Permalink
Add VA4200WZ and VA4201WZ (Koenkk#3795)
Browse files Browse the repository at this point in the history
* Add device VA4200WZ & VA4201WZ

* Add VA4201WZ

* Add valve_switch to expose.js

* Fix lint
  • Loading branch information
Maelstrom96 authored Feb 2, 2022
1 parent 5744a89 commit 59cae6c
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
32 changes: 32 additions & 0 deletions devices/sinope.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,4 +331,36 @@ module.exports = [
},
exposes: [e.water_leak(), e.battery_low(), e.temperature(), e.battery()],
},
{
zigbeeModel: ['VA4200WZ'],
model: 'VA4200WZ',
vendor: 'Sinopé',
description: 'Zigbee smart water valve (3/4")',
fromZigbee: [fz.cover_position_via_brightness, fz.cover_state_via_onoff, fz.battery],
toZigbee: [tz.cover_via_brightness],
configure: async (device, coordinatorEndpoint) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl', 'genPowerCfg']);
await reporting.batteryPercentageRemaining(endpoint);
await reporting.onOff(endpoint);
await reporting.brightness(endpoint); // valve position
},
exposes: [e.valve_switch(), e.valve_position(), e.battery_low(), e.battery()],
},
{
zigbeeModel: ['VA4201WZ'],
model: 'VA4201WZ',
vendor: 'Sinopé',
description: 'Zigbee smart water valve (1")',
fromZigbee: [fz.cover_position_via_brightness, fz.cover_state_via_onoff, fz.battery],
toZigbee: [tz.cover_via_brightness],
configure: async (device, coordinatorEndpoint) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl', 'genPowerCfg']);
await reporting.batteryPercentageRemaining(endpoint);
await reporting.onOff(endpoint);
await reporting.brightness(endpoint); // valve position
},
exposes: [e.valve_switch(), e.valve_position(), e.battery_low(), e.battery()],
},
];
2 changes: 2 additions & 0 deletions lib/exposes.js
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,8 @@ module.exports = {
tamper: () => new Binary('tamper', access.STATE, true, false).withDescription('Indicates whether the device is tampered'),
temperature: () => new Numeric('temperature', access.STATE).withUnit('°C').withDescription('Measured temperature value'),
test: () => new Binary('test', access.STATE, true, false).withDescription('Indicates whether the device is being tested'),
valve_position: () => new Numeric('position', access.ALL).withValueMin(0).withValueMax(100).withDescription('Position of the valve'),
valve_switch: () => new Binary('state', access.ALL, 'OPEN', 'CLOSE').withDescription('Valve state if open or closed'),
valve_state: () => new Binary('valve_state', access.STATE, 'OPEN', 'CLOSED').withDescription('Valve state if open or closed'),
valve_detection: () => new Switch().withState('valve_detection', true).setAccess('state', access.STATE_SET),
vibration: () => new Binary('vibration', access.STATE, true, false).withDescription('Indicates whether the device detected vibration'),
Expand Down

0 comments on commit 59cae6c

Please sign in to comment.