android app TOON

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

Moderators: marcelr, TheHogNL, TerrorSource, Toonz

Re: android app TOON

Postby Toonz » Fri Feb 22, 2019 9:23 am

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
User avatar
Toonz
Forum Moderator
Forum Moderator
 
Posts: 1099
Joined: December 2016

Re: android app TOON

Postby said0066 » Fri Feb 22, 2019 8:47 pm

x11vnc works great with bVNC Free on my android Phone. Thanks!
said0066
Starting Member
Starting Member
 
Posts: 8
Joined: February 2019

Re: android app TOON

Postby RoadXY » Fri Mar 29, 2019 8:41 pm

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 https://www.domoticaforum.eu/viewtopic. ... 04&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).
RoadXY
Member
Member
 
Posts: 62
Joined: October 2015

Re: android app TOON

Postby glsf91 » Sat Mar 30, 2019 9:52 am

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 https://www.domoticaforum.eu/viewtopic. ... 04&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.
glsf91
Member
Member
 
Posts: 77
Joined: September 2017

Re: android app TOON

Postby RoadXY » Sat Mar 30, 2019 11:24 am

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.
RoadXY
Member
Member
 
Posts: 62
Joined: October 2015

Re: android app TOON

Postby glsf91 » Sat Mar 30, 2019 11:42 am

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 7:43 pm, edited 1 time in total.
glsf91
Member
Member
 
Posts: 77
Joined: September 2017

Re: android app TOON

Postby MyZ » Sat Mar 30, 2019 2:12 pm

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 https://www.domoticaforum.eu/viewtopic. ... 04&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!
MyZ
Member
Member
 
Posts: 53
Joined: June 2018

Re: android app TOON

Postby glsf91 » Sat Mar 30, 2019 9:49 pm

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;
    }
glsf91
Member
Member
 
Posts: 77
Joined: September 2017

Re: android app TOON

Postby WickedMaster » Mon Apr 01, 2019 10:24 am

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).
User avatar
WickedMaster
Member
Member
 
Posts: 68
Joined: November 2018

Re: android app TOON

Postby mAiden » Mon Apr 01, 2019 10:43 am

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.
mAiden
Member
Member
 
Posts: 222
Joined: July 2017

Re: android app TOON

Postby RoadXY » Mon Apr 01, 2019 11:04 am

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 12:19 pm, edited 1 time in total.
RoadXY
Member
Member
 
Posts: 62
Joined: October 2015

Re: android app TOON

Postby RoadXY » Mon Apr 01, 2019 11:05 am

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: 62
Joined: October 2015

Re: android app TOON

Postby RoadXY » Mon Apr 01, 2019 11:30 am

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
RoadXY
Member
Member
 
Posts: 62
Joined: October 2015

Re: android app TOON

Postby mAiden » Mon Apr 01, 2019 12:14 pm

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.
mAiden
Member
Member
 
Posts: 222
Joined: July 2017

Re: android app TOON

Postby RoadXY » Mon Apr 01, 2019 12:23 pm

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?
RoadXY
Member
Member
 
Posts: 62
Joined: October 2015

PreviousNext

Return to Toon external control

Who is online

Users browsing this forum: No registered users and 0 guests