:description:Instructions for setting up ATM90E26 energy metering sensors
:image:atm90e26.jpg
:keywords:ATM90E26, Single-Phase High-Performance Wide-SpanEnergy Metering IC, Single Phase Energy Meter
The ``atm90e26`` sensor platform allows you to use your ATM90E26 voltage/current and power sensors
(`datasheet <https://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-46002-SE-M90E26-Datasheet.pdf>`__) with
ESPHome. This sensor is found in the `DitroniX GTEM ESP32 <https://ditronix.net/wiki/gtem-esp32-atm90e26-sdk-v1-specification/>`__ energy meter and other devices.
Communication with the device is done via an :ref:`SPI bus <spi>`, so you need to have an ``spi:`` entry in your configuration
with both ``mosi_pin`` and ``miso_pin`` set.
The ATM90E26 IC measures a single phase's voltage (using a transformer) and current (using a shunt or CT clamp)
and additionally provides active, reactive, and apparent power, frequency, power factor and phase angle measurements.
Configuration variables:
------------------------
-**cs_pin** (**Required**, :ref:`Pin Schema <config-pin_schema>`): The pin CS is connected to. For the 6 channel meter main board, this will always be 5 and 4. For the add-on boards a jumper can be selected for each CS pin, but default to 0 and 16.
-**line_frequency** (**Required**, string): The AC line frequency of the supply voltage. One of ``50Hz``, ``60Hz``.
-**voltage** (*Optional*): Use the voltage value of this phase in V (RMS).
All options from :ref:`Sensor <config-sensor>`.
-**current** (*Optional*): Use the current value of this phase in amperes. All options from
:ref:`Sensor <config-sensor>`.
-**power** (*Optional*): Use the power value on this phase in watts. All options from
:ref:`Sensor <config-sensor>`.
-**reactive_power** (*Optional*): Use the reactive power value on this phase. All options from
:ref:`Sensor <config-sensor>`.
-**power_factor** (*Optional*): Use the power factor value on this phase. All options from
:ref:`Sensor <config-sensor>`.
-**forward_active_energy** (*Optional*): Use the forward active energy value on this phase in watt-hours.
All options from :ref:`Sensor <config-sensor>`.
-**reverse_active_energy** (*Optional*): Use the reverse active energy value on this phase in watt-hours.
All options from :ref:`Sensor <config-sensor>`.
-**frequency** (*Optional*): Use the frequency value calculated by the meter. All options from
:ref:`Sensor <config-sensor>`.
-**pl_const** (*Optional*, int): A constant derived from the physical characteristics of your measurement setup. See the Calibration section.
Defaults to ``1429876``.
-**gain_metering** (*Optional*, int): This value determines how quickly internal energy registers accumulate and hence defines the value of a "pulse". Matching it against an existing meter is useful in that it allows visual confirmation for some devices that blink an LED for each pulse. See also the **meter_constant**.
Defaults to ``7481``.
-**gain_voltage** (*Optional*, int): Voltage gain to scale the low voltage AC power back to household mains feed.