├── case_ears.stl ├── jpgs ├── sct_100a.jpg ├── 2chan_board.jpg ├── 6chan_board.jpg └── cropped-CircuitSetup_name-1.png ├── 6channel_energy_meter_box.stl ├── LICENSE ├── digiWTHR └── solar_weather.yaml ├── README.md ├── digi_nrg_2chan32.yaml └── digi_nrg_6chan32.yaml /case_ears.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CircuitSetup/digiNRG_ESPHome/master/case_ears.stl -------------------------------------------------------------------------------- /jpgs/sct_100a.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CircuitSetup/digiNRG_ESPHome/master/jpgs/sct_100a.jpg -------------------------------------------------------------------------------- /jpgs/2chan_board.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CircuitSetup/digiNRG_ESPHome/master/jpgs/2chan_board.jpg -------------------------------------------------------------------------------- /jpgs/6chan_board.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CircuitSetup/digiNRG_ESPHome/master/jpgs/6chan_board.jpg -------------------------------------------------------------------------------- /6channel_energy_meter_box.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CircuitSetup/digiNRG_ESPHome/master/6channel_energy_meter_box.stl -------------------------------------------------------------------------------- /jpgs/cropped-CircuitSetup_name-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CircuitSetup/digiNRG_ESPHome/master/jpgs/cropped-CircuitSetup_name-1.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 digiblur 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /digiWTHR/solar_weather.yaml: -------------------------------------------------------------------------------- 1 | substitutions: 2 | display_name: digiWTHR 3 | 4 | esphome: 5 | name: solar_weather 6 | platform: ESP8266 7 | # board: d1_mini_pro 8 | board: d1_mini 9 | 10 | wifi: 11 | ssid: !secret wifi_ssid 12 | password: !secret wifi_pass 13 | manual_ip: 14 | static_ip: !secret ip_solarweather 15 | gateway: !secret ip_gateway 16 | subnet: !secret ip_subnet 17 | dns1: !secret ip_dns1 18 | 19 | #api: 20 | 21 | # Enable logging 22 | logger: 23 | 24 | mqtt: 25 | broker: !secret mqtt_broker 26 | username: !secret mqtt_user 27 | password: !secret mqtt_pass 28 | birth_message: 29 | topic: solarsensor/birthdisable 30 | payload: disable 31 | will_message: 32 | topic: solarsensor/willdisable 33 | payload: disable 34 | 35 | ota: 36 | 37 | i2c: 38 | - id: ic_1 39 | sda: 4 40 | scl: 5 41 | scan: false 42 | 43 | sensor: 44 | - platform: bme280 45 | temperature: 46 | name: ${display_name} Temp 47 | oversampling: 4x 48 | pressure: 49 | name: ${display_name} Pres 50 | oversampling: 4x 51 | humidity: 52 | name: ${display_name} Humi 53 | oversampling: 4x 54 | address: 0x76 55 | update_interval: 30s 56 | 57 | - platform: bh1750 58 | name: ${display_name} Lux 59 | address: 0x23 60 | update_interval: 25s 61 | 62 | - platform: adc 63 | pin: A0 64 | name: ${display_name} Battery 65 | update_interval: 35s 66 | filters: 67 | - multiply: 5.1923 68 | 69 | 70 | deep_sleep: 71 | run_duration: 40s 72 | sleep_duration: 4min -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # digiNRG - Whole Home Power Monitoring with ESPHome 2 | Whole home power monitoring and additional power circuits with ESPHome and Home Assistant. This implementation utilizes the ATM90E32AS based board from CircuitSetup. Other home automation software supporting MQTT can also use this integration. 3 | 4 | Video Demostration and Setup - https://youtu.be/BOgy6QbfeZk 5 | 6 | Update 2019/08/24 - For v1.2 of the board your voltage calibration will be high, >64,000. This is normal. 7 | 8 | ### Parts List 9 | [Split Core Current Transformer 100A/50ma](https://amzn.to/2JtuRSt) 10 | [ESP32 NodeMCU](https://amzn.to/2XvEBAs) 11 | [CircuitSetup 6 Channel or 2 Channel Board](https://circuitsetup.us/index.php/product-category/power-management/) 12 | [9VAC Power Supply](https://amzn.to/2Jt4uMh) 13 | 14 | ### Sample Calibrations for SCT Sizes 15 | If you have any to add or changes to these, pleast let us know! These are based on the 6 channel board with 1X gain. 16 | [SCT-013-000 100A/50ma](https://amzn.to/2JtuRSt) - 32498 17 | [SCT-013-050 50A/1V](https://amzn.to/2XzkyB3) - 15420 18 | [SCT-013-030 30A/1V](https://amzn.to/2FZLdB9) - 9210 19 | 20 | ### Sample ESPHome YAML Configurations 21 | digi_nrg_2chan32.yaml - Included in this repo 22 | digi_nrg_6chan32.yaml - Included in this repo 23 | 24 | ![alt text](https://raw.githubusercontent.com/digiblur/digiNRG_ESPHome/master/jpgs/2chan_board.jpg "2 Channel") 25 | ![alt text](https://raw.githubusercontent.com/digiblur/digiNRG_ESPHome/master/jpgs/6chan_board.jpg "6 Channel") 26 | ![alt text](https://raw.githubusercontent.com/digiblur/digiNRG_ESPHome/master/jpgs/sct_100a.jpg "SCT") 27 | 28 | -------------------------------------------------------------------------------- /digi_nrg_2chan32.yaml: -------------------------------------------------------------------------------- 1 | substitutions: 2 | # Change the disp_name to something you want 3 | disp_name: 2C 4 | # Interval of how often the power is updated 5 | update_time: 10s 6 | 7 | esphome: 8 | name: digi_nrg_2chan32 9 | platform: ESP32 10 | board: nodemcu-32s 11 | 12 | wifi: 13 | ssid: !secret wifi_ssid 14 | password: !secret wifi_pass 15 | manual_ip: 16 | static_ip: !secret ip_eh_nrgnode_2chan32 17 | gateway: !secret ip_gateway 18 | subnet: !secret ip_subnet 19 | dns1: !secret ip_dns1 20 | 21 | mqtt: 22 | broker: !secret mqtt_broker 23 | username: !secret mqtt_user 24 | password: !secret mqtt_pass 25 | 26 | # Enable logging 27 | logger: 28 | 29 | #api: 30 | 31 | ota: 32 | 33 | web_server: 34 | port: 80 35 | 36 | spi: 37 | clk_pin: 18 38 | miso_pin: 19 39 | mosi_pin: 23 40 | 41 | sensor: 42 | - platform: wifi_signal 43 | name: ${disp_name} WiFi Signal 44 | update_interval: 60s 45 | - platform: atm90e32 46 | cs_pin: 5 47 | phase_a: 48 | voltage: 49 | name: ${disp_name} Volts 50 | accuracy_decimals: 1 51 | current: 52 | name: ${disp_name} CT1 Amps 53 | id: "ct1Amps" 54 | power: 55 | name: ${disp_name} CT1 Watts 56 | accuracy_decimals: 1 57 | id: "ct1Watts" 58 | # Voltage using a 12VAC power transformer 59 | gain_voltage: 32428 60 | # Current calibration using a 100A/50ma SCT-013-000 61 | gain_ct: 24131 62 | phase_c: 63 | current: 64 | name: ${disp_name} CT2 Amps 65 | id: "ct2Amps" 66 | power: 67 | name: ${disp_name} CT2 Watts 68 | accuracy_decimals: 1 69 | id: "ct2Watts" 70 | # If the wattage is backwards due to the phase 180 degrees from the clamp direction 71 | filters: 72 | - multiply: -1.0 73 | gain_voltage: 32428 74 | gain_ct: 24131 75 | frequency: 76 | name: ${disp_name} Freq 77 | line_frequency: 60Hz 78 | gain_pga: 2X 79 | update_interval: ${update_time} 80 | - platform: template 81 | name: ${disp_name} Total Amps 82 | id: "totalAmps" 83 | lambda: return id(ct1Amps).state + id(ct2Amps).state; 84 | accuracy_decimals: 2 85 | unit_of_measurement: A 86 | update_interval: ${update_time} 87 | icon: "mdi:flash-circle" 88 | - platform: template 89 | name: ${disp_name} Total Watts 90 | id: "totalWatts" 91 | lambda: return id(ct1Watts).state + id(ct2Watts).state; 92 | accuracy_decimals: 0 93 | unit_of_measurement: W 94 | icon: "mdi:flash-circle" 95 | update_interval: ${update_time} 96 | 97 | - platform: total_daily_energy 98 | name: ${disp_name} Total kWh 99 | power_id: totalWatts 100 | filters: 101 | - multiply: 0.001 102 | unit_of_measurement: kWh 103 | 104 | time: 105 | - platform: sntp 106 | id: sntp_time 107 | 108 | switch: 109 | - platform: restart 110 | name: ${disp_name} Restart -------------------------------------------------------------------------------- /digi_nrg_6chan32.yaml: -------------------------------------------------------------------------------- 1 | substitutions: 2 | # Change the disp_name to something you want 3 | disp_name: 6C 4 | # Interval of how often the power is updated 5 | update_time: 10s 6 | 7 | esphome: 8 | name: digi_nrg_6chan32 9 | platform: ESP32 10 | board: nodemcu-32s 11 | 12 | wifi: 13 | ssid: !secret wifi_ssid 14 | password: !secret wifi_pass 15 | manual_ip: 16 | static_ip: !secret ip_eh_nrgnode 17 | gateway: !secret ip_gateway 18 | subnet: !secret ip_subnet 19 | dns1: !secret ip_dns1 20 | 21 | mqtt: 22 | broker: !secret mqtt_broker 23 | username: !secret mqtt_user 24 | password: !secret mqtt_pass 25 | 26 | # Enable logging 27 | logger: 28 | 29 | #api: 30 | 31 | ota: 32 | 33 | web_server: 34 | port: 80 35 | 36 | spi: 37 | clk_pin: 18 38 | miso_pin: 19 39 | mosi_pin: 23 40 | 41 | sensor: 42 | - platform: wifi_signal 43 | name: ${disp_name} WiFi 44 | update_interval: 60s 45 | - platform: atm90e32 46 | cs_pin: 5 47 | phase_a: 48 | voltage: 49 | name: ${disp_name} Volts A 50 | id: ic1Volts 51 | accuracy_decimals: 1 52 | # filters: 53 | # - multiply: 2.0 54 | current: 55 | name: ${disp_name} CT1 Amps 56 | id: ct1Amps 57 | gain_voltage: 42620 58 | # Voltage using a 9VAC power transformer 59 | # Note: If you can not get the voltage correct with the highest gain of 65535, uncomment the 2.0 multiply filter above and lower the gain as needed 60 | gain_ct: 15420 61 | # Current calibration using a 50A/1V SCT-013-050 62 | phase_b: 63 | current: 64 | name: ${disp_name} CT2 Amps 65 | id: ct2Amps 66 | gain_ct: 32498 67 | # Current calibration using a 100A/50ma SCT-013-000 68 | phase_c: 69 | current: 70 | name: ${disp_name} CT3 Amps 71 | id: ct3Amps 72 | gain_ct: 32498 73 | # Current calibration using a 100A/50ma SCT-013-000 74 | frequency: 75 | name: ${disp_name} Freq A 76 | line_frequency: 60Hz 77 | gain_pga: 1X 78 | update_interval: ${update_time} 79 | - platform: atm90e32 80 | cs_pin: 4 81 | phase_a: 82 | voltage: 83 | name: ${disp_name} Volts B 84 | id: ic2Volts 85 | accuracy_decimals: 1 86 | current: 87 | name: ${disp_name} CT4 Amps 88 | id: ct4Amps 89 | gain_voltage: 42620 90 | gain_ct: 32498 91 | # Current calibration using a 100A/50ma SCT-013-000 92 | phase_b: 93 | current: 94 | name: ${disp_name} CT5 Amps 95 | id: ct5Amps 96 | gain_ct: 32498 97 | # Current calibration using a 100A/50ma SCT-013-000 98 | phase_c: 99 | current: 100 | name: ${disp_name} CT6 Amps 101 | id: ct6Amps 102 | gain_ct: 8650 103 | # Current calibration using a 30A/1V SCT-013-030 104 | frequency: 105 | name: ${disp_name} Freq B 106 | line_frequency: 60Hz 107 | gain_pga: 1X 108 | update_interval: ${update_time} 109 | - platform: template 110 | name: ${disp_name} CT1 Watts 111 | id: ct1Watts 112 | lambda: return id(ct1Amps).state * id(ic1Volts).state; 113 | accuracy_decimals: 0 114 | unit_of_measurement: W 115 | icon: "mdi:flash-circle" 116 | update_interval: ${update_time} 117 | - platform: template 118 | name: ${disp_name} CT2 Watts 119 | id: ct2Watts 120 | lambda: return id(ct2Amps).state * id(ic1Volts).state; 121 | accuracy_decimals: 0 122 | unit_of_measurement: W 123 | icon: "mdi:flash-circle" 124 | update_interval: ${update_time} 125 | - platform: template 126 | name: ${disp_name} CT3 Watts 127 | id: ct3Watts 128 | lambda: return id(ct3Amps).state * id(ic1Volts).state; 129 | accuracy_decimals: 0 130 | unit_of_measurement: W 131 | icon: "mdi:flash-circle" 132 | update_interval: ${update_time} 133 | - platform: template 134 | name: ${disp_name} CT4 Watts 135 | id: ct4Watts 136 | lambda: return id(ct4Amps).state * id(ic2Volts).state; 137 | accuracy_decimals: 0 138 | unit_of_measurement: W 139 | icon: "mdi:flash-circle" 140 | update_interval: ${update_time} 141 | - platform: template 142 | name: ${disp_name} CT5 Watts 143 | id: ct5Watts 144 | lambda: return id(ct5Amps).state * id(ic1Volts).state; 145 | accuracy_decimals: 0 146 | unit_of_measurement: W 147 | icon: "mdi:flash-circle" 148 | update_interval: ${update_time} 149 | - platform: template 150 | name: ${disp_name} CT6 Watts 151 | id: ct6Watts 152 | lambda: return id(ct6Amps).state * id(ic1Volts).state; 153 | accuracy_decimals: 0 154 | unit_of_measurement: W 155 | icon: "mdi:flash-circle" 156 | update_interval: ${update_time} 157 | - platform: template 158 | name: ${disp_name} Total Amps 159 | id: totalAmps 160 | lambda: return id(ct4Amps).state + id(ct5Amps).state; 161 | accuracy_decimals: 2 162 | unit_of_measurement: A 163 | icon: "mdi:flash" 164 | update_interval: ${update_time} 165 | 166 | - platform: template 167 | name: ${disp_name} Total Watts 168 | id: totalWatts 169 | lambda: return id(totalAmps).state * id(ic2Volts).state; 170 | accuracy_decimals: 1 171 | unit_of_measurement: W 172 | icon: "mdi:flash-circle" 173 | update_interval: ${update_time} 174 | 175 | - platform: total_daily_energy 176 | name: ${disp_name} Total kWh 177 | power_id: totalWatts 178 | filters: 179 | - multiply: 0.001 180 | unit_of_measurement: kWh 181 | 182 | switch: 183 | - platform: restart 184 | name: ${disp_name} Restart 185 | time: 186 | - platform: sntp 187 | id: sntp_time 188 | 189 | --------------------------------------------------------------------------------