Skip to content

Commit

Permalink
feat: Support setting vacation_mode on Ubisys H1 (#6342)
Browse files Browse the repository at this point in the history
When updated the H1 supports setting vacation_mode, they actually got back to me on this as I requested this feature last year!
  • Loading branch information
sjorge committed Oct 27, 2023
1 parent 3faa4db commit d6996a6
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/devices/ubisys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,17 @@ const ubisys = {
} as Tz.Converter,
thermostat_vacation_mode: {
key: ['vacation_mode'],
convertSet: async (entity, key, value, meta) => {
/* Both Ubisys H1 and H10 use hvacThermostat cluster with the ubisys manufacturerCode for custom attributes
* 0x0005 is used on both but with different functions and data types which is rather annoying
* manually massaging of the writeAttribute is needed :(
*/
if (typeof value === 'boolean') {
await entity.write('hvacThermostat', {0x0005: {value: value, type: Zcl.DataType.boolean}}, manufacturerOptions.ubisys);
} else {
meta.logger.error('vacation_mode must be a boolean!');
}
},
convertGet: async (entity, key, meta) => {
await entity.read('hvacThermostat', ['occupancy']);
},
Expand Down Expand Up @@ -892,10 +903,11 @@ const definitions: Definition[] = [
.withSystemMode(['off', 'heat'], ea.ALL)
.withRunningMode(['off', 'heat'])
.withSetpoint('occupied_heating_setpoint', 7, 30, 0.5)
.withSetpoint('unoccupied_heating_setpoint', 7, 30, 0.5)
.withLocalTemperature()
.withPiHeatingDemand(ea.STATE_GET)
.withWeeklySchedule(['heat']),
e.binary('vacation_mode', ea.STATE_GET, true, false)
e.binary('vacation_mode', ea.ALL, true, false)
.withDescription('When Vacation Mode is active the schedule is disabled and unoccupied_heating_setpoint is used.'),
],
configure: async (device, coordinatorEndpoint, logger) => {
Expand Down

0 comments on commit d6996a6

Please sign in to comment.