zorrua
September 21, 2019, 8:44pm
1
Hello,
I have a Efergy (Model elite 2.0R) to monitor the power use of my house.
I can capture the data by RTL-SDR device in 433 MHz: https://github.com/andresol/Efergy-E2-linux
Is it possible to add this data to Home Assistant? Is there any compatible hardware for this?
I will appreciate your help.
Regards.
1 Like
Hi @zorrua - I found this post when looking for the same thing, but I’ve now solved it.
If you’ve already got RTL-SDR working with the device and outputting at the command line, you’re nearly there!
Here’s what I did to get data from my Efergy elite 3.0R .
Setup RTL-SDR with help from:
I’m using a similar command-line data capture to you (from same original source): https://github.com/magellannh/RPI_Efergy
In the C code, I changed EXPECTED_BYTECOUNT_IF_CRC_USED
to 8
(Some interesting discussion: https://goughlui.com/2013/11/14/efergy-energy-monitor-decoding-with-rtl-sdr/ )
Settings/command that worked for me:
rtl_fm -f 433.518e6 -s 200000 -r 96000 -A fast | ./EfergyRPI_log -d
So to send this command line output to MQTT:
rtl_fm -f 433.518e6 -s 200000 -r 96000 -A fast | ./EfergyRPI_log | xargs -I{} mosquitto_pub -t 'energy/maintariff' -u xxx -P xxx -m '{}'
I put that command into a script and made it a service that runs on boot with help from: https://www.raspberrypi.org/documentation/linux/usage/systemd.md
In the HA dev tools I tested that the MQTT message was being received.
The messages I get look like: date,time,value
so I split the value out on its own with the template below.
Then I created an MQTT sensor with value template in HA like:
# sensors.yaml
- platform: mqtt
name: 'Energy Usage'
state_topic: 'energy/maintariff'
value_template: "{{ value.split(',')[-1] }}"
I’ve been experimenting with how to best display it as a relevant graph.
3 Likes
Another (maybe simpler) option is to use the packet decoding already done in rtl_433. My runstring to send it to MQTT is:
rtl_433 -R 36 -f 433485000 -F mqtt://10.1.1.20,user=username,pass=password,retain=1,events=Efergy[/id]
(all on one line of course)
I have multiple Efergy transmitters. The config.yaml entry for one of them is:
mqtt:
sensor:
- name: "Efergy Gen Consumption Direct Amps"
state_topic: "Efergy/11086"
unit_of_measurement: "A"
value_template: "{{ value_json.current }}"
- name: "Efergy Gen Consumption Direct Battery"
state_topic: "Efergy/11086"
value_template: "{{ value_json.battery_ok }}"
- name: "Efergy Gen Consumption Direct Update"
state_topic: "Efergy/11086"
value_template: "{{ value_json.time }}"
- name: "Efergy Gen Consumption Direct Interval"
state_topic: "Efergy/11086"
value_template: "{{ value_json.interval }}"
1 Like