Software: modifications and extensions Toon

Forum about the tweaking of the Eneco Toon.

Moderator: marcelr

Re: Software: modifications and extensions Toon

Postby Toonz » Sat Apr 01, 2017 1:50 pm

Hi all,

a small note regarding the buienradar app:
As you might have noticed the small colored weather icons are not shown anymore on the tile (non-Dim state) and the details screen for the 5 days forecast
Reason: the buienradar website is now redirecting http requests for these images to https which is not supported by Toon.

I will download all images manually and include these in the drawable folder.
As I will be busy this week, I am not sure about the eta.

Regards,

Toonz
Toonz
Member
Member
 
Posts: 95
Joined: December 2016

Re: Software: modifications and extensions Toon

Postby Toonz » Sat Apr 01, 2017 7:17 pm

that was easier than I thought. New Buienradar release.
Changelog:
- small icons for 5 days forecast and tile in non-dim state now included in the drawables folder and shown correctly.

Kind regards,

Toonz
Attachments
ToonBuienradar_V7.2.zip
(64.84 KiB) Downloaded 16 times
Toonz
Member
Member
 
Posts: 95
Joined: December 2016

Re: Software: modifications and extensions Toon

Postby marcelr » Sat Apr 01, 2017 7:21 pm

Will copy it to the downloads section.
marcelr
Member
Member
 
Posts: 357
Joined: May 2012
Location: Ehv

Re: Software: modifications and extensions Toon

Postby BrainHunt » Mon Apr 03, 2017 10:18 pm

Short question: I seem to have the same issue that QuasaR described end of February: I can't start x11vnc anymore (same error message).

The only fixes I see, seem to refer to the startup script which I didn't create in the first place. Probably I am missing something but can anyone help me get it back to work? I would like to share a tile that I'm working on but it would be nice to add a picture 8)

Thanks in advance
BrainHunt
Starting Member
Starting Member
 
Posts: 14
Joined: June 2016

Re: Software: modifications and extensions Toon

Postby QuasaR » Tue Apr 04, 2017 8:21 am

BrainHunt wrote:Short question: I seem to have the same issue that QuasaR described end of February: I can't start x11vnc anymore (same error message).

The only fixes I see, seem to refer to the startup script which I didn't create in the first place. Probably I am missing something but can anyone help me get it back to work? I would like to share a tile that I'm working on but it would be nice to add a picture 8)

Thanks in advance


If you run the command: which x11vnc
Do you get the following result : /usr/bin/x11vnc

If so, try starting it manually (it may give error's and refuse to start).
If that 'works' you need a startup script, I am using the following:

place this in /etc/init.d

Code: Select all
#!/bin/sh
#
# Start the server, with ssl support, VeNCrypt, and standard VNC password authentication.
# Accept multiple clients simultaneously. Run quietly, in the background.
#
# http://www.karlrunge.com/x11vnc/x11vnc_opts.html
#
# add to startup sequence with:    /usr/sbin/update-rc.d -v x11vnc start 60 5 . stop 60 0 1 6 .


DAEMON=/usr/bin/x11vnc
DAEMON_NAME=x11vnc
PasswDir=/.vnc
PasswFile=/.vnc/passwd
test -x $DAEMON || exit 0

start_x11vnc () {
        if [ -L $PasswDir ] && [ -d $PasswDir ]; then
                if [ -e $PasswFile ]; then
                        $DAEMON -shared \
                                -rawfb map:/dev/fb0@800x480x32 \
                                -forever \
                                -pipeinput UINPUT:touch,touch_always=1,abs,pressure=128,tslib_cal=/etc/pointercal,direct_abs=/dev/input/event0,direct_btn=/dev/input/event0,direct_rel=/dev/input/event0,direct_key=/dev/input/event0,nouinput \
                                -cursor arrow \
                                -usepw \
                                -quiet -bg
                else
                        echo -e \n
                        echo "The password file doesn't exist yet. Create one before using the startup script."
                fi
        else
                echo -e \n
                echo "a symlink from /.vnc to /root/.vnc seems to be missing. Add it with 'ln -s /root/.vnc /.vnc' "
        fi
}

stop_x11vnc () {
        killall $DAEMON_NAME
}

case "$1" in
start)
        echo -n "Starting x11vnc"
        start_x11vnc
        ;;

stop)
        echo -n "Stopping x11vnc"
        stop_x11vnc
        ;;

restart)
        $0 stop
        sleep 1
        $0 start
        ;;

*)
        echo "Usage: $0 {start|stop|restart}" >&2
        exit 1
        ;;
