Atlas Scientific w/ EZO Sensors on Raspberry Pi and MQTT Atlas IoT Monitoring Software

I’m starting this topic because of some of the issues I ran into when trying to connect my Atlas Scientific EZO sensors. The sensors are attached to an AS i3 InterLink full isolation carrier board which is connected to a Raspberry Pi. I’m starting off with just a pH sensor/probe and I’m using the Atlas IoT Monitoring Software.

Installing the monitoring software was fairly easy. You can find everything you need under the Documents & Downloads section on their page. I used the preferred method which is using an image file. After that I struggled setting up the MQTT with Home Assistant which now that I look back was fairly easy. I used a program call MQTT Explorer which really helped me out.

FYI the EZO board comes in UART mode and needs to be changed to i2c. This was easy to do using jumper cables such as these found on Amazon. The documentation on how to do it can be found on the AS website or by going here. Do not attempt this with the i3 Interlink or sensor attached to the RPi and make sure the RPi is powered off. You basically short the TX and PGND on the sensor by connecting them to each other with a jumper cables. Then attach the VCC of the sensor to power on the RPi which is the first set of prongs on the main strip of the RPi. Then connect the GND to ground on the RPi which is the third set of prongs on the main strip of the RPi but before powering on the RPi disconnect it, just remember where it’s at. Power on the RPi and reconnect it, wait for the light on the sensor to change from green to blue, and then disconnect the wire. Shutdown the RPi, unhook all of the jumpers, reconnect the i3 Interlink with sensor on top, and power RPi back on and if the sensor is blue or flashing blue to green then it worked.

I’m assuming you have the Mosquito Broker add-on and MQTT integration already installed in HA. To start sending the MQTT topic to HA you’ll need to fill in some information in the monitoring software. Under Endpoint URI enter homeassistant:local and your HA MQTT user name and password that you created when you setup MQTT in HA. Change the polling interval if you want. Then choose a name for the topic. This is what all your sensors will be associated with. Then check the box to enable MQTT and save everything. I rebooted the RPi just for good measure.

After doing this I opened up the MQTT Explorer and created a new connection. Enter the same information as you did in the AS monitoring software MQTT setup and then connect. You should see the name of the topic you choose popup and it’ll start communicating based on the polling interval you previously set. By expanding it all of the way and highlighting the final one you can see the data you’re sending. If you don’t see the topic then go back and double check everything.

On the right column of the explorer find the topic and copy it. You can then go to your HA and open the MQTT integration and click on configure, Paste the topic under “Listen to a topic” and start listening. If everything is working you’ll see the data being received and stop listening.

The final part is you need to create MQTT sensors. You’ll need to create a sensor under your configuration file for any data being sent using the below template.

mqtt:
  sensor:
    - name: "choose a name"
      state_topic: "the topic you copied from the explorer"
      value_template: "{{ value_json.enter one of the data values }}"

Hopefully others can add to this and I’ll expand and edit this as I learn or do more.

There was a lot of effort getting these into esphome, so that presents another option.

I honestly found more information about using ESPHome than MQTT. I’m not saying one is easier than the other but there’s definitely more information about using ESPHome than MQTT. I actually thought I took the easy route by using the Atlas IoT Monitoring Software but due to the lack of information it wasn’t. However, looking back at everything and knowing what I know now, it was actually easy to do.

For a commercial setup, Atlas are quite open about how to DIY their stuff :slight_smile:

True. It’s just a matter of being able to DIY. I only have basic programming knowledge so I’m still trying to figure everything out. Now I’m trying to figure out how to send the send and receive data using MQTT but without the Atlas IoT software. I’m struggling with that right now.

I am using the Atlas IOT Monitoring software for the time being; I currently have an ORP probe. I am new to both Atlas and Home Assistance. This has been a steep learning curve for me to get this far! :slight_smile: I am trying to figure out if what I have completed so far is correct.

I am a bit confused on a few points:

  1. Atlas Software MQTT Settings Topic? Currently, mine is /ORP/add_62/
  2. MQTT Explorer Topic that I need to copy? I don’t see the Atlas Topic: /ORP/add_62/ when I expand all of the possible drop down menus under $SYS.
  3. The final part, the configuration file. Where is this file located?

Atlas Software MQTT Settings

Below is the image of MQTT Explorer, I believe I have this part correct.

Broker options:



MQTT Explorer


image

@SabotTX did you get it working.? Once you get everything connected for the first time then everything is a lot easier after that.

So you kind of posted the pictures backwards in order of how everything should be done so lets untangle that first. You set up your broker in HA first which it looks like you did it correct because I see it in the MQTT Explorer. The next step is setting up the Atlas software which it does not look like you did correctly. If it was connected you would see it in the Explorer just like you see the second homeassistant under the main homeassistant.

