Web proxy to control Toon remotely

Everything about external control, apps, VNC, etc goes here.

Moderators: marcelr, TheHogNL, TerrorSource, Toonz

Web proxy to control Toon remotely

Postby Martin101010 » Sat Mar 03, 2018 2:58 pm

Hello all,
As you might know we were trying to create an app with secure access to remotely change the settings of Toon. Unfortunately, password authentication and the iPhone where an issue.

We managed to create another solution which is phone manufacturer independent. What you need is a working secure webserver (https and PhP) with external access. I use a Synology NAS. This server must be in the same Lan as your toon.

This website, when logged on, looks like the toon app. An php script is acting as a kind of proxy in the background between the website and the toon. In this way the local Lan is not exposed. And others cannot access Toon without the password.

Just copy the files from GitHub https://github.com/jonkootje/secure-toon-control
to your webserver (sub) folder and change the IP address (of your Toon) and the Password in the api.php script (line 15 and 17)
Point the browser of your phone, pc or tabled to the url or ip address of your webserver and logon with the password and you’re in business.

Sander and Martin
Martin101010
Starting Member
Starting Member
 
Posts: 38
Joined: November 2017

Re: Web proxy to control Toon remotely

Postby TheHogNL » Sat Mar 03, 2018 6:00 pm

Nice! Ofcourse you will need to open a portforwarding to your internal webserver so you can connect to the webserver. This opens a port into your home network from everything on the internet.

You could also run this website on a external webserver and open a portforwarding to allow only your external webserver to access your Toon. Now only your webserver has access to your home network. A bit more secure.

Even better is to use the openvpn from Toon to build a own VPN towards the external webserver. Now your webserver is directly connected to your Toon making it even more secure. But then again, it all depends on the security of your webserver :-)
Member of the Toon Software Collective
User avatar
TheHogNL
Forum Moderator
Forum Moderator
 
Posts: 1303
Joined: August 2017

Re: Web proxy to control Toon remotely

Postby michel30 » Sat Mar 03, 2018 8:29 pm

This works very nice.
Thanks for this nice web page app.
michel30
Member
Member
 
Posts: 232
Joined: August 2017

Re: Web proxy to control Toon remotely

Postby michel30 » Sun Mar 04, 2018 7:14 pm

@Martin101010

Are you also building in this webpage app power now, gas now , energie use etc like the original toon App?

I used this app today a couple of times, works very good..

Thanks.
michel30
Member
Member
 
Posts: 232
Joined: August 2017

Re: Web proxy to control Toon remotely

Postby gijsje » Sun Mar 04, 2018 11:07 pm

It is not working for me
I does say it is connected but no temp displayed.

This is the info from /happ_thermstat?action=getThermostatInfo
Code: Select all
{"result":"ok", "currentTemp":"1979", "currentSetpoint":"2000", "currentInternalBoilerSetpoint":"70", "programState":"0", "activeState":"1", "nextProgram":"-1", "nextState":"-1", "nextTime":"0","nextSetpoint":"0","randomConfigId":"1352600945","errorFound":"255","connection":"0","burnerInfo":"1","otCommError":"0","currentModulationLevel":"99"}


if i do F12 i see this error
Code: Select all
app.js:248 Uncaught TypeError: Cannot read property 'currentTemp' of null
    at Object.fillData (app.js:248)
    at Object.success (app.js:201)
    at i (jquery.js:2)
    at Object.fireWith [as resolveWith] (jquery.js:2)
    at A (jquery.js:4)
    at XMLHttpRequest.<anonymous> (jquery.js:4)
gijsje
Starting Member
Starting Member
 
Posts: 25
Joined: December 2017

Re: Web proxy to control Toon remotely

Postby gielie » Mon Mar 05, 2018 8:40 am

gijsje wrote:It is not working for me
I does say it is connected but no temp displayed.

This is the info from /happ_thermstat?action=getThermostatInfo
Code: Select all
{"result":"ok", "currentTemp":"1979", "currentSetpoint":"2000", "currentInternalBoilerSetpoint":"70", "programState":"0", "activeState":"1", "nextProgram":"-1", "nextState":"-1", "nextTime":"0","nextSetpoint":"0","randomConfigId":"1352600945","errorFound":"255","connection":"0","burnerInfo":"1","otCommError":"0","currentModulationLevel":"99"}


if i do F12 i see this error
Code: Select all
app.js:248 Uncaught TypeError: Cannot read property 'currentTemp' of null
    at Object.fillData (app.js:248)
    at Object.success (app.js:201)
    at i (jquery.js:2)
    at Object.fireWith [as resolveWith] (jquery.js:2)
    at A (jquery.js:4)
    at XMLHttpRequest.<anonymous> (jquery.js:4)


I have the same problem, What version is your toon on, mine is 4.9
gielie
Member
Member
 
Posts: 53
Joined: November 2017

Version 4.9 support & Gas and Energy feature

Postby Martin101010 » Mon Mar 05, 2018 5:41 pm

@Gijsje & @Gielie:
Thanks for reporting that bug. From now on the application also supports version 4.9. The Toon URL is different in 4.8 (Instead of happ_thermstat it was happ_thermostat), thats why the application could not get the data from the Toon device.

To get this working:

