Shubhamjain007 / openhab

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

PLC-BUS Binding #112

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
1. Feature Description
Create a binding to talk (via USB) to a PLCBus interface to control lights 
(incl. dimming) and appliances (on/off). Make it work on the Rasberry Pi (or 
so: http://code.google.com/p/openhab/wiki/HardwareFAQ ) 

2. Example Use Case
Home automation for existing PLCBus installations.

Interesting references
======================
The PLCBus Protocol: 
http://www.hekkers.net/domotica/Docs/PLCBUS%20RS232%20to%20PLCBUS%20Control%20Tr
ansport%20Protocol.pdf

PLCBus adapter: 
http://x10-hk.com/store/product_info.php?cPath=22_26&products_id=165
and manual: http://x10-hk.com/store/manual/plcbus1141_software_029.pdf

Appliance module: 
http://x10-hk.com/store/product_info.php?cPath=22_24&products_id=31
Lamp module: 
http://x10-hk.com/store/product_info.php?cPath=22_24&products_id=267

I would sponsor a set of 1 interface and 3 modules for the implementer

Original issue reported on code.google.com by step...@wissel.net on 28 Aug 2012 at 9:15

GoogleCodeExporter commented 8 years ago
forgot: There is already a Linux deamon: 
http://code.google.com/p/plcbus-daemon-for-linux/

Original comment by step...@wissel.net on 28 Aug 2012 at 9:19

GoogleCodeExporter commented 8 years ago
I have implemented the PLCBus Protocol in java now.

Next i'am trying to build the bindung for openhab.

Which commands do you use on PLCBus?

Do you need polling for the status of the devices?

Original comment by pinguin45 on 13 Sep 2012 at 8:53

GoogleCodeExporter commented 8 years ago
Page 6/7 in the PLCBus protocol describes the commands. I use mostly on/off 
(and DIM) but I also have the blinds switches (Vorhang rauf/runter).

My understanding is: you need to poll. Where do I send the equipment (German 
plugs I presume?) PM me stephan at wissel dot net

Original comment by step...@wissel.net on 13 Sep 2012 at 3:37

GoogleCodeExporter commented 8 years ago
can anybody (Robin, Stephan) confirm that the binding is working?

Original comment by teichsta on 3 Dec 2012 at 4:41

GoogleCodeExporter commented 8 years ago
Yes it is working.  Changed the library for the serial bindingfor 
better.support in most architectures

Original comment by pinguin45 on 3 Dec 2012 at 4:44

GoogleCodeExporter commented 8 years ago
ok!

please find some review-comments below:

# PLCBusActivator
* decrease loglevel of both statements to "debug"
* change Text to "PLCBus Binding started/stopped"

# PLCBusBinding
* remove (or at least decrease the loglevel of) the both logging statements in 
activate() and deactivate()
* internalReceiveCommand() (Z93) - enhance log statement with itemName that 
cause this error
* internalReceiveUpdate() (Z150) - enhance log statement with itemName that 
cause this error
* implementation of internalReceiveUpdate() seems wrong to me. 
InternalReceiveUpdate() receives State updates from the openHAB-EventBus and 
should forward them to the connected hardware. What you have implemented is 
kind of In-Binding. Your are going to read values from the PLCBus. Such code 
should be placed in a different InBinding since there have to be some 
Polling-Mechanism to frequently ask for new values. Or does the PLCBus provide 
some kind of active announcements? Please see org.openhab.serial binding for 
information how this could be accomplished.
* rewrite update() to something like:

    if (config != null) {
        String portString = (String) config.get("port");
        if (StringUtils.isNotBlank(portString)) {
            port = Integer.parseInt(portString);
        }
    }

iterating through the keys doesn't seem to be necessary here.
* generally: i am wondering if there should be some kind of ConnectionPool to 
reuse open SerialConnection. I am quite unsure if it is clever to reopen 
connections for each update or command

# IPLCBusController
* method-names should start with lower case letters

#PLCUnit
* since the name is ambiguous could you rename it to PLCDevice?

# PLCBusGenericBindingProvider
* please add valid configuration examples in class-level javadoc
* implementation of AutoUpdateBindingProvider doesn't seem to be useful when 
"true" is returned constantly (that should be the default behaviour of the 
AutoUpdateBinding)
* validateItemType(): does the PLCBus binding really accept any ItemType? If 
yes please add a reasonable comment, if not please do some rough type checking

# MANIFEST.MF
* add jssc jar to bundle-classpath (MANIFEST.MF)
* add Vendor (openHAB.org"
* change Bundle-Name to "openHAB PLCBus Binding"
* change version to 1.1.0.qualifier
* remove the min-version of some imported packages
* remove the exported packages (since i can't see any consumer in the 
workspace, right?)
* remove Bundle-ActivationPolicy parameter

# jssc.jar
* add jssc.jar to build-path
* add jssc.jar to build.properties
* if possible rename add a version to jssc.jar

Original comment by teichsta on 4 Dec 2012 at 4:58

GoogleCodeExporter commented 8 years ago
scheduled for 1.1

Original comment by teichsta on 4 Dec 2012 at 10:27

GoogleCodeExporter commented 8 years ago
Glad I'm not the only one (besides Robin) who can make use of that ;-)

Original comment by step...@wissel.net on 5 Dec 2012 at 2:17

GoogleCodeExporter commented 8 years ago
Is the jssc.jar still necessary? There seems to be no dependency?!

Original comment by teichsta on 14 Dec 2012 at 9:28

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I added the binding to the 1.1.0-plcbus branch of the main repo.

The binding still lacks of detailed documentation of the main classes (starting 
with "PLCBUs"). The protocol classes should contain detailed documentation as 
well but the missing documentation won't be a showstopper for 1.1.0. 
Furthermore there are very few log statements currently. It would be nice to 
have some more statements to allow for reasonable debugging.

Could you add the missing documentation by Sunday?

Things i changed:
* added pom.xml
* added config parameter "plcbus:port" to openhab_default.cfg (please review 
and give some documentation for that as well)
* removed unused methods
* removed unused classes

Original comment by teichsta on 14 Dec 2012 at 1:59

GoogleCodeExporter commented 8 years ago
merged the binding to default branch.

The Wiki-Page (http://code.google.com/p/openhab/w/edit/PLCBusBinding) is still 
to be done.

Original comment by teichsta on 16 Dec 2012 at 5:52

GoogleCodeExporter commented 8 years ago
WIKI was created meanwhile!

Binding can be considered as "implemented" ... GREAT ;-)

Original comment by teichsta on 10 Feb 2013 at 9:59

GoogleCodeExporter commented 8 years ago
Hi, I have been searching high and low for a way to use OpenHAB with my UPB 
setup. I came across this binding and I think that, with a little modification, 
the PLC-Bus Binding could be used to address UPB systems. They are very similar 
technologies, but alter in the command structure used to interact with devices. 
I have documentation from PulseWorx (The company responsible for the UPB 
standard) regarding what is needed to interface with devices. What does 
everyone think? could this be tweaked to work with UPB? Thanks.

Original comment by BJHiltbr...@gmail.com on 9 Mar 2015 at 1:38

GoogleCodeExporter commented 8 years ago
Hi BJHiltbrand,

please note, that this Tracker is closed for some while already. Best is to ask 
this question on the Google Group (see 
https://groups.google.com/forum/#!forum/openhab).

Best, Thomas E.-E.

Original comment by teichsta on 9 Mar 2015 at 3:33