Smarter Wifi iKettle 2 script for Domoticz
Moderator: leecollings
-
- Posts: 543
- Joined: Saturday 02 July 2016 5:17
- Target OS: Linux
- Domoticz version: Beta
- Contact:
Re: Smarter Wifi iKettle 2 script for Domoticz
I've updated the script in the first post of this thread, fixed a few things:
1) Script would freeze after about 3 - 6 hours, now it loops the entire connection so as not to do that.
2) Implemented work-around for reliability issue with my kettle in detecting if it is on or off base using the temperature 127 if it's off base to determine the on / off base status (instead of the 07 / 08 which I found to be unreliable).
3) Implemented 4 temperature selection options via command line variables
Starting to think we need a nice web interface or something for the kettle AND coffee machine. Domoticz is ok with just the kettle but there are too many configuration options for the coffee machine, I think a seperate page is needed.
I had to blank out the icon cause I bought it off some icon site
Also I think it would be great to change the number of cups to the actual ml in the kettle as you suggested.
1) Script would freeze after about 3 - 6 hours, now it loops the entire connection so as not to do that.
2) Implemented work-around for reliability issue with my kettle in detecting if it is on or off base using the temperature 127 if it's off base to determine the on / off base status (instead of the 07 / 08 which I found to be unreliable).
3) Implemented 4 temperature selection options via command line variables
Starting to think we need a nice web interface or something for the kettle AND coffee machine. Domoticz is ok with just the kettle but there are too many configuration options for the coffee machine, I think a seperate page is needed.
I had to blank out the icon cause I bought it off some icon site
Also I think it would be great to change the number of cups to the actual ml in the kettle as you suggested.
Unless otherwise stated, all my code is released under GPL 3 license: https://www.gnu.org/licenses/gpl-3.0.en.html
Re: Smarter Wifi iKettle 2 script for Domoticz
I could not get a reliable reading on the ml... there is the base value and the sensor reading... i mapped out some numbers... but i see no relation. ie. the numbers would change too much even with the same amount of water in the kettle if you put the kettle off base and on base again...
you can check it out on the github page...
https://github.com/Tristan79/iBrew
still have some problems with network connection... (the console waits on user input, means message are not read from the socket...
resulting in a backlog of status messages...)
but it's all new for me python, servers, network
i figures this one out...
The water level is at least in some of the sources:
waterlevelMessage = int(b[4], 0) + 256 * waterlevelMessage = int(b[3], 0)
the calibration base is of the same format... but no correlation
you can check it out on the github page...
https://github.com/Tristan79/iBrew
still have some problems with network connection... (the console waits on user input, means message are not read from the socket...
resulting in a backlog of status messages...)
but it's all new for me python, servers, network
i figures this one out...
Code: Select all
Command Message: 15 Turn on
─────────────────────────────────────────────────────────────────────────
✓ iKettle 2.0 ? SmarterCoffee
Argument: <temperature><keepwarm>
temperature 00..64
keepwarm 0 (not warming), minutes: 05..1e
15 32 00 7e start boiling
15 32 7e start boiling
15 32 05 7e
if it's not on temp it boils first before warming...
if it's warming you have to send an off command to boil again
waterlevelMessage = int(b[4], 0) + 256 * waterlevelMessage = int(b[3], 0)
the calibration base is of the same format... but no correlation
-
- Posts: 543
- Joined: Saturday 02 July 2016 5:17
- Target OS: Linux
- Domoticz version: Beta
- Contact:
Re: Smarter Wifi iKettle 2 script for Domoticz
I have a whole inventory of Gizmos I'm trying to integrate into Domoticz at the moment:
iKettle 2.0 (done)
Smarter Coffee machine (in progress)
Roomba 980 Robotic Wifi vacuum cleaner (in progress, extremely difficult cause all communication is SSL encrypted with what appears to be a self signed cert, I haven't been able to read the packets locally).
Braun Oral B bluetooth toothbrush
iKettle 2.0 (done)
Smarter Coffee machine (in progress)
Roomba 980 Robotic Wifi vacuum cleaner (in progress, extremely difficult cause all communication is SSL encrypted with what appears to be a self signed cert, I haven't been able to read the packets locally).
Braun Oral B bluetooth toothbrush
Unless otherwise stated, all my code is released under GPL 3 license: https://www.gnu.org/licenses/gpl-3.0.en.html
Re: Smarter Wifi iKettle 2 script for Domoticz
Ha I figured out how to see traffic... got 2 new command before it didn't work anymore...
Code: Select all
10.0.0.99:iKettle 2.0$message 19
Command Message: 19 Formula Mode
─────────────────────────────────────────────────────────────────────────
✓ iKettle 2.0 ? SmarterCoffee
Arguments: <formulatemperature><keepwarmtime>
Example raw code: 19 32 19 7e
Boil water to (default user temperature)
and cool until 50'C (32) with keep warm time of 25 minutes (19)
iBrew: Ready On Base (72ºC, 1.8l)
10.0.0.99:iKettle 2.0$message 1f
Command Message: 1f Set Default Values
─────────────────────────────────────────────────────────────────────────
✓ iKettle 2.0 ? SmarterCoffee
Arguments <keep warm time><defaulttemp><formula><formulatemp>
Example raw code: 1f 19 64 01 22 7e
sets 25 keep warm, 100 default temperature, formula mode = true
34 formula temperature
default user defaults are 1f 00 64 00 4b 7e
iBrew: Ready On Base (71ºC, 1.8l)
10.0.0.99:iKettle 2.0$info
iBrew: Message Send 64 7e
Get identify of device
iBrew: Message Received: 65 01 13 7e
Identify of device iKettle 2.0 Firmware v19
iBrew: Ready On Base (71ºC, 1.8l)
10.0.0.99:iKettle 2.0$
-
- Posts: 543
- Joined: Saturday 02 July 2016 5:17
- Target OS: Linux
- Domoticz version: Beta
- Contact:
Re: Smarter Wifi iKettle 2 script for Domoticz
Nice! How did you see the packets if you don't mind me asking? I've never managed to figure out wireshark.
I'm interested since it might help me to get the Roomba 980 working locally.
I'm interested since it might help me to get the Roomba 980 working locally.
Unless otherwise stated, all my code is released under GPL 3 license: https://www.gnu.org/licenses/gpl-3.0.en.html
Re: Smarter Wifi iKettle 2 script for Domoticz
Since I did not know what I was doing, I tried many options...
In the end i configured the kettle to my local homenetwork like normal,
on my mac i plugged in a cable, cable connects to internet/homenetwork
then i put internet sharing on in the sharing settings, and the wifi becomes an access point... I connected my phone to my mac, and then it just worked,... i was very surprised
kettle <-> homenetwork <-> cable <-> macbook (wireshark,internet connection sharing) <-> wifi <-> phone
wireshark, if you open it, you select the connection (in this case wifi to capture the phone messages)... and then run the app on the phone...
ofcourse I accidently reset the wifi of the kettle, so now I have to try it again...
you should look for messages ending in 7e
screenshot from my own communication kettle <-> ibrew,...
In the end i configured the kettle to my local homenetwork like normal,
on my mac i plugged in a cable, cable connects to internet/homenetwork
then i put internet sharing on in the sharing settings, and the wifi becomes an access point... I connected my phone to my mac, and then it just worked,... i was very surprised
kettle <-> homenetwork <-> cable <-> macbook (wireshark,internet connection sharing) <-> wifi <-> phone
wireshark, if you open it, you select the connection (in this case wifi to capture the phone messages)... and then run the app on the phone...
ofcourse I accidently reset the wifi of the kettle, so now I have to try it again...
you should look for messages ending in 7e
screenshot from my own communication kettle <-> ibrew,...
Last edited by trixwood on Sunday 07 August 2016 14:56, edited 1 time in total.
-
- Posts: 543
- Joined: Saturday 02 July 2016 5:17
- Target OS: Linux
- Domoticz version: Beta
- Contact:
Re: Smarter Wifi iKettle 2 script for Domoticz
Ahh interesting way of doing it making the Mac the wifi access point, I'll try that with the Roomba.
Thanks!
Thanks!
Unless otherwise stated, all my code is released under GPL 3 license: https://www.gnu.org/licenses/gpl-3.0.en.html
Re: Smarter Wifi iKettle 2 script for Domoticz
im not really sure, but i implemented a little scale to hopefully get the right waterlevel, and after a boiling test I notice, that the temperature has inpact on the value you get.... higher temprature higher waterlevel still not sure how to proceed...
-
- Posts: 543
- Joined: Saturday 02 July 2016 5:17
- Target OS: Linux
- Domoticz version: Beta
- Contact:
Re: Smarter Wifi iKettle 2 script for Domoticz
Trixwood, I noticed the water level jumps around a lot on my kettle as well (and there appears to be a correlation to temperature as you mentioned). Perhaps a filter such as if value above x = 100ml if value above x = 200ml to deliver a somewhat stable value?
Take the cup code of my script as a template for how to do it.
Find the unit level you think is relatively stable, eg 50ml or 100ml, in my case I was lazy and just poured cups of water in it and recorded the values (I have pretty big cups).
Delivering a value that isn't going to change every second is important cause then we can just update Domoticz if the value changes, constantly writing new values to the Domoticz database is bad for the SD cards in devices like Raspberry Pi cause they have a limited number of writes before wearing out so in my script I always check if the value is different before sending the new data to Domoticz which gets written to the Micro SD card.
Take the cup code of my script as a template for how to do it.
Find the unit level you think is relatively stable, eg 50ml or 100ml, in my case I was lazy and just poured cups of water in it and recorded the values (I have pretty big cups).
Delivering a value that isn't going to change every second is important cause then we can just update Domoticz if the value changes, constantly writing new values to the Domoticz database is bad for the SD cards in devices like Raspberry Pi cause they have a limited number of writes before wearing out so in my script I always check if the value is different before sending the new data to Domoticz which gets written to the Micro SD card.
Unless otherwise stated, all my code is released under GPL 3 license: https://www.gnu.org/licenses/gpl-3.0.en.html
Re: Smarter Wifi iKettle 2 script for Domoticz
there is a base watersensor value, a watersensor value and the temperature...
not knowing the temp had influence... around 24C i measured
# calibrate nokettlebase: 1120 measure: kettle off: 2010 kettle empty: 2070 kettle full: 2140 (div 890 950 1020)
# calibrate emptykettlebase: 1070 measure: kettle off: 1975 kettle empty: 2020 kettle full: 2085 (div 905 950 1015)
# calibrate fullkettlebase: 1010 measure: kettle off: 1875 kettle empty: 1950 kettle full: 2015 (div 865 940 1005)
# div = measure - base
50'C
to het it correct... so that means measuring...
not knowing the temp had influence... around 24C i measured
# calibrate nokettlebase: 1120 measure: kettle off: 2010 kettle empty: 2070 kettle full: 2140 (div 890 950 1020)
# calibrate emptykettlebase: 1070 measure: kettle off: 1975 kettle empty: 2020 kettle full: 2085 (div 905 950 1015)
# calibrate fullkettlebase: 1010 measure: kettle off: 1875 kettle empty: 1950 kettle full: 2015 (div 865 940 1005)
# div = measure - base
Code: Select all
# 1.8l
def water_level(self):
x = (1.800/72) * (self.waterSensor - self.waterSensorBase - 952)
return x
Code: Select all
def water_level(self):
x = (1.800/72) * (self.waterSensor - self.waterSensorBase - 1000)
return x
Re: Smarter Wifi iKettle 2 script for Domoticz
Hi!
I have really fun figuring this out...
Could you run from https://github.com/Tristan79/iBrew
./iBrew sweep (ipofyourcoffee)
And post the relevant output?
I used it to map all commands of the iKettle 2.0
(i found the default user settings message (except it does not contains the formula temperature), still have to figure out what some of them do)
Would be nice to have them for the Coffee machine also.
Also so output from raw commands would be nice
Anyway if you have time
if it fails (wifi reset, ... could be all sort of things...) you can continue with
start scanning for new command starting at command 2C
ps.. the code is a mess, i know...
Update: Found almost all codes & reply plus meaning for the iKettle! Yeah!
I have really fun figuring this out...
Could you run from https://github.com/Tristan79/iBrew
./iBrew sweep (ipofyourcoffee)
And post the relevant output?
I used it to map all commands of the iKettle 2.0
(i found the default user settings message (except it does not contains the formula temperature), still have to figure out what some of them do)
Would be nice to have them for the Coffee machine also.
Also so output from raw commands would be nice
Anyway if you have time
if it fails (wifi reset, ... could be all sort of things...) you can continue with
Code: Select all
./iBrew sweep 2C (ipofyourcoffee)
ps.. the code is a mess, i know...
Update: Found almost all codes & reply plus meaning for the iKettle! Yeah!
-
- Posts: 45
- Joined: Wednesday 16 December 2015 14:30
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.1
- Location: Belgium
- Contact:
Re: Smarter Wifi iKettle 2 script for Domoticz
Hi,
I tried everything I can but I wasn't able to make your script work
First, I think I had some trouble with screen. Even if I installed it, Monit never detected the process running. I think I did something wrong with the startup.sh file... Chmod is ok, I checked path in every file and still it won't work.
Anyway, I just tried to run your python script with sudo python kettle.py and I get an "IndentationError:" on line 25.
I fixed that and I get errors somewhere else, etc. I can't figure it out.
Could you provide the files you are using in order to help me get it working?
Thank you very much!
I tried everything I can but I wasn't able to make your script work
First, I think I had some trouble with screen. Even if I installed it, Monit never detected the process running. I think I did something wrong with the startup.sh file... Chmod is ok, I checked path in every file and still it won't work.
Anyway, I just tried to run your python script with sudo python kettle.py and I get an "IndentationError:" on line 25.
I fixed that and I get errors somewhere else, etc. I can't figure it out.
Could you provide the files you are using in order to help me get it working?
Thank you very much!
Re: Smarter Wifi iKettle 2 script for Domoticz
Are there any instruction anywhere to get iBrew working on ubuntu? I'm a newbie to Linux although working IT forever... I have ubuntu server running with Homebridge and looking to get iBrew working with the Smarter 2.0 kettle I have either with Domoticz or Homebridge...
Re: Smarter Wifi iKettle 2 script for Domoticz
He!
It has no package since most linux distros pack python , download the source in a folder, open up a terminal go into the folder where the source is and run either "make" or "pip install requirements.txt" That will download any missing python packages. After that you are ready to go...
Note to myself, I will add more instructions when I finish the web part... kinda did not expect anybody else to use it Probably christmas depends how fast I recovery and can walk again... (yeah bummer for me, everything is on hold for me at the moment)
For binding it with domoticz you can use either the rest api (the part of the webstuff that is finished) or just script it using the command line options.
If you spend more then an hour getting it to work, stop. Post an issue on the github page, (since i get mail from that).
And please do not spend 11 hours
Signed me!
the rest api which returns json, docs are in the web part (old screeshot):
It has no package since most linux distros pack python , download the source in a folder, open up a terminal go into the folder where the source is and run either "make" or "pip install requirements.txt" That will download any missing python packages. After that you are ready to go...
Note to myself, I will add more instructions when I finish the web part... kinda did not expect anybody else to use it Probably christmas depends how fast I recovery and can walk again... (yeah bummer for me, everything is on hold for me at the moment)
For binding it with domoticz you can use either the rest api (the part of the webstuff that is finished) or just script it using the command line options.
If you spend more then an hour getting it to work, stop. Post an issue on the github page, (since i get mail from that).
And please do not spend 11 hours
Signed me!
the rest api which returns json, docs are in the web part (old screeshot):
Re: Smarter Wifi iKettle 2 script for Domoticz
Hi Trixwood, Thanks for the reply, I've got a bit further now, but still having issues (me not know how to run stuff) I will post in GitHub.
Thanks Andy
Thanks Andy
Re: Smarter Wifi iKettle 2 script for Domoticz
https://github.com/Tristan79/iBrew/
Updated iBrew with trigger support & mini guide to integrate the ikettle 2.0 and the smarter coffee in domoticz
Updated iBrew with trigger support & mini guide to integrate the ikettle 2.0 and the smarter coffee in domoticz
-
- Posts: 543
- Joined: Saturday 02 July 2016 5:17
- Target OS: Linux
- Domoticz version: Beta
- Contact:
Re: Smarter Wifi iKettle 2 script for Domoticz
If anyone runs into this error message:
root@domoticz:~/scripts/smarter# python kettle.py on
Traceback (most recent call last):
File "kettle.py", line 1, in <module>
import requests
ImportError: No module named requests
Solution (on Debian / Ubuntu) is:
apt-get install python-requests
root@domoticz:~/scripts/smarter# python kettle.py on
Traceback (most recent call last):
File "kettle.py", line 1, in <module>
import requests
ImportError: No module named requests
Solution (on Debian / Ubuntu) is:
apt-get install python-requests
Unless otherwise stated, all my code is released under GPL 3 license: https://www.gnu.org/licenses/gpl-3.0.en.html
-
- Posts: 543
- Joined: Saturday 02 July 2016 5:17
- Target OS: Linux
- Domoticz version: Beta
- Contact:
Re: Smarter Wifi iKettle 2 script for Domoticz
trixwood, are you finding that often the iKettle will not join the Wifi network and just sit with its own SSID broadcasting requiring a manual restart of the kettle?
Unless otherwise stated, all my code is released under GPL 3 license: https://www.gnu.org/licenses/gpl-3.0.en.html
Re: Smarter Wifi iKettle 2 script for Domoticz
I have now an ikettle 2.0 and i wanted to download ibrew.exe for windows but it is no longer avileble. Who has a copy for my?
Who is online
Users browsing this forum: Google [Bot] and 1 guest