Luc-S/Toon-HASS

Settings lost upon restart

Closed this issue · 53 comments

Hi, first of all thanks for a great app!
I have installed the app using the Toon store app on my Toon (4.9.23) and configured my HA setup and two sensors and switches. At first it works fine, I can toggle the switches and see my sensor values.

The strange thing is that after a while (I think after a restart of qt-gui due to memory issues) the app is blank and does not contain anything anymore as if it was never configured. If I look on the filesystem I see the correct userSettings.json and sensors.json etc.

Any idea why this could be happening?

Luc-S commented

I've had this issue when I was building this application and crashed the Toon occasionally with some messed up code :) When the code was sorted I didn't have this issue anymore so maybe you have something running on your Toon that isn't performing as it should be?

I have to look into this to answer why this application isn't able to correctly read it's settings after a crash.

As a workaround you can copy the .json files to a backup_folder and restore them to the app folder on the Toon. After a normal reboot or qt-gui restart the app is fixed without having to reconfigure it.

Hi, thanks for the quick response, I guess it must be something on my Toon as no other users of your app are reporting this issue. Thanks for the workaround tip but the strange thing is that the files are there when the app is blank. I also don't know how to debug it so that makes it hard to troubleshoot the problem.

@sanderdh i have the same issue. but the server settings are present. here is my config file:

sensors.json:

{"Sensor1":"sensor.oprit_temperature","Sensor2":"sensor.oprit_humidity","Sensor3":"sensor.douche_temperature","Sensor4":"sensor.douche_humidity","Sensor5":"","Sensor6":"","Sensor7":"","Sensor8":""}
i use the toonstore app. do i need to try the git version?

@arcidodo I still have not managed to fix this issue. One thing I want to try is to place a script between the toon homeassistant app and the output of the /api/states call on my HA. I thought maybe the output of the /api/states call is big enough to cause memory issues. This script should be able to filter the output to only the sensors/switches I use in the Toon HA app.
I also use the ToonStore app, have not tried the current git version, but I see that I am missing code from (for example) the last commit, so I will give this a try.

@sanderdh did you already try using the git version to fix it? I'm having the exact same issue.

Luc-S commented

I'm looking into this issue. Since I've updated my Toon I can now somewhat reproduce this, still a hit and miss though :)

Anyway, as a quick workaround you can add a little line of code to manually retrieve the settings. On line 214 of file HomeAssistantScreen.qml you will find a MouseArea.onClicked function, there add app.readDefaults(); to the top.

This should be the result (don't copy paste because I think you will mess up the indents):

MouseArea {
        anchors.fill: parent
        onClicked: {
               app.readDefaults();
               app.getSensorInfo();
               app.getSwitchInfo();
               app.setSliderObject();
               app.getAlarmInfo();
        }
}

Now when it failed loading your settings press the HomeAssistant icon in the top right to fire this function. It will look as if nothing happens (or maybe I was just too impatient) but when you enter the settings screen or if you close the app and open it again it should have retrieved your settings again.

Not the nicest way but this was the easiest for a quick workaround... :)

Because this works (for me... please let me know if it doesn't for you), I guess it has something to do with timing. Maybe I can add something like a retry after a few seconds when certain config elements are empty but the userSettings.json does exist.

Luc-S commented

Whoops, wrong button. Closed it by mistake by sending in my previous comment. Opened it again :)

does not work for me, the servers settings looks ok, but the sensors.json is still not loaded. but the sensor entity is still present in the sensors.json file.

@ludocornelissen I installed the git version on my Toon, the issue I currently have is that I am running Toon version 4.15.6 (last version before apps are rolled into one file) and this results in not having QtQuick 2.1 (I have QtQuick 1.1). So I modified all files to use QtQuick 1.1 in the git version and got the app to run. However if I restart qt-gui the app is blank again and I see errors in the qt-gui output:

