An electricity meter adapted to measure electricity consumption in an electricity distribution network with three phases (L1, L2, L3), the electricity meter comprising: - a measuring circuit for measuring voltages and currents for each of the three phases, - a microcontroller unit configured to calculate the electric energy supplied from the electricity distribution network via the phases, and - an impedance learning algorithm unit for being executed by the microcontroller unit, being arranged to estimate impedance values of the electricity distribution network as seen at the electricity meter, wherein the impedance learning algorithm unit is arranged to: - based on measured voltages and currents from the three phases, continuously calculate values of zero sequence and negative sequence voltages (V 0, V 2) and values of zero sequence and negative sequence currents (I 0, I 2) characterized in - estimating a zero sequence impedance (Z 0) as the ratio between a summation of changes in the zero sequence voltage (ΔV 0) and a summation of the changes in the zero sequence current (ΔI 0), - estimating a negative sequence impedance ( Z 2) as the ratio between a summation of changes in the negative sequence voltage (ΔVz) and a summation of changes in the negative sequence current (ΔI 2) wherein the summations of changes in zero- and negative sequence voltages and currents are continuously updated in an adjustable auto-regressive process and wherein the auto-regressive process for estimating the zero sequence impedance (Z 0) comprises a first forgetting factor (ρ 0), and the auto-regressive processes for estimating the negative sequence impedance ( Z 2) comprises a second forgetting factor (ρ 2). - a measuring circuit for measuring voltages and currents for each of the three phases, - a microcontroller unit configured to calculate the electric energy supplied from the electricity distribution network via the phases, and - an impedance learning algorithm unit for being executed by the microcontroller unit, being arranged to estimate impedance values of the electricity distribution network as seen at the electricity meter, wherein the impedance learning algorithm unit is arranged to: - based on measured voltages and currents from the three phases, continuously calculate values of zero sequence and negative sequence voltages (V 0, V 2) and values of zero sequence and negative sequence currents (I 0, I 2) characterized in - estimating a zero sequence impedance (Z 0) as the ratio between a summation of changes in the zero sequence voltage (ΔV 0) and a summation of the changes in the zero sequence current (ΔI 0), - estimating a negative sequence impedance ( Z 2) as the ratio between a summation of changes in the negative sequence voltage (ΔVz) and a summation of changes in the negative sequence current (ΔI 2) wherein the summations of changes in zero- and negative sequence voltages and currents are continuously updated in an adjustable auto-regressive process and wherein the auto-regressive process for estimating the zero sequence impedance (Z 0) comprises a first forgetting factor (ρ 0), and the auto-regressive processes for estimating the negative sequence impedance ( Z 2) comprises a second forgetting factor (ρ 2). - based on measured voltages and currents from the three phases, continuously calculate values of zero sequence and negative sequence voltages (V 0, V 2) and values of zero sequence and negative sequence currents (I 0, I 2) - estimating a zero sequence impedance (Z 0) as the ratio between a summation of changes in the zero sequence voltage (ΔV 0) and a summation of the changes in the zero sequence current (ΔI 0), - estimating a negative sequence impedance ( Z 2) as the ratio between a summation of changes in the negative sequence voltage (ΔVz) and a summation of changes in the negative sequence current (ΔI 2) wherein the summations of changes in zero- and negative sequence voltages and currents are continuously updated in an adjustable auto-regressive process and wherein the auto-regressive process for estimating the zero sequence impedance (Z 0) comprises a first forgetting factor (ρ 0), and the auto-regressive processes for estimating the negative sequence impedance ( Z 2) comprises a second forgetting factor (ρ 2).