Software: modifications and extensions Toon

Forum about the tweaking of the Eneco Toon.

Moderator: marcelr

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 6 times
Toonz
Member
Member
 
Posts: 95
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: 95
Joined: December 2016

Re: Software: modifications and extensions Toon

Postby Toonz » Sat Apr 22, 2017 9:33 am

Hi all,

just before I really need to start packing for the holiday I would like to share my latest proof of concept.
Well, not only a concept, it is working fine but not sure if it is the best solution.
Challenge: rotate tiles on the homescreen to see more than just the 4 tiles of screen 1 in dim state (thanks Marcel for the suggestion)

Solution: I've implemented a timer which rotates through the different existing homescreen pages every 15 seconds in dim state only.
You now can see all those tiles in dim state you have never seen before :-)

Pro's: it is a clean, simple mod to the Homescreen.qml
Con's: if you want to have a tile fixed on screen you will need to add the same tile to all homescreens (like the clock for example)
Alternatively I could look into rotating single tiles but then the question is which tiles to select. Getting a bit more complicated quickly. Happy to hear your views.

If you want to implement this copy the code below to the Homesceen.qml in the apps folder homescreen at the Component.onCompleted (line 488 in my firmware)

Code: Select all
   Component.onCompleted: {
      registry.registerWidgetContainer("prominent", rightPanel);
//screen rotate start
      homescreenrotate.running = true;
//screen rotate end
   }

//screen rotate start

   function rotateHomescreen() {
      if (screenStateController.dimmedColors) {   // only rotate screen in dim state, ignore the last page (usually empty)
         var newpage = currentPage + 1;
         if (newpage >= pagecount - 1)
            newpage = 0;
         widgetNavBar.navigateBtn(newpage);
      }
   }

   Timer {
      id: homescreenrotate
      interval: 15000              //update every 15 sec, change to whatever you like
      triggeredOnStart: false         //can only be run once the page has loaded, not at start
      running: false            //timer will be started in the onCompleted function right above after loading the page
      repeat: true
      onTriggered: rotateHomescreen()
   }

//screen rotate end
Toonz
Member
Member
 
Posts: 95
Joined: December 2016

Previous

Return to Eneco Toon as Domotica controller

Who is online

Users browsing this forum: No registered users and 1 guest

cron