Software: modifications and extensions Toon

Forum about the tweaking of the Eneco Toon.

Moderator: marcelr

Re: Software: modifications and extensions Toon

Postby Toonz » Fri Mar 31, 2017 11:42 am

Hi all,

last week I received my rfxcom interface for the klikaanklikuit lights I have in two bedrooms.
I installed Domoticz on my raspberry and all is working fine.
My next step was to create an app on Toon to show the status of the lights on a tile and with a screen where you can switch the lights.
I started with the app from adjego and expanded that further.
Had to draw some new icons for the Dimstate/non-dim state.

All working fine but still some stuff to do:
- current list of devices is not retrieved from Domoticz, listed devices are hardcoded in DomoticzApp (idx variable in http request).
- currently the status of the lights is refreshed every 10 seconds. Which means that after switching a light on or off it takes 0-10 seconds before the status is shown on Toon but the lights are actually switched realtime via domoticz. I still need to figure out how I can trigger the status update on Toon after switching a light on Toon (calling a function in another QML file)
- Initially I had active buttons on the tile as well but it didn't look nice in Dim state, will see if I can add this back in later

I'm quite busy coming week, expect a clean version somewhere next weekend.
Consider this as work in progress and a source of inspiration :-)

EDIT: attachment removed, see next post
Toonz
Member
Member
 
Posts: 348
Joined: December 2016

Re: Software: modifications and extensions Toon

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

Hi all,

'final' version on my app to control the two klikaanklikuit lights via domotics. Don't worry, no April 1st joke. :D

changelog:
- you can now click on the light icons on the tile as well to switch the lights on or off
- the new status of the lights is shown directly on the tiles as well as on the main screen.
Only the 'last seen' date-time on the main screen will be updated during the regular refresh cycle via domoticz every xx seconds (timer in DomoticzApp.qml)

Todo (at some time, not very soon):
- Implement a mechanism for Domoticz to trigger a screen refresh at Toon when lights are switched by Domoticz or the klikaanklikuit switches

Regards,

Toonz
Attachments
domoticzLights_V1.0.zip
(12.65 KiB) Downloaded 69 times
Toonz
Member
Member
 
Posts: 348
Joined: December 2016

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: 348
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 40 times
Toonz
Member
Member
 
Posts: 348
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
Advanced Member
Advanced Member
 
Posts: 598
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: 17
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: 18
Joined: February 2017

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: 30
Joined: October 2016

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: 348
Joined: December 2016

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: 105
Joined: October 2013

Re: Software: modifications and extensions Toon

Postby Toonz » Fri Apr 21, 2017 4:17 pm

Hi all,

I found a zero-day bug in the buienradar app. The function determineNight() in buienradar.js wasn't giving the correct result between 00:00 and 09:59 because of a missing leading zero. The impact was that the icon on the buienradar tile in dim state was showing a moon instead of a sun till 10:00.

I found this while implementing the following tweak:
I was not happy with the screen brightness in dim state: either too bright for the evening or to dark during a sunny day.
I therefore created this small tweak which will lower the brightness in dim state after sunset and increases it again after sunrise.
Change will be visible at the first time the buienradar timer is fired (within 10 minutes after sunrise/sunset).
The sunrise/sunset times are already retrieved from the buienradar.xml file.
This functionality is currently commented out because I am not sure all users want it.
Remove the comment // in line 363-367 in BuienradarApp.qml if you want to use it (I really like it personally)

Replace the values 10 (brightness dim state after sunset) and/or value 30 (brightness dim state after sunrise) to the values you prefer personally.
Note that this will overwrite the dim state brightness setting value from the 'instellingenmenu' every 10 minutes.

By the way: I also found the color array used in dim/non-dim state, which can be manipulated to implement something like f.lux to reduce 'blue' light after sunset.
For later maybe (after the holidays :-) )


Changelog:
- fix determineNight() function in Buienradar.js
- added dormant code in BuienradarApp.qml to control screen brightness in dim state
Attachments
ToonBuienradar_V7.2.1.zip
(64.98 KiB) Downloaded 39 times
Toonz
Member
Member
 
Posts: 348
Joined: December 2016

Re: Software: modifications and extensions Toon

Postby Toonz » Fri Apr 21, 2017 6:57 pm

Ierlandfan wrote:You seem to know your way around in QT so I have a question
Since in the new happ_thermstat version the printTableInfo is disabled this could be a nice workaround

Will have a look after my holiday
Toonz
Member
Member
 
Posts: 348
Joined: December 2016

Re: Software: modifications and extensions Toon

Postby Toonz » Thu May 04, 2017 9:10 pm

Hi all,

back from leave. Hereby a new version of the Buienradar app. The oldest to-do item is finally implemented: save the selected weather station and lon/lat coordinates for the rain tile and load at startup. The trick was not to read the default values at the very start (init function) but after the user interface has loaded via the onCompleted functionality (learned about this when doing the homescreen mod above).
Files written to the buienradar folder: selectedStation.txt, selectedLongitude.txt and selectedLatitude.txt

If these files don't exists the default values from the BuienradarApp.qml are used at startup.
These text files are written when changing the weather station or rain coordinates via the screens

No other change request pending for this app anymore.

EDIT, marcelr: Thanks, Toonz, moved the attached file to the downloads thread.
Toonz
Member
Member
 
Posts: 348
Joined: December 2016

Re: Software: modifications and extensions Toon

Postby Toonz » Sat May 06, 2017 1:21 pm

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

You think something like this will work?
...
Since in the new happ_thermstat version the printTableInfo is disabled this could be a nice workaround


Hi Ierlandfan,

I don't have an Eneco subscription and therefor cannot config my boiler in the app (tries to retrieve the list of boilers from Eneco which fails of course).
I haven't found any QML code asking for this level of detailed info from the boiler.
Will keep it on my to-do list, first the trash collecting stuff....;-)

Regardz,

Toonz
Toonz
Member
Member
 
Posts: 348
Joined: December 2016

Re: Software: modifications and extensions Toon

Postby TerrorSource » Tue May 09, 2017 9:05 pm

Toonz wrote:Added my final version, changelog:
- big Buienradar image enlarged as before
- added some clarifying text in the lon/lat entry screen

Happy to take any change requests but currently my to-do list is empty.
Probably will move on to the traffic app.

Many thanks to all who contributed: RomMom, hvxl, Marcelr and Brainhunt (apologies if I forgot someone).
It was a steep learning curve into Javascript and QML for me.
P.S. Marcel, your solution for redirecting the console output has been a life saver a couple of times, thanks for that

EDIT (marcelr): Moved attachment to the downloads thread.


Some traffic websites offer a free xml service.
Here's an example for fileindex.nl: https://pastebin.com/vzCvLnR2
TerrorSource
Member
Member
 
Posts: 70
Joined: May 2017

PreviousNext

Return to Eneco Toon as Domotica controller

Who is online

Users browsing this forum: No registered users and 1 guest