file:///qmf/qml/apps/homeassistant/HomeassistantScreen.qml:998: TypeError: Result of expression 'JSON.parse(app.homeAssistantSwitch1Info)['attributes']' [undefined] i
s not an object.
file:///qmf/qml/apps/homeassistant/HomeassistantApp.qml:520: Error: Cannot assign [undefined] to QString
file:///qmf/qml/apps/homeassistant/HomeassistantScreen.qml:520: TypeError: Result of expression 'JSON.parse(app.homeAssistantSwitch2Info)['attributes']' [undefined] is not an object.
file:///qmf/qml/apps/homeassistant/HomeassistantApp.qml:525: Error: Cannot assign [undefined] to QString
file:///qmf/qml/apps/homeassistant/HomeassistantScreen.qml:525: TypeError: Result of expression 'JSON.parse(app.homeAssistantSwitch3Info)['attributes']' [undefined] is not an object.
file:///qmf/qml/apps/homeassistant/HomeassistantApp.qml:530: Error: Cannot assign [undefined] to QString
file:///qmf/qml/apps/homeassistant/HomeassistantScreen.qml:530: TypeError: Result of expression 'JSON.parse(app.homeAssistantSwitch4Info)['attributes']' [undefined] is not an object.
file:///qmf/qml/apps/homeassistant/HomeassistantApp.qml:535: Error: Cannot assign [undefined] to QString
file:///qmf/qml/apps/homeassistant/HomeassistantScreen.qml:535: TypeError: Result of expression 'JSON.parse(app.homeAssistantSwitch5Info)['attributes']' [undefined] is not an object.
file:///qmf/qml/apps/homeassistant/HomeassistantApp.qml:540: Error: Cannot assign [undefined] to QString
file:///qmf/qml/apps/homeassistant/HomeassistantScreen.qml:540: TypeError: Result of expression 'JSON.parse(app.homeAssistantSlider1Info)['attributes']' [undefined] is not an object.
file:///qmf/qml/apps/homeassistant/HomeassistantApp.qml:446: TypeError: Result of expression 'JSON.parse(homeAssistantSlider1Info)['attributes']' [undefined] is not an object.
file:///qmf/qml/apps/homeassistant/HomeassistantApp.qml:557: Error: Cannot assign [undefined] to QString
file:///qmf/qml/apps/homeassistant/HomeassistantApp.qml:557: Error: Cannot assign [undefined] to QString

I am not sure if upgrading my Toon to a more recent version will fix these issues but I might give it a try.

Luc-S commented

@arcidodo Just to be sure, this workaround did work for the server settings? Or do you mean that you don’t have any issues regarding the server settings and you only miss the objects?

@sanderdh When I installed the app from the Toon store I noticed that the code was slightly modified. One of the things that got changed was all paths to system files, they were made relative. Maybe that’s a must for the Toon version you’re running?

So instead of file:/// it was something like ./

I’m at work so right now I can’t really help much :)

@Luc-S i have no issues with the server settings, i'm only missing the objects.

when i tail in the qt log i see allot errors messages:

file://qmf/qml/apps/homeassistant/HomeassistantScreen.qml:303: TypeError: Cannot read property 'unit_of_measurement' of undefined file://qmf/qml/apps/homeassistant/HomeassistantScreen.qml:247: TypeError: Cannot read property 'friendly_name' of undefined file://qmf/qml/apps/homeassistant/HomeassistantTile.qml:129: TypeError: Cannot read property 'unit_of_measurement' of undefined file://qmf/qml/apps/homeassistant/HomeassistantTile.qml:114: TypeError: Cannot read property 'friendly_name' of undefined file://qmf/qml/apps/homeassistant/HomeassistantTile.qml:129: TypeError: Cannot read property 'unit_of_measurement' of undefined file://qmf/qml/apps/homeassistant/HomeassistantTile.qml:114: TypeError: Cannot read property 'friendly_name' of undefined file://qmf/qml/apps/homeassistant/HomeassistantScreen.qml:315: TypeError: Cannot read property 'unit_of_measurement' of undefined file://qmf/qml/apps/homeassistant/HomeassistantScreen.qml:258: TypeError: Cannot read property 'friendly_name' of undefined file://qmf/qml/apps/homeassistant/HomeassistantTile.qml:159: TypeError: Cannot read property 'unit_of_measurement' of undefined file://qmf/qml/apps/homeassistant/HomeassistantTile.qml:144: TypeError: Cannot read property 'friendly_name' of undefined file://qmf/qml/apps/homeassistant/HomeassistantTile.qml:159: TypeError: Cannot read property 'unit_of_measurement' of undefined file://qmf/qml/apps/homeassistant/HomeassistantTile.qml:144: TypeError: Cannot read property 'friendly_name' of undefined file://qmf/qml/apps/homeassistant/HomeassistantScreen.qml:327: TypeError: Cannot read property 'unit_of_measurement' of undefined file://qmf/qml/apps/homeassistant/HomeassistantScreen.qml:269: TypeError: Cannot read property 'friendly_name' of undefined file://qmf/qml/apps/homeassistant/HomeassistantScreen.qml:405: TypeError: Cannot read property 'unit_of_measurement' of undefined file://qmf/qml/apps/homeassistant/HomeassistantScreen.qml:351: TypeError: Cannot read property 'friendly_name' of undefined file://qmf/qml/apps/homeassistant/HomeassistantScreen.qml:418: TypeError: Cannot read property 'unit_of_measurement' of undefined file://qmf/qml/apps/homeassistant/HomeassistantScreen.qml:362: TypeError: Cannot read property 'friendly_name' of undefined file://qmf/qml/apps/homeassistant/HomeassistantScreen.qml:430: TypeError: Cannot read property 'unit_of_measurement' of undefined file://qmf/qml/apps/homeassistant/HomeassistantScreen.qml:373: TypeError: Cannot read property 'friendly_name' of undefined file://qmf/qml/apps/homeassistant/HomeassistantScreen.qml:446: TypeError: Cannot read property 'unit_of_measurement' of undefined file://qmf/qml/apps/homeassistant/HomeassistantScreen.qml:384: TypeError: Cannot read property 'friendly_name' of undefined

