We propose a new approach to studying electrical networks interpreting the Ohm law as the operator which solves certain local Yang–Baxter equation. Using this operator and the medial graph of the electrical network we define a vertex integrable statistical model and its boundary partition function. This gives an equivalent description of electrical networks. We show that, in the important case of an electrical network on the standard graph introduced in [Curtis E B et al 1998 Linear Algebr. Appl. 283 115–50], the response matrix of an electrical network, its most important feature, and the boundary partition function of our statistical model can be recovered from each other. Defining the electrical varieties in the usual way we compare them to the theory of the Lusztig varieties developed in [Berenstein A et al 1996 Adv. Math. 122 49–149]. In our picture the former turns out to be a deformation of the later. Our results should be compared to the earlier work started in [Lam T and Pylyavskyy P 2015 Algebr. Number Theory 9 1401–18] on the connection between the Lusztig varieties and the electrical varieties. There the authors introduced a one-parameter family of Lie groups which are deformations of the unipotent group. For the value of the parameter equal to 1 the group in the family acts on the set of response matrices and is related to the symplectic group. Using the data of electrical networks we construct a representation of the group in this family which corresponds to the value of the parameter −1 in the symplectic group and show that our boundary partition functions belong to it. Remarkably this representation has been studied before in the work on six vertex statistical models and the representations of the Temperley–Lieb algebra.