esac

exit 0


Please note! In the original script here on the forum, there is extra encryption enabled ( on the -usepw \ line). I removed it because the iOS clients can't handle it and I am using a VPN connection to my house before I can access Toon through VNC.
QuasaR
Starting Member
Starting Member
 
Posts: 15
Joined: February 2017

Re: Software: modifications and extensions Toon

Postby Toonz » Fri Apr 14, 2017 3:21 pm

Hi all,

A nice Easter to all of you.
Happy to share my latest project: showing which type of garbage needs to be put at the street: paper waste, organic waste, plastic/metal/cartons or other waste.
The icon for the right type of waste is shown under the temperature at the side panel in dim state.

I am absolutely not in favour of modifying system apps but I ran out of space for a new tile ;-).
I made changes to two thermostat app files: ThermostatApp.qml and ThermostatSidePanel.qml
I added wasteCalendar.js with the actual data for waste collection at my place and the icons in the drawables folder.
All changes made to the two system files are clearly marked with '//waste display start' and '//waste display end lines'.
To make the screen more balanced I am showing the temperature a bit higher to make room for the waste icon. If there is no Icon to show the original position is used.

The attached Thermostat app is from 3.1.2. I am not sure if the app has changed over time. I suggest you to apply the changes between the two markers in your own version on your Toon.
You also need to edit wasteCalendar.js to enter the waste collection dates for your place.
The icon is updated every 2 hours, so a change will become visible between 00:00 and 02:00

I have asked my 'waste' company for an xml feed of the dates but no response so far ;-)

Happy to hear your comments/suggestions or complaints :-)

Screenshot showing the icon for plastic/metal and cartons waste:

Screenshot_with_waste.png
Screenshot_with_waste.png (29.59 KiB) Viewed 460 times
Attachments
thermostat_show_waste_mod_V0.1.zip
(109.05 KiB) Downloaded 12 times
Toonz
Member
Member
 
Posts: 95
Joined: December 2016

Re: Software: modifications and extensions Toon

Postby Ierlandfan » Tue Apr 18, 2017 9:56 pm

My trash calendar is a little more structured so I want to use the weeknumbers and days to show the bin. I did it in Lua but qml is "a different cookie"
I was thinking something along this line:

Code: Select all
/* In accordance with ISO 8601, weeks start on Monday and the first Thursday of a year is always in week 1 of that year. Most years have 52 weeks, but some have 53. */

QDate date;
QDate::weekNumber(* weekNumber = 0) <<< Semantically wrong and compiled?(No experience with QT)
var specialdays; // like holidays and things like that
= {
//Insert special days
}

if (lookupdate != specialdays)
if (*weekNumber == afvalSoort ) 

switch (date.dayOfWeek()) { //You get the idea
case 1:
  //Monday
  break;
case 2:
  //Tuesday, it's subconcious in our head
//Show Icon
case 3:
//Wednesday, it's concious in our head, put it on the street in the evening
//Show Icon
case 4:
//Thursday morning, just in case I forgot and I am watching the thermostat
  ///Show Icon

case 5:
//Just in case like some holiday on thursday
  //Show Icon
case 6:
  //Saturday, don't bother me, too late
  break;
case 7:
//Sunday, don't bother me,
  break;
Ierlandfan
Member
Member
 
Posts: 60
Joined: October 2013

Re: Software: modifications and extensions Toon

Postby Toonz » Tue Apr 18, 2017 11:05 pm

I made a small change in the function updateWasteIcon to show the icon from ~17:00 onwards (ThermostatApp.qml):

Code: Select all
      var now = new Date( (new Date)*1 + 1000*3600*7); //current date/time plus 7 hours to show icon from 17:00 the day before onwards


@Ierlandfan: I like the idea to make a formula for the correct 'waste days' but we still need to edit special dates (holidays) in the code to make it 100% correct.
I am leaning towards the idea of putting the calendar in a separate text file which you can easily update without the need for restarting qt-gui (could be a local file on Toon or a file on your webserver)

EDIT 19/4: first bug found: waste icon isn't removed properly the next day, fix being tested.....
Toonz
Member
Member
 
Posts: 95
Joined: December 2016

Re: Software: modifications and extensions Toon

Postby Toonz » Thu Apr 20, 2017 7:52 pm

Here the next beta for the waste icon display functionality.
Installation preferably manual to keep your own version of the thermostat app (see some posts above)

Changelog:
- fix for removing the icon after 24 hours
(The function updateWasteIcon in ThermostatApp.qml was lacking proper initialisation of the variables which caused the icon to stay on screen if the next day was not a waste day.)
- waste icon is now shown from around 18:00 the day before (see post above) and is removed same time next day


To do (not in the coming 2 weeks):
- read the waste calendar from an external file instead of hardcoding in wasteCalendar.js
Attachments
thermostat_show_waste_mod_V0.2.zip
(122.74 KiB) Downloaded 9 times
Toonz
Member
Member
 
Posts: 95
Joined: December 2016

Re: Software: modifications and extensions Toon

Postby klaphekje » Thu Apr 20, 2017 8:04 pm

Hi Toonz,

As usual, very nice work and thanks for the update. Now i dont have to put out the trash every single day ;)