@Luc-S I have tried both the Toon store version (1.0.3) and the git version (including patches I mentioned) but the behavior is the same. It seems to work until I reboot, then the app is blank.
I also noticed that alot of values have no default, for example the SSL toggle is "" at first and if I toggle it on and off it is "off" maybe that is an issue and why I see the undefined errors?

I would like to debug more myself but a trying things out with a qt-gui restart all the time is really slow. Is there a better way? Can I run/emulate the app on a desktop?

Luc-S commented

@arcidodo These errors are probably caused by not having the sensor attributes loaded correctly. The application tries to retrieve the values from an object, however this object is not in a valid format (because it isn't capable of retrieving the Home Assistant info without the correct attribute names). So these messages should disappear when the objects are correctly loaded from the files.

@sanderdh I think this also applies to your debug output. It's maybe a little different because of your older qml version? So 'file-wise' (the file:///...) it should be OK.

I have never emulated a qml application tbh. I'm also trying to investigate by qt-gui restarts. On newer Toon versions it feels as if it's a tad faster though :)

I don't know if the problems could be caused by not having default values, my first guess was that the application cannot successfully read all files during 'initiation'. However with @arcidodo's feedback I guess this isn't the case as manually forcing the application to read the files does not provide a workaround.

Luc-S commented

I have updated some files for you guys to check out. I'm not sure if it solves the problem but I did see the application pull in all(!) Home Assistant objects and store it in a sensor variable for all empty sensor items. This was of course not how I meant this function to work.

Normally it would send a call using e.g. the sensor.outside_temp sensor to retrieve this specific information. For every empty sensor however the call still seemed to work, but then all Home Assistant object info was retrieved and stored in the application variables...

It's pretty late so I hope there aren't any mayor bugs :)

I shortly tried the code with these changes and the changes I have to make to make it work on my Toon version (QtQuick 1.1) and it still doesn't work. I also tried changing the paths to the json files (userSettings.json for example) from relative to absolute but it still doens't work. Maybe there is another way to open the files then FileIO?

@Luc-S i also tried the changes and it looks like its working! after the reboot the temp/hum sensor data is still present thank you!! (newest firmware 5.2.11)

Luc-S commented

@arcidodo That's great! Glad it solved your problem.

@sanderdh I used the same file read method as the waste collection app uses:

FileIO {                                                                                     
    id: userSettingsFile                                                                 
    source: "./userSettings.json"                                                        
}

...

wasteSettingsJson = JSON.parse(userSettingsFile.read());

I don't have much qml knowledge and a quick Google search also did not present an alternative for FileIO. Does your qt log say something new with these updated files? If I'm not mistaken those logs you previously got should now be gone, maybe it's something else now?

@Luc-S I gave it a shot today and can confirm that the changes you made solve the issue on firmware 5.2.11. However for some reason the switches are now not displayed correctly anymore in the app on my Toon: The buttons are not drawn and names are all displayed on one line on top of eachother. Was this also the case for you @arcidodo?

