:description:Configure an Etekcity Voltson and calculate the missing current sensor
:image:esw01-eu.jpg
:keywords:Etekcity, Voltson, ESW01, ESW01-EU, HLW8012, Home Assistant, ESPHome
The Etekcity Voltson brings a 10A relay, two LEDs (blue and yellow), a push button and a :doc:`/components/sensor/hlw8012`
in a very small package and at a reasonable price.
..note::
There are quite a few hardware revisions out there. Also reginal versions like US, UK and EU are different.
Flashing
--------
Opening the case for flashing varies a lot for different hardware revisions. Mine was easy as it had two tiny T5 Torx screws in the front and four Philipps screws inside.
Once you have opened the case, remove the PCB from it and attach your TTL as follows:
5V and GND go to the bottom:
..figure:: images/esw01-eu-pcb-bottom.jpg
:align:center
:width:75.0%
On the opposite side, T12 is TX, T13 is RX. During boot you need to connect T11 and T16 pads to GND. Easiest is to flash with pogo pins.
..figure:: images/esw01-eu-pcb-top.jpg
:align:center
:width:75.0%
Configuration
-------------
As the Voltson has its SEL pin permanently pulled high, we are unable to switch from voltage measurement to current measurement.
This will be circumvented by defining the initial mode to be voltage measurement (see :doc:`/components/sensor/hlw8012` documentation)
and calculating the current with `Ohm's law <https://en.wikipedia.org/wiki/Ohm%27s_law>`_: ``P (watts) = V (volts) x I (amps)``