Software: modifications and extensions Toon

Everything about software tools, new software development and toolchains. For developers, mostly.

Moderators: marcelr, TheHogNL, Toonz

marcelr
Global Moderator
Global Moderator
Posts: 1153
Joined: Thu May 10, 2012 10:58 pm
Location: Ehv

Re: Software: modifications and extensions Toon

Post by marcelr »

wbmk wrote:@cygnusx

Thank you for providing the Kodi sample. I am looking into rooting my Toon and using it as a front end for kodi (playlist for music and selection of radio stations) and for controlling my FHEM setup.

I am new to qml... is there a visual editor that could be used, or are you using notepad++ ore something for editing?

And would it be possible to share the code for your own buienradar setup? I too have a pi running (with FHEM) and would like to set this up.

Regards, Wbmk
cygnusx hasn't been active since july 20th, so I wouldn't hold my breath waiting for answers.
As for editing: you can use any ASCII text editor. Syntax highlighting etc., is probably available in Qt's own environment, but also in editors like emacs, eclipse etc.

best,

marcelr
wbmk
Starting Member
Starting Member
Posts: 24
Joined: Sun Nov 13, 2016 5:10 pm

Re: Software: modifications and extensions Toon

Post by wbmk »

@marcelr

Ok, thanx for the info. I will look into this.

Regards, wbmk
BrainHunt
Starting Member
Starting Member
Posts: 23
Joined: Thu Jun 30, 2016 11:37 am

Re: Software: modifications and extensions Toon

Post by BrainHunt »

@Rommon: Thank you for your description of 'baby steps' in qml :D

I tried to follow the steps regarding the MyClock example but unfortunately after killing the gui, the MyClock app doesn't show. I wonder if it has anything to do with the fact that I use Dutch as language on the Toon, is there a chance that the MyClock app is still linked to 'Klok'? Any thoughts where to change this? (e.g. in the language folder?)

@MarcelR: is there a way to open a SFTP channel to the Toon so we can easily copy files to it? (instead of having to vi to create/edit files) Or is there another method that I am missing?
(and thanks for the great work!)
marcelr
Global Moderator
Global Moderator
Posts: 1153
Joined: Thu May 10, 2012 10:58 pm
Location: Ehv

Re: Software: modifications and extensions Toon

Post by marcelr »

BrainHunt wrote:@MarcelR: is there a way to open a SFTP channel to the Toon so we can easily copy files to it? (instead of having to vi to create/edit files) Or is there another method that I am missing?
(and thanks for the great work!)
I uploaded an sftp package for toon to the Downloads thread some months ago. Runs on top of dropbear, and yes, makes life a bit easier for shuttling files to toon and back.
I bumped that topic each time I changed something, so everyone could see something's changed, but apparently that option has been shut down a while ago.

best,

marcelr
BrainHunt
Starting Member
Starting Member
Posts: 23
Joined: Thu Jun 30, 2016 11:37 am

Re: Software: modifications and extensions Toon

Post by BrainHunt »

Great, thanks!

I'll look into it tonight.

Best
BurnoutVmax
Starting Member
Starting Member
Posts: 3
Joined: Mon Nov 21, 2016 10:39 pm

Re: Software: modifications and extensions Toon

Post by BurnoutVmax »

Hacked my "Marktplaats-Toon" on version 3.6.3 and using it from within Domoticz on a Raspberry Pi3... sweet ;-)

Anyone who fixed the "Buienradar/Wheather" widget on a hacked Toon (without a VPN to Eneco)?
wbmk
Starting Member
Starting Member
Posts: 24
Joined: Sun Nov 13, 2016 5:10 pm

Re: Software: modifications and extensions Toon

Post by wbmk »

Did you use the method descibed in the forum to root your toon?

If so, were you able to use a password or the screwdriver method

I am lokking in to rooting my toon
BurnoutVmax
Starting Member
Starting Member
Posts: 3
Joined: Mon Nov 21, 2016 10:39 pm

Re: Software: modifications and extensions Toon

Post by BurnoutVmax »

Yes, no screwdriver needed. The password was doing fine for my boatloader...
RomMon
Starting Member
Starting Member
Posts: 44
Joined: Mon Aug 29, 2016 9:05 pm

Re: Software: modifications and extensions Toon

Post by RomMon »

