Your code replaces the entire machines field with the value you specify.
As explained in the doc, you can use the "dot notation" to reference nested fields within the document.
In your case:
db.collection('customers').document('B')
.update(
{ "machines.B1.status": "online"}
);