Toon as a domotica controller?

Everything about rooting Toons 1 and 2.

Moderators: marcelr, TheHogNL, Toonz

al_n
Member
Member
Posts: 52
Joined: Tue Jun 02, 2015 7:51 pm

Re: Toon as a domotica controller?

Post by al_n »

You probably can get the midnight values via box talk but this is the long way around things
marcelr
Global Moderator
Global Moderator
Posts: 1153
Joined: Thu May 10, 2012 10:58 pm
Location: Ehv

Re: Toon as a domotica controller?

Post by marcelr »

Sorry, wrong handler ...

Code: Select all

 return file_get_contents( $toon_url.':'.$toon_port.'/hdrv_p1?action=getKeyValues');
This should be more like it ...

grtz,

marcelr
User avatar
RDNZL
Forum Moderator
Forum Moderator
Posts: 1008
Joined: Sun Sep 24, 2006 1:45 pm
Location: Dordrecht, The Netherlands
Contact:

Re: Toon as a domotica controller?

Post by RDNZL »

Eerste integratie van Toon met Loxone.
toon.resized.png
toon.resized.png (63.68 KiB) Viewed 19449 times
Regards, Ron.
marcelr
Global Moderator
Global Moderator
Posts: 1153
Joined: Thu May 10, 2012 10:58 pm
Location: Ehv

Re: Toon as a domotica controller?

Post by marcelr »

The 6 degrees look like boiler control setpoint rather than a boiler temperature (there are three of them: CH output temp, CH return temp, DHW temp, take your pick :-)).
Otherwise: nice feature.

grtz,

marcelr
al_n
Member
Member
Posts: 52
Joined: Tue Jun 02, 2015 7:51 pm

Re: Toon as a domotica controller?

Post by al_n »

Just a little toon UI hack to hide the annoying error notification when you are not connected to eneco.
In the file /HCBv2/qml/apps/internetSettings/InternetSettingsApp.qml after line 369:

Code: Select all

smStatus = parseInt(statemachine);
add the following

Code: Select all

if(smStatus == _ST_INTERNET) {
    smStatus = _ST_TUNNEL;
}
marcelr
Global Moderator
Global Moderator
Posts: 1153
Joined: Thu May 10, 2012 10:58 pm
Location: Ehv

Re: Toon as a domotica controller?

Post by marcelr »

Nice find!
My toon immediately told me that my contract had changed ...

grtz,

marcelr
Flying
Starting Member
Starting Member
Posts: 1
Joined: Tue Dec 22, 2015 4:05 pm

Re: Toon as a domotica controller?

Post by Flying »

Has anyone run their own GUI on the toon?

My attempts unfortunately failed. I have confirmed that my compile toolchain is setup correctly (I can compile and run a Qt Console Application on the Toon succesfully).
Last edited by Flying on Fri Dec 25, 2015 1:14 am, edited 1 time in total.
marcelr
Global Moderator
Global Moderator
Posts: 1153
Joined: Thu May 10, 2012 10:58 pm
Location: Ehv

Re: Toon as a domotica controller?

Post by marcelr »

