Page 9 of 39

Re: Toon as a domotica controller?

Posted: Thu Dec 10, 2015 3:23 pm
by al_n
marcelr wrote:
I couldn't ssh from toon to my mac got an error:
ssh: connection to root@10.10.10.2:22 exited: no matching algo kex
Is probably a Mac problem, not toon's :-).
Not really, its a dropbear problem

Re: Toon as a domotica controller?

Posted: Thu Dec 10, 2015 8:33 pm
by Ierlandfan
Here you can see some screenshots with OT data from Toon. I know there's a json call to set the programs and thermostat just have to find it again.
toondomoticz2.png
toondomoticz2.png (200.62 KiB) Viewed 17293 times
toondomoticz.png
toondomoticz.png (201.2 KiB) Viewed 17293 times

Re: Toon as a domotica controller?

Posted: Fri Dec 11, 2015 12:04 am
by Ierlandfan
cat happ_thermstat.txt |grep handl
or
cat happ_thermstat.txt |grep web

ip_toon:7080/happ_thermstat?action=getDhwSettings
ip_toon:7080/happ_thermstat?action=setDhwSettings //needs parameters
// don't know
http://ip_toon:7080/happ_thermstat?action=setSetpoint //needs parameters
//probably need steps, outTemps, setTemps'
http://ip_toon:7080/happ_thermstat?action=requestDataId
//no idea about format, alwas returns OK
http://ip_toon:7080/happ_thermstat?action=GetHolidays
//Holidays need to be set somewhere
http://ip_toon:7080/happ_thermstat?WriteDataId
/needs parameters
http://ip_toon:7080/happ_thermstat?action=getActiveNext
{result:'ok',
{active:[programType=1, temperatureValue=2250, temperatureState=0, startTime=1449727200, endTime=1449784800],
{next:[programType=1, temperatureValue=0, temperatureState=2, startTime=1449784800, endTime=1449813600]
}

//debug data..it's seems possible to change the state..need to find out how
{result:'error', comment:'need state'}
happ_thermstat: {result:'error', comment:'invalid state'}
happ_thermstat: {result:'ok', stateValue:'%i'}

Those are examples of web_handlers which you can query. Some needs specific values. You can find them in /Hcbv2/sbin/<binary>. Just do a strings -f <binary> to find more info.

Re: Toon as a domotica controller?

Posted: Fri Dec 11, 2015 10:35 am
by al_n
the web handlers are not part of the source distro available from quby, right? Or did I miss anything?

Re: Toon as a domotica controller?

Posted: Fri Dec 11, 2015 11:40 am
by al_n
I've decompiled happ_thermstat, gives a better overview of the handlers

Code: Select all

int32_t web_debugOT(int32_t a1, int32_t a2, int32_t a3);
int32_t web_getActiveNext(int32_t a1, int32_t a2, int32_t a3);
int32_t web_getWeeklyList(int32_t a1, int32_t a2, int32_t a3);
int32_t web_handleActivateTimer(int32_t a1);
int32_t web_handleChangeSchemeState(int32_t a1);
int32_t web_handledoFwUpgrade(int32_t a1, int32_t a2);
int32_t web_handleGetDhwSettings(int32_t a1, int32_t a2, int32_t a3);
int32_t web_handlegetEdge2Stats(int32_t a1, int32_t a2);
int32_t web_handleGetHeatingHistory(int32_t a1, int32_t a2, int32_t a3, int32_t a4);
int32_t web_handleGetSchemeState(int32_t a1, int32_t a2, int32_t a3);
int32_t web_handleGetStateValue(int32_t a1, int32_t a2, int32_t a3);
int32_t web_handleGetThermostatInfo(int32_t a1, int32_t a2);
int32_t web_handleMemDataId(int32_t a1, int32_t a2);
int32_t web_handleNotifyChange(int32_t a1, int32_t a2, int32_t a3, int32_t a4);
int32_t web_handlePrintTableInfo(int32_t a1);
int32_t web_handleRequestDataId(int32_t a1, int32_t a2);
int32_t web_handleResetGwMem(void);
int32_t web_handleRoomSetpoint(int32_t a1, int32_t a2, int32_t a3);
int32_t web_handleSetBoilerOnOff(int32_t a1, int32_t a2, int32_t a3);
int32_t web_handleSetDhwSettings(int32_t a1, int32_t a2);
int32_t web_handleTestBoilerEvent(int32_t a1, int32_t a2);
int32_t web_handleUpdateDhwValue(int32_t a1, int32_t a2, int32_t a3);
int32_t web_handleUpdateStateValue(int32_t a1, int32_t a2, int32_t a3, int32_t a4);
int32_t web_handleWriteDataId(int32_t a1, int32_t a2);
int32_t web_master(int32_t a1, int32_t a2, int32_t a3, int32_t * a4);
int32_t web_specialOverride(int32_t a1, int32_t a2, int32_t a3);

Re: Toon as a domotica controller?

Posted: Fri Dec 11, 2015 11:46 am
by marcelr
the web handlers are not part of the source distro available from quby, right? Or did I miss anything?
Nope, it's closed source stuff.
This is happ_thermstat for SW 2.9.6, right?
What tool did you use for disassembly? (So I can check whether stuff has been added for 3.0 and possibly later).

grtz,

marcelr

Re: Toon as a domotica controller?

Posted: Fri Dec 11, 2015 11:59 am
by al_n
Yes 2.9.6
I've used an online tool at: https://retdec.com

Re: Toon as a domotica controller?

Posted: Fri Dec 11, 2015 5:52 pm
by Ierlandfan
FW 3.1.22

int32_t waitOtTimeout(int32_t a1, int32_t a2, int32_t a3, int32_t a4);
int32_t web_debugOT(int32_t a1, int32_t a2, int32_t a3);
int32_t web_getActiveNext(int32_t a1, int32_t a2, int32_t a3, int32_t a4);
int32_t web_getWeeklyList(int32_t a1, int32_t a2, int32_t a3);
int32_t web_handleActivateTimer(int32_t a1);
int32_t web_handleChangeSchemeState(int32_t a1);
int32_t web_handledoFwUpgrade(int32_t a1, int32_t a2, int32_t a3);
int32_t web_handleGetDhwSettings(int32_t a1, int32_t a2);
int32_t web_handlegetEdge2Stats(int32_t a1, int32_t a2);
int32_t web_handleGetHeatingHistory(int32_t a1, int32_t a2);
int32_t web_handleGetHolidays(int32_t a1, int32_t a2);
int32_t web_handlegetRemoveHoliday(int32_t a1);
int32_t web_handleGetSchemeState(int32_t a1, int32_t a2, int32_t a3);
int32_t web_handleGetStateValue(int32_t a1, int32_t a2, int32_t a3, int32_t a4);
int32_t web_handleGetThermostatInfo(int32_t a1, int32_t a2);
int32_t web_handleMemDataId(int32_t a1, int32_t a2, int32_t a3, int32_t a4);
int32_t web_handleNotifyChange(int32_t a1, int32_t a2);
int32_t web_handlePrintTableInfo(int32_t a1);
int32_t web_handleRequestDataId(int32_t a1, int32_t a2);
int32_t web_handleResetGwMem(void);
int32_t web_handleRoomSetpoint(int32_t a1, int32_t a2);
int32_t web_handleSetBoilerOnOff(int32_t a1, int32_t a2, int32_t a3, int32_t a4);
int32_t web_handleSetDhwSettings(int32_t a1, int32_t a2, int32_t a3);
int32_t web_handleSetHoliday(int32_t a1);
int32_t web_handleTestBoilerEvent(int32_t a1, int32_t a2, int32_t a3);
int32_t web_handleUpdateDhwValue(int32_t a1, int32_t a2, int32_t a3);
int32_t web_handleUpdateStateValue(int32_t a1, int32_t a2, int32_t a3);
int32_t web_handleWriteDataId(int32_t a1, int32_t a2);
int32_t web_master(int32_t a1, int32_t a2, int32_t a3, char * a4);
int32_t web_specialOverride(int32_t a1, int32_t a2, int32_t a3);

Re: Toon as a domotica controller?

Posted: Fri Dec 11, 2015 6:11 pm
by Ierlandfan
If a handler isn't working try without Capitalised first letter.
E.g:
NotifyChange(int32_t a1, int32_t a2);
http://ip_toon:7080/happ_thermstat?action=NotifyChange
No Handler found

http://ip_toon:7080/happ_thermstat?action=notifyChange //n in notify not capitalised
{result:'ok', dataId:'0', 'value1':'02', 'value2':'00'}

Re: Toon as a domotica controller?

Posted: Fri Dec 11, 2015 8:39 pm
by al_n
any luck with changing programs or changing any settings?

Re: Toon as a domotica controller?

Posted: Fri Dec 11, 2015 8:47 pm
by al_n
my toon was disconnected from the internet until yesterday when I rooted it. Now it is connected but I still get a warning that there is a connection problem (I guess because it cant reach quby/eneco). That's no problem but I do wonder why I don't get the weather info. Do you get it?

Re: Toon as a domotica controller?

Posted: Fri Dec 11, 2015 9:24 pm
by marcelr
I do wonder why I don't get the weather info. Do you get it?
I don't get it, never have, since I don't have an eneco account.
If you have shut down the OpenVPN connection, then you won't get any weather info. toon tries to download some javascript stuff from quby, to display the weather and traffic info (at least in FW <= 2.9.33).

grtz,

marcelr

Re: Toon as a domotica controller?

Posted: Fri Dec 11, 2015 9:56 pm
by al_n
Could be nice if we could proxy this somehow to display the info.
Can you tell us what is being downloaded?

I do see a definition to http://xml.buienradar.nl in hcb_project.xml

Re: Toon as a domotica controller?

Posted: Fri Dec 11, 2015 9:59 pm
by al_n
ideally we can hack a dns entry so toon will talk to an alternative server

Re: Toon as a domotica controller?

Posted: Fri Dec 11, 2015 11:29 pm
by Ierlandfan
Possible way:

hcb_project.xml:

<happ_weather>
<squareImage>1</squareImage>
<defaultLocation>Utrecht</defaultLocation>
<disableData>0</disableData>
<contentProxyUrl>javaExternalContentProxy/?url=</contentProxyUrl>
<trafficXmlUrl>http://xml.fileindex.nl</trafficXmlUrl>
<weatherXmlUrl>http://xml.buienradar.nl</weatherXmlUrl>
<servletPath>http://www.buienradar.nl</servletPath>
</happ_weather>

Maybe if we change it to another (local) proxy or unset it, it will be downloaded through normal connection instead of the VPN