@Luc-S I gave it a shot today and can confirm that the changes you made solve the issue on firmware 5.2.11. However for some reason the switches are now not displayed correctly anymore in the app on my Toon: The buttons are not drawn and names are all displayed on one line on top of eachother. Was this also the case for you @arcidodo?

@ludocornelissen i use only sensors. I tried an switch and you are right! Same issue here!

Sent with GitHawk

Luc-S commented

@ludocornelissen Well that’s not good... I’m not at my pc right now and I don’t have any time to check this out right now but my first guess would be the return; on line 665 of HomeAssistantApp.qml. I think this isn’t needed and maybe I should call the callback method with a valid empty json to make sure switches and other objects aren’t affected.

I’ll try to look into this asap. Thanks for letting me know and for double checking @arcidodo

Luc-S commented

On the other hand, that return; does make sure the rest of the function isn’t executed which is correct... I’ll think of something tomorrow :)

Edit:
Maybe I’ll have put that entire function in an if/else. If entity == “” then a callback with data that is acceptable for empty objects (without return;), else run the retrieve code as is.

Luc-S commented

I was able to reproduce the issue about having the switches on top of each other and updated the HomeassistantApp.qml. Something about calling the callback("") with an empty string like this broke the code causing the GUI to mess up.

I've changed the callback(""); to a return false; and added an "else" clause for the call to HomeAssistant.

@Luc-S Thanks for looking into it, this solves it for me :)

Luc-S commented

Awesome, thanks for letting me know!

Luc-S commented

@sanderdh Maybe this is something that you can check; While investigating in the 'new user system' issue I realised that at some point I used new switch images which I never added to this Github. They are now available in the drawables folder.

New images:

knob.png
backgroundOff.png
backgroundOn.png

Ok I will add the images. I guess I should update my Toon to a new (or the newest) version as your fixes did not fix my initial problem so it must be related to the old Toon version. How does editing files on Toon work if all apps are just a single file?

Hi all,

i think I do something wrong. I've copied the homeassistant folder to Toon (/qmf/qml/apps), but I cannot add a tile to Toon. I don't see the HomeAssistant tile. I also copied the files over the Toonstore version and then the HomeAssistant tile disappeared.

I want this version installed because I want to get rid of the loosing configuration settings. I'm on Toon version 5.2.11

Luc-S commented

I was a little too excited while cleaning up the app I guess. I removed the 2 old button images but they are still used on the configuration screen. I've added them to the drawables folder again, make sure to copy them to your application folder.

This is a quick fix in regards to these buttons because I will be on holiday soon. When I'm back I'll fix this to how it should be by rewriting these buttons so they are the same as the main screen switches.

Let me know if it helps in resolving the issues.

Luc-S commented

And file EditTextLabel4421.qml was trying to load the old QtQuick 1.1 version instead of 2.1.

Updated this file too.

Oke great. The tile is back again :-).

I finally upgraded my Toon to fw 5.2.11 and downloaded the latest version of this app from git. The good news is that it now finally loads my config after a reboot! The strange thing is I get a big blank box after reboot and if I config two switches they seem to be on top of each other in the layout. Are these known issues?
Screenshot from 2019-05-31 22-26-57
Screenshot from 2019-05-31 22-30-10

Also an option to hide unused items (alarm and scenes in my case) would be nice.

Luc-S commented

These GUI errors appear when there's something wrong loading the app. Most sections that you don't use are hidden already, if it loads correctly :) Are you maybe using old config files with updated app code? Maybe try starting the app without config first to see if it starts OK.

If that's not the case and you also have these issues without older config files, could you maybe check the Toon's Qt log for the error? If you don't know how, here's a post where I have some info: #11 (comment)

I deleted everything and started fresh. I was able to add the sensors and they work but not the switches as they were not saved. I added them by manually adding switches.json. Screen layout is again as in the screenshot of my previous comment.

App related output from the qt log:

qml: TSC found this app to be custom installed: homeassistant qml: ==================================Loading homeassistant app============================ qrc:/apps/homescreen/TileThumbnail.qml:73:3: QML Image: Failed to get image from provider: image://scaled//qmf/qml/apps/homeassistant/drawables/homeAssistant.png qml: Loaded fullscreen file://qmf/qml/apps/homeassistant/HomeassistantConfigurationScreen.qml > HomeassistantConfigurationScreen_QMLTYPE_556(0x1c7a170) qml: stub Widget init for file://qmf/qml/apps/homeassistant/HomeassistantConfigurationScreen.qml qml: Loaded fullscreen file://qmf/qml/apps/homeassistant/HomeassistantScreen.qml > HomeassistantScreen_QMLTYPE_534(0x1cf9c30) qml: stub Widget init for file://qmf/qml/apps/homeassistant/HomeassistantScreen.qml qml: *** added to loadedTilesWidgetInfo: file://qmf/qml/apps/homeassistant/HomeassistantTile.qml qml: Succeeded instantiating tile from file://qmf/qml/apps/homeassistant/HomeassistantTile.qml qml: filterEnabledApps [homescreen,systray,tscSettings,thermostat,clock,settings,systemSettings,thermostatSettings,internetSettings,eMetersSettings,graph,inbox,customerService,domesticHotWater,winwit,weather,benchmark,controlPanel,statusUsage,smokeDetector,boilerstatus,homeassistant,toonstore] file://qmf/qml/apps/homeassistant/HomeassistantScreen.qml:339:23: Unable to assign [undefined] to QString file://qmf/qml/apps/homeassistant/HomeassistantTile.qml:159:10: Unable to assign [undefined] to QString file://qmf/qml/apps/homeassistant/HomeassistantScreen.qml:351:23: Unable to assign [undefined] to QString file://qmf/qml/apps/homeassistant/HomeassistantScreen.qml:429:23: Unable to assign [undefined] to QString file://qmf/qml/apps/homeassistant/HomeassistantScreen.qml:442:23: Unable to assign [undefined] to QString file://qmf/qml/apps/homeassistant/HomeassistantScreen.qml:454:23: Unable to assign [undefined] to QString file://qmf/qml/apps/homeassistant/HomeassistantScreen.qml:466:23: Unable to assign [undefined] to QString file://qmf/qml/apps/homeassistant/HomeassistantApp.qml:435: TypeError: Cannot read property 'max' of undefined This button has no kpiId!!!!!!!!!! fixme!!!!!! pre= "/apps/homeassistant/HomeassistantScreen." , post= "" file://qmf/qml/apps/homeassistant/HomeassistantApp.qml:801: ReferenceError: pass is not defined This button has no kpiId!!!!!!!!!! fixme!!!!!! pre= "/apps/homeassistant/HomeassistantScreen." , post= "" file://qmf/qml/apps/homeassistant/HomeassistantApp.qml:801: ReferenceError: pass is not defined This button has no kpiId!!!!!!!!!! fixme!!!!!! pre= "/apps/homeassistant/HomeassistantScreen." , post= "" file://qmf/qml/apps/homeassistant/HomeassistantApp.qml:801: ReferenceError: pass is not defined This button has no kpiId!!!!!!!!!! fixme!!!!!! pre= "/apps/homeassistant/HomeassistantScreen." , post= "" file://qmf/qml/apps/homeassistant/HomeassistantApp.qml:801: ReferenceError: pass is not defined This button has no kpiId!!!!!!!!!! fixme!!!!!! pre= "/apps/homeassistant/HomeassistantConfigurationScreen." , post= "" file://qmf/qml/apps/homeassistant/HomeassistantApp.qml:435: TypeError: Cannot read property 'max' of undefined This button has no kpiId!!!!!!!!!! fixme!!!!!! pre= "/apps/homeassistant/HomeassistantScreen." , post= "" file://qmf/qml/apps/homeassistant/HomeassistantApp.qml:801: ReferenceError: pass is not defined This button has no kpiId!!!!!!!!!! fixme!!!!!! pre= "/apps/homeassistant/HomeassistantScreen." , post= "" file://qmf/qml/apps/homeassistant/HomeassistantApp.qml:801: ReferenceError: pass is not defined This button has no kpiId!!!!!!!!!! fixme!!!!!! pre= "/apps/homeassistant/HomeassistantScreen." , post= "" file://qmf/qml/apps/homeassistant/HomeassistantApp.qml:801: ReferenceError: pass is not defined This button has no kpiId!!!!!!!!!! fixme!!!!!! pre= "/apps/homeassistant/HomeassistantConfigurationScreen." , post= "" qml: back to file://qmf/qml/apps/homeassistant/HomeassistantConfigurationScreen.qml qml: back to file://qmf/qml/apps/homeassistant/HomeassistantScreen.qml file://qmf/qml/apps/homeassistant/HomeassistantApp.qml:435: TypeError: Cannot read property 'max' of undefined

