reef-pi :: An opensource reef tank controller based on Raspberry Pi.

I have an optical sensor hooked to an ATO where the pump relay is reversed. Its set up this way so that I can add saltwater and have the ato empty down to the desired level. That work well, but after its complete the ato will keep triggering intermittently and eventually leave the sensor dry and the pump running.

The pump should not be on when the sensor is dry. Anyone understand whats happening?
Please disregard this is relay sticking not ATO.
 
RC snubber
i havent massed with them. Ive just had relays get stuck on ac unit and well pumps. (ants climb into controls and get smashed in the contactor.) once they start to arc they start circling the drain. also have welded relays in 12v heavy duty use. like the relays under your hood for the horn. I custom built a control box for a warn wench and it pulled more than the 15amp the relays were rated at and arc welded them in the on position from the sudden high current.
 
Seems to have been just a bad connection.. need a real male-male jst adapter.. for now I have it plugged back into the board with the pot and it's "working".. Just a little dimmer than the other at lower levels, probably due to the resistance on the pot. But it does dim properly, so that's a plus..

This is just odd looking

1613040298310.png
Right on and that looks very odd, the blue is hard on the eyes.
 
1613316086428.png

{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"id": 3,
"links": [],
"panels": [
{
"datasource": null,
"fieldConfig": {
"defaults": {
"custom": {},
"mappings": [
{
"from": "",
"id": 1,
"operator": "",
"text": "Off",
"to": "",
"type": 1,
"value": "0"
},
{
"from": "",
"id": 2,
"operator": "",
"text": "On",
"to": "",
"type": 1,
"value": "1"
}
],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 0
},
{
"color": "green",
"value": 1
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 3,
"w": 24,
"x": 0,
"y": 0
},
"id": 2,
"options": {
"colorMode": "background",
"graphMode": "none",
"justifyMode": "center",
"orientation": "vertical",
"reduceOptions": {
"calcs": [
"last"
],
"values": false
}
},
"pluginVersion": "7.0.0",
"targets": [
{
"expr": "equipment_fan_state",
"interval": "",
"legendFormat": "Fan",
"refId": "A"
},
{
"expr": "equipment_fuge_light_state",
"interval": "",
"legendFormat": "Fuge Light",
"refId": "B"
},
{
"expr": "equipment_heater_state",
"interval": "",
"legendFormat": "Heater",
"refId": "C"
},
{
"expr": "equipment_skimmer_state",
"interval": "",
"legendFormat": "Skimmer",
"refId": "F"
},
{
"expr": "equipment_sump__state",
"interval": "",
"legendFormat": "Sump",
"refId": "G"
},
{
"expr": "equipment_gyre_pump_state",
"interval": "",
"legendFormat": "Gyre",
"refId": "D"
}
],
"timeFrom": null,
"timeShift": null,
"title": "Equipment Status",
"type": "stat"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"custom": {},
"decimals": 2,
"mappings": [],
"max": 90,
"min": 70,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 79
}
]
},
"unit": "fahrenheit"
},
"overrides": []
},
"gridPos": {
"h": 4,
"w": 12,
"x": 0,
"y": 3
},
"id": 4,
"options": {
"orientation": "auto",
"reduceOptions": {
"calcs": [
"last"
],
"values": false
},
"showThresholdLabels": false,
"showThresholdMarkers": true
},
"pluginVersion": "7.0.0",
"targets": [
{
"expr": "tank_temp_reading",
"interval": "",
"legendFormat": "{{jobname}} Tank Temp",
"refId": "A"
},
{
"expr": "sump_temp_reading",
"interval": "",
"legendFormat": "Sump Temp",
"refId": "B"
}
],
"timeFrom": null,
"timeShift": null,
"title": "Tank Temp",
"type": "gauge"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"custom": {},
"decimals": 2,
"mappings": [],
"max": 125,
"min": 55,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 90
}
]
},
"unit": "fahrenheit"
},
"overrides": []
},
"gridPos": {
"h": 4,
"w": 12,
"x": 12,
"y": 3
},
"id": 5,
"options": {
"orientation": "auto",
"reduceOptions": {
"calcs": [
"last"
],
"values": false
},
"showThresholdLabels": false,
"showThresholdMarkers": true
},
"pluginVersion": "7.0.0",
"targets": [
{
"expr": "internal_box_temp_reading",
"interval": "",
"legendFormat": "Internal Temp 1",
"refId": "A"
},
{
"expr": "internal_box_temp_2_reading",
"interval": "",
"legendFormat": "Internal Temp 2",
"refId": "B"
}
],
"timeFrom": null,
"timeShift": null,
"title": "Box Temp",
"type": "gauge"
},
{
"aliasColors": {
"Back": "rgb(159, 255, 220)",
"Blue Light": "blue",
"Front ": "rgb(142, 164, 166)",
"Middle": "rgb(255, 255, 255)"
},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": null,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 6,
"w": 24,
"x": 0,
"y": 7
},
"hiddenSeries": false,
"id": 8,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [
{
"alias": "Middle",
"yaxis": 1
}
],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "left_white_left_white",
"interval": "",
"legendFormat": "Left White",
"refId": "A"
},
{
"expr": "left_blue_left_blue",
"interval": "",
"legendFormat": "Left Blue",
"refId": "B"
},
{
"expr": "right_white_right_white",
"interval": "",
"legendFormat": "Right White",
"refId": "C"
},
{
"expr": "right_blue_right_blue",
"interval": "",
"legendFormat": "Right Blue",
"refId": "D"
},
{
"expr": "blue_bar_back_channel_1",
"interval": "",
"legendFormat": "Back Blue Bar",
"refId": "E"
},
{
"expr": "blue_bar_front_channel_1",
"interval": "",
"legendFormat": "Front Blue Bar",
"refId": "F"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Lights",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": null,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 13
},
"hiddenSeries": false,
"id": 12,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "tank_temp_reading",
"interval": "",
"legendFormat": "Tank Temp",
"refId": "A"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Tank Temp",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {
"Sump Temp": "yellow"
},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": null,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 13
},
"hiddenSeries": false,
"id": 15,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "sump_temp_reading",
"interval": "",
"legendFormat": "Sump Temp",
"refId": "A"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Sump Temp",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": null,
"fieldConfig": {
"defaults": {
"custom": {
"align": null
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"fill": 3,
"fillGradient": 3,
"gridPos": {
"h": 7,
"w": 24,
"x": 0,
"y": 21
},
"hiddenSeries": false,
"id": 14,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"dataLinks": []
},
"percentage": false,
"pluginVersion": "7.0.0",
"pointradius": 0.5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "internal_box_temp_reading",
"format": "time_series",
"instant": false,
"interval": "",
"intervalFactor": 2,
"legendFormat": "Internal Temp 1",
"refId": "A"
},
{
"expr": "internal_box_temp_2_reading",
"interval": "",
"legendFormat": "Internal Temp 2",
"refId": "B"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Box Temp",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"transformations": [],
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "fahrenheit",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": false
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {
"Fan": "purple",
"Heater": "dark-red"
},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": null,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 5,
"w": 12,
"x": 0,
"y": 28
},
"hiddenSeries": false,
"id": 16,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "equipment_heater_state",
"instant": false,
"interval": "",
"intervalFactor": 1,
"legendFormat": "Heater",
"refId": "A"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Heater",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {
"Fan": "purple"
},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": null,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 5,
"w": 12,
"x": 12,
"y": 28
},
"hiddenSeries": false,
"id": 10,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "equipment_fan_state",
"instant": false,
"interval": "",
"intervalFactor": 1,
"legendFormat": "Fan",
"refId": "A"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Fan",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
}
],
"refresh": "5s",
"schemaVersion": 25,
"style": "dark",
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-6h",
"to": "now"
},
"timepicker": {
"refresh_intervals": [
"10s",
"30s",
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
]
},
"timezone": "",
"title": "Reef Pi Full",
"uid": "7SiCNC6Wz",
"version": 30
}
 
