Output:
The following options for output state reporting are possible, HOWEVER Domoticz does not seem to like anything else than Level, have to figure out why...
Configuration options:
Level,
rising edge (button press)
falling edge (button release)
Inverted level

Counters:
Can be enabled on ALL inputs and outputs.
For the inputs hardware edge detection is used, for the outputs software edge detection is used @ the input report rate. (both are rising edge)
The hardware registers are sampled every 20 msec (at least that is the intention... ), which should allow for 50Hz signals....
Tests @ 5Hz showed an error rate of approx 0.5- 0.7% (tested with 40000 and 185000 counts, with 50/50 and 30/70 duty cycles, tested with 3 parallel connected inputs)
Tests @ 10Hz showed an error rate of approx 3.3 - 3.7 % (avg 3.4 %) (tested with 40000 and 87000 counts, with 50/50 duty cycles)
Initial test @ 20Hz showed an error rate near 10%
The encountered errors are due to kernel / userland switches and the linux multitasking mechanism, and are the best achievable.

The PiFace driver works as follows:
- Enable spi-bcm2708 module in /etc/modprobe.d/raspi-blacklist.conf (put a # before blacklist)
- Reboot
- Put a piface.conf configuration file in the domoticz program folder, needed if the default config (see later on) needs to be changed.
- Select PiFace from hardware dialog
- Goto devices screen and add devices..

PiFace devices and numbering:
Enabled I/O ports will be reported as a lighting 1 (impuls) device.
The ID field will show if a pin is a input (I) or output (O).
The Unit field will show the PiFace board, and pin number. The decade number ID's the PiFace board, the unit number the pin number.
So Unit 25 = PiFace Board address 2, and pinnumber 5 (pincount starts at 0)

Enabled Counters will be reported as a RFXMeter.
The ID field will show the PiFace address, Pintype, and Pinnumber.
The hundreds tell if a pin = input or output (input = 1xx, output 0xx)
The decades = address of the PiFace board
The unit number = pinnumber

Well, see it as an on-board I/O extension for the RPi capable of
* counting 8 channels (replacement of RFXMeter) or
* sensing ordinary wired switches (existing doorbell?, door/window contacts?) or
* switching ordinary wired devices (heating system?, doorbell ringer?, Selecting antenna on remote radio station, ...).
Most applications will have their dedicated RF solutions but this opens up the use of Domoticz in the DIY area.

As an addition to keptenkurk;
Besides the inputs, there are outputs as well.
The PiFace hardware has 2 relays, which allows you to switch all kinds of power signals directly.
Also 6 high current outputs are available, one can use this to control a motor fi.
Also do not forget that due to the nature of domoticz event system, (using blocky and Lua) one can have the I/O of the PiFace interact with all the other (RF stuff) available in Domoticz.

To give you an idea, this is the project that I am working (and the reason why I wrote the PiFace driver): (Pi will be mounted in my utillity closet)
- Hook up my doorbell switch, and play MP3 sound with Pi audio out. (and have logging and kodak moments ; p available at the same time).
- Connect 3 KWh S0 meters to register and keeptrack of my energy consumption
- Connect 3 water flow meters to register and keeptrack of my water usage, and signal leakage.
Unfortunately this is a nogo with the PiFace as the water flow meters produce a frequency modulated pulse signal that requires more processing than the PiFace can offer, so I will need to design new hardware for it.
- Hook up 3 solenoid valves to control my outdoor sprinklers and faucets.

This of course all can be done with RF modules, but they generally do not work 100% reliable and for some controls like to solenoid valves one needs reliability.
Besides this a PiFace is far cheaper than a set of RF modules, and less bulky (if all stuff to controll in close by).

Here is a photo of a PiFace with a additional header soldered onto it, to allow stacking.
In this case I used a standard header, as I had an extended version on my experimental addon board.

Soldering is a bit tricky and a soldering iron with a long pointy tip is required, because you will need to solder the back row of pins through the pin openings.
Its advisable to have a socket header ontop of the pinheader to prevent the pins in the addon header to slant, as they can get hot and the connector plastic can melt, and the pins can slant due to the side pressure of the soldering process. Normally this will not be the case but again this is not normal soldering
I also suggest to remove the solder from the top of the header pins of the PiFace board, with fi. desoldering wire (Litze), so the addon connector will have a proper base.

I don't think that I am at the same level than you for soldering things, and more specialy if it requires a specific attention.

Maybe we could suggest Piface manufacturer to have such a stackable header as an option. I think lot of people would pay for it !

I would love to by a piface, but first I need to have the Razberry for my Z-wave devices, and for the moment I do not want to by a second pi just for piface stuff...

Do you think there is a way to solve this issue with a triple header cable (ribbon) : I can remember that old IDE cables (for IDE hard drives) use to have 3 header : 1 for the motherboard, 1 for a master drive, and 1 for a slave drive.
maybe this would do the trick ? what about ?

bistoury wrote:
Do you think there is a way to solve this issue with a triple header cable (ribbon) : I can remember that old IDE cables (for IDE hard drives) use to have 3 header : 1 for the motherboard, 1 for a master drive, and 1 for a slave drive.
maybe this would do the trick ? what about ?

Hi bistoury,

What you are proposing can succeed, however not with IDE cables, as they have sockets pressed on.
You will need 1 presson header socket (std ribbon) connector, and several presson boxed pinheader connectors, these all exist, and should be available at farnell.
However I think that it can be quite costly, as some of these presson boxed pinheader connectors can be quite expensive.

I fully agree with keptenkurk's suggestion, as I it was my next suggestion.. (the kepten beat me to it )...

With this ciruit the PiFace inputs can be made much more robust, and can also be used for other I/O applications.
When using the 2N7000 this circuit can handle max 40V dc as input voltage, instead of the default 3v3 of the PiFace...
For the S0 appilication the 1K resistors are needed, but for other applications they can be changed to higher values like 10k or 100k to reduce input current.

As promised...
I scanned some catalog pages of my farnell catalog (old one), of the connectors you can use.
I highted the ones that you might need, the connectors are still available, although the pricing may have changed.

So to sum up things, I would need the following Items :
- 1 ribbon 10 to 15 cm, with 26 ways (I have found ref. 1207444 or ref. 1207422 --if you want some colors !-- but it has a pitch of 1.27 => this is half the pitch of the connector so I wonder if this would fit my needs)
- 1 female connector to connect the ribbon to the Pi's GPIO (26 ways, pitch 2.54, ref 1098511)
- 2 male connectors to connect Piface and Razberry Boards (26 ways, pitch 2.54, ref 1098599)
- 1 Piface (as a starter ) (ref. 2218566)

I must admit that solution b) is only 6€ cheaper and have evolution possibilities....but is absolutly not WAF...
whereas as solution a) can be a bit more stylish (with the appropriate Piface case, around 20€ )...