# Decoding a 433 MHz energy monitor

I am attempting to capture transmissions from my own energy monitor, a Watts Clever EW4009 for use with Home Assistant.

I believe it is an FSK signal, with 250 um packets.

I have captured several transmissions, and found the following variation between them:

0011 0011 00110 011 01000100 1101 1110 – 0 watts

0011 0011 00110 011 01000100 1101 1110 – 0 watts

0011 0101 00110 110 01000100 1110 0011 – 1335 watts

1110 0001 00110 101 01000100 1000 1110 – 1190 watts

1100 0001 00110 101 01000100 0110 1110 – 1134 watts

0000 1000 00110 100 01000100 1011 0100 – 813 watts

1100 0011 00110 100 01000100 0110 1111 – 693 watts

1101 0110 00110 100 01000100 1000 0010 – 726 watts

I think the transmission might have a different "watt" value, since the "watt" value displayed on the energy monitor base station depends on the base station settings for voltage etc.

Here is the full transmission (0 watts example): 101010101010101010101010001011011101010010001100011101001111100100010101001111101011001100110011001100110100010011011110010101010000000000000000

And a screenshot of the signal with the variation between them highlighted:

Update: My question is how can I decode the binary data to obtain the watt value above which is shown on the energy monitor? I have attempted to convert the watt value to binary, but it looks like the data is probably encrypted somehow

• You seem unsure of data format, and you might broaden your interpretation...it might not be FSK (could also be OOK). Investigate pulse-width, pulse-position too. There are many encoding possibilities besides FSK. Sep 25, 2021 at 13:21
• represent the watt reading in binary Sep 25, 2021 at 15:35
• I believe it sends values in amps with max current of 100A and 0.1A sensitivity. Sep 26, 2021 at 1:04
• "I believe it sends values in amps with max current of 100A and 0.1A sensitivity." - that sounds reasonable (though the specs say max current 60A and minimum sensitivity 0.2A, it might transmit values from eg. 0-99.9A with 0.1A resolution). What voltage is it set to, and what mode are you using it in? Sep 26, 2021 at 5:40
• What makes you think it's encrypted? Do you even know what base format it has: NRZ or Manchester? It looks a bit on the Manchester side to me. Given that it is actually FSK and not OOK or such. Sep 27, 2021 at 11:00

From what I have determined there is a serial TTL data stream on the RJ45 connector of the display. This when interfaced with a serial to USB convertor can be connected to a PC and the data displayed on a program which is supposed to be on the Watts Clever web site. This may be an easier way to go to get the data you are after once you work out the protocol which is more likely in ASCII and more readable.

Its fairly straightforward to get the EW4009 working in home assistant

1. To do so, you'll need the serial port working on ttyUSB0 on your home assistant
2. Create a python script EW4009.py, Save in your /config folder in Home Assistant
import serial
import time
import json

# Open serial port
ser = serial.Serial('/dev/ttyUSB0', 9600)

# Write hex characters

# Wait for a response
time.sleep(1)

#CT Clamp 1
# Extract text between S02 and S03
starta = response.find(b'S02')
enda = response.find(b'S03')

#CT Clamp 2
# Extract text between S03 and S04
startb = response.find(b'S03')
endb = response.find(b'S04')

if starta != -1 and enda != -1:
responsea = response[starta:enda]

if startb != -1 and endb != -1:
responseb = response[startb:endb]

# Calculate the number from the 5th and 6th bytes
bytes_a = responsea[5:7]
bytes_b = responseb[5:7]

# Concatenate the bytes into a single string
output = bytes_a + bytes_b

# Convert the ASCII values to numeric values
ct_clamp1 = int(output[0])+256*int(output[1])
ct_clamp2 = int(output[2])+256*int(output[3])

#JSON Code to output format in JSON for multisensor
# Create a dictionary with the attributes
attributes = {
'CTClamp1': ct_clamp1,
'CTClamp2': ct_clamp2,
}

# Print the dictionary as a JSON object
print(json.dumps(attributes))

# Close serial port
ser.close()

   - platform: command_line
name: Multisensor
unique_id: 'Ew4009_2'
command: 'python3 /config/EW4009.py'
value_template: "{{ value }}"
json_attributes:
- CTClamp1
- CTClamp2
scan_interval: 30


template:

 - sensor:
name: ew4009_ct_clamp1_power
unique_id: 'clampct1'
state_class: measurement
icon: mdi:transmission-tower
unit_of_measurement: W
device_class: power
state: >
{{ state_attr('sensor.multisensor', 'CTClamp1'  ) | int }}

- sensor:
name: ew4009_ct_clamp2_power
unique_id: 'clampct2'
state_class: measurement
icon: mdi:transmission-tower
unit_of_measurement: W
device_class: power
state: >
{{ state_attr('sensor.multisensor', 'CTClamp2'  ) | int }}


1. Restart home assistant

You need to make sure from a ssh terminal that the python code returns JSON data.

For example, executing:

python /config/EW4009.py returns {"CTClamp1":85, "CTClamp2": 150} where 85 and 150 are the power readings from your connected wireless CT clamps.

Good luck

• stevet - Hi, Thanks for writing an answer. (a) As you're new here, please see the tour & help center as the site rules differ from typical forums. (b) I'm not familiar with Home Assistant but the Python code & config data in the answer was being mangled, as it was being interpreted by the default Markdown parser. Therefore I added "code fences" around the code and the config data to prevent the mangling. Please review to see if it needs any further changes, for it to be displayed how you intended. Thanks. Oct 5, 2023 at 5:09