We construct knot invariants from solutions to the Yang--Baxter equation associated to appropriately generalized left/right Yetter--Drinfel'd modules over a braided Hopf algebra with an automorphism. When applied to Nichols algebras, our method reproduces known knot polynomials and naturally produces multivariable polynomial invariants of knots. We discuss in detail Nichols algebras of rank 1 which recover the ADO and the colored Jones polynomials of a knot and two sequences of examples of rank 2 Nichols algebras, one of which starts with the product of two Alexander polynomials, and then conjecturally the Harper polynomial. The second sequence starts with the Links--Gould invariant (conjecturally), and then with a new 2-variable knot polynomial that detects chirality and mutation, and whose degree gives sharp bounds for the genus for a sample of 30 computed knots.