Smart relay input voltage sensor

Looking to connect a wifi relay to my gate motor and integrate into home assist, the motor is solar powered and I would like to monitor the input voltage as to check if the relay is drawing to much from the battery’s overnight.

I notice devices such as the Shelly pm 1 support power monitoring, but they all seem to only monitor the load not the input.

Is there a relay that can display the input voltage once integrated into home assist?

Is this 240VAC or some DC voltage? Probably need that info before anyone can recommend something.

And welcome to Home Assistant… :slight_smile:

24v DC input provided by the solar controller

Ok - for 24V DC you can simply build a voltage divider and measure the voltage using the ESP32 ADC. This assumes you are ok with soldering components etc.

Assume a max source voltage of 28V, R1 could be a 300KOhm resistor , R2 a 40KOhm resistor which means that the output voltage of the divider is 0-3.3V, which an ESP32 can read with an ADC, using ESPHome.

image

https://ohmslawcalculator.com/voltage-divider-calculator

sensor:
  - platform: adc
    pin: GPIO32
    name: "Battery Voltage"
    attenuation: auto
    update_interval: 60s
    filters:
      - multiply: 8.5

Wow thank you for your detailed response :+1:

No problem. If you build something don’t forget to test with a multimeter that you get voltages in the expected range. This will save blowing up your ESP.