Skip to content

kbirger/ha-smarter-integration

Repository files navigation

Smarter Kettle and Coffee integration

GitHub Release GitHub Activity License

pre-commit

hacs Project Maintenance BuyMeCoffee

Note: At the moment, this integration supports only Smarter Kettle V3, as that is the only device I possess. The platform upon which this integration is built is capable of supporting other devices, and if you have come here with the desire to integrate another device from Smarter into your Home Assistant, please contact me by creating an Issue on this repository. With your help, I may be able to support your device as well. Kettle V1 and V2 use a different technology, and will not be supported.

This component will set up the following entities.

Platform Entity Description
binary_sensor Boiling On if kettle is currently heating water
binary_sensor Cooling On if kettle has warmed water and is allowing it to cool, such as for formula mode
binary_sensor Keeping Warm On if kettle has warmed water and will keep it warm
sensor Water Temperature Current temperature of water
sensor Boil Temperature Temperature for the next "boil" command
sensor Target Temperature Current target temperature 1
sensor State Current state of Kettle as reported by the API
sensor Kettle is Present Whether the kettle is on the base
sensor Water Level Current water level 2
switch Boiling Set On to boil to target temperature. Set Off to turn off boiling / keep-warm. State will remain On while keep-warm is active
number Boil Temperature Same as the sensor, but allows setting
number Keep Warm Time Allows you to set the time for which kettle will continue to heat water

Notes:

1 If you run a boil program, then change the boil temperature while water is being heated, your target temperature will reflect the current boil command, and the target temperature will reflect the new temperature. This comes from the Smarter API and can be observed on their app too.

2 May not always be correct. The kettle requires periodic calibration, but in my experience, this isn't all that accurate. It's probably for this reason that the first-party app gives a big range in terms of the volume of water available.

alt text

Installation

HACS

hacs_badge

The recommended and easiest installation option is via the Home Assistant Community Store (HACS). After HACS is installed, you may install this integration in one of two ways. If your Home Assistant instance is set up with the my integration for link forwarding, you may use the button below to automatically be taken to the install page for this integration. Otherwise, please follow the instructions for adding a custom repository. When the integration is installed, it may be configured from the UI, the same way as first party integrations.

Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.

Manual

If you do not wish to use HACS, you may follow the instructions below. This installation method will not provide you with updates, and you will have to perform these steps each time you want to install an updated version.

  1. Using the tool of choice open the directory (folder) for your HA configuration (where you find configuration.yaml).
  2. If you do not have a custom_components directory (folder) there, you need to create it.
  3. In the custom_components directory (folder) create a new folder called smarter.
  4. Download all the files from the custom_components/smarter/ directory (folder) in this repository.
  5. Place the files you downloaded in the new directory (folder) you created.
  6. Restart Home Assistant
  7. In the HA UI go to "Configuration" -> "Integrations" click "+" and search for "Smarter Kettle and Coffee integration"

Using your HA configuration directory (folder) as a starting point you should now also have this:

Configuration

At this time, the only configuration provided is the ability to log in with your credentials.

Roadmap

This integration is two parts. The underlying smarter-client library and this integration, both of which are developed by me. For simplicity, the roadmap below encompasses planned features for both.

General

  • Better documentation: My time right now is somewhat limited, but I recognize that this is lacking
  • Better testing: As above. In the interest of getting something out, and getting some testers, I have not finished fully testing everything.
  • Consistent linting, testing, and other config

Library-specific (technical)

  • Native support for asynchio: for now, since the underlying firebase api does not support Coroutines, I am using the executor in HA. As time allows, I will investigate if this is the best solution, and perhaps provide async support directly int the library instead
  • Better abstractions: This project started with me hacking away and doing a POC. The approach I took at first is one that I recognize is ultimately sub-optimal. The library needs to be cleaned up prior to v1.0
  • Logging support: I need to provide a way to log to the HA log from the library.
  • Expose session events: The library should notify the extension when session is updated/refreshed, so that refresh token can be updated, etc.
  • Support starting session from refresh token
  • Event callbacks for when kettle state changes: currently, this is done implicitly by entiy state changes, but more things could be done if the library explicitly notifies of these events.
  • Calibration detection and calibrate functionality: detect when kettle needs calibration and provide interface for calling calibration
  • automatically fetch lazy-loaded entities via decorator

Integration

  • Start extension from refresh token: If one is available, avoid sending credentials over the wire
  • Network configuration: Currently, the integration will crawl all networks ("Homes") in your account, and provide those devices. I will eventually add an explicit network configuration flow
  • Device opt-in flow and config entry per device: I am on the fence here, but leaning towards providing a config entry per device, because some configurations may be beneficial to expose on a per-device basis
  • Formula mode support
  • Alarms Support: to be honest, not 100% sure what this is in the base API. It might be how notifications are performed.
  • Services for sending commands such as boil: right now this is achieved through the switch entity, but services would also be convenient and allow for some interesting posibilities, such as custom preset buttons
  • Add / Test unload and reload support
  • Custom controls: Need to research this a bit more. I'm not sure if this is something that would require a dedicated platform. Currently, some devices, such as vacuums, can provide controls
  • Secure credential storage: Currently the extension stores username and password. I'm not happy about this, but have not had time to research something better. If you know the best way to do this, please create an Issue. One possibility is that your credentials will only be used once, to store the refresh token. This may result in needing to periodically reauthenticate, but not 100% sure.
  • Add events: honestly, this one is a maybe. Seems like a small nice to have, since entities already provide events. If anyone feels that this would be useful, please create an Issue in the tracker and state your use-case.
  • Create UI card: Maybe? Not sure if this is helpful
  • auto update new/removed devices
  • async_dispatcher_connect
  • async switch / number entity support
  • translations
  • better support for turning off boil switch. Currently, sometimes when in keep-warm, and you turn the switch off, it briefly reverts to on. Not sure if there's a reliable way to address this, because the value is coming from the integration, and we do not simply want to ignore it, as that could lead to incorrect results. This is a minor issue.

Contributions are welcome!

If you want to contribute to this please read the Contribution guidelines

Credits

This project was generated from @oncleben31's Home Assistant Custom Component Cookiecutter template.

Code template was mainly taken from @Ludeeus's integration_blueprint template