Setting up the MQTT with the Atlas software.

1 - Double check your spelling in the Endpoint URI. It’s hard to tell in your picture if your spelled homeassistant:local or if you spelled it homeasslstant:local with an l after the ss or an i. It’s a little blurry so I just want to make sure.

3 - The next thing that I see missing is your User ID and Password. Use the same one you used in HA when you sent up the broker which looks to be myusername and it’s password. FYI it looks like the password you used is quite long, I personally use something simple that is only 4-6 characters long. It’s just easier. Either way, make sure you correctly enter both into the Atlas MQTT setup.

3 - Next, just to keep it simple, delete the Client ID and for the Topic just use one word like Atlas or something else that will stand out when you’re looking at everything. You could always go back and change these things.

4 - Next, change the Interval (Secs) to something shorter like 10 seconds or whatever. For now, it just makes it easier to see the data coming in. Again, you could always go back and change this.

5 - Save everything and just for the good measure reboot your RPi and then check to make sure it all saved correctly. (If you go back and change anything I would always reboot the RPi just to make sure everything saved and updated correctly.)

Now go back and open up the MQTT Explorer and check to see what it shows. I used Atlas as the name for my Topic which you can see in the picture below.

If you don’t see it at first, give it a second. This is one of the reasons I suggested changing the Interval (Secs) to something shorter. If you have 60-seconds you might have to wait 60-seconds for it to show. If you see Atlas or whatever Topic you used then so far you’re good. If not, go back over the steps and doublecheck everything.

If you see you Topic keep expanding it until you get to what I have highlighted in yellow below and make sure you click on it so it’s highlighted. When you do that you should see information similar to what I have on the right of the below picture. The data highlighted is my pH value. That as well as everything above and below it could be brought into HA. The data highlighted in the green is your Topic. If you go back and change your Topic name in the Atlas software this (as well as the part where you expanded Atlas) will change to the new name.

Now you can copy the green highlighted data and enter into the part where you tried to Listen to a topic in HA. After you start listening to it you will have to again wait for the interval time you selected for the first data message to appear. They will continue to appear at the selected interval until you stop listening. If this is working then you’re almost there.

