Page 1 of 8

Toon app: Home Assistant controller

Posted: Fri Jun 15, 2018 10:49 pm
by Luc_S
Hey guys, as requested in the 'Software: modifications and extensions Toon' topic (domoticaforum.eu/viewtopic.php?f=87& ... 285#p86598) I started a new topic for telling you all a bit about a new Toon app I have been creating.

My goal was to have some functionalities of Home Assistant available through my Toon. You can check out the result on the url below. Don't expect the code to be top notch, still learning and I expect to have more questions for you then the other way around :D

https://github.com/Luc-S/Toon-HASS

Because everyone is running a different configuration in Home Assistant I tried to make is as generic as possible. For now it supports;
  • 8 sensors
    4 scenes
    1 input_number (max 6 options)
    5 switches
    1 custom alarm panel
Image

Cheers!

Re: Toon app: Home Assistant controller

Posted: Sat Jun 16, 2018 11:47 am
by TheHogNL
Very nice one! Should be included in the toonstore!

Re: Toon app: Home Assistant controller

Posted: Sat Jun 16, 2018 12:16 pm
by marcelr
TheHogNL wrote:Very nice one! Should be included in the toonstore!
OK, will package it. Version number will be 1.0.0, is that OK?

Re: Toon app: Home Assistant controller

Posted: Sat Jun 16, 2018 1:05 pm
by Luc_S
marcelr wrote:
TheHogNL wrote:Very nice one! Should be included in the toonstore!
OK, will package it. Version number will be 1.0.0, is that OK?
Cool! I must say that I haven’t spend hours in testing the app yet but I’m confident it’s good enough for a first version :)

And btw, any coding tips and tricks are welcome! Right now I’m trying to make it work with Home Assistant on SSL.

Re: Toon app: Home Assistant controller

Posted: Sat Jun 16, 2018 3:40 pm
by michel30
Hello,

This looks nice,

Does it also works with domoticz? or do you need the real home assistant program?

Re: Toon app: Home Assistant controller

Posted: Sat Jun 16, 2018 8:24 pm
by TheHogNL
If you can produce this, then to me you are a coder :D nothing less than the coders at Quby anyway :lol:

Re: Toon app: Home Assistant controller

Posted: Sat Jun 16, 2018 10:50 pm
by marcelr
TheHogNL wrote:If you can produce this, then to me you are a coder :D nothing less than the coders at Quby anyway :lol:
+1

I packaged it, with a few minor patches to make the packager happy, will run some tests tomorrow, and then it will be available for everyone as a toonstore package.

Re: Toon app: Home Assistant controller

Posted: Sat Jun 16, 2018 11:54 pm
by TheHogNL
marcelr wrote:
TheHogNL wrote:If you can produce this, then to me you are a coder :D nothing less than the coders at Quby anyway :lol:
+1

I packaged it, with a few minor patches to make the packager happy, will run some tests tomorrow, and then it will be available for everyone as a toonstore package.
And ofcourse you proposed your minor patches as a pull request on github? 8)

Re: Toon app: Home Assistant controller

Posted: Sun Jun 17, 2018 8:41 am
by marcelr
Github? Isn't that Microsoft-owned as of late?

The only change is in the name: homeAssistant has become homeassistant, because the packager won't take capitals in a package name.

There's still quite some stuff to be handled for the app to become update proof. Files are being generated based on user settings, and I bet you want to keep these over updates. That needs fixing in the installer.
Installation works (from a toonstore test repo), but I don't see anything happening on my 4.13.7 toon. Is there a tile to be added to the tiles menu? Or an extra icon in the systray?

Re: Toon app: Home Assistant controller

Posted: Sun Jun 17, 2018 11:03 am
by Luc_S
michel30 wrote:Hello,

This looks nice,

Does it also works with domoticz? or do you need the real home assistant program?
I'm not familiar with the domoticz api and responsecodes etc., but I'm sure it doesn't work with domoticz right now. It shouldn't be too complicated for someone to rebuild the the api functions for it to support other platforms.

marcelr wrote:Github? Isn't that Microsoft-owned as of late?

The only change is in the name: homeAssistant has become homeassistant, because the packager won't take capitals in a package name.

There's still quite some stuff to be handled for the app to become update proof. Files are being generated based on user settings, and I bet you want to keep these over updates. That needs fixing in the installer.
Installation works (from a toonstore test repo), but I don't see anything happening on my 4.13.7 toon. Is there a tile to be added to the tiles menu? Or an extra icon in the systray?
If you guys need my help in any way to help out with getting this into the toonstore let me know :) You have to manually add a tile to the main tile menu (at least that's how it worked on my Toon without using a toonstore installation).

Re: Toon app: Home Assistant controller

Posted: Sun Jun 17, 2018 12:02 pm
by marcelr
Just added two pull requests to Github. Not sure if it's any good (I never touch the stuff).
The App file needs renaming to HomeassistantApp.qml, and this should also be edited in qmldir and the file itself.

Will repackage now and make the app available to all.

Re: Toon app: Home Assistant controller

Posted: Sun Jun 17, 2018 12:31 pm
by marcelr
One more thing: The installation directory is/needs to be called /HCBv2/qml/apps/homeassistant. Please edit your code accordingly, for the json file paths.

Re: Toon app: Home Assistant controller

Posted: Sun Jun 17, 2018 1:38 pm
by Luc_S
marcelr wrote:One more thing: The installation directory is/needs to be called /HCBv2/qml/apps/homeassistant. Please edit your code accordingly, for the json file paths.
Is there an easy way to change the folder name on Github? I thought this would be easy enough to quickly fix on my phone but... I'll have to look into this when I get home :P

I'm not really familiar yet with Github :D

Re: Toon app: Home Assistant controller

Posted: Sun Jun 17, 2018 1:45 pm
by marcelr
The folder name is not a big issue, as long as the file names are correct.
homeassistant-1.0.0 is now available for testing, from the toonstore.

To Do: make settings files persistent over versions. (is a matter of adapting the installer, nothing to do with the app itself).

Re: Toon app: Home Assistant controller

Posted: Sun Jun 17, 2018 6:59 pm
by Luc_S
After these changes I thought I would update my own app with the new files. For some reason the app wouldn't load anymore (no option to add homeAssistant to the tile menu anymore), I'm looking into it :)

[Edit]:
I couldn't figure out why but I had to change 2 filenames back to their original names:
1. HomeassistantScreen.qml back to HomeAssistantScreen.qml
2. HomeassistantConfigurationScreen.qml back to HomeAssistantConfigurationScreen.qml

Of course also the corresponding references needed to be reverted in the HomeassistantApp.qml:

Code: Select all

property url homeAssistantScreenUrl : "HomeAssistantScreen.qml"
...
property url homeAssistantConfigurationScreenUrl : "HomeAssistantConfigurationScreen.qml"
If anyone knows why please let me know, then we can process this name change. For now I hope I'm not breaking anyone else's work :)

[Edit 2]:
Already fixed by latest pull request :)