Karthikeyan-kkk / openhab

Automatically exported from code.google.com/p/openhab
GNU General Public License v3.0
0 stars 0 forks source link

Enhance Fritz!Box-Binding #272

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
1. Feature Description
Call-states are already advertised by the fritzbox-binding. However, it would 
be of great use to:

2. Example Use Case
- Turn off WIFI/DECT when nobody's at home
- De-/Activate answering maschine

Original issue reported on code.google.com by honkton...@gmail.com on 3 May 2013 at 6:47

GoogleCodeExporter commented 9 years ago

Original comment by kai.openhab on 4 May 2013 at 2:39

GoogleCodeExporter commented 9 years ago
could you provide more information if these functions are accessible via 
telnet? Is there developer documentation available?

Original comment by teichsta on 7 May 2013 at 3:59

GoogleCodeExporter commented 9 years ago
Thanks for looking into this.

Documentation is for the command is 
here:http://www.wehavemorefun.de/fritzbox/Ctlmgr_ctl
Parameters are listed below the modules listed on this page: 
http://www.wehavemorefun.de/fritzbox/User-Interface-Module

WIFI ON/OFF:
ctlmgr_ctl w wlan settings/ap_enabled 1
ctlmgr_ctl w wlan settings/ap_enabled 0
Details: http://www.wehavemorefun.de/fritzbox/Wlan

DECT ON/OFF:
ctlmgr_ctl w dect settings/enabled 1
ctlmgr_ctl w dect settings/enabled 0
Details: http://www.wehavemorefun.de/fritzbox/Dect

Original comment by honkton...@gmail.com on 7 May 2013 at 4:32

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago

Original comment by teichsta on 21 May 2013 at 9:41

GoogleCodeExporter commented 9 years ago
I'm currently looking into this and decided to go the following route:
 - Enable telnet by phone
 - Set Fritzbox-password in openhab.cfg
 - Use telnet from binding to run commands on the box

So the next problem: Does someone one a good (and recent) java telnet client 
library for this purpose?

I googled and found two considerable:
  - http://commons.apache.org/proper/commons-net/
  - http://sadun-util.sourceforge.net/telnet_library.html

Can someone assign this issue to me?

Original comment by hlw31...@gmail.com on 25 Jun 2013 at 8:04

GoogleCodeExporter commented 9 years ago
Great that you are looking into this! I have just assigned the issue to you :-)

Regarding the telnet libraries: If commons-net offers what you need, I would go 
for this one. It is already part of the openHAB target platform, so you 
wouldn't not even have to add anything. Just do a package import of what you 
need and you are set!

Original comment by kai.openhab on 25 Jun 2013 at 8:16

GoogleCodeExporter commented 9 years ago
Did some investigation:
Easiest way is to set WLAN by telnet and port 1011 which is only available 
local to the fritzbox so user has to enable telnet on the fritzbox.

Using shell commands, I'm able to switch DECT/WIFI ON/OFF. Now the next step is 
to implement the 
[http://commons.apache.org/proper/commons-net/javadocs/api-3.3/org/apache/common
s/net/telnet/TelnetClient.html]

Original comment by hlw31...@gmail.com on 13 Jul 2013 at 10:35

GoogleCodeExporter commented 9 years ago
From my point of view another use case 
would be a missed call (last calls) as status for the openhab webinterface.

Like:

Group Fritzbox
WIFI ON/OFF
DECT ON/OFF
List of Missed Calls

But as far as I understand the documentation of fritzbox command line mentioned 
above, this would be just another line of code to read the status from fritzbox.

Original comment by ch.ro.de...@gmail.com on 25 Jul 2013 at 9:00

GoogleCodeExporter commented 9 years ago
Is there any progress on this feature? Any chance to have it for 1.3?

Original comment by kai.openhab on 6 Aug 2013 at 8:21

GoogleCodeExporter commented 9 years ago
I'm sorry but I did not yet have the time to dig deeper into this. Until 1.3. 
this won't get finished. Maybe I shall just post how to do it and leave the 
programming  of the binding to the java-experts...

Original comment by hlw31...@gmail.com on 15 Aug 2013 at 10:44

GoogleCodeExporter commented 9 years ago
I can't get a grip on apache.commons so I'll unassign this issue.

However, here's the way to go:
 - Enable telnet (dail #96*7* on phone) (http://www.tecchannel.de/server/extra/432803/tuning_hacks_fritzbox_fritz_box_erweiterungen_ftp_telnet/index5.html)
 - Need password: access fritzbox by telnet'ing
 - Query/Switch/Modify with http://www.wehavemorefun.de/fritzbox/Ctlmgr_ctl

Some examples:
DECT Query, ON/OFF: ctlmgr_ctl r dect settings/enabled , ctlmgr_ctl w dect 
settings/enabled 1 , ctlmgr_ctl w dect settings/enabled 0
WIFI Query, ON/OFF: ctlmgr_ctl r wlan settings/ap_enabled , ctlmgr_ctl w wlan 
settings/ap_enabled 1 , $ ctlmgr_ctl w wlan settings/ap_enabled 0

All modules/settings can be found on 
http://www.wehavemorefun.de/fritzbox/UI-Module.

Using the expect-script on 
http://stackoverflow.com/questions/7013137/automating-telnet-session-using-bash-
scripts the exec-binding is able to query/switch f.e. WIFI.

I'm really sorry to surrender :(

Original comment by hlw31...@gmail.com on 3 Oct 2013 at 8:47

GoogleCodeExporter commented 9 years ago

Original comment by teichsta on 5 Nov 2013 at 10:47

GoogleCodeExporter commented 9 years ago
Hi,

I just wanted to say, that I thought this issue is interesting and did some 
work on it. I extended the existing binding to simply switch on/off wlan, dect 
and tam. Furthermore I implemented the possibility to trigger any kind of 
command or query via telnet on the fritzbox. So it is possible to query the cpu 
load or temperature 
(http://www.wehavemorefun.de/fritzbox/User-Interface-Module). The queries and 
commands are normal linux shell commands which are executed via telnet.

I would like to commit my changes and let you test it. Can someone tell me how 
i can to this?

Examples for use of the binding:
first of all you have to add the following line to the configuration:
fritzbox:password=secret

Then you can use the binding this way:

Switch DECT {fritzbox="dect"}
Switch WLAN {fritzbox="wlan"}
Switch TAM0 {fritzbox="tam0"}

or do a query on the cpu temperature
String CPU_Temp {fritzbox="query:ctlmgr_ctl r cpu status/StatTemperature | cut 
-d, -f1"}

or trigger a command
Switch CMD{fritzbox="cmd:ON=touch on OFF=rm on"}

Original comment by dom...@gmail.com on 7 Nov 2013 at 7:22

GoogleCodeExporter commented 9 years ago
Sounds great! Please read 
https://code.google.com/p/openhab/wiki/HowToContribute.
In short: Push your code to a forked repo on GitHub and create a pull request 
there!

Original comment by kai.openhab on 8 Nov 2013 at 10:11

GoogleCodeExporter commented 9 years ago
Thanks for your answer. Done it: https://github.com/openhab/openhab/pull/95

For everyone who wants to test the binding, it can be found here: 
https://github.com/dhufnagel/openhab

If there is a need for the jar-Version of it, please let me know.

Original comment by dom...@gmail.com on 9 Nov 2013 at 12:03

GoogleCodeExporter commented 9 years ago
This issue has been migrated to Github. If this issue id is greater than103 its 
id has been preserved on Github. You can open your issue by calling the URL 
https://github.com/openhab/openhab/issues/<issueid>. Issues with ids less or 
equal 103 new ids were created.

Original comment by teichsta on 17 Nov 2013 at 8:08

GoogleCodeExporter commented 9 years ago
see above!

Issue has been migrated to Github and should be discussed there.

Original comment by teichsta on 21 Nov 2013 at 1:51

GoogleCodeExporter commented 9 years ago
Hi,
I'm interested in the new implemented fritzbox features. As AVM offers multi 
user access, it is necessary to define a user besides the password. Is this 
already possible?
Like:
fritzbox:password=secret
fritzbox:user=admin

Original comment by staehle...@googlemail.com on 25 Dec 2013 at 9:34

GoogleCodeExporter commented 9 years ago
since this issue tracker is no longer synched please use our new tracker at 
github 
https://github.com/openhab/openhab/issues?direction=desc&sort=created&state=open

Original comment by teichsta on 26 Dec 2013 at 10:58