Efergy receiver for ESPHome / Home Assistant — NodeMCU ESP8266

This package uses the decoder and radio settings that received ID 47183 on
the project NodeMCU. It fixes the radio at 433.550 MHz and filters that transmitter.
It runs with Wi-Fi and ESPHome's encrypted native API. No MQTT broker is needed.

INSTALL
1. Extract this archive on your PC.
2. Copy efergy-receiver.yaml and the components folder into your ESPHome
   configuration directory. For a typical Home Assistant Device Builder
   installation this is /config/esphome. Use your file editor, Samba share
   or Studio Code Server to transfer the files.
3. Replace the placeholders in secrets.example.yaml with your own settings,
   generating a fresh 32-byte base64 API key and an OTA password.
   Merge these entries into your existing
   ESPHome secrets.yaml. Keep your existing Wi-Fi secrets and other entries.
   The YAML expects wifi_ssid and wifi_password. Adjust those references if
   your Wi-Fi secrets have different names. Do not share the secrets file.
4. Open ESPHome Device Builder. The new device is named Efergy Receiver.
   Validate and install its configuration. The first installation must use
   USB because the current Arduino test firmware has no ESPHome OTA service.
   Use Install > Plug into this computer if available, or download the binary
   and flash it with https://web.esphome.io/ using Chrome or Edge.
5. When it joins Wi-Fi, open its logs in Device Builder. Expect:
   Ready at 433.550 MHz, filtering ID=47183 (0xB84F)
   and checksum=OK current readings.
6. In Home Assistant go to Settings > Devices & services. Configure the
   discovered ESPHome device. If discovery does not appear, add the ESPHome
   integration and enter the device's IP address. Use efergy_api_key from
   your secrets file when asked for the encryption key.
7. Later firmware updates can be installed wirelessly through Device Builder.

DIRECTORY LAYOUT — paths on the Home Assistant / ESPHome host
/config/esphome/
  efergy-receiver.yaml
  secrets.yaml                      (existing file; merge new entries)
  components/
    efergy_receiver/
      __init__.py
      efergy_receiver.h
      efergy_receiver.cpp
      EfergyDecoder.h

The external-components path is relative to the device YAML. Do not place
an extra Efergy-ESPHome parent directory between the YAML and components.
Do not add the public 91JJ component alongside this local component.

WIRING — unchanged from your working receiver
CC1101 VCC -> 3V3, GND -> GND
SCK -> D5/GPIO14; MISO/SO -> D6/GPIO12; MOSI/SI -> D7/GPIO13
CSN -> D0/GPIO16; GDO0 -> D2/GPIO4; GDO2 -> D1/GPIO5
The component owns this SPI bus; do not configure other SPI devices on it.
This version supports NodeMCU ESP8266 only. ESP32 needs a platform adaptation.

HOME ASSISTANT ENTITIES
Current: decoded current in amperes, updated for each valid selected packet.
Apparent Power: current x assumed mains_voltage (230 V by default), in VA.
Transmitter Battery Low: true means the transmitter reports a low battery.
Receiving Transmitter: true while a selected valid packet has arrived within
45 seconds; false when stale or the receiver has failed.
Valid Packets: accepted selected packets since receiver boot.
Dropped Edges: lost queued edges since receiver boot; zero is the target.
Current and apparent power become unknown when reception is stale.
Battery state stays at its last received value when reception is stale.

Apparent power is not measured real power: this CT-only system has no voltage
or power-factor measurement. This package intentionally does not register a
watts or kWh entity for the Energy dashboard. We can add an explicitly
estimated power/energy calculation if you want that later.

LOGS AND TROUBLESHOOTING
USB logger output is disabled to reduce timing disruption. Use Device Builder
Wi-Fi logs. The efergy_receiver tag has DEBUG logging for readings and counters.
If reception is affected by networking, try INFO for that tag first and share
the Dropped Edges value and Wi-Fi logs. The ESP32 will provide more headroom.
If validation or compilation fails, share the complete first error.
If a power readout does not reflect your house, confirm ID 47183 belongs to
your physical transmitter before using its readings in automations.

VERIFICATION
The author reported successful ESPHome/Home Assistant operation with this
corrected component. The decoder also recovered 12 recorded packets in
offline replay. Compatibility with other Efergy variants and boards has not
been established. ID 47183 is an example; identify your own transmitter.

REFERENCES
https://esphome.io/components/external_components/
https://esphome.io/components/api/
https://github.com/merbanan/rtl_433/blob/master/src/devices/efergy_e2_classic.c
https://www.ti.com/lit/ds/symlink/cc1101.pdf
