Skip to content
View in the app

A better way to browse. Learn more.

Power Forum - Renewable Energy Discussion

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Robbie3337

Members
  • Joined

  • Last visited

Reputation Activity

  1. Thanks
    Robbie3337 got a reaction from Youda in Measuring the water level in my Jojo Tanks in HA   
    Update:

    So the issue was indeed the INA219 sensor from DFRobot. When I changed the INA219 with the suggested generic sensor, everything worked, even the tank volume started updating!
    Thanks especially to @Muttley for your help!

    I'm going to experiment on the "days of water left" and the "Tank Refill Rate"

    This is amazing!

  2. Like
    Robbie3337 got a reaction from Muttley in Measuring the water level in my Jojo Tanks in HA   
    Your suspicions about the DFRobot sensor were correct. Thanks for that! I'll be doing the other 2 JoJo tanks as well that's on out farm.
  3. Like
    Robbie3337 got a reaction from Muttley in Measuring the water level in my Jojo Tanks in HA   
    Hi everyone,

    I finally got time to change the INA219 sensor and things are looking very promising. I'm just waiting a bit for more data and then I'll report back.

    Thanks for the help!
  4. Like
    Robbie3337 reacted to stormjp in Measuring the water level in my Jojo Tanks in HA   
    Hi Muttley and Robbie

    I'll be attempting this project over the weekend, as the ultrasonic sensors are proving to be absolute rubbish inside the tanks.

    I have 2x ECO Slimline 2220lt tanks, but will initially only use the DF Robot solution in one tank. Problem with these slimline tanks are that they have two cylinders, which join together towards the top, so I'm not sure on which formula to use in the yaml file. Do you guys perhaps have any ideas?
  5. Like
    Robbie3337 got a reaction from Muttley in Measuring the water level in my Jojo Tanks in HA   
    Just an update, I have received the INA219 from PiShop and will be replacing the DFRobot this weekend 😁
  6. Like
    Robbie3337 got a reaction from Muttley in Measuring the water level in my Jojo Tanks in HA   
    I think it's good to have a bit of humour while we struggle with these wonderful devices. It helps taking the focus off of the frustration a bit. But yes, I definitely agree. We will get this right eventually 😂
    Thanks for the tip on the DF Robot sensor! I will buy the generic INA219 as per one of your links. I agree with your approach to diagnosing the issue.
    It will probably only arrive early next week, so I will post back when the new INA219 has been installed.
    Thanks again!
  7. Like
    They said it'll be simple
    Ok so a few more things come to mind:
    When I had the issue yesterday, I noticed that I was not getting any values for INA219 Power (W) or and Values for INA219 Current (mA). We need these values to get the tank volume and the tank %. The way that I got this to work was a simple reboot of the 24V power supply which powers the INA219 and the probe. I then started to get W and mA data coming in.
    Your example from above is showing the exact same scenario as I had:

    I think the above is step 1 in troubleshooting but I also noticed a few other things:

    I also noticed a few more things in your esphome code which I've updated based on your original figures shared and adjusted for a single tank like yours:
     
    - platform: template name: "Tank Volume" id: tank_volume unit_of_measurement: "litres" lambda: |- constexpr float tank_radius = 1.10; // Adjust the tank radius as needed constexpr float max_height = 2.70; // Adjust the max height as needed constexpr float pi = 3.14159265f; constexpr float total_volume = pi * tank_radius * tank_radius * max_height * 1000; float percentage_full = id(current_full_percentage).state; float water_level = max_height * (percentage_full / 100.0f); float current_volume = pi * tank_radius * tank_radius * water_level * 1000; return current_volume; Your max height seems quite low compared to what it's listed on the Jojo Website - they state that the height is 3150mm and you're only accounting for a height of 2700mm. Did you put a tape measure into the tank to the bottom with water inside to check?
    I think try the above steps and lets see what it comes up with.
    You may also need to reboot the ESP32 - I think the sequence I use is: power off probe, power of ESP32, power on probe, power on ESP32.
     
  8. Like
    No worries - glad you got sorted, I'm sure your INA219 is good!
    NB: no need to drain the tank - just pull out the probe and take it a reading. Because it's only 2 calibrations points, full and empty and thus you can just take an empty reading with the probe out the tank and one when it's full, ie: at the bottom of the tank when it's full.
    Regarding the missing values, I forgot to mention that you'll need to add in a template sensor to your configuration.yaml file:
    template: - sensor: - name: "Water Tank Level" unique_id: water_tank_level state: > {% set current = states('sensor.ina219_current') | float(default=0) %} {% set height = ((current * 5.0663) - 24.86) | round(2) %} {% if 0.000 <= height <= 72.000 %} {{ height }} {% else %} unknown {% endif %} I completely forgot the logic for the above ^ so just use claude.ai - share your esp32 code with it and this and ask it to make the necessary changes.
    Or even ask it to explain the above to you. 🙃
    Oh and also, chances are that your Jojo tank holds more than 10 000L!
     
  9. Like
    Robbie3337 got a reaction from Muttley in Measuring the water level in my Jojo Tanks in HA   
    Thank you so much for your swift reply!
    Regarding the ina219 sensor - I could not find the one that you linked in stock, so I bought this one instead. According to this wiki, I matched the address with the DIP switch configuration.
    I added a "0" after the "2.7" Yesterday after your reply, and I think that was the problem. I'm still monitoring, but it looks positive, thank you!
    I'm busy draining the tank to recalibrate everything. I will keep you posted.
    Do you maybe know why my "Tank Volume" and "Current Full Percentage" aren't showing any data?
     
    Again, thank you so much!
     
     


  10. Like
    Hi all,
    Thought I'd share my journey in creating an accurate water level measuring system for my Jojo tanks.
    I've finally managed to find a solution which is about 99.6% accurate. This equates to a water height difference of +-5mm between the actual height in the tank vs what the probe is reading. I'd call this a success 🙃
    Some of the other ESP32 + sensor solutions which I've tried and given up on:
    Waterproof ultrasonic sensor - difficult to implement as the minimum distance between the sensor and the water level is +-20CM if I recall correctly. This meant that I would need to 3D print a cone to raise the ultrasonic sensor and cut a large hole in the Jojo Tank. Plus the issues of condensation on the sensor. Analog water pressure sensor - this was attached to the bottom of the outlet of the tank. The readings were all over the place and I'd see random drops for no apparent reason so I gave up on this. Throw in pressure sensor + ADS1115 A/D Module + voltage regulation - this was probably the longest standing solution that I had in place. The results were very erratic and I'd see random fluctuations for no apparent reason. Landed up having to re-calibrate multiple times - definitely something was wrong. After advice from others on the Home Assistant Forum, I tried a solution which was suggested by others and it's been spot on and much easier to implment!
    Hardware:
    ESP32 24V Power Supply DC - DC Voltage Regulator DF Robot Throw in submersible pressure sensor INA219 Current Sensor USB Power Supply Misc conduit and enclosure
    2 Measurements were taken to calibrate:
    1: when the sensor was not inside the tank 2: when the sensor was in the tank and the tank was full (manual float switch had stopped filling). As seen in the code below:
          float full_voltage = 0.00092; // Voltage at full condition
          float empty_voltage = 0.00042; // Voltage at empty condition
    &
          float max_full_reading = 9.2;  // Adjust the maximum reading at full water level
          float min_empty_reading = 4.2;  // Adjust the minimum reading at empty water level
    As there are 2 tanks and only 1 sensor, the total volume is multiplied by 2.
    Both tank levels equalize when they're full and are thus same.
    YAML:
    captive_portal: i2c: sda: 21 scl: 22 sensor: - platform: ina219 address: 0x40 shunt_resistance: 0.1 ohm current: name: "INA219 Current" id: ina_current accuracy_decimals: 5 filters: - multiply: 1000 #convert from Amps to mA unit_of_measurement: "mA" power: name: "INA219 Power" accuracy_decimals: 5 bus_voltage: name: "INA219 Bus Voltage" accuracy_decimals: 2 shunt_voltage: name: "INA219 Shunt Voltage" id: ina219_shunt_voltage accuracy_decimals: 5 max_voltage: 32.0V max_current: 400mA update_interval: 10s - platform: template name: "Water Level" id: water_level unit_of_measurement: 'm' accuracy_decimals: 3 update_interval: 60s lambda: |- float shunt_voltage = id(ina219_shunt_voltage).state; float full_voltage = 0.00092; // Voltage at full condition float empty_voltage = 0.00042; // Voltage at empty condition float max_height = 1.570; // Adjust the max height as needed // Calculate water level based on calibration float slope = (max_height - 0.0) / (full_voltage - empty_voltage); float intercept = max_height - slope * full_voltage; float water_level = slope * shunt_voltage + intercept; // Ensure water level is within bounds water_level = water_level < 0.0 ? 0.0 : water_level; water_level = water_level > max_height ? max_height : water_level; ESP_LOGD("custom", "Shunt Voltage: %.5f V", id(ina219_shunt_voltage).state); ESP_LOGD("custom", "Water Level: %.5f m", water_level); return water_level; - platform: template name: "Current Full Percentage" id: current_full_percentage unit_of_measurement: '%' accuracy_decimals: 1 update_interval: 60s lambda: |- float max_full_reading = 9.2; // Adjust the maximum reading at full water level float min_empty_reading = 4.2; // Adjust the minimum reading at empty water level float current_reading = id(ina_current).state; if (current_reading <= min_empty_reading) { return 0.0; } else if (current_reading >= max_full_reading) { return 100.0; } else { float current_full_percentage = 100 * (current_reading - min_empty_reading) / (max_full_reading - min_empty_reading); return current_full_percentage; } - platform: template name: "Tank Volume" id: tank_volume unit_of_measurement: "litres" lambda: |- float tank_radius = 0.71; // Adjust the tank radius as needed float max_height = 1.57; // Adjust the max height as needed float total_volume_single_tank = 3.14159265 * tank_radius * tank_radius * max_height * 1000; float percentage_full = id(current_full_percentage).state; float water_level = max_height * (percentage_full / 100.0); float current_volume_single_tank = 3.14159265 * tank_radius * tank_radius * water_level * 1000; float total_volume_both_tanks = 2 * current_volume_single_tank; return total_volume_both_tanks; We had a water outage today so I had an opportunity to test the sensor value (height) vs the actual height with a tape measure and I was off by 5mm, so I'll take this as a success.


    Hope this is useful to you guys - shout if I can answer any questions
  11. Like
    Hi Guys 
    Just wanted to share my latest video on installation and connecting your inverter to Home Assistant using the new RS485 shield and ESP32C board. 
    Makes life much easier to set the thing up, no soldering and you only need to connect the power up inside the inverter to a 12V power supply and the RS485 cables so dead easy. 
    You can get the board and an ESP32 from https://smarthomeintegrations.co.za/ for R400 and get delivery in a day or so. 
    Slipx06 (Paul) has also included some cool new YAML code to calculate Daily energy production and consumption in the ESP32 and send that info to HA as well. 
    Let me know what you guys think of the video please
     
     

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.