Skip to content

Commit

Permalink
Fix fan_mode and fan_state value incorrect (#5327)
Browse files Browse the repository at this point in the history
This handles `hvacFanCtrl` messages where `fanMode` isn't present, such
as `{"fanModeSequence":1}` (such as that generated by the Mercator
SSWF01G fan controller, reported in
Koenkk/zigbee2mqtt#15186). Previously, without
`fanMode` present, the state was assumed to be on.
  • Loading branch information
davidjb authored Jan 14, 2023
1 parent c3a234e commit bf525f1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions converters/fromZigbee.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ const converters = {
cluster: 'hvacFanCtrl',
type: ['attributeReport', 'readResponse'],
convert: (model, msg, publish, options, meta) => {
const key = getKey(constants.fanMode, msg.data.fanMode);
return {fan_mode: key, fan_state: key === 'off' ? 'OFF' : 'ON'};
if (msg.data.hasOwnProperty('fanMode')) {
const key = getKey(constants.fanMode, msg.data.fanMode);
return {fan_mode: key, fan_state: key === 'off' ? 'OFF' : 'ON'};
}
},
},
thermostat: {
Expand Down

0 comments on commit bf525f1

Please sign in to comment.