@Ranjib

Unable to access Kaza HS303 via reef-pi

I get this error when trying to access is thru the reefpi GUI..

{"error":"Failed to update. Error: can't update 18 - can't get output pin"} | HTTP 500

I have the following version::

"sw_ver": "1.0.10 Build 200828 Rel.162602",
"hw_ver": "1.0",
"model": "KP303(US)",

Version: 4.1-11-g2f5dd6e2
Website: http://reef-pi.com
Github: https://github.com/reef-pi/reef-pi
Copyright © 2021 Ranjib Dey
Status
Current time: Sun Feb 14 15:24:05
Uptime: 4 days ago
IP: 10.167.15.10

EDIT*** seems to be only an issue with versions after the official 4.1 build.
 
Last edited:
That makes sense to what it's doing then. Although I don't recall it losing power around that time. Might have been a bad dip that caused it.

I'm on version 4.1
I know it is old but you may want an rtc board so time is always correct
 
Would you guys mind sharing your grafana boards?
Looking for a bit of inspiration.
Sorry about the delay, mine is still a work in progress so nothing really to share. I am also trying to tie in my stats from my network also so just haven't had time to finish things up yet. My main goal is just to replicate the dashboard since grafana keeps the data longer and I can trigger alerts etc and since its running on another vm it doesnt consume resources on the pi. I will post when I get further along...:)
 
