bwp91/homebridge-govee

RFE: add sensors for Kettle state

Opened this issue · 1 comments

Note that I'm a homeassistant user and have never used Homebridge before today, so apologies if my terminology is slightly off.

  • Please explain your feature request in a one or two sentences.
    I'd like to expose Kettle attributes as sensors (in homeassistant) -- primarily temperature and done-boiling/keep-warm-mode-started. The reason I installed this plugin is that I'd like to get "water done boiling" status updates into homeassistant (i.e. I don't have any use for the remote start buttons). All I really want to do is get a watch notification when my water is done. The govee app is surprisingly useless for this unless I open the app before I start the water, and I don't want to have to do that. So I'm trying to get a homeassistant notification instead.

Looks like it might be possible somewhere in the externalUpdate() function here:

externalUpdate(params) {
// Check for some other scene/mode change
(params.commands || []).forEach((command) => {
const hexString = base64ToHex(command);
const hexParts = hexToTwoItems(hexString);
// Return now if not a device query update code
if (getTwoItemPosition(hexParts, 1) !== 'aa') {
return;
}
const deviceFunction = `${getTwoItemPosition(hexParts, 2)}${getTwoItemPosition(hexParts, 3)}`;
switch (deviceFunction) {
case '0500': { // current mode
// switch to green tea_: aa050002000000000000000000000000000000ad
// switch to oolong tea: aa050003000000000000000000000000000000ac
// switch to coffee____: aa050004000000000000000000000000000000ab
// switch to black tea_: aa050005000000000000000000000000000000aa
// switch to preset1___: aa050001010000000000000000000000000000af
// switch to preset2___: aa050001020000000000000000000000000000ac
// No point in changing any switches for the sake of three seconds, no action taken here
break;
}
case '1001': { // current temperature in F
// const currentTempInF = hexToDecimal(`${getTwoItemPosition(hexParts, 4)}${getTwoItemPosition(hexParts, 5)}`);
// const currentTempInC = farToCen(currentTempInF / 100);
break;
}
case '1700': { // on/off base?
const onBase = getTwoItemPosition(hexParts, 4) === '00' ? 'yes' : 'no';
if (this.cacheOnBase !== onBase) {
this.cacheOnBase = onBase;
this.accessory.log(`current on base [${this.cacheOnBase}]`);
}
break;
}
case '2200': // keep warm off
case '2201': // keep warm on
case '2300': // scheduled start off
case '2301': { // scheduled start on
break;
}
default:
this.accessory.logDebugWarn(`${platformLang.newScene}: [${command}] [${hexString}]`);
break;
}
});
(I see temperature is commented out)

  • Any particular Govee devices that this relates to?
    7171 kettle

btw, I found your plugin here: https://www.reddit.com/r/homeassistant/comments/11nwq02/comment/jne77w8/

thanks for your work on this!