android app TOON

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

Moderators: marcelr, TheHogNL, Toonz

Toonz
Forum Moderator
Forum Moderator
Posts: 1873
Joined: Mon Dec 19, 2016 1:58 pm

Re: android app TOON

Post by Toonz »

We just need someone to write a proper app. The newer firmware (5.x) now also supports QtWebsockets which gives much more options for a mobile app to communicate with Toon.
Just need someone ti build such an app.

In the meantime you can consider using x11vnc on Toon.
You have then full remote control over your Toon (you will need to open up your firewall at home to allow incoming connections on port 5900 to Toon).
A good working client for Android devices is bVNCfree for instance, on a PC you can user TigerVNC but I gues sthere will be many others
member of the Toon Software Collective
said0066
Starting Member
Starting Member
Posts: 13
Joined: Mon Feb 18, 2019 4:18 pm

Re: android app TOON

Post by said0066 »

x11vnc works great with bVNC Free on my android Phone. Thanks!
RoadXY
Member
Member
Posts: 111
Joined: Wed Oct 21, 2015 8:11 am

Re: android app TOON

Post by RoadXY »

I've updated the app which vlabianski started.

I, however, don't have an rooted Toon yet so I'm not 100% sure it will work.
(I have an issue while I was rooting my Toon viewtopic.php?f=104&t=12044)

You can either build your own from the code or download the APK from here:
https://github.com/Inversion-NL/Toon-Android

It's a beta version for now until I get someone willing to solve the issue on my Toon (paid, offcourse).
glsf91
Member
Member
Posts: 184
Joined: Fri Sep 15, 2017 9:25 pm

Re: android app TOON

Post by glsf91 »

RoadXY wrote:I've updated the app which vlabianski started.

I, however, don't have an rooted Toon yet so I'm not 100% sure it will work.
(I have an issue while I was rooting my Toon viewtopic.php?f=104&t=12044)

You can either build your own from the code or download the APK from here:
https://github.com/Inversion-NL/Toon-Android

It's a beta version for now until I get someone willing to solve the issue on my Toon (paid, offcourse).
Thanks. Great you picked this up. It is not crashing anymore at startup which is good.
If I may give you some remarks:

When Away/sleep/home/comfort is selected it is almost not visible that it is selected. Maybe change color background or change color text on button, like on Toon.

Right to the degrees is displayed "At <time> on 0.00". That (0.00) is not correct when on my Toon is "Om 23:00 op Slapen". Also 1 decimal should be enough.
1 decimal is also enough for both degrees at the left side.

When changing something it is giving an error below which is disappearing too fast. Something about responsedata or responseheader is null.
When you tell me which url you use I can give you the respons if you want.

When touch refresh icon, it is not giving any feedback. So unsure if it is doing anything.
RoadXY
Member
Member
Posts: 111
Joined: Wed Oct 21, 2015 8:11 am

Re: android app TOON

Post by RoadXY »

Could you create some screenshots please?

I also noticed that the intro library that I used doesn't respond to touches, at least it doesn't on my Pixel 3 XL running Android Q.
glsf91
Member
Member
Posts: 184
Joined: Fri Sep 15, 2017 9:25 pm

Re: android app TOON

Post by glsf91 »

RoadXY wrote:Could you create some screenshots please?

I also noticed that the intro library that I used doesn't respond to touches, at least it doesn't on my Pixel 3 XL running Android Q.
From the error I cannot make e screenshot.


Image

Like poster below, Power usage is indeed alsways zero.
Last edited by glsf91 on Sat Mar 30, 2019 8:43 pm, edited 1 time in total.
MyZ
Member
Member
Posts: 53
Joined: Mon Jun 04, 2018 6:57 pm

Re: android app TOON

Post by MyZ »

RoadXY wrote:I've updated the app which vlabianski started.

I, however, don't have an rooted Toon yet so I'm not 100% sure it will work.
(I have an issue while I was rooting my Toon viewtopic.php?f=104&t=12044)

You can either build your own from the code or download the APK from here:
https://github.com/Inversion-NL/Toon-Android

It's a beta version for now until I get someone willing to solve the issue on my Toon (paid, offcourse).
Nice work. I don't have the error as described above, however is "stroom nu" not working. It's stays zero. I agree with the decimal places. One should do it. Keep up the good work!
glsf91
Member
Member
Posts: 184
Joined: Fri Sep 15, 2017 9:25 pm

