Toon (eneco) integration with Home Assistant

LOL :).
I actually hooked up the sensors (I have 3 in total) to HASS directly because I felt it’s more reliable than having Toon in between.
But there’s 1 reason why I would like to have the sensors in Toon which is that Toon can also call my mobile, while in Hass I only have Twitter notification and no calling.

Is this instruction still valid for testing?

I’m not very familiar with command line pi stuff so if I can a little bit more detail in what I should do I can test it. Either here or via a personal message is also fine.

If you don’t use virtualenv (if you don’t know if you are then you are not) : pip install toonlib
if you are : mkvirtualenv toonlib && pip install toonlib
After this you need to locate the installation dir. This is very configuration specific (depends on whether you use virtualenv, python2.7 or python3.5 etc) so can’t really help much. If you are using a debian derivative you could do “sudo updatedb && locate toonlib”
Once you locate the directory edit configuration.py of the installed package on line 7 to say “STATE_CACHING_SECONDS = 10” or whatever small number suits you.
After this you can just start a python console and follow the rest of the comments on the previous post.
If you need more details on something ping me. Thanks!

I have uploaded version 0.5.1 of toonlib that has some possible solution for the deauthentication issue. @krocat if you would like to bump the components dependency to that and all, please give the new component a try once @krocat pushes and give feedback here on whether the issue is solved. Thanks!

Done, the master branch on Github now supports smoke detectors and has the 0.5.1 reference for the deauth issue

I just renamed the directories to lower case, do you want to merge that too?

Yes, I was trying to do that, but I don’t think the Windows desktop client for Github detects that as a change. Go ahead. BTW, I see you have a tox.ini in your toonlib repo, can I use that for ToonHA as well? I’ve never used Tox

I guess you could but do you have any tests defined? tox is for running tests on multiple python versions. On this project its there because I am using a cookiecutter template to develop python so everything is setup from scratch. On this project there is no use for tox since I have no tests defined for toonlib. At least not yet :slight_smile:

I’m trying to follow these instructions, but I guess it’s not as simple as just installing Tox and running it. I received an error about an ini missing earlier and then I saw you have one in toonlib. I need to read up on this stuff:

can you say how exactly the smoke detectors are now supported?
I mean, should Hass see them automatically?
And what is reported? Smoke Alarm trigger only? or also burglar alarm (when opening the lid of the detector), heat alarm (when temperature is above a certain threshold) and battery status?

Hass should now detects any detectors that you have connected to your Toon. It works the same way as in the Toon app. You see your detectors with their battery status. You can click the sensor to see the exact type and the last time it connected with your toon for status:

So far no triggers of any kind. I guess we need to test to see if and how this shows up in the api response. There are no obvious fields in the json response. I’ll look to see if there’s documentation on toonapi.com

but so you have also such a detector? can’t you test the triggering then like costas explained?
if you can’t then I can see if I’ll manage to do some tests.

I do and I can, but there’s only so much stuff you can fit in one day :slight_smile: Any ideas on how to trigger the alarm without burning the house down?

ok I see. same here :wink:
I once did it just by burning some paper in a large bowl and keep the sensor right above it.
There’s also smoke in a can but I find it a bit too expensive for a 1 or 2 time test.
One of the cheapest I found online in NL: https://neyfik.com/product/neyfik-rookmelder-test-spray/

@krocat I self merged the changes about the lower case. No code changes anyway… I hope you don’t mind i just wanted the latest code and copying things around becomes tedious pretty soon.

@krocat You have no tests so there is nothing to pass for tox. The linting is according to pep8 but If you want you can intergate the _CI directory of toonlib so you can run lint easily. If you need help let me know. if you want you can use my template https://github.com/costastf/python_library_cookiecutter to build the ToonHA.

Update on the deauthentication issue. I had a few horrible meltdowns where the lib thinks its deauthenticated (because apparently error message “Cannot retrieve common name for client” does not only happen in deauthentication. )So when the library sees that message it does a reset and relogin and recursivelly calls itself, but thanks to uvloop we have concurrent access to the object in an inconsistent state and that leads to a loop of reauthentication requests and other ugly stuff. So, back to the drawing board… For one, I will remove that message as an identification of de authentication and I will wait for something more concrete to hook as an event… @krocat I will create a new version and bump the dependency on ToonHA if thats ok with you…

Hi costas, that’s fine. I will look at cookiecutter

hey all :slight_smile: , can someone help me with this integration ,im kinda new to all of this, but i have a toon and i want this in my home assistant , now i was following the instructions on github but i got stuck :frowning:
https://github.com/opdoffer/toon-homeassistant

What i did:

  1. pasted the toon.py and toonclient.py in my homeassistant folder.
  2. i logged in to my raspberry pi (with hassbian 1,1) and cd to the folder where my toon.py file is.
  3. i did the command: python toon.py install

and here it goes wrong , i get this error:
pi@hassbian:/home/homeassistant/.homeassistant/toon $ python toon.py install
Traceback (most recent call last):
File “toon.py”, line 6, in
import requests
ImportError: No module named requests

what am i doing wrong ? im really new with python/homeassistant so i need dummy language to understand it :stuck_out_tongue: ,

i hope someone can help me with this , you wil be my hero .
thanks

Hi Tim,
That’s old and is not working anymore. We (or actually others than myself :)) are building a new component. You can try this one: https://github.com/krocat/ToonHA/tree/Smart-Plugs-integration

I suggest we start a new topic about this and close this topic referring to the new topic because as you can see it brings confusion to new comers.