Toon app: Home Assistant controller

Forum about forum-provided applications on Toon

Moderator: marcelr

Toon app: Home Assistant controller

Postby Luc_S » Fri Jun 15, 2018 9:49 pm

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!
Luc_S
Starting Member
Starting Member
 
Posts: 25
Joined: June 2018

Re: Toon app: Home Assistant controller

Postby TheHogNL » Sat Jun 16, 2018 10:47 am

Very nice one! Should be included in the toonstore!
TheHogNL
Member
Member
 
Posts: 491
Joined: August 2017

Re: Toon app: Home Assistant controller

Postby marcelr » Sat Jun 16, 2018 11:16 am

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?
marcelr
Advanced Member
Advanced Member
 
Posts: 934
Joined: May 2012
Location: Ehv

Re: Toon app: Home Assistant controller

Postby Luc_S » Sat Jun 16, 2018 12:05 pm

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.
Luc_S
Starting Member
Starting Member
 
Posts: 25
Joined: June 2018

Re: Toon app: Home Assistant controller

Postby michel30 » Sat Jun 16, 2018 2:40 pm

Hello,

This looks nice,

Does it also works with domoticz? or do you need the real home assistant program?
michel30
Member
Member
 
Posts: 174
Joined: August 2017

Re: Toon app: Home Assistant controller

Postby TheHogNL » Sat Jun 16, 2018 7:24 pm

If you can produce this, then to me you are a coder :D nothing less than the coders at Quby anyway :lol:
TheHogNL
Member
Member
 
Posts: 491
Joined: August 2017

Re: Toon app: Home Assistant controller

Postby marcelr » Sat Jun 16, 2018 9:50 pm

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.
marcelr
Advanced Member
Advanced Member
 
Posts: 934
Joined: May 2012
Location: Ehv

Re: Toon app: Home Assistant controller

Postby TheHogNL » Sat Jun 16, 2018 10:54 pm

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)
TheHogNL
Member
Member
 
Posts: 491
Joined: August 2017

Re: Toon app: Home Assistant controller

Postby marcelr » Sun Jun 17, 2018 7:41 am

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?
marcelr
Advanced Member
Advanced Member
 
Posts: 934
Joined: May 2012
Location: Ehv

Re: Toon app: Home Assistant controller

Postby Luc_S » Sun Jun 17, 2018 10:03 am

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).
Luc_S
Starting Member
Starting Member
 
Posts: 25
Joined: June 2018

Re: Toon app: Home Assistant controller

Postby marcelr » Sun Jun 17, 2018 11:02 am

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
Advanced Member
Advanced Member
 
Posts: 934
Joined: May 2012
Location: Ehv

Re: Toon app: Home Assistant controller

Postby marcelr » Sun Jun 17, 2018 11:31 am

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.
marcelr
Advanced Member
Advanced Member
 
Posts: 934
Joined: May 2012
Location: Ehv

Re: Toon app: Home Assistant controller

Postby Luc_S » Sun Jun 17, 2018 12:38 pm

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
Luc_S
Starting Member
Starting Member
 
Posts: 25
Joined: June 2018

Re: Toon app: Home Assistant controller

Postby marcelr » Sun Jun 17, 2018 12:45 pm

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).
marcelr
Advanced Member
Advanced Member
 
Posts: 934
Joined: May 2012
Location: Ehv

Re: Toon app: Home Assistant controller

Postby Luc_S » Sun Jun 17, 2018 5:59 pm

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 9:02 pm, edited 1 time in total.
Luc_S
Starting Member
Starting Member
 
Posts: 25
Joined: June 2018

Next

Return to Toon Apps

Who is online

Users browsing this forum: No registered users and 1 guest