If the sensor is pressed, the IO state should be 0. The touch sensor pulls the line low when pressed, and when not pressed, the internal pullup of the PCF8574 IO pulls the line back high.
Inverting the value like you did is a good way to fix the "problem". Note however that the ! symbol means logic NOT, and the ~ symbol means bit NOT. It's not common practice to use ! when dealing with bits/data, rather than logic. Along the lines of more common programming practice, I would have done something like this instead:
I admittedly don't understand the "level pull" thing because I don't understand the electronical side
- but -
yes, thanx, works quite as well!
- and insanely quick!