Shubhamjain007 / openhab

Automatically exported from code.google.com/p/openhab
0 stars 0 forks source link

digitalSTROM Binding (DSS) #78

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hello,

the binding to Digitalstrom would be very nice. In the same way like KNX.

The complete Source at: https://gitorious.digitalstrom.org/projects

Greetings

Stefan

Original issue reported on code.google.com by bachm...@es-tec.net on 17 Apr 2012 at 9:34

GoogleCodeExporter commented 8 years ago
Agreed, this would be nice!
As I unfortunately do not have any digitalSTROM hardware, I am not the right 
candidate to implement it.

How about you? :-)

Original comment by kai.openhab on 18 Apr 2012 at 4:58

GoogleCodeExporter commented 8 years ago
me neither, sorry!

Original comment by teichsta on 18 Apr 2012 at 7:06

GoogleCodeExporter commented 8 years ago
Hello,

i´m Interested in openHAB. i have some HW installed in my house. It would be 
possible to share it for development, but i am not a developer.

Let me know, if you have an Idea for this.

Original comment by Radermac...@googlemail.com on 19 Nov 2012 at 10:51

GoogleCodeExporter commented 8 years ago
an integration of digitalstorm would be great, please do it ;-) i'll buy 
digitalstrom equipment next year and then you could also get access to a linux 
box in the same local subnet if needed

Original comment by diter...@gmail.com on 21 Dec 2012 at 7:59

GoogleCodeExporter commented 8 years ago
Hi,
I also would like to see a digitalstrom binding to be developed.
Did some research in this issue and could share these information with 
potential developers. Unfortunately, i don't have any programming skills to 
start developing on my own.
@Thomas and Kai, aizo has a testrack for testing so missing hardware should not 
be a problem.

Original comment by josh.m5968 on 7 Mar 2013 at 9:49

Attachments:

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
developer documentation could be found here 
http://www.digitalstrom.org/entwickler/developer-tools/

Original comment by teichsta on 7 Mar 2013 at 1:40

GoogleCodeExporter commented 8 years ago
Hi all,
I had a closer look into the sources of some of openhabs bindings and started 
developement of a digitalstrom binding by refactoring the http binding.
As i said before, i have no programming experience, though i might ask some 
silly questions.
Developement will be done in several steps.
First Step
Implement basic functions for switching lights on and off, dim lights, open and 
shut rollershutters.
Second Step
Implement more features like controlling complete room scenes.

One of the tricky parts is the right scene translation to follow aizos guidance 
for external applications (not to turnon/turnoff or set device values but use 
scenes).

I will post progress updates here and push the sources...

Regards
Josh

Original comment by josh.m5968 on 24 Mar 2013 at 5:59

GoogleCodeExporter commented 8 years ago
Hi Josh, great that you take some action on this! I'll try my best to provide 
you support if you have questions or get stuck.
As far as I know, DS is not bi-directional (i.e. there is no status feedback 
from the devices), so the complexity of the binding should not be too high. The 
scene-only concept will of course still require some thoughts about a good 
mapping into openHAB.

Original comment by kai.openhab on 24 Mar 2013 at 7:29

GoogleCodeExporter commented 8 years ago
Hi Kai,
Thanks for offering your support.
There is a function to request device status (/json/device/getState?), which im 
going to implement for in-binding.
What i am going to do for outbinding:
- send command to device
- parse response from dss to check if command was executed
- use the getState function to check device status and push update on event bus.

Original comment by josh.m5968 on 24 Mar 2013 at 7:55

GoogleCodeExporter commented 8 years ago
Ok, I guess the actual device status is kept in the dSS, which will answer the 
getState requests as I am pretty sure that I was told that you cannot request 
it from the devices themselves.
But it still means that you do not require a background thread that receives 
push notifications from the dSS. You simply won't notice if a device state 
changes (e.g. because some physical button was pressed) - or is there a way to 
receive push notifications from the dSS?

> - use the getState function to check device status and push update on event 
bus.
This would definitely make sense at system startup time - you might want to 
have a look at the KNXBinding, where there is a DatapointInitializer to do such 
a task.

Original comment by kai.openhab on 24 Mar 2013 at 8:02

GoogleCodeExporter commented 8 years ago
Yes, device status is stored in the dss, you cannot request devices themselves. 
There is some kind of a event system on the dss that can be subscribed to, but 
this might be to complex for a first release.
At first i thought of using the getState function for polling, which of course 
might produce some traffic.
I will have a closer look on the dss event subscription.

Original comment by josh.m5968 on 24 Mar 2013 at 8:32

