Had this working with ESP32 and IAN219, but for some reason I can’t get it working with ESP8266 and IAN3221. I’m currently only using Channel 2 all readings are good in the sensors till I try to add the Total_Daily_Energy configuration. I can post the ESP32 IAN219 configuration if necessary
Thanks
name: solar-panel-8266-ina3221
esp8266:
board: esp01_1m
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
password: "2658a10a85f927998ff66c8859186d5b"
wifi:
ssid: "XXXXXX"
password: "XXXXXXX"
# Optional manual IP
manual_ip:
static_ip: 192.168.1.96
gateway: 192.168.1.1
subnet: 255.255.255.0
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Solar-Panels-3221"
password: "Y9fH0IPkz5U4"
captive_portal:
# Example configuration entry
i2c:
sda: GPIO 4
scl: GPIO 5
scan: true
sensor:
- platform: ina3221
address: 0x40
channel_1:
shunt_resistance: 0.0025 ohm
current:
name: "INA3221 Channel 1 Current"
power:
name: "INA3221 Channel 1 Power"
bus_voltage:
name: "INA3221 Channel 1 Bus Voltage"
shunt_voltage:
name: "INA3221 Channel 1 Shunt Voltage"
channel_2:
shunt_resistance: 0.0030 ohm
current:
name: "INA3221 Channel 2 Current"
power:
name: "INA3221_Channel_2_Power"
bus_voltage:
name: "INA3221 Channel 2 Bus Voltage"
filters:
multiply: 1.0
shunt_voltage:
name: "INA3221 Channel 2 Shunt Voltage"
# ...
channel_3:
shunt_resistance: 0.0049 ohm
current:
name: "INA3221 Channel 3 Current"
power:
name: "INA3221 Channel 3 Power"
bus_voltage:
name: "INA3221 Channel 3 Bus Voltage"
shunt_voltage:
name: "INA3221 Channel 3 Shunt Voltage"
# ...
update_interval: 30s
# Example configuration entry
- platform: total_daily_energy
name: "Total Daily Energy"
power_id: INA3221_Channel_2_Power
# The power sensor to convert, can be any power sensor
- platform: ina3221
# ...
power:
id: Solar_Panel_Power
filters:
# Multiplication factor from W to kW is 0.001
- multiply: 0.001
unit_of_measurement: kWh
# Enable time component to reset energy at midnight
# Enable time component to reset energy at midnight
time:
- platform: sntp
id: my_time```