2 Pifaces config in Hassio

I have now 1 RPi 4 with 1 Piface.
I would connect a second Piface but I don’t know how I must program this in yaml.
If I number further then Input7 I get an error.
Must I set the address from the Piface somewhere in the configuration file.
Can anyone give me a solution to fix this problem ?

Set the jumpers on the PiFace board for address 0 (JP1: 1-2, JP2: 1-2).
You can use

I Have do this but how must I this declare in the configuration.yaml.
If I count further then 7 then I get an error.

Couple ways, in configuration.yaml just add:
if switch and using folder “switches”:
switch: !include_dir_merge_list switches/
if binary sensor in include folder:
binary_sensor: !include include/binary_sensors.yaml
OR just add to :slight_smile:

# Example configuration.yaml entry
binary_sensor:
  - platform: rpi_pfio
    ports:
      0:
        name: PIR Office
        invert_logic: true
      1:
        name: Doorbell
        settle_time: 50

So did I , but more then 7 inputs or outputs didn’t work.
Before I used HA I used Domoticz with 2 pifaces and that works .
I think that I must declare that I have 2 Pifaces (address settings maybe)

Looking for same thing how to get two pifaces to work. Doesn’t seem to be obvious how to address the second PiFace (with jumpers configured for address 01)

Home Assistant used piface digitalio ,on GitHub I found this source code:

  >>> p.digital_write(5, 1, 2) # writes pin5 on board2 high

From this example code I can conclude that there is an address setting because the last number is therefore the pifacenr.
When I look in the INIT_PY of Home Assistant I see this line:

def write_output(port, value):
    """Write a value to a PFIO."""
    PFIO.digital_write(port, value)

I think if the board_address is not set then this is default (0).
Could it be if the INIT_PY is changed (how ,I’mno t sure exactly) a line “board address” is added, something like this:

def write_output(port, value, board_address):
    """Write a value to a PFIO."""
    PFIO.digital_write(port, value, board_address)

What should look like this.

# Example configuration.yaml entry
switch:
  - platform: rpi_pfio
     board_address: 1      <-----------------------
     ports:
       0:
         name: Doorlock
         invert_logic: true
       1:
         name: Light Desk 

maybe I’m thinking too easily , I’m not an programmer.
I have create an future request over this issue https://community.home-assistant.io/t/more-then-1-piface-address-rule/175932

I am not a programmer but I like your logical thinking. Perhaps I have a stab at guessing the name… perhaps looking at the implementation in other binary sensors where more than one board can be stacked. I had already soldered (beautifully) my shim to my piface only to find code not complete ! I will investigate… a few spare days / weeks/ months at the moment

Same problem !!!
Just landed in this wonderful Hassio world, coming from domoticz, but I nee dto control TWO piface boards.
Have you solved??

I’m not an programmer ,it’s too difficult for me .
Maybe there is someone on this forum who has the same problem and can fix this .
If I know what and where I must search then would I try this.