Hi
Is there a guide on how to setup MQTT in reef pi and communicate with home assistant, i did i search but came back empty.
Thanks
 
Looking for some help from the masses. I believe I’m having a DNS issue but my inexperience prevents me from finding a solution.

I’m building a Reef-Pi Setup (with Leviathan Hat). My current roadblock is that I cannot access the configuration site’s URL http://Leviathan.local or from the IP address 192.168.30.xx. The Pi in question is behind a vLAN but I’ve tried hardwiring it to the primary LAN and had the same problem.

I can ping the IP from multiple computer with my home network. Just cannot access said Pi via any web browser.

Current Network setup:
Unifi USG
Unifi Cloud Key 1
Multiple Unifi Switches
Multiple Unifi APs
Pi-Hole running on Raspberry Pi
(Which I can access via http://xxxx.local or via IP address from the Reef Pi browser.)

I have Google DNS and PiHole but to be honest I am having trouble understanding the problem and therefore cannot determine the solution.
 
Looking for some help from the masses. I believe I’m having a DNS issue but my inexperience prevents me from finding a solution.

I’m building a Reef-Pi Setup (with Leviathan Hat). My current roadblock is that I cannot access the configuration site’s URL http://Leviathan.local or from the IP address 192.168.30.xx. The Pi in question is behind a vLAN but I’ve tried hardwiring it to the primary LAN and had the same problem.

I can ping the IP from multiple computer with my home network. Just cannot access said Pi via any web browser.

Current Network setup:
Unifi USG
Unifi Cloud Key 1
Multiple Unifi Switches
Multiple Unifi APs
Pi-Hole running on Raspberry Pi
(Which I can access via http://xxxx.local or via IP address from the Reef Pi browser.)

I have Google DNS and PiHole but to be honest I am having trouble understanding the problem and therefore cannot determine the solution.
have you tried to temp disable pihole and see if it works? I know some apps on my phone wont load through pihole, so i have to 5 min disable launch and the it works even when pihole restarts.
 
have you tried to temp disable pihole and see if it works? I know some apps on my phone wont load through pihole, so i have to 5 min disable launch and the it works even when pihole restarts.
I tried for a few minutes. Will try longer this evening.
 
1613064268872.png

1613064317979.png

1613064346189.png


New data is written inbetween old data instead of at the very right, the graph then flickers back and forth between new and old data. Happens every time i reboot the pi. If i reboot it again, all previous data is magically sorted again, but the newly arriving one will be broken again. After some time in the range of an hour or two, the problem stops, and new data is appended at the right again.

Same exact behaviour at the same exact timings is happening in health, temperature, and ph graph as far as i can tell. Others had this problem as well iirc.
I know exactly what is going on. Because of memory optimization reason, reef-pi metrics storage (such as the charts you shared) is stored in a ring buffer (a data structure that uses constant memory, so reef-pi's memory footprint stay within bounds), but this looses the order of data (time wise). When this data is first returns its sorted, but the updates are then not sorted, just added at the next available slot, which causes this issue. This whole thing happens on-demand, in memory (of the browser that you are using), and not in disk/pi. The data is stored inside reef-pi db is actually not sorted, just stored as ring, as it is. I'll go through the code and clean it up soon as i can
 

ARE YOU READY TO CONFESS TO CRAZIEST, DUMBEST, FUNNIEST THING YOU’VE EVER DONE IN REEFING?

  • Yeah, I'll confess! (Share your story in the comments!)

    Votes: 33 54.1%
  • Nah, I'll keep mine a secret...(Don't be like that, share with the class!)

    Votes: 28 45.9%
Back
Top
Home
Post thread…
Market
What's new