Smarter iKettle API is a web API based on .NET 5, which wrapped communication with kettle. Using this API you can very easily control your kettle from any computer, phone or home automation platform.
The things you need to run this API is .NET 5 runtime, which you can download here or docker to run application in a container and connected kettle to your local network.
Smarter iKettle API can be integrated with every home automation solution because it uses web API.
Sample configuration
switch:
platform: command_line
switches:
ikettle:
friendly_name: Smarter iKettle 2.0
command_on: >-
curl -d -X POST http://192.168.1.10:5021/api/v2/kettle/boil
command_off: >-
curl -d -X POST http://192.168.1.10:5021/api/v2/kettle/interrupt
command_state: >-
curl -sb -H "Accept: application/json" http://192.168.1.10:5021/api/v2/kettle/details
value_template: >-
{%- if value_json['status'] == 1 -%}
{{ true }}
{%- else -%}
{{ false }}
{%- endif -%}
Configure KettleSettings
section in file src\Smarter.iKettle.Api\appsettings.json
"KettleSettings": {
"Host": "Kettle IP Address",
"Port": 2081,
"WaterSensorMax": 2250,
"WaterSensorMin": 2080
}
- Host - Kettle IP address or hostname
- Port - Kettle port (default: 2081)
- WaterSensorMax - The maximum value that you could read from the water sensor when the kettle was full
- WaterSensorMin - The minimum value that you could read from the water sensor when the kettle was empty
If you run the application in docker container, then the easiest way to override those settings are provides environment variables during run container (e.g. -e "KettleSettings: Host=ip_address" -e "KettleSettings: Port=2081" -e "KettleSettings: WaterSensorMax=2250" -e "KettleSettings: WaterSensorMin=2080")
Note: You can read the water sensor value from /api/v2/kettle/details
endpoint
To run application go to src\Smarter.iKettle.Api
folder and run command:
$ dotnet run .
To run application in docker container run commands:
- Pull image from Docker Hub
$ docker pull aslabicki/smarter-ikettle-api
Or go to root folder and build image locally
$ docker build -t smarter-ikettle-api .
- Start container
$ docker run -d --rm -p 5021:80 -e "KettleSettings__Host=ip_address" -e "KettleSettings__Port=2081" -e "KettleSettings__WaterSensorMax=2250" -e "KettleSettings__WaterSensorMin=2080" smarter-ikettle-api
Code | Description | Schema |
---|---|---|
200 | Success | Details |
default | ProblemDetails |
Code | Description | Schema |
---|---|---|
204 | Success | |
default | ProblemDetails |
Name | Located in | Description | Required | Schema |
---|---|---|---|---|
request | body | Yes | HeatRequest |
Code | Description | Schema |
---|---|---|
204 | Success | |
400 | Bad Request | string |
default | ProblemDetails |
Name | Located in | Description | Required | Schema |
---|---|---|---|---|
request | body | Yes | HeatFormulaRequest |
Code | Description | Schema |
---|---|---|
204 | Success | |
400 | Bad Request | string |
default | ProblemDetails |
Code | Description | Schema |
---|---|---|
204 | Success | |
default | ProblemDetails |
Name | Type | Description | Required |
---|---|---|---|
status | integer | ||
temperature | integer | ||
waterSensor | integer | ||
waterPercent | double | ||
onBase | boolean |
Name | Type | Description | Required |
---|---|---|---|
type | string | ||
title | string | ||
status | integer | ||
detail | string | ||
instance | string |
Name | Type | Description | Required |
---|---|---|---|
temperature | integer | Yes | |
keepWarmMinutes | integer | No |
Name | Type | Description | Required |
---|---|---|---|
temperature | integer | Yes |
Note: The application has a swagger installed to generate API documentation which is available under /docs/index.html
endpoint
- Communication over MQTT
- Implement other endpoints (e.g. get and set user default settings)
- Unit tests 😅
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.