philklei / tahoma-api

API for Tahoma
Apache License 2.0
30 stars 13 forks source link

How to use this? #3

Closed Endogen closed 6 years ago

Endogen commented 6 years ago

Could you please briefly describe in the README how to use this? I have a TaHoma Box and a windowing system that is based on RTS (Radio Technology Somfy). Can i already use this to control it? Or do i need Somfy Connect or anything else to start?

What i would like to do is, control the system without the need to use the Somfy App - i would like to use my own implementation for that.

n4uti commented 6 years ago

Philklei has done his job very well, so thanks for this :-) I have installed his "egg" :-) on my vserver or raspberrypi and used my own python script to provide a rest api to call his api like that:

https://pastebin.com/xaqNK29S

It depends on flask, so you have to install it first. After running the server you can use it like this:

http://127.0.0.1:5000/execute/Room%20One/up http://127.0.0.1:5000/execute/Room%20One/my http://127.0.0.1:5000/execute/Room%20One/down

Dont forget to use your own credentials in:

api = TahomaApi('your@user.at', 'pw')

And another good idea is to use an auth method like basic auth or something else. It depends on you to implement it :-)

Endogen commented 6 years ago

Nice! Will try it tomorrow, thanks a lot! :D

Endogen commented 6 years ago

@n4uti Doesn't seem to work with your implementation Unresolved reference 'Action'

but i don't actually understand why. The class is defined correctly in tahoma_api.py

Endogen commented 6 years ago

Solved it. File __init__.py has to have:

from .tahoma_api import Action

Works great!

n4uti commented 6 years ago

Hm, yes its possible that i have fixed this too :)

Endogen commented 6 years ago

Anything else you fixed that could be helpfull for me? :)

n4uti commented 6 years ago

I dont think so but i will take a look after work today. Is it running and working for you, or other problems now? ;)

Endogen commented 6 years ago

It works fine, no issues for now. But i would be interested in cleaning up the whole project since it's basically a total mess - not the code in tahoma_api.py but nearly everything else :-/