Hi, First post so please be gentle - Just really getting into Home Assistant and playing with sensors, trying to setup a energy monitor and whilst I have this working on 1 channel I want to get all four working.
Setup - Home Assistant on Docker (Raspberry Pi), D1 Mini flashed with ESPHOME, MottramLabs 4 channel ADS1115 and 4x CT013 Clamps
My code as per below … Any pointers on getting the other 3 sensors working would be appreciated as I’ve hit a brick wall trying to search for something to help…
# energy.yaml
# 2022-11-15 -
# Standard YAML Stuff
esphome:
name: housepowermonitor
platform: ESP8266
board: d1_mini
# Enable Logger
logger:
# Enable Home Assistant API
api:
# Over the Air Password
ota:
password: ""
# Network Configuration
wifi:
networks:
- ssid: "xxxxxxx"
password: "xxxxxxx"
# Fallback hotspot in case Wifi connection fails
ap:
ssid: "espfallback"
password: ""
# Config
captive_portal:
# Web Server
web_server:
port: 80
auth:
username: xxxxxxx
password: xxxxxxx
# Time Services
time:
platform: sntp
id: my_time
# Hardware Control
i2c:
sda: 4
scl: 5
scan: true
id: bus_a
# Module
ads1115:
- address: 0x48
id: ads1115_48
# Sensors
sensor:
# Input Sensor (Clamp)
- platform: ads1115
multiplexer: "A0_GND"
gain: 6.144
name: "ADS1115 Channel A0-GND"
id: adc_sensor0
# Read a known voltage from Home Assistant to get a more accurate running position
- platform: homeassistant
name: "Known Voltage"
entity_id: sensor.g_dc1_energy_voltage
id: known_volts
# Daily Totals Sensor
- platform: total_daily_energy
name: "Total Daily Energy CH0"
power_id: my_power0
unit_of_measurement: "kWh"
id: import_ct_total
# Clamp Sensor
- platform: ct_clamp
sensor: adc_sensor0
name: "Home Current CH0"
id: livesensor0
update_interval: 5s
filters:
- calibrate_linear:
- 0 -> 0
- 0.02345 -> 4.646
# Return Sensor
- platform: template
id: my_power0
name: "Home Power CH1"
lambda: return id(livesensor0).state * id(known_volts).state / 1000;
update_interval: 5s