Í have tried to get your version of DomoticzLights working but it just does not show up when added to Globals.qml

Do you have any idea how that is possible? Your other apps all work fine!
klaphekje
Starting Member
Starting Member
 
Posts: 12
Joined: October 2016

Re: Software: modifications and extensions Toon

Postby Ierlandfan » Thu Apr 20, 2017 8:40 pm

In our case they shift the pickup day for the the bin so I was thinking along this line:

function getIconName(lookupDate) {
if (lookupdate == specialweek)
// return the text "special week", show correct bin with arrow and the day+date in text (So you know there something different)
else
return afvalSoortURL[afvalSoort[lookupDate]];

But first make your script work, for some reason it doesn't show a bin. Do I have to wait untill some time of day to show up or is a killal -9 qt-gui enough to make it instant show?
Ierlandfan
Member
Member
 
Posts: 60
Joined: October 2013

Re: Software: modifications and extensions Toon

Postby Toonz » Thu Apr 20, 2017 10:23 pm

klaphekje wrote:Hi Toonz,

As usual, very nice work and thanks for the update. Now i dont have to put out the trash every single day ;)

Í have tried to get your version of DomoticzLights working but it just does not show up when added to Globals.qml

Do you have any idea how that is possible? Your other apps all work fine!

Can you try to rename the folder to domoticz instead of domoticzLight (and the same in Globals.qml)?
Toonz
Member
Member
 
Posts: 95
Joined: December 2016

Re: Software: modifications and extensions Toon

Postby Toonz » Thu Apr 20, 2017 10:46 pm

Ierlandfan wrote:In our case they shift the pickup day for the the bin so I was thinking along this line:

function getIconName(lookupDate) {
if (lookupdate == specialweek)
// return the text "special week", show correct bin with arrow and the day+date in text (So you know there something different)
else
return afvalSoortURL[afvalSoort[lookupDate]];

But first make your script work, for some reason it doesn't show a bin. Do I have to wait untill some time of day to show up or is a killal -9 qt-gui enough to make it instant show?

killall qt-gui should be sufficient as the timer is also fired at start, so the icon should be there instantly. Updated every hour thereafter.
Just double checking - did you:
- copy the new waste icons into the drawables folder?
- copy all the code blocks between "//waste display start" and "//waste display end" in both ThermostatApp.qml and ThermostatSidepanel.qml?
- added '21 april 2017 in this case' to the wasteCalender.js file? (case sensitive, no leading zeroes in day numbers)
var afvalSoort = {
"21 april 2017" : 3,
.....



Regarding your suggestion above, how do we know which week is a special week? Still needs to be hardcoded somehow I think
Toonz
Member
Member
 
Posts: 95
Joined: December 2016

Re: Software: modifications and extensions Toon

Postby Ierlandfan » Fri Apr 21, 2017 7:00 am

Well, we could check a public calender for (Dutch) special days

It's working now. The case-sensitive part did the trick, I wrote all months with leading Capital :-)
Ierlandfan
Member
Member
 
Posts: 60
Joined: October 2013

Re: Software: modifications and extensions Toon

Postby Ierlandfan » Fri Apr 21, 2017 1:56 pm

You seem to know your way around in QT so I have a question

You think something like this will work?

property int boilerDataRequestId: 1
var requestId = p.boilerDataRequestId++; // This does 2, 3, 4, 5, 6,7, 8 etc.

function parseDataId{
requestId; // parse the request and scan all ID's
return requestId; // Output of the parsed data
//dump to file
}

Since in the new happ_thermstat version the printTableInfo is disabled this could be a nice workaround
Ierlandfan
Member
Member
 
Posts: 60
Joined: October 2013

PreviousNext

Return to Eneco Toon as Domotica controller

Who is online

Users browsing this forum: No registered users and 1 guest