Skip to content

Commit

Permalink
Wifi stats
Browse files Browse the repository at this point in the history
Wifi stats and readme updates.
  • Loading branch information
danpeig committed Dec 27, 2022
1 parent afa9a12 commit 0098811
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 9 deletions.
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ The solution I present here is a DIY project built on the top of [Open Energy Mo
- Daily energy consumption (kWh)
- Weekly energy consumption (kWh)
- Monthly energy consumption (kWh)
- Wifi connection stats

## Hardware

Expand All @@ -38,7 +39,7 @@ N = number of phases to be measured (1, 2 or 3)
- 2 x N x 10 kOhm resistor
- N x 10uF electrolytic capacitor
- N x 22 Ohm resistor. If using another range/model of current sensor, the resistance will change or the resistor will not be needed at all.
- N x 2.5mm stereo audio connector
- N x 3.5mm stereo audio connector
- Wires and a prototype board for connecting everything

![Parts and final assembly](images/electronic_parts.png)
Expand Down Expand Up @@ -198,12 +199,21 @@ MQTT integration is disabled by default. To enable, uncomment the lines in the y

- **I don't have a neutral wire. Can I use 2 phases for voltage measurement?** Yes, but you need to change the power calculations in the code.

- **Losing Wifi or MQTT connection** Try to decrease the CROSSINGS setting in *esp32emon.h*. The blocking nature for Emonlib sometimes does this.
- **Losing Wifi, MQTT connection or constant reboots:** Try to decrease the CROSSINGS setting in *esp32emon.h*. The blocking nature for Emonlib sometimes does this.

- **ESPHome webserver is crashing** The web server was disabled because it was crashing the ESP32. due the blocking nature of Emon library. You may be able to run it if you decrease the CROSSINGS setting in *esp32emon.h*.
- **ESPHome webserver is crashing:** The web server was disabled because it was crashing the ESP32. due the blocking nature of Emon library. You may be able to run it if you decrease the CROSSINGS setting in *esp32emon.h*.

## Download sources
- [GitHub Releases](https://github.com/danpeig/ESP32EnergyMonitor/releases/)
- **Negative power readings:** Double check the CT clamp connections. Try inverting the clamp direction in the wire.

## Download
- [GitHub Release](https://github.com/danpeig/ESP32EnergyMonitor/releases/)

## Version history
- 1.0 (24/12/2022)
- Initial release
- 1.1 (27/12/2022)
- Added Wifi connection status outputs
- Improved current and voltage calibration output visuals

## Further reading and references
- [Savjee Home Energy monitor with ESP32](https://savjee.be/blog/Home-Energy-Monitor-ESP32-CT-Sensor-Emonlib/)
Expand Down
6 changes: 3 additions & 3 deletions esphome-esp32emon/esp32emon.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
#define I3 33

// Calibration for voltage sensors CV and current sensors CI
#define CV1 545
#define CV2 545 //Set to CV1 if using only one voltage meter
#define CV3 545 //Set to CV1 if using only one voltage meter
#define CV1 510
#define CV2 510 //Set to CV1 if using only one voltage meter
#define CV3 510 //Set to CV1 if using only one voltage meter

#define CI1 96.72
#define CI2 94.93
Expand Down
25 changes: 24 additions & 1 deletion esphome-esp32emon/esp32emon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ esphome:
- esp32emon.h
project:
name: danpeig.esp32emon
version: "1.0.0"
version: "1.1.0"

# Board configuration
esp32:
Expand Down Expand Up @@ -264,3 +264,26 @@ sensor:
restore: false #If true, save the reading to the flash memory to prevent data loss in case of power loss
filters:
- multiply: 0.001

# Wifi signal sensors
- platform: wifi_signal # Reports the WiFi signal strength/RSSI in dB
name: "WiFi signal dB"
id: wifi_signal_db
update_interval: 60s
entity_category: "diagnostic"

- platform: copy # Reports the WiFi signal strength in %
source_id: wifi_signal_db
name: "WiFi signal percent"
filters:
- lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
unit_of_measurement: "%"
entity_category: "diagnostic"

# Other information
text_sensor:
- platform: wifi_info
ip_address:
name: ESP32 IP Address
ssid:
name: ESP32 SSID

0 comments on commit 0098811

Please sign in to comment.