Luc-S commented

Can you change a line of code in file HomeassistantApp.qml? One of the errors (the one on line 801) is about not being able to work with a given object. The code checks this, however it appears that I cannot use a simple 'pass' statement in a case switch and it breaks the code.

Please change line 801 in file HomeassistantApp.qml:

pass

to:

logText("Unable to work with object type: " + type + ".");
return false;

Is it possible you are using an object that isn't allowed somewhere? You can only configure objects like:
scene.<scene_name>
switch.<switch_name>
input_boolean.<boolean_name>
input_number.<number_name>
alarm_control_panel.<alarm_name>

And don't forget to add the type in front of the object, because it's needed to build the correct call.

I added the line (and set debug to 1) and the result is: Unable to work with object type: .
So type seems to be empty? I used 'switch.tetris' as value for the switch.
Another strange thing is that when I deleted the second switch and looked at switches.json it is still there in the file but not in the gui?

Luc-S commented

Can you change 'type' to 'entity' on line 801? I'm curious what is triggering that call function.

logText("Unable to work with object type: " + type + ".");

to

logText("Unable to work with object type: " + entity + ".");

Strange, it is also empty: I changed the type in the logtext to entity too to make sure I am seeing my code change, so I got:
Unable to work with object entity: .

Luc-S commented

It looks as if the app is unable to read/write the switch.json and therefor leaves all switch variables empty. You did say that you started clean right? And the app did create a switch.json for you?

Yes I copied a fresh git clone to my Toon, I even renamed the folder in case the software should have issues working with the symlink. I am using legacy authentication by the way. I also have two sensors added to the app and they are working nicely now, even after restarting qt-qui.

Luc-S commented

Ok, let me quickly fire up a legacy login to see if I can reproduce some of these issues.

Just to be sure, the app uses some hardcoded file locations, make sure that you use the correct folder from where the app is loaded:

E.g. for the switches.json
"file:///HCBv2/qml/apps/homeassistant/switches.json"

yeah I got the file at /HCBv2/qml/apps/homeassistant/switches.json

Should I switch to token auth instead?

Luc-S commented

I don't think it will make a difference. Can you check the file permissions with 'ls -l'?

I just updated to 5.2.11 (I was on 5.0.4) and will now try to start over with the files on GitHub using legacy. Let's see :)

Luc-S commented

Ok, maybe it does help using the token in the meantime. I got the issues reproduced :p

I have:

/qmf/qml/apps/homeassistant# ls -la
drwxr-xr-x    4 root     root          1712 Jun  1 21:42 .
drwxrwxr-x   35 root     root          2680 Jun  1 20:22 ..
-rw-r--r--    1 root     root          1797 May 31 22:54 EditTextLabel4421.qml
-rw-r--r--    1 root     root          8552 May 31 22:58 EditTextLabel4421.qmlc
-rw-r--r--    1 root     root         29369 Jun  1 21:41 HomeassistantApp.qml
-rw-r--r--    1 root     root         42296 Jun  1 21:42 HomeassistantApp.qmlc
-rw-r--r--    1 root     root         34592 May 31 22:54 HomeassistantConfigurationScreen.qml
-rw-r--r--    1 root     root         68436 May 31 22:58 HomeassistantConfigurationScreen.qmlc
-rw-r--r--    1 root     root         72475 May 31 22:54 HomeassistantScreen.qml
-rw-r--r--    1 root     root        143132 May 31 22:58 HomeassistantScreen.qmlc
-rw-r--r--    1 root     root          4216 May 31 22:54 HomeassistantTile.qml
-rw-r--r--    1 root     root         17584 May 31 22:58 HomeassistantTile.qmlc
-rw-r--r--    1 root     root            23 May 31 22:58 alarm.json
drwxr-xr-x    2 root     root          1944 May 31 22:54 drawables
drwxr-xr-x    2 root     root          1952 May 31 22:54 lang
-rw-r--r--    1 root     root           112 May 31 22:54 qmldir
-rw-r--r--    1 root     root            49 Jun  1 21:42 scenes.json
-rw-r--r--    1 root     root           167 Jun  1 21:42 sensors.json
-rw-r--r--    1 root     root            14 Jun  1 21:42 sliders.json
-rw-r--r--    1 root     root            98 May 31 23:16 switches.json
-rw-r--r--    1 root     root             0 May 31 23:00 token.txt
-rw-r--r--    1 root     root            86 Jun  1 21:42 userSettings.json