I have extracted room temperature data from toon in two ways: by logging the communication between toon and the boiler (boiler side, with Schelte's OTGW) and by logging internal temperature values with a simple shell script.

I find temperature discrepancies up to 1.5 degrees (internal toon readings are lower). The temperature as logged with the OTGW is consistent with the temperature on the display. Could some of you test (and report) whether this is the case on more toons? The big question of course is: which one is correct?
NB: make sure to subtract 6 degrees from the internal toon readings, see the script below for explanation.

The script for doing this is attached below. Copy to toon, chmod 755 <whatever_name_you_give_it> and run in the background. Kill with ctrl+c.

Code: Select all

#! /bin/sh
#
# Script for reading toon room temperature values and storing them in a file.
# Data are stored on a daily basis: data for every day are put into a new file.
#
#   call: ./read_temp.sh outputfile_prefix
#
# The current date and .txt extension are added automatically.
#
#   example: ./read_temp.sh test- &
#
# will yield files like: test-20151222.txt (and runs in the background, 
# so you can close your shell without stopping the logging).
#
# note 1: Toon fills in UTC timestamps, please correct afterwards for your 
#         timezone.
#
# note 2: Toon temperature values have an offset of -6 degrees (variable 
#         i2cTempError, in the happ_thermstat code, default value -6.0),
#         or -6 degrees + your manually entered temperature correction. 
#         To get the actual values, please correct for this offset.
#	  
# note 3: Timing isn't really spot-on. The sleep command creates intervals, not 
#         accurately timed interrupts, so intervals between samples will be 
#         slightly larger.
#
# marcelr, 20151222, first draft.
#

# 
# temperature value files for toon (internally, toon uses the second file):
#
file0="/sys/devices/platform/imx-i2c.0/i2c-0/0-0048/device0/value"
file1="/sys/devices/platform/imx-i2c.0/i2c-0/0-0049/device1/value"

# set initial value for date cut-off (1 day + 1 second, to make sure it's used 
# in the very first loop iteration)
 
sec_day_old=86401

while true; do
    read -r line < "$file0"
    t0=$line
    read -r line < "$file1"
    t1=$line
    unix_time=`date +%s`
    sec_day=`expr $unix_time % 86400`

# construct output filename

    if [ "$sec_day" -lt "$sec_day_old" ]; then
	today="`date +%Y%m%d`"
	filename="$1-$today.txt"
    fi
    sec_day_old=$sec_day
	
    echo -e "$unix_time\t$t0\t$t1" >> $filename
    sleep 60
done
grtz,

marcelr
marcelr
Global Moderator
Global Moderator
Posts: 1153
Joined: Thu May 10, 2012 10:58 pm
Location: Ehv

Re: Toon as a domotica controller?

Post by marcelr »

Now with attached file ....

grtz,

marcelr
Attachments
read_temp.sh.zip
Shell script for direct temperature readout on toon.
(1.07 KiB) Downloaded 672 times
marcelr
Global Moderator
Global Moderator
Posts: 1153
Joined: Thu May 10, 2012 10:58 pm
Location: Ehv

Re: Toon as a domotica controller?

Post by marcelr »

Has anyone run their own GUI on the toon?
Not yet. Currently, boiler control has my priority. But it would be good to post your code here, so other people can give it a shot if they want to.
The big question of course is: which one is correct?
The temperature readings, remember?

So far, I think the displayed temperature is correct (and therefore the data reported to the OTGW and boiler are correct, even though the update rate is crappy there). Checked with a bunch of old school thermometers :-).
happ_thermstat still does 6.0 degree subtraction, the extra offset (+1.1 in my case) should be added there as well, since happ_thermstat performs all I/O with the boiler module. (Haven't found the extra offset in the code, yet).

grtz,

marcelr
marcelr
Global Moderator
Global Moderator
Posts: 1153
Joined: Thu May 10, 2012 10:58 pm
Location: Ehv

Re: Toon as a domotica controller?

Post by marcelr »

This morning I tried to mount a USB-stick (vfat filesystem) to my toon, could be useful for logging purposes, or in general, when disk space runs out on your toon.
Apparently, the codepage is missing from the kernel modules.

from dmesg:

Code: Select all

...
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00
sd 0:0:0:0: [sda] Assuming drive cache: write through
sd 0:0:0:0: [sda] Assuming drive cache: write through
 sda: sda1
sd 0:0:0:0: [sda] Assuming drive cache: write through
sd 0:0:0:0: [sda] Attached SCSI removable disk
FAT: codepage cp437 not found
...
So, I tried to install the missing kernel module from the openembedded tree, but apparently, toon's linux kernel has module version checking switched on. No luck.
Then I patched the bitbake recipe (linux-quby2_2.36.6-R07.bb) to resemble my toon's kernel version, built the code, installed and yes, it's working.

If you want to do the same:

1: find your toon's kernel version (this one's for sw version 3.0.32, YMMV):

Code: Select all

eneco-001-xxxxxxx:/mnt# uname -r
2.6.36-R07-h21
2: patch the bitbake recipe:

Code: Select all

require linux-quby2_2.6.x.inc


#REV = "h11" original version
# patched: 
REV = "h21"

PD_REL_BSP  = "08"

PD_REL_KERN = "07"
PD_REL_WLAN = "02"
PD_REL_ZWAV = "01"
...
3: copy the kernel config file to reflect the correct kernel version:

Code: Select all

 cp defconfig-2.6.36-R07-h11 defconfig-2.6.36-R07-h21
4: build (in ~/oe/qb2):

Code: Select all

. ../bb_env.sh
bitbake linux-quby2
5: wait, and then copy to toon and install.

6: mount your USB stick (again, YMMV):

Code: Select all

mount /dev/sda1 /mnt -t vfat
If you don't have a working openembedded tree, but want to give it a shot, my modules are attached. They will only work in combination with the correct kernel version.

Note: there may have been kernel configuration changes between version h11 and the current. However, filesystem code has probably remained untouched by Quby.

grtz,

marcelr
Attachments
kernel-module-nls-cp437_2.6.36-R07-h21_qb2.ipk.zip
kernel modules for codepage support, FAT-style filesystems.
(10.75 KiB) Downloaded 591 times
Darkje
Starting Member
Starting Member
Posts: 17
Joined: Fri Jan 15, 2016 2:38 pm

Re: Toon as a domotica controller?

Post by Darkje »