You can either get the fixed version on the GitHub repository (https://github.com/jonkootje/secure-toon-control) and change the new made variable $VERSION to '4.9'.
OR
You can manually edit the URL in php/api.php. Directly after the settings section you can find the URL builder, there you see that the request goes to /happ_thermostat, in your case you have to change that to /happ_thermstat and everything should work!

@Michel30:
For that I need the http request that gives the gas and energy usage information. I can't find that anywhere. Does anyone here know that?
Last edited by Martin101010 on Mon Mar 05, 2018 7:20 pm, edited 1 time in total.
Martin101010
Starting Member
Starting Member
 
Posts: 38
Joined: November 2017

Re: Web proxy to control Toon remotely

Postby michel30 » Mon Mar 05, 2018 6:40 pm

Hello,

I think it is here:

http://TOON_IP/happ_pwrusage?action=GetCurrentUsage

This is live use of you power and gas. but the scrip must say refresh ... every 10 sec to receive new data.

Total you can find here: http://TOON_IP/hdrv_zwave?action=getDevices.json
michel30
Member
Member
 
Posts: 232
Joined: August 2017

Re: Version 4.9 support & Gas and Energy feature

Postby gijsje » Mon Mar 05, 2018 8:23 pm

Martin101010 wrote:@Gijsje & @Gielie:
Thanks for reporting that bug. From now on the application also supports version 4.9. The Toon URL is different in 4.8 (Instead of happ_thermstat it was happ_thermostat), thats why the application could not get the data from the Toon device.


Thanks now it works
gijsje
Starting Member
Starting Member
 
Posts: 25
Joined: December 2017

Re: Web proxy to control Toon remotely

Postby Martin101010 » Mon Mar 05, 2018 9:20 pm

@Michel30

Thanks for the URL. I made a GitHub branch with a version that shows the Power and Gass usage (https://github.com/jonkootje/secure-too ... er-support). I'm not able to test it currently so if you can do it for me that would be great. Also i don't know in what unit the Gass usage is given. I put Liters for now because i saw that on other screenshots but i'm not sure if that's the right one.

When i get confirmation that everything works well, i will merge the branch with the master branch on GitHub.

Sander
Martin101010
Starting Member
Starting Member
 
Posts: 38
Joined: November 2017

Re: Web proxy to control Toon remotely

Postby michel30 » Mon Mar 05, 2018 10:59 pm

@Martin101010

Unfortunately it does not work, in the bottom it stays on orange Loading...

I changed my IP plus version number.

Code: Select all

// SETTINGS - CHANGE THESE \/\/\/\/\/\/\/\/\/

$ADRESS = 'MY IP'; // LOCAL IP ADRESS OF TOON SERVER
$VERSION = '4.9'; // TOON VERSION (SUPPORTED: 4.8 / 4.9)



Could you load your TOON settings? without the power use?
michel30
Member
Member
 
Posts: 232
Joined: August 2017

Re: Web proxy to control Toon remotely

Postby Martin101010 » Thu Mar 08, 2018 8:21 am

@Michel30

I updated the branch with a fix in the php/api.php. I hope it will work now: https://github.com/jonkootje/secure-too ... er-support

Sander
Martin101010
Starting Member
Starting Member
 
Posts: 38
Joined: November 2017

Re: Web proxy to control Toon remotely

Postby gielie » Thu Mar 08, 2018 3:04 pm

The latest version doesn't work at all, i get a screen without any data, the first version works fine..

btw i can't git clone the latest version

Code: Select all
admin@Endor:/volume1/web/Toon2$ /opt/bin/git clone https://github.com/jonkootje/secure-toon-control.git
Cloning into 'secure-toon-control'...
fatal: unable to access 'https://github.com/jonkootje/secure-toon-control.git/': error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version
gielie
Member
Member
 
Posts: 53
Joined: November 2017

Re: Web proxy to control Toon remotely

Postby Rudolf » Thu Mar 08, 2018 9:11 pm

The power-branch shows a page for me.
The number for gas and power is 0.
(And the gas-icon looks like a water droplet to me)

Pages shows this php-error on both branches
Code: Select all
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /var/www/html/index.php:1) in /var/www/html/index.php on line 5


Running the site in docker with this command:
Code: Select all
docker run -p 80:80 -d -e 'GIT_REPO=https://github.com/jonkootje/secure-toon-control.git' richarvey/nginx-php-fpm:latest


I'm no web-dev, so I don't know what php is complaining about.... :P
Nice project. This allows my household to control Toon without pre-installing an app first. Keep up the good work.
Rudolf
Member
Member
 
Posts: 117
Joined: December 2017

Re: Web proxy to control Toon remotely

Postby aabre » Sun Apr 15, 2018 9:56 am

@Martin101010

Tks Martin101010 is works great, installed te files on a Vimexx hosting website (PHP) for 0,45 euro a month give my router NAT only acces from the web server and it works perfect.

Ik have 4 Toons in my house so I have to figure out to controle them separatedly.

perhaps it is possible to add a port number variable or can I use $ADRESS = 'xxx.xxx.xxx.xxx:45000'; // LOCAL IP ADRESS OF TOON SERVER AND PORT NUMBER 45000 ?


Great work Martin
User avatar
aabre
Starting Member
Starting Member
 
Posts: 33
Joined: November 2017
Location: Schiedam

Next

Return to Toon external control

Who is online

Users browsing this forum: No registered users and 0 guests