Tellstick zNet Litev2 Local client, almost done...

Moderator: Telldus

Post Reply
kamsvag
Posts: 63
Joined: Thu Jan 18, 2018 11:08 am

Tellstick zNet Litev2 Local client, almost done...

Post by kamsvag » Thu Jan 18, 2018 11:08 am

Ok, so I build a local client for the zNet client. It's almost ready to be released.

It's a command line tool writen in Python with a GUI and a process that polls data from the Tellstick on an interval provided by you comparing with previous poll. The difference in the polls then get reported back to a server specified by you. I use this to trigger events in eventGhost.


This is what we have so far... :D

Image

Kalarne
Posts: 25
Joined: Thu Jan 18, 2018 11:08 am

Re: Tellstick zNet Litev2 Local client, almost done...

Post by Kalarne » Thu Jan 18, 2018 11:08 am

Interesting,
Does the Python part run in Tellstick and the server part in a Windows or Linux computer?

I have a lot of more questions, but I have to understand the overall architecture before I ask them.

kamsvag
Posts: 63
Joined: Thu Jan 18, 2018 11:08 am

Re: Tellstick zNet Litev2 Local client, almost done...

Post by kamsvag » Thu Jan 18, 2018 11:08 am

It's just a script that runs in Windows/Linux/OS X.

I use eventGhost as center in my home automation so I setup a couple of functions where the klient polls a list from the Tellstick on an interval choosen by user. The list polled is compared to previous poll, any deviations in the new list get send to an by the user defined IP address.

I've set up so that on that other end I have an eventGhost server listening. Depending on what shows up in the log eventGhost executes macros. A macro could be something as simple as;
C:\Python27\python.exe C:\TDTools\TDTools_Beta.py --on 23

This would turn on the device with the ID 23.

To see what ID devices has use --list 'C:\Python27\python.exe C:\TDTools\TDTools_Beta.py --list'

kamsvag
Posts: 63
Joined: Thu Jan 18, 2018 11:08 am

Re: Tellstick zNet Litev2 Local client, almost done...

Post by kamsvag » Thu Jan 18, 2018 11:08 am

If you want to read the script and follow what happens it's easy.
  • Import external libraries
    Define Global Variables
    Define all Funtions
    Reading arguments and executing corresponding funtion (some functions call functions from within)

kamsvag
Posts: 63
Joined: Thu Jan 18, 2018 11:08 am

Re: Tellstick zNet Litev2 Local client, almost done...

Post by kamsvag » Thu Jan 18, 2018 11:08 am

You'll find a new thread under Beta where I posted the script for you to download.

Kalarne
Posts: 25
Joined: Thu Jan 18, 2018 11:08 am

Re: Tellstick zNet Litev2 Local client, almost done...

Post by Kalarne » Thu Jan 18, 2018 11:08 am

Thanks,
I will check this! :-)

Kalarne
Posts: 25
Joined: Thu Jan 18, 2018 11:08 am

Re: Tellstick zNet Litev2 Local client, almost done...

Post by Kalarne » Thu Jan 18, 2018 11:08 am

I am trying to get your code running, but have a authorization problem. I don't know which key/keys I should use.

In config there is "Bearer" but the codes/keys I get are named Private key/Public key/Token/ Token secret. Confusing!

If you could you show me how you have written in config and what key/keys you have used , would be helpful for me.

kamsvag
Posts: 63
Joined: Thu Jan 18, 2018 11:08 am

Re: Tellstick zNet Litev2 Local client, almost done...

Post by kamsvag » Thu Jan 18, 2018 11:08 am

You need to create your local TOKEN using this step-by-step guide.

http://api.telldus.net/localapi/api.html

Kalarne
Posts: 25
Joined: Thu Jan 18, 2018 11:08 am

Re: Tellstick zNet Litev2 Local client, almost done...

Post by Kalarne » Thu Jan 18, 2018 11:08 am

Thanks,
I am up and running now, but have problems with Tkinter. I have Python 3.5 and Tkinter should be installed.
Nice program you have done!

kamsvag
Posts: 63
Joined: Thu Jan 18, 2018 11:08 am

Re: Tellstick zNet Litev2 Local client, almost done...

Post by kamsvag » Thu Jan 18, 2018 11:08 am

Thanks, it's written in Python 2.7

Try that and the gui might work better.

martikainen
Posts: 16
Joined: Thu Jan 18, 2018 11:08 am

Re: Tellstick zNet Litev2 Local client, almost done...

Post by martikainen » Thu Jan 18, 2018 11:08 am

Nice! Does this mean that you have the same possibilty to create macros and control your devices on the zNet litev2 transmitter as you have with a Tellstick DUO connected to the client running Eventghost?
I've been waiting for a solution that works togheter with eventghost :)

kamsvag
Posts: 63
Joined: Thu Jan 18, 2018 11:08 am

Re: Tellstick zNet Litev2 Local client, almost done...

Post by kamsvag » Thu Jan 18, 2018 11:08 am

Yes.

kamsvag
Posts: 63
Joined: Thu Jan 18, 2018 11:08 am

Re: Tellstick zNet Litev2 Local client, almost done...

Post by kamsvag » Thu Jan 18, 2018 11:08 am

Here you'll find the updated version.

http://forum.telldus.com/viewtopic.php? ... 852#p34852

Post Reply