I am having an argument with somebody regarding who is liable if something goes wrong with a manufactured electronic / electrical product. The argument also goes about whether there is some sort of certification of such products.

Ok, so lets say I buy an Arduino PLC and I connect a Wifi Controller and a couple of relays to the PLC. I then slap all of that in a box and I call it XYZremote. I take XYZremote to Makro and I try an get it on their shelf:

Does this product require some or other certification given that it is now a finished product?
(My friend thinks that it doesn't because the individual components are certified in their own right) I disagree because the manufacturers cannot speak for the finished product.

Lets say a customer purchases XYZremote, installs it and it can be proved that his house burnt down due to this device:

Who is liable - Makro, Me or Arduino
(My friend seems to think that he is not liable because the individual parts were certified) - My contention is that the manufacturer of those parts cannot be held directly responsible because they cannot take responsibility for how those components were connected together)

What about if I wire up a PLC into a control panel and the control panel burns the place down - surely the PLC manufacturer cannot be held liable.

What does the law say about such matters?