BrainHunt wrote:@Rommon: Thank you for your description of 'baby steps' in qml :D

I tried to follow the steps regarding the MyClock example but unfortunately after killing the gui, the MyClock app doesn't show. I wonder if it has anything to do with the fact that I use Dutch as language on the Toon, is there a chance that the MyClock app is still linked to 'Klok'? Any thoughts where to change this? (e.g. in the language folder?)
Sorry for the last reply, missed your post.
[I found a typo in my 'goal 1', see at the end of this post for details. Will correct the tutorial also.]

Think we all use the Dutch language on our Toon.
No need to translate. It 'should' work without translation. Without translation, it will just not translate (e.g. 'clock' will stay 'clock' and not become 'klok')
Only annoying thing is that if you make just one silly typo, like missing comma (,), colon (:) or even another typo, the whole tile will not show up.
Unfortunately 'goal 1' needs to be completed in one step to work, but where possible try to do the changes in (even smaller baby) steps.

Another nice example to follow is the following: http://doc.qt.io/qt-4.8/qml-tutorial.html
Also here I had the problem that example 3 didn't show up, and even after a long time staring at the files, I wasn't able to get it working.
Than decided to start all over, and it worked at once (so must have been a stupid typo .. somewhere).

And be aware, maybe I made a typo in my tut. Just read over the steps again, and yes I'm afraid that I put in a wrong commend at the very end.

Code: Select all

add:   "myclock",         just after clock (all small)
is wrong this should be

Code: Select all

add:   "myClock",         just after clock
I will update this now.
BrainHunt
Starting Member
Starting Member
Posts: 23
Joined: Thu Jun 30, 2016 11:37 am

Re: Software: modifications and extensions Toon

Post by BrainHunt »

@RomMon: Thanx, that did the trick!

Empowered by the ' myClock experience', I have also focused on something that I wanted to change for a long time now: change the temperature that is shown to a more precise value instead of the rounding to half degrees.

Looking in the folder ' /HCBv2/qml/apps/thermostat', I found the files that are responsible for the various activities around the thermostat. In the file ' ThermostatApp.qml' the main variables and initiation functions are defined. At line 46, the variable 'thermInfo' is defined which contains a number of properties including ' currentTemp' and 'currentDisplayTemp', but also the current state etc. However the actual showing of the temperature is not in this file.

In the file 'thermostatSidePanel.qml', the right side of the homescreen is drawn, including the current temperature, the buttons to increase/decrease the temperature and showing and selecting the current temp program. At line 58 I found the following code:

Code: Select all

currentTemperature = app.thermInfo['currentDisplayTemp'] / 100.0;
This variable 'currentTemperature' is then used to update when a new temperature is selected by pressing the increase/decrease buttons. As yet I haven't found yet where the actual display command is for this variable (still need to dig deeper in the qml syntax :D ). However for my goal, it was sufficient to change line 58 to the following code:

Code: Select all

currentTemperature = app.thermInfo['currentTemp'] / 100.0;
So in effect using the actual temperature (with one decimal) to show instead of the rounded value.

The only thing you need to be aware of is that with the increase/decrease buttons are programmed in steps of 0.5C. That is probably the reason why Toon shows the temperature in half degrees. It is possible to change the steps to increase/decrease in the file 'thermostatSidePanel.qml'. Around line 373 you can find the settings, looking like:

Code: Select all

			rangeMin: 6.0
			rangeMax: 30.0
			increment: 0.5
			valueSuffix: "°"
Changing the value 'increment' for instance to 0.1 allows more precise setting the desired temperature.

Of course after all changes, don't forget to restart the gui to show the new temperature settings:

Code: Select all

killall -9 qt-gui
Ierlandfan
Member
Member
Posts: 151
Joined: Thu Oct 03, 2013 7:53 pm

Re: Software: modifications and extensions Toon

Post by Ierlandfan »

