Toon app: Home Assistant controller

Forum about forum-provided applications on Toon

Moderators: marcelr, TheHogNL, Toonz, TerrorSource

Post Reply
Luc_S
Starting Member
Starting Member
Posts: 45
Joined: Tue Jun 05, 2018 6:57 pm

Toon app: Home Assistant controller

Post 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!
TheHogNL
Forum Moderator
Forum Moderator
Posts: 2034
Joined: Sun Aug 20, 2017 8:53 pm

Re: Toon app: Home Assistant controller

Post by TheHogNL »

Very nice one! Should be included in the toonstore!
Member of the Toon Software Collective
marcelr
Global Moderator
Global Moderator
Posts: 1152
Joined: Thu May 10, 2012 10:58 pm
Location: Ehv

Re: Toon app: Home Assistant controller

Post 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?
Luc_S
Starting Member
Starting Member
Posts: 45
Joined: Tue Jun 05, 2018 6:57 pm

Re: Toon app: Home Assistant controller

Post 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.
michel30
Member
Member
Posts: 261
Joined: Fri Aug 25, 2017 4:42 pm

Re: Toon app: Home Assistant controller

Post by michel30 »

Hello,

This looks nice,

Does it also works with domoticz? or do you need the real home assistant program?
TheHogNL
Forum Moderator
Forum Moderator
Posts: 2034
Joined: Sun Aug 20, 2017 8:53 pm

Re: Toon app: Home Assistant controller

Post by TheHogNL »

If you can produce this, then to me you are a coder :D nothing less than the coders at Quby anyway :lol:
Member of the Toon Software Collective
marcelr
Global Moderator
Global Moderator
Posts: 1152
Joined: Thu May 10, 2012 10:58 pm
Location: Ehv

Re: Toon app: Home Assistant controller

Post 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.
TheHogNL
Forum Moderator
Forum Moderator
Posts: 2034
Joined: Sun Aug 20, 2017 8:53 pm

Re: Toon app: Home Assistant controller

Post 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)
Member of the Toon Software Collective
marcelr
Global Moderator
Global Moderator
Posts: 1152
Joined: Thu May 10, 2012 10:58 pm
Location: Ehv

Re: Toon app: Home Assistant controller

Post 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?
Luc_S
Starting Member
Starting Member
Posts: 45
Joined: Tue Jun 05, 2018 6:57 pm

Re: Toon app: Home Assistant controller

Post 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).
marcelr
Global Moderator
Global Moderator
Posts: 1152
Joined: Thu May 10, 2012 10:58 pm
Location: Ehv

Re: Toon app: Home Assistant controller

Post 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.
marcelr
Global Moderator
Global Moderator
Posts: 1152
Joined: Thu May 10, 2012 10:58 pm
Location: Ehv

Re: Toon app: Home Assistant controller

Post 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.
Luc_S
Starting Member
Starting Member
Posts: 45
Joined: Tue Jun 05, 2018 6:57 pm

Re: Toon app: Home Assistant controller

Post 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
marcelr
Global Moderator
Global Moderator
Posts: 1152
Joined: Thu May 10, 2012 10:58 pm
Location: Ehv

Re: Toon app: Home Assistant controller

Post 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).
Luc_S
Starting Member
Starting Member
Posts: 45
Joined: Tue Jun 05, 2018 6:57 pm

Re: Toon app: Home Assistant controller

Post 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 :)
Last edited by Luc_S on Sun Jun 17, 2018 10:02 pm, edited 1 time in total.
Post Reply

Return to “Toon Apps”