Toon app: Home Assistant controller

Forum about the tweaking of the Eneco Toon.

Moderator: marcelr

Re: Toon app: Home Assistant controller

Postby TerrorSource » Sun Jun 17, 2018 8:33 pm

I've installed Home Assistant Controller as a test on my Toon and the icon in the Tile stays blue-colored in dim-state.
Maybe you can change that into a grey toned one? like Sonos-app has?
TerrorSource
Member
Member
 
Posts: 108
Joined: May 2017

Re: Toon app: Home Assistant controller

Postby Luc_S » Sun Jun 17, 2018 9:46 pm

TerrorSource wrote:I've installed Home Assistant Controller as a test on my Toon and the icon in the Tile stays blue-colored in dim-state.
Maybe you can change that into a grey toned one? like Sonos-app has?

I'm not familiar with the Sonos-app dim-state icon but I did create a grey-style Home Assistant icon and added this to the latest update on GitHub :)
Luc_S
Starting Member
Starting Member
 
Posts: 15
Joined: June 2018

Re: Toon app: Home Assistant controller

Postby Toonz » Mon Jun 18, 2018 8:18 am

Luc_S wrote:I'm not familiar with the Sonos-app dim-state icon but I did create a grey-style Home Assistant icon and added this to the latest update on GitHub :)


you basically have to create two versions of each icon, one coloured one for normal state and one for the dim state (grey).
In your tile you can test whether you are in dim state or not (see other apps for examples).
Toonz
Advanced Member
Advanced Member
 
Posts: 608
Joined: December 2016

Re: Toon app: Home Assistant controller

Postby Rudolf » Mon Jun 18, 2018 10:00 am

Thanks for putting this together, I'm using emulated_hue to control (switches in) HASS, but this looks neat. Very promising development, impressive work for a non-coder.

Will try this when an updated version hits the stores. (or maybe even sooner :D )

As an alternative for using a Tile to open the app, may I suggest using an icon in the notification bar (as ToonStore and DashTicz do)

Here's an example in code:
https://github.com/Dashticz/dashticz_to ... czTray.qml
*App.xml seems to refer to it too:
https://github.com/Dashticz/dashticz_to ... iczApp.qml
Don't know if any other modifications are required.

michel30 wrote:Hello,

This looks nice,

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


Isn't DashTicz for Toon what you're looking for:
https://www.domoticaforum.eu/viewtopic.php?f=87&t=11882
Rudolf
Member
Member
 
Posts: 63
Joined: December 2017

Re: Toon app: Home Assistant controller

Postby Luc_S » Tue Jun 19, 2018 7:25 pm

Rudolf wrote:As an alternative for using a Tile to open the app, may I suggest using an icon in the notification bar (as ToonStore and DashTicz do)

I'll put it on the wishlist. I was hoping to be able to add some sensor info to the tile so you didn't have to open the app for some key values, that's why I started with a tile :)