Im playing arround with Toon for a while using the unofficial API (also using official sandbox api). This forum is one of my information points. Time to do something back:

URI for getting 5 minute interval data. (the RealTime graph in tablet toon). Usage is equal as for the GraphData:
/toonMobileBackendWeb/client/auth/getGasFlowData
/toonMobileBackendWeb/client/auth/getElecFlowData

URI for getting graph data of the wallplug. These also need an "devUuid=". But it's not the UUID of the device iteself, but the UUID of the graph. These can be found with retrieveToonState, and look for

"deviceConfigInfo > device > x > quantityGraphUuid"
/toonMobileBackendWeb/client/auth/smartplug/getGraphData

"deviceConfigInfo > device > x > flowGraphUuid"
/toonMobileBackendWeb/client/auth/smartplug/getFlowData

It's a bit cryptic, but who knows the unoffical api a little bit, will understand...

Grtx, Richard
Ierlandfan
Member
Member
Posts: 153
Joined: Thu Oct 03, 2013 7:53 pm

Re: Toon as a domotica controller?

Post by Ierlandfan »

Who needs cryptics when you have full local access.
marcelr
Global Moderator
Global Moderator
Posts: 1153
Joined: Thu May 10, 2012 10:58 pm
Location: Ehv

Re: Toon as a domotica controller?

Post by marcelr »

Don't know about the API, official or otherwise. I don't have it.

But this gives me everything you talk about in a single call:

Code: Select all

http://toon-ip/hdrv_zwave?action=getDevices.json
which yields:

Code: Select all

{ 
"dev_settings_device":{"uuid":"neco-001-xxxxxx:hdrv_zwave_103023C678B9", "name":"settings_device", "internalAddress":"settings_device", "type":"settings_device", "supportsCrc":"49", "location":"(null)"},
"dev_3":{"uuid":"eneco-001-xxxxxx:hdrv_zwave_63823C62E60", "name":"HAE_METER_v2", "internalAddress":"3", "type":"HAE_METER_v2", "supportsCrc":"1", "supportedCC":"22 3c 3d 3e 56 60 70 72 7a 86 8b 73", "IsConnected":"1", "HealthValue":"10", "location":"(null)"},
"dev_3.1":{"uuid":"eneco-001-xxxxxx:hdrv_zwave_63848732E70", "name":"HAE_METER_v2_1", "internalAddress":"3.1", "type":"gas", "supportsCrc":"0", "CurrentGasFlow":"344.00", "CurrentGasQuantity":"6044613.00", "location":"(null)"},
"dev_3.2":{"uuid":"eneco-001-xxxxxx:hdrv_zwave_6385CFF2E70", "name":"HAE_METER_v2_2", "internalAddress":"3.2", "type":"elec", "supportsCrc":"0", "CurrentElectricityFlow":"NaN", "CurrentElectricityQuantity":"NaN", "location":"(null)"},
"dev_3.3":{"uuid":"eneco-001-xxxxxx:hdrv_zwave_63858EC2E70", "name":"HAE_METER_v2_3", "internalAddress":"3.3", "type":"elec_delivered_nt", "supportsCrc":"0", "CurrentElectricityFlow":"0.00", "CurrentElectricityQuantity":"3861142.00", "location":"(null)"},
"dev_3.4":{"uuid":"eneco-001-xxxxxx:hdrv_zwave_6387CCD2E70", "name":"HAE_METER_v2_4", "internalAddress":"3.4", "type":"elec_received_nt", "supportsCrc":"0", "CurrentElectricityFlow":"0.00", "CurrentElectricityQuantity":"8085330.00", "location":"(null)"},
"dev_3.5":{"uuid":"eneco-001-xxxxxx:hdrv_zwave_638D7AB2E70", "name":"HAE_METER_v2_5", "internalAddress":"3.5", "type":"elec_delivered_lt", "supportsCrc":"0", "CurrentElectricityFlow":"0.00", "CurrentElectricityQuantity":"5514694.00", "location":"(null)"},
"dev_3.6":{"uuid":"eneco-001-xxxxxx:hdrv_zwave_6381EFB2E70", "name":"HAE_METER_v2_6", "internalAddress":"3.6", "type":"elec_received_lt", "supportsCrc":"0", "CurrentElectricityFlow":"550.00", "CurrentElectricityQuantity":"3246271.00", "location":"(null)"}
}
Parse, and you're done.

grtz,

marcelr
cygnusx
Starting Member
Starting Member
Posts: 48
Joined: Tue Apr 14, 2015 10:12 am

Re: Toon as a domotica controller?

Post by cygnusx »

Hello, i have a toon but i dont have the ketelmodule. What does it do? The voltage of opentherm is already 24 volts by itself right?

Can someone measure the voltage so i can try to power mine?
Post Reply

Return to “Toon Rooting”