Re: android app TOON

Post by glsf91 »

RoadXY wrote:Could you create some screenshots please?

I also noticed that the intro library that I used doesn't respond to touches, at least it doesn't on my Pixel 3 XL running Android Q.
I can solve the powerusage if I change this in mainactivity:

Code: Select all

        if(aDevicesInfo.getElecProdFlowHigh() > 0){
            currentElectricUsage = aDevicesInfo.getElecProdFlowHigh();
            String text = decimalFormat.format(aDevicesInfo.getElecProdFlowHigh()) + " watt";
            txtvCurrentPowerUse.setText(text);
        } else {
            currentElectricUsage = aDevicesInfo.getElecProdFlowLow();
            String text = decimalFormat.format(aDevicesInfo.getElecProdFlowLow()) + " watt";
            txtvCurrentPowerUse.setText(text);
        }
At my toon dev_3.6 is used for low electricty.

I also think why the error is coming:

Code: Select all

        protected void onPostExecute(Object o) {
            if(o instanceof String) {
                ResponseData responseData = null;

                switch (method) {
                    case "getthermostatinfo":
                        responseData = Converter.convertFromTemperature((String) o);
                        break;
                    case "getzwavedevices":
                        responseData = Converter.convertFromDeviceInfo((String) o);
                        break;
                    case "setschemestate":
                        break;
                    case "setsetpoint":
                        break;
                }

                if (responseData != null && responseHandler != null) {
                    responseHandler.onResponse(responseData);
                } else
                    responseHandler.onResponseError(new NullPointerException("response data or responseHandler is null"));
In this part responseData will be always null when setschemestate or setsetpoint is used.

And for selected button background color I would propose this: <color name="colorPresetAccent">#DDDDDD</color>

I also see the problem with: "At <time> on 0.00"

In ThermostatInfo there is a mistake in nextSetPoint. This must be nextSetpoint.
So private int nextSetPoint; should be private int nextSetpoint;
And also in:

Code: Select all

    public double getNextSetPoint(){
        return nextSetpoint;
    }
WickedMaster
Member
Member
Posts: 76
Joined: Wed Nov 07, 2018 1:53 pm

Re: android app TOON

Post by WickedMaster »

That "zero" issue can be solved easily by just fetching the information from /happ_pwrusage?action=GetCurrentUsage. This keeps a track of the current usage.
{"result":"ok",
"powerUsage": {"value":276, "avgValue":373.76},
"powerProduction": {"value":0, "avgValue":0.00},
"gasUsage": {"value":0, "avgValue":0.00}
}
I've got no gas, so I won't see any gas usage. Seems like the page even shows power production (for people with solar panels).
mAiden
Member
Member
Posts: 330
Joined: Mon Jul 10, 2017 10:22 am

Re: android app TOON

Post by mAiden »

Got also a error here. When i start the app, once the connection is established, the app crashes immediately.
Running Android 9. Will try to make a video of it.
Member of the Toon Software Collective
RoadXY
Member
Member
Posts: 111
Joined: Wed Oct 21, 2015 8:11 am

Re: android app TOON

Post by RoadXY »

glsf91 wrote:When Away/sleep/home/comfort is selected it is almost not visible that it is selected. Maybe change color background or change color text on button, like on Toon.
I've created an issue for this (to keep track) here:
https://github.com/fabianblom/Toon-Android/issues/5
glsf91 wrote:Right to the degrees is displayed "At <time> on 0.00". That (0.00) is not correct when on my Toon is "Om 23:00 op Slapen". Also 1 decimal should be enough.
1 decimal is also enough for both degrees at the left side.
I've created an issue for this here:
https://github.com/fabianblom/Toon-Android/issues/6
glsf91 wrote:When changing something it is giving an error below which is disappearing too fast. Something about responsedata or responseheader is null.
When you tell me which url you use I can give you the respons if you want.
I'll have an look when my bricked Toon is up and running again.
These messages (toasts) are there for debugging right now.
glsf91 wrote:When touch refresh icon, it is not giving any feedback. So unsure if it is doing anything.
I could create an toast message (those messages at the bottom of the screen which dissapear after a few seconds), if that helps?
I didn't display an waiting screen because that just blocks further use of the app until the request to Toon is finished.
Now it'll queue up commands and execute them in order.
Last edited by RoadXY on Mon Apr 01, 2019 1:19 pm, edited 1 time in total.
RoadXY
Member
Member
Posts: 111
Joined: Wed Oct 21, 2015 8:11 am

Re: android app TOON

Post by RoadXY »

RoadXY wrote:Could you create some screenshots please?

I also noticed that the intro library that I used doesn't respond to touches, at least it doesn't on my Pixel 3 XL running Android Q.
I've already fixed this in 0.5.1
RoadXY
Member
Member
Posts: 111
Joined: Wed Oct 21, 2015 8:11 am

Re: android app TOON

Post by RoadXY »

WickedMaster wrote:That "zero" issue can be solved easily by just fetching the information from /happ_pwrusage?action=GetCurrentUsage. This keeps a track of the current usage.
{"result":"ok",
"powerUsage": {"value":276, "avgValue":373.76},
"powerProduction": {"value":0, "avgValue":0.00},
"gasUsage": {"value":0, "avgValue":0.00}
}
I've got no gas, so I won't see any gas usage. Seems like the page even shows power production (for people with solar panels).
Thanks, when my Toon is up and running again I'll check
mAiden
Member
Member
Posts: 330
Joined: Mon Jul 10, 2017 10:22 am

Re: android app TOON

Post by mAiden »

Code: Select all

            case R.id.btnPlus:
                TemperatureController.getInstance().setTemperatureHigher(0.5);
                break;
            case R.id.btnMin:
                TemperatureController.getInstance().setTemperatureLower(0.5);
                break

Bron: https://github.com/Inversion-NL/Toon-Android/blob/master/app/src/main/java/com/toonapps/toon/view/MainActivity.java
This is also not going well, Toon will raise and lower the temperature by 0.1 not by 0.5, this is due to the resource file that must be loaded, otherwise our custom apps will not work.
Member of the Toon Software Collective
RoadXY
Member
Member
Posts: 111
Joined: Wed Oct 21, 2015 8:11 am

Re: android app TOON

Post by RoadXY »

glsf91 wrote:I can solve the powerusage if I change this in mainactivity:

Code: Select all

        if(aDevicesInfo.getElecProdFlowHigh() > 0){
            currentElectricUsage = aDevicesInfo.getElecProdFlowHigh();
            String text = decimalFormat.format(aDevicesInfo.getElecProdFlowHigh()) + " watt";
            txtvCurrentPowerUse.setText(text);
        } else {
            currentElectricUsage = aDevicesInfo.getElecProdFlowLow();
            String text = decimalFormat.format(aDevicesInfo.getElecProdFlowLow()) + " watt";
            txtvCurrentPowerUse.setText(text);
        }
I'm not sure if I can follow you here.
What did you change and where?
glsf91 wrote:At my toon dev_3.6 is used for low electricty.
Thanks, I'll look into it.
glsf91 wrote:I also think why the error is coming:

Code: Select all

        protected void onPostExecute(Object o) {
            if(o instanceof String) {
                ResponseData responseData = null;

                switch (method) {
                    case "getthermostatinfo":
                        responseData = Converter.convertFromTemperature((String) o);
                        break;
                    case "getzwavedevices":
                        responseData = Converter.convertFromDeviceInfo((String) o);
                        break;
                    case "setschemestate":
                        break;
                    case "setsetpoint":
                        break;
                }

                if (responseData != null && responseHandler != null) {
                    responseHandler.onResponse(responseData);
                } else
                    responseHandler.onResponseError(new NullPointerException("response data or responseHandler is null"));
In this part responseData will be always null when setschemestate or setsetpoint is used.
Which error do you mean?
glsf91 wrote:And for selected button background color I would propose this: <color name="colorPresetAccent">#DDDDDD</color>[/qoute]
Thanks, I'll look into it.
glsf91 wrote:I also see the problem with: "At <time> on 0.00"

In ThermostatInfo there is a mistake in nextSetPoint. This must be nextSetpoint.
So private int nextSetPoint; should be private int nextSetpoint;
And also in:

Code: Select all

    public double getNextSetPoint(){
        return nextSetpoint;
    }
I'm not sure if I follow.
There is no 'nextSetpoint' in my code?
Post Reply

Return to “Toon external control”