In my /qmf/qml/apps/homeassistant-1.0.3 folder I also have files that I don't have in the folder listed above, like sensorInfo.json and switchInfo.json. Is that correct? Thanks again for al your effort btw!

Luc-S commented

When I'm running a newer version than on the ToonStore I uninstall the app from the ToonStore, remove all files from that app and add the folder from GitHub. That way I don't have a HomeAssistant-1.0.3 folder.

I'm not sure if the installation is now interfering with the newer files tbh.

These are my files (and I'm experiencing errors too... so maybe yours are fine as well):

drwxr-xr-x    4 root     root          1784 Jun  1 22:53 .
drwxrwxr-x   34 root     root          2744 Jun  1 22:43 ..
-rwxr-xr-x    1 root     root         10244 Jun  1 22:43 .DS_Store
-rwxr-xr-x    1 root     root          1797 Jun  1 22:43 EditTextLabel4421.qml
-rw-r--r--    1 root     root          8552 Jun  1 22:45 EditTextLabel4421.qmlc
-rwxr-xr-x    1 root     root         29281 Jun  1 22:50 HomeassistantApp.qml
-rw-r--r--    1 root     root         42172 Jun  1 22:53 HomeassistantApp.qmlc
-rwxr-xr-x    1 root     root         34592 Jun  1 22:43 HomeassistantConfigurationScreen.qml
-rw-r--r--    1 root     root         68436 Jun  1 22:45 HomeassistantConfigurationScreen.qmlc
-rwxr-xr-x    1 root     root         72475 Jun  1 22:43 HomeassistantScreen.qml
-rw-r--r--    1 root     root        143132 Jun  1 22:45 HomeassistantScreen.qmlc
-rwxr-xr-x    1 root     root          4216 Jun  1 22:43 HomeassistantTile.qml
-rw-r--r--    1 root     root         17584 Jun  1 22:45 HomeassistantTile.qmlc
-rw-r--r--    1 root     root            23 Jun  1 22:48 alarm.json
drwxr-xr-x    2 root     root          1944 Jun  1 22:43 drawables
drwxr-xr-x    2 root     root          1952 Jun  1 22:43 lang
-rwxr-xr-x    1 root     root           112 Jun  1 22:43 qmldir
-rw-r--r--    1 root     root            49 Jun  1 22:54 scenes.json
-rw-r--r--    1 root     root           118 Jun  1 22:54 sensors.json
-rw-r--r--    1 root     root            14 Jun  1 22:54 sliders.json
-rw-r--r--    1 root     root            81 Jun  1 22:48 switches.json
-rw-r--r--    1 root     root             0 Jun  1 22:45 token.txt
-rw-r--r--    1 root     root           109 Jun  1 22:54 userSettings.json

No problem :) I'd like to know were I messed up :p

I created a token and added it to token.txt and I can read the sensors (gosh the attic is hot right now...) but the app still behaves the same...

Screenshot from 2019-06-02 01-18-08

Luc-S commented

Hmm that's too bad. I just tried this myself to see if it worked and I did have to close the app and open it again to sort off refresh the screen and it was OK. However I only had 1 sensor and 1 switch.

Hmm I am doing a 'close and reopen' bu runnig killall qt-gui or is there a better way? I will give it another try in the morning.

Luc-S commented

Don't have a quick fix sadly. Try turning on legacy and save, then legacy back off and save. Close the app and then open. I know... what the f, but that's just what I did and it's late... :)

Luc-S commented

I've made some changes in the HomeassistantApp.qml to fix the errors you got in your log. Something was going wrong loading unused objects.

Try it out when you get the time and let me know what happens :) I've updated the file on GitHub.

I pulled in your changes and copied them over and restarted qt-gui and it actually works fine now! The buttons render correctly now and they actually work! Thanks!
Still using token auth by the way.

Luc-S commented

That’s great! Thanks for helping out debugging 👍