The final part is creating a sensor. Open up your File Editor or Studio Code Server in HA and go to your configuration file. Here you create a sensor using what previously highlighted in green and blue. (If you don’t know how to do this, click on the below arrow to expand my explanation explaining how.

Explanation

If you’ve never edited any HA files you need to use File Editor or Studio Code Server. If you don’t already have one of them you can find them in the ADD-ON STORE in HA which is the same place you found the Mosquitto broker add-on.

I would personally suggest using the File Editor because it would probably be easier for you. Add it, insIt should appear in the side menu of HA. After you install it click on START. I have all of the options enabled for it but that’s just my preference. I would definitely choose Start of boot and Show in sidebar which makes it easier to find,

Open the UI by either clicking on that option or on the new icon for it on the sidebar. Look for a file name configuration and open it and go to an empty stop at the bottom and create your sensor.

If you don’t see that file you might have to open another folder such as homeassistant to find it.

For future knowledge and since you’re new at HA, based on how much you start using HA adding sensors and other things could quickly fill up your configuration file. So what I do it point the configuration file to a seperate file for my MQTT sensors. I actually do this for templates, input_buttons, and others things because it’s cleaner and I have more control entering in the actual yaml code than using the Lovelace UI and HA Helpers.

My configuration begins like this and has a couple of other things which I did not include. The hashtag sign at the beginning means everything after it is a comment.

# Configuration yaml. 

# Loads default set of integrations. Do not remove.
default_config:

# Text to speech.
tts:
  - platform: google_translate

# Separate included files.
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
# group: !include group.yaml
light: !include light.yaml
# zone: !include zone.yaml
sensor: !include sensor.yaml
switch: !include switch.yaml
device_tracker: !include device_tracker.yaml
input_select: !include input_selects.yaml
input_boolean: !include input_booleans.yaml
input_text: !include input_texts.yaml
input_button: !include input_buttons.yaml
input_number: !include input_numbers.yaml
input_datetime: !include input_datetimes.yaml 
plant: !include plants.yaml
template: !include templates.yaml
binary_sensor: !include binary_sensor.yaml
timer: !include timers.yaml
mqtt: !include mqtt.yaml  # Adding this will point to a separate file for MQTT sensors.

homeassistant:
  customize: !include customize.yaml

After you get everything working and if you want to do this then go ahead and try it. All you need to do is add the line of code in the configuration file that I marked and then create a new file called mqtt.yaml like below.

After creating the file, cut and paste the MQTT sensor from the configuration file to the new mqtt file. Then remove the part that says mqtt since HA knows that’s what everything in the file is and shift the rest of it over so it looks like below.

# mqtt sensors -------------------------------------------


- sensor:
    - name: "Atlas 001 ph value"
      state_topic: "atlas/pH/add99"
      value_template: "{{ value_json.value }}"
    

Then you could restart HA and it should work but before you do click on the CHECK CONFIGURATION button. I always do this when making changes to make sure I didn’t do anything that will lock up HA.

# Below is what you need to create your sensor

mqtt:
  sensor:
    - name: "ENTER A NAME FOR YOUR SENSOR"
      state_topic: "ENTER THE TOPIC HIGHLIGHTED IN GREEN"
      value_template: "{{ value_json.ENTER THE BLUE HIGHLIGHTED VALUE }}"

# Below is what mine looks like.

mqtt:
  sensor:
    - name: "Atlas 001 ph value"
      state_topic: "atlas/pH/add99"
      value_template: "{{ value_json.value }}"

The value I highlighted in blue is only one of several values that you could make a sensor for. If you go back and look at the values above and below it, you could use any of these: created_at, VersionInfo, ModuleType, etc. if you notice, mine does not have anything for name. In your Atlas software, you can click on your sensor and go to its settings and give it a name. If you choose to do this the name you give it will now be displayed as the Name value. I don’t think this matters much because you can name your sensor whatever you want and then always edit it in HA.

You can now add your sensor to HA by using whichever card works best for you.

You can expand the arrow to see how I use HA. I just started using the Atlas sensors but plan on using more. I found they’re a lot cheaper and versatile than buying Blue Lab and other environment and water monitoring products from other companies. I have grow tents and use the AC Infinity controller because @dalinicus created an awesome HA integration for it that you can find HERE. I started with no knowledge of HA and only basic coding experience but HA could get a little addictive as you can see from my interface. I also use the HA Cloud by Nabu Casa which allows me to remotely connect with my phone. You could find more info about that HERE.

My Home Assistant

ezgif-5-194db573db

Hopefully this helps.

I am ready to jump in with HA monitoring my salt pool water quality with acid feeder. I would really appreciate some help answering a few questions about hardware:

On AS website, under IoT Monitoring software, it shows this RPi with 6 sensors.
image

But this does not look like the i3 Interlink (New). Should I buy the i3 Interlink? Do I buy 2 interlinks if I want to use 5 sensors? It says they are stackable.

It says it does not come with EZO circuits nor sensors. The circuits/sensors I think I need are:
pH, ORP, Dissolved O2, Conductivity, temp?, water flow sensor (for the acid feed pump?) But which kit? There is pH kit or micro pH kit or get the EZO pH Circuit and separe consumer grade pH probe?

For the acid feed, I think I need the EZO-PMP-L, right?

image
image

I can’t find if they sell what looks like a small monitor afixed to a RPi perhaps? where do i find one of those?

Found the touchscreen on CanaKit’s official website. I should have looked there first.

It kind of looks like the Whitebox T3 pictured below and from what I understand the i3 Interlink replaced that.

No. The Interlink boards do not come with any EZO circuits or probes.

I didn’t buy any of their kits because I didn’t need the “extra” things that came with them and also because I don’t think any of the kits had the EZO board or were made for the Interlink. Instead I bought the Interlink, the EZO circuit I needed for the parameter I wanted to monitor, and one of the available probes for that parameter. (From what they claim, any probe for that parameter made from any company with a SMA or BNC connector will work with their circuits.)

Yes. Depending on the amount of circuits and types of circuits you would need additional Interlink boards. Keep in mind that each i3 Interlink has two isolated EZO circuit slots, one non-isolated EZO circuit slot, and two non-isolated 5-pin EZO data cable connectors. Isolation is recommended for pH, ORP, DO, and Conductivity.

From my understanding, you could also connect the EZO circuits individually to the RPi with a USB cable by using the Gen 2 Electrically Isolated USB EZO Carrier Board. If you use that then you could also use AtlasDesktop but I don’t know much about that and as of right now it doesn’t seem compatible with as many EZO circuits as AtlasIoT for the Raspberry Pi.

I originally planned on doing this but couldn’t find one that allowed me to cover up the RPi and stacked boards. I know the one in the picture allows you to stack the boards but does it come with a piece to enclose and protect everything? I couldn’t find one so I instead choose to put the RPi in a waterproof enclosure and then use a touchscreen display that attached via HDMI. It worked better for the way I set my system up.