Atm I'm trying to make it communicate with Home Assistant on SSL. For some reason I'm unable to make it work. Home Assistant is running on a valid certificate (using Let's encrypt combined with DuckDNS). The generated fullchain certificate is added to my Toon but it's still giving me 'Unable to locally verify the issuer's authority.'.

This is what I did:
1. Copied the generated fullchain.pem to Toon's directories as files:
    a. /etc/ssl/certs/fullchain.pem
    b. /usr/share/ca-certificates/fullchain.crt
Yes they both are exactly the same files.

2. Then I added 'fullchain.crt' to the bottom of file '/etc/ca-certificates.conf'
3. Ran command 'update-ca-certificates'.

Now I see the .pem and .crt files linked:
Code: Select all
lrwxrwxrwx    1 root     root            40 Jun 15 18:28 fullchain.pem -> /usr/share/ca-certificates/fullchain.crt


When trying to wget the main Home Assistant api XML I get the error 'Unable to locally verify the issuer's authority.'. In the custom app I get no responseText whatsoever.

Anyone an idea what's going wrong here?
Luc_S
Starting Member
Starting Member
 
Posts: 15
Joined: June 2018

Re: Toon app: Home Assistant controller

Postby Toonz » Tue Jun 19, 2018 10:19 pm

Luc_S wrote:Anyone an idea what's going wrong here?

have you used all ssl options in the wget call (see wget --help for help)?
Toonz
Advanced Member
Advanced Member
 
Posts: 608
Joined: December 2016

Re: Toon app: Home Assistant controller

Postby Luc_S » Wed Jun 20, 2018 7:13 pm

Toonz wrote:
Luc_S wrote:Anyone an idea what's going wrong here?

have you used all ssl options in the wget call (see wget --help for help)?

Not all but I did try the following:

wget --ca-directory=/etc/ssl/certs https://xxx.duckdns.org/api/states?api_password=xxx
Resolving xxx.duckdns.org... x.x.x.x
Connecting to xxx.duckdns.org|x.x.x.x|:443... connected.
ERROR: cannot verify xxx.duckdns.org's certificate, issued by `/C=US/O=Let\'s Encrypt/CN=Let\'s Encrypt Authority X3':
Unable to locally verify the issuer's authority.
To connect to xxx.duckdns.org insecurely, use `--no-check-certificate'.

wget --ca-directory=/usr/share/ca-certificates https://xxx.duckdns.org/api/states?api_password=xxx
Resolving xxx.duckdns.org... x.x.x.x
Connecting to xxx.duckdns.org|x.x.x.x|:443... connected.
ERROR: cannot verify xxx.duckdns.org's certificate, issued by `/C=US/O=Let\'s Encrypt/CN=Let\'s Encrypt Authority X3':
Unable to locally verify the issuer's authority.
To connect to xxx.duckdns.org insecurely, use `--no-check-certificate'.

wget --certificate=/etc/ssl/certs/fullchain.pem https://xxx.duckdns.org/api/states?api_password=xxx
OpenSSL: error:0906D06C:PEM routines:PEM_read_bio:no start line
OpenSSL: error:140B0009:SSL routines:SSL_CTX_use_PrivateKey_file:PEM lib
Disabling SSL due to encountered errors.

wget --certificate=/usr/share/ca-certificates/fullchain.crt https://xxx.duckdns.org/api/states?api_password=xxx
OpenSSL: error:0906D06C:PEM routines:PEM_read_bio:no start line
OpenSSL: error:140B0009:SSL routines:SSL_CTX_use_PrivateKey_file:PEM lib
Disabling SSL due to encountered errors.

wget --certificate=/etc/ssl/certs/fullchain.pem --certificate-type=PEM --private-key=/etc/ssl/certs/fullchain_key.pem --private-key-type=PEM --secure-protocol=SSLv2 https://xxx.duckdns.org/api/states?api_password=xxx
Resolving xxx.duckdns.org... x.x.x.x
Connecting to xxx.duckdns.org|x.x.x.x|:443... connected.
Unable to establish SSL connection.
Luc_S
Starting Member
Starting Member
 
Posts: 15
Joined: June 2018

Re: Toon app: Home Assistant controller

Postby marcelr » Wed Jun 20, 2018 8:19 pm

Toon's native wget doesn't support ssl. You will need the version from the forum ftp server to get that working ...
marcelr
Advanced Member
Advanced Member
 
Posts: 840
Joined: May 2012
Location: Ehv

Re: Toon app: Home Assistant controller

Postby Luc_S » Wed Jun 20, 2018 8:44 pm

marcelr wrote:Toon's native wget doesn't support ssl. You will need the version from the forum ftp server to get that working ...

Ah ok, should I be spending time to get wget working? I was troubleshooting wget because it gave me some errors to work with. In the app (where it is needed) I'm getting a status 0 with an empty responseText :roll:

A simple curl command is giving me the response I expect so I should be very close right? :D
Code: Select all
curl 'https://xxx.duckdns.org/api/states?api_password=xxx'


[Edit]:
I did a "update-ca-certificates --fresh" and a reboot of my Toon and it appears to be working!

[Edit 2]:
In the end this is what is now configured on my Toon, no clue if everything is needed but it works so I'm not changing it :P
My certificate structure looks like this:
DST Root CA X3 (Root certificate authority)
----> Let's Encrypt Authority X3 (Intermediate certificate authority)
---- ----> xxx.duckdns.org (Certificate)

    1. I copied all 3 certificates to /etc/ssl/certs/ with a .pem extension and to /usr/share/ca-certificates/ with a .crt extension (I kept names exactly the same apart from the file extensions).
    2. I added the .crt filenames to /etc/ca-certificates.conf (last 3 lines)
Code: Select all
# Lines starting with # will be ignored
# Lines starting with ! will remove certificate on next update
#
...
...
DST_Root_CA_X3.crt
xxx_duckdns_org.crt
LE_Authority_X3.crt

    3. Ran command 'update-ca-certificates --fresh'. A 'ls -l' command in folder /etc/ssl/certs/ now gives the following certificates and references;
Code: Select all
lrwxrwxrwx    1 root     root    45 Jun 20 19:41 DST_Root_CA_X3.pem -> /usr/share/ca-certificates/DST_Root_CA_X3.crt
lrwxrwxrwx    1 root     root    46 Jun 20 19:41 LE_Authority_X3.pem -> /usr/share/ca-certificates/LE_Authority_X3.crt
lrwxrwxrwx    1 root     root    52 Jun 20 19:41 xxx_duckdns_org.pem -> /usr/share/ca-certificates/xxx_duckdns_org.crt

    4. I did a reboot of Toon and the app now works as expected with Home Assistant on SSL :)
Luc_S
Starting Member
Starting Member
 
Posts: 15
Joined: June 2018

Re: Toon app: Home Assistant controller

Postby Luc_S » Wed Jun 27, 2018 9:05 pm

Hey all, I completed adding some sensor info to the tile. The first 3 configured sensors will be shown on the tile.

Because now I have more than 4 tiles I want on the main tile window, I added a date/time style tile option :) (this can be turned off, in that case the Home Assistant icon will be centered and still available in dim-state as grey styled icon).

[Edit]:
Sensor info will now also automatically refresh every minute, this to make sure the sensor info shown on the tile is kinda up-to-date :P

Image

Image
Luc_S
Starting Member
Starting Member
 
Posts: 15
Joined: June 2018

Re: Toon app: Home Assistant controller

Postby timkoers » Thu Jun 28, 2018 5:50 pm

Are self signed certificates supported?

I've got an instance running self signed certificates, but it doesn't seem to connect.


Btw, you are an absolute hero making this app.
I'll see if I can contribute to the app on GitHub :D
timkoers
Starting Member
Starting Member
 
Posts: 3
Joined: June 2018

Re: Toon app: Home Assistant controller

Postby marcelr » Fri Jun 29, 2018 12:01 am

timkoers wrote:Are self signed certificates supported?

I've got an instance running self signed certificates, but it doesn't seem to connect.

AFAIK, No. :-(
marcelr
Advanced Member
Advanced Member
 
Posts: 840
Joined: May 2012
Location: Ehv

Re: Toon app: Home Assistant controller

Postby timkoers » Tue Jul 03, 2018 8:28 pm

So I followed the duckdns tutorial and everything seems to be working as it should.
When I add the server to the Toon app, it shows Settings not saved, got response ""

How do I fix that issue?

Since Let's Encrypt certificate last for 90 days, do I need to update the certificates on the Toon every 90 days as well?
timkoers
Starting Member
Starting Member
 
Posts: 3
Joined: June 2018

Re: Toon app: Home Assistant controller

Postby Luc_S » Wed Jul 11, 2018 10:08 pm

Tbh I have been trying to make ssh work on the Toon for days. In the end I got it working as I described. Make sure to enter the duckdns url in the app <domain>.duckdns.org with port 443.

About updating the certificates, good question, I don't know. I'm not really familiar with SSH, I needed it on my HASS because I bought an Echo Dot which I wanted to use with my home automation.
Luc_S
Starting Member
Starting Member
 
Posts: 15
Joined: June 2018

Re: Toon app: Home Assistant controller

Postby Rudolf » Thu Jul 12, 2018 7:23 am

I highly doubt that; the only cert Toon has to trust is the root-certificate (the cert of the certificate authority - ca). As long as that certificate is valid, Toon will accept certificates derived from this ca.
It might the confusing that the cert is called 'xxx_duckdns_org.crt', makes me believe it's specific for that xxx-domain, but I don't think it is.

Here's a more accurate description:
https://support.dnsimple.com/articles/w ... rtificate/
Rudolf
Member
Member
 
Posts: 63
Joined: December 2017

Previous

Return to Eneco Toon as Domotica controller

Who is online

Users browsing this forum: No registered users and 1 guest