I am not sure if they use the OT values for anything,I know that you can sign up for a service contract to repair your CV and the error is then automatically send to the repairguys. (At least I think that's how it works)
If we could figure out how boxtalk (well, actually happ_thermstat) is processing the Thermstatinfo we might be able to make the OT data work in 3.6.3 (Or we wait for another version where they hopefully fixed it)
It's nice to know how we can query boxtalk through qml though!
hayman
Starting Member
Starting Member
Posts: 36
Joined: Fri Feb 26, 2016 6:16 pm

Re: Software: modifications and extensions Toon

Post by hayman »

is there a short file how to update hackd toon ... ?
RomMon
Starting Member
Starting Member
Posts: 44
Joined: Mon Aug 29, 2016 9:05 pm

Re: Software: modifications and extensions Toon

Post by RomMon »

@BrainHunt, Nice accomplishment


@hayman, have a look at this post:
http://www.domoticaforum.eu/viewtopic.p ... 150#p77719
Not sure which release you have at the moment, but from this file, and the posts in the pages just before and after this, you can get an understanding of the process.
I upgraded from 2.9.26 to 3.0.29 using this file.
adjego
Starting Member
Starting Member
Posts: 7
Joined: Wed Nov 30, 2016 2:25 pm

Re: Software: modifications and extensions Toon

Post by adjego »

Nice work all!

Was anybody here able to get some klikaanklikuit/domoticz switches working from Toon?
I'm very interested in getting this to work on my Toon aswell.

Already have the Kodi app running and i updated the thermostat settings to show 0.1 resolution instead of 0.5.
Ierlandfan
Member
Member
Posts: 151
Joined: Thu Oct 03, 2013 7:53 pm

Re: Software: modifications and extensions Toon

Post by Ierlandfan »

This wil give you a starting pont (Code is NOT working, just a WIP and to give you some some idea how it probably could be implemented, I copied the code from The KodiRemote app, in the future I want to use the "bedien"tile (On the side when screen is dimmed)

Code: Select all

//
// Domoticz app v0.2 by Ierlandfan, based on KodiRemote app code written by cygnusx
//
import QtQuick 1.1
import BasicUIControls 1.0
import qb.components 1.0


Screen {
 id: root

 screenTitleIconUrl: "drawables/domoticzSystrayIcon.png"
 
 //Edit these settings:
 property string hostName: "192.168.1.63"
 property string portNum: "8080"
 screenTitle: qsTr("Domoticz")
 
  onHidden: {
  screenStateController.screenColorDimmedIsReachable = true;
 // do-something-here-when-screen-is-dimmed
 }
 onShown: {
  
//do-something-here-when-screen-is-no-longer-dimmed 
 
  screenStateController.screenColorDimmedIsReachable = false;
 }
 
 function simpleSynchronous(request) {
  pageThrobber.visible = true;
  var xmlhttp = new XMLHttpRequest();
  xmlhttp.open("PUT", request, true);
  xmlhttp.timeout = 1500;
  xmlhttp.send();
  xmlhttp.onreadystatechange=function() {
   if (xmlhttp.readyState == 4) {
    if (xmlhttp.status == 200) {
     pageThrobber.visible = false;
     if (typeof(functie) !== 'undefined') {
      functie(parameter);
     }
    }
   }
  }
 }
 Throbber {
  id: pageThrobber
  visible: true
  z: 20
  anchors {
   horizontalCenter: parent.horizontalCenter
   verticalCenter: parent.verticalCenter
  }
 }
 StyledRectangle {
  id: light1
  width: nowPlayingImage.width+24
  height: nowPlayingImage.height+24
  radius: 3
  color: colors.background
  opacity: ((nowPlayingImage.height > 0)? 1.0:0.0)
  shadowColor: colors.shadow
  shadowPixelSize: 1
  anchors.top: parent.top
  anchors.left: parent.left
  anchors.leftMargin: 23
  anchors.topMargin: 30
  
  Image {
   id: light1
   source: ""
   width: 220
   height: ((sourceSize.height/sourceSize.width)*width) 
   anchors.top: parent.top
   anchors.left: parent.left
   anchors.leftMargin: 3
   anchors.topMargin: 3
   /*onClicked: {
    console.log("On/Off");
    //On, show image Light On and send command to Domoticz 
simpleSynchronous("http://"+hostName+":"+portNum+"/json.htm?type=command&param=switchlight&idx=99&switchcmd=On");  
   Onbutton.visible = true;
     OffButton.visible = false;
    
    } else {
     //Off, show image Light Off and send command to Domoticz
simpleSynchronous("http://"+hostName+":"+portNum+"/json.htm?type=command&param=switchlight&idx=99&switchcmd=Off");
     OnButton.visible = false;
     OffButton.visible = true;
     
    }

   }*/
Post Reply

Return to “Toon software development”