GoogleCodeExporter commented 8 years ago
Hi Kai,
as promised, i had a deeper look into the dss event subscription, but find it 
nearly impossible to implement it.
Might be i found a different solution on getting status updates from the dss.
Does the REST Service accept status updates as a parameter appended to the URI ?
Fo example :
"POST http://localhost:8080/rest/items/Temperature_FF_Office&status=ON" ???
If this would be possible, we could use a dss server app called "Scene 
Responder" to post this messages whenever a staus change happens.

I made a little progress whith writing the binding, so feel free to review my 
server side clone joshm5968-digitalstrom.
It's not very much at the moment, just wrote methods for logging into the dss 
requesting the session token and a method to read device status.

Original comment by josh.m5968 on 7 Apr 2013 at 10:07

GoogleCodeExporter commented 8 years ago
Yes, the REST API allows updating item states - see 
https://code.google.com/p/openhab/wiki/REST:

"To directly access an item state, you can access
http://localhost:8080/rest/items/Temperature_FF_Office/state
which returns the state as a plain string.
Likewise, you can send a status update using the HTTP verb PUT to the same uri, 
passing the new state as a plain string argument in the body (encoding 
text/plain)."

Original comment by kai.openhab on 8 Apr 2013 at 9:15

GoogleCodeExporter commented 8 years ago
Hi Kai,
I read the wiki before i asked my question, but the solution there is not what 
i (we) need, or i am absolutely wrong.

On dss side, i can just define a uri to call when a status change happens. I 
don't know, how to add the needed status information.

Btw, i have a lot of mistakes in my sources, so you better leave this till i 
inform about new progress.

Original comment by josh.m5968 on 9 Apr 2013 at 3:18

GoogleCodeExporter commented 8 years ago
Not sure, if I understand what your problem is - is it that you do not have the 
status available on the dSS and thus cannot send it in the HTTP request? Or do 
you not know how to send a HTTP PUT request from the dSS with the status in the 
request body?

Original comment by kai.openhab on 9 Apr 2013 at 3:23

GoogleCodeExporter commented 8 years ago
I do not know how to add the status to the uri. But i will do my homework and 
do some further research on this.

Original comment by josh.m5968 on 9 Apr 2013 at 6:09

GoogleCodeExporter commented 8 years ago
The status does not belong into the URI, but in the body. See details on how 
PUT requests were here: 
http://stackoverflow.com/questions/4477454/how-is-a-http-put-request-typically-i
ssued

Original comment by kai.openhab on 9 Apr 2013 at 7:37

GoogleCodeExporter commented 8 years ago
Hi Kai,
today is the day where i would like to ask you to review my code, i made a lot 
of progress but still need some help.

First of all, what are we able to do :
- Connect to digitalSTROM Server torequest session token.
- Request state for Switch an Rollershutter item (Dimmer not implemented yet).
- Send ON/OFF commands to Switch item.
- Send UP/DOWN commands to Rollershutter items.

My main problem is, tha my code will not read the configuration for IP, PPORT 
and applicationToken out of openhab config file.
In DigitalSTROMBinding.java, i had to set up this declarations for testing.
I hope you will find my mistakes and help me out with a solution.

Josh

Original comment by josh.m5968 on 18 Apr 2013 at 9:36

GoogleCodeExporter commented 8 years ago

Original comment by teichsta on 30 Apr 2013 at 2:48

GoogleCodeExporter commented 8 years ago
Hi,
problem from #19 is fixed, still don't really know why.

I had to move getSessionToken() from activate() to execute().
It seems that declarations from config file are not read in activate() method.

Next step will be writing a Setup guide for WIKI.
After this, I will take care of DIMMER ITEMS.

Original comment by josh.m5968 on 1 May 2013 at 1:20

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Hi,

could you please review my coding. From my perspective, the binding is ready 
for public testing. I finished implementing support for DimmerItems, so it can 
be used for Switch-, Dimmer- and RollershutterItems.
A readme with configuration instructions, which can be used for the WIKI is 
also included.

Waiting for your comments
Josh

Original comment by josh.m5968 on 4 May 2013 at 10:40

GoogleCodeExporter commented 8 years ago
Hi,

I use Digitalstrom too. Is here a new state?

It would be very nice, if this Binding would be ready for Version 1.3

Regards
Christian

Original comment by Radermac...@googlemail.com on 8 Aug 2013 at 6:29

GoogleCodeExporter commented 8 years ago
See WIKI pages ;-)

Original comment by josh.m5968 on 12 Aug 2013 at 4:04

GoogleCodeExporter commented 8 years ago
namely this one: http://code.google.com/p/openhab/wiki/digitalSTROMBinding

Original comment by teichsta on 12 Aug 2013 at 4:10

GoogleCodeExporter commented 8 years ago
Binding has been added with changeset 
https://code.google.com/p/openhab/source/detail?r=1fd1017371b4543f01bb4d8bb3d27a
50e26ae970.

Thanks for everybody involved!

Original comment by kai.openhab on 20 Aug 2013 at 9:28