SDI-12 Logger through HomeAssistant

So if I understand you right, you hooked the SDI-12 sensor up to an ESP32 and you want the ESP to talk to home assistant?

I think you can make this work with ESPHome: Custom UART Device — ESPHome

I guess you should be able to get the untemplated SDI-12 string into home assistant that way.

thanks for the speedy reply,

i have the sensor connected to the sdi12 to usb adapter and the adapter connected to the esp32 via uart.
and yes i would like the esp32 to send the read and retrieve data comands and to relay it back to homeassistant.

do you mean i should replace the original untemplated SDI-12 string code in your original config.yaml with the yaml code from the custom UART device link?.
like i said im a complete novice at this so please bare with me.

and what would need changing in the SDI-12 measure comands so it uses the uart for the on “1M!” and off “1D0!” and not the usb?.

also just to check is all this code going into the esp32’s config.yaml or does some go in the homeassistant config.yaml in file editor?.

The first thing to do after you connected the ESP to the SDI-12 modbus (Liudr board) is to get a sensor reading on the ESP. I’m not very familiar with ESPs connected via UART, but you might be lucky on other forums for setting up such a connection. Googled a bit, you are not the first one thinking in this direction: ESP32 as Converter between modbus and SDI - Using Arduino / Project Guidance - Arduino Forum

Out of curiosity, what is your usecase? What is the added value in setting up the Raspberry Pi separated from the SDI-12 modbus?

-edit: Looks like ESPHome has a modbus controller component you could try: Modbus Controller — ESPHome

hi Rik, i have the esp32 connected to the serial conections sdi-12 lidur board, i am pretty sure the connections are correct.
why do you think i might need aditional hardware?, i was under the impression that the liudr board would interface with the acclima sensor and then connect with the esp32 via tx rx pins then relay the readings wirelessly to my rp4.

its very similar to your setup, you have your teros sensors connected to the sdi-12 liudr board, i have my acclima sensor connected the same.
your data is traveling via the usb serial port on the liudr board direct to your rp4, my data is traveling via the serial connections on the liudr board into the uart connections on the esp32 then transmitted wirelessly to my rp4.

i thought that our projects were similar enough that your original code could be adapted to account for the differences in how we send and recieve the data, yours serial usb, mine uart, without to much work.

the only reason the rp4 is seperate from the sdi-12 adapter is because the rp4 is in use in an existing set up and the sensor will be a few rooms away.
i thought it would be straight forward using the esp32 to transmit the data to homeassistant wirelessly. :slightly_frowning_face:

if we cant get your original code to work with some modifications could this approach work? - https://community.home-assistant.io/t/reading-sending-to-esp32-serial-uart-vs-mqtt-for-ha-workflows/280111/7

i have used his work and came up with this,

esphome:
  name: acclimatdr-310w
  platform: ESP32
  board: esp-wrover-kit
  includes:
    - uart_read_line_sensor.h
    
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Acclima Tdr-310W"
    password: "ytxcMUCZwHJt"

captive_portal:

# Enable logging
logger:
  level: VERBOSE #makes uart stream available in esphome logstream
  baud_rate: 0 #disable logging over uart

# Enable Home Assistant API
api:

ota:

uart:
  id: tdr_wc_ec
  tx_pin: 16
  rx_pin: 17
  baud_rate: 9600

text_sensor:
- platform: custom
  text_sensors:
    id: "tdr_wc_ec_uart"
  lambda: |-
    auto tdr_wc_ec_sensor = new UartReadLineSensor(id(tdr_wc_ec));
    App.register_component(tdr_wc_ec_sensor);
    return {tdr_wc_ec_sensor};
    
- platform: homeassistant
  name: "ACCLIMA COMMANDS"
  id: acclima_command
  entity_id: input_text.acclima_command
  
switch:
  - platform: template
    name: "Send Command"
    id: send_cmd
    icon: "mdi:send"
    turn_on_action:
      - uart.write:
         id: tdr_wc_ec
         data: !lambda |-
          std::string str = id(acclima_command).state;
          std::vector<uint8_t> vec(str.begin(), str.end());
          vec.push_back('\r');
          return vec;
      - delay: 2000ms
      - switch.turn_off: send_cmd


it dosent quite work… my buttons on the dashboard are not correct (not the same as the example in the link) so i cant input any comands for the sensor so i dont get any readings, but im trying and i feel i have made some progress.

honestly im green as grass when it comes to this stuff so any help much appreciated.

I don’t think you need additional hardware, you are already putting in an ‘in between ESP’ :wink:

I think you are on the right track templating the ESP via ESPhome following that thread. Although these lambda templates are hard to troubleshoot, especially since they are C++ and do not 1 to 1 match with Home Assistant templates. I’m afraid I’m also not much of a help on those templates.

Setting up some working switches an text inputs in ESPHome to see whether it connects to Home Assistant shouldn’t be to difficult though, maybe try adding a simple switch first to see if that works, then you are down to troubleshooting these lambda templates to get a reading.

Also I don’t know if you already found the ESP log, inside Home Assistant you can open the ESPHome tab and click your ESP there. From that screen you can open a live log, it might help reading this log while trying to input text.

-edit: Adding a few lines in your ESPHome config for debugging UART communication might also be a good idea UART Bus — ESPHome

Keep us posted on your findings, I’m interested on the outcome

ok thanks its good to know that maybe im on the right track.

yes i have found the logs section in esphome thanks.

i tried adding a couple of simple switches, not sure if they are correct?. it still doesnt work but there is activity in the logs.

esphome:
  name: acclimatdr-310w
  platform: ESP32
  board: esp-wrover-kit
  includes:
    - uart_read_line_sensor.h
    
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Acclima Tdr-310W"
    password: "ytxcMUCZwHJt"

captive_portal:

# Enable logging
logger:
  level: VERBOSE #makes uart stream available in esphome logstream
  baud_rate: 0 #disable logging over uart

# Enable Home Assistant API
api:

ota:

uart:
  id: tdr_wc_ec
  tx_pin: 16
  rx_pin: 17
  baud_rate: 9600

text_sensor:
- platform: custom
  text_sensors:
    id: "tdr_wc_ec_uart"
  lambda: |-
    auto tdr_wc_ec_sensor = new UartReadLineSensor(id(tdr_wc_ec));
    App.register_component(tdr_wc_ec_sensor);
    return {tdr_wc_ec_sensor};
    
switch:
  - platform: uart
    name: "read sensor"
    data: '1M!'
    
  - platform: uart
    name: "get measurement"
    data: '1D0!'    
    
INFO Reading configuration /config/esphome/acclima TDR-310W.yaml...
INFO Starting log output from acclimatdr-310w.local using esphome API
INFO Successfully connected to acclimatdr-310w.local
[10:43:12][I][app:102]: ESPHome version 2022.2.6 compiled on Mar 11 2022, 10:32:46
[10:43:12][C][wifi:491]: WiFi:
[10:43:12][C][wifi:353]:   Local MAC: 94:B9:7E:7B:94:D0
[10:43:12][C][wifi:354]:   SSID: [redacted]
[10:43:12][C][wifi:355]:   IP Address: 192.168.1.239
[10:43:12][C][wifi:357]:   BSSID: [redacted]
[10:43:12][C][wifi:358]:   Hostname: 'acclimatdr-310w'
[10:43:12][C][wifi:360]:   Signal strength: -51 dB ▂▄▆█
[10:43:12][V][wifi:362]:   Priority: 0.0
[10:43:12][C][wifi:366]:   Gateway: 192.168.1.1
[10:43:12][C][wifi:367]:   DNS1: 192.168.1.1
[10:43:12][C][wifi:368]:   DNS2: 0.0.0.0
[10:43:12][C][logger:233]: Logger:
[10:43:12][C][logger:234]:   Level: VERBOSE
[10:43:12][C][logger:235]:   Log Baud Rate: 0
[10:43:12][C][logger:236]:   Hardware UART: UART0
[10:43:12][C][uart.arduino_esp32:107]: UART Bus:
[10:43:12][C][uart.arduino_esp32:108]:   TX Pin: GPIO16
[10:43:12][C][uart.arduino_esp32:109]:   RX Pin: GPIO17
[10:43:12][C][uart.arduino_esp32:111]:   RX Buffer Size: 256
[10:43:12][C][uart.arduino_esp32:113]:   Baud Rate: 9600 baud
[10:43:12][C][uart.arduino_esp32:114]:   Data Bits: 8
[10:43:12][C][uart.arduino_esp32:115]:   Parity: NONE
[10:43:12][C][uart.arduino_esp32:116]:   Stop bits: 1
[10:43:12][C][uart.switch:040]: UART Switch 'read sensor'
[10:43:12][C][uart.switch:040]: UART Switch 'get measurement'
[10:43:12][C][captive_portal:144]: Captive Portal:
[10:43:12][C][mdns:084]: mDNS:
[10:43:12][C][mdns:085]:   Hostname: acclimatdr-310w
[10:43:12][V][mdns:086]:   Services:
[10:43:12][V][mdns:088]:   - _esphomelib, _tcp, 6053
[10:43:12][V][mdns:090]:     TXT: version = 2022.2.6
[10:43:12][V][mdns:090]:     TXT: mac = 94b97e7b94d0
[10:43:12][C][ota:085]: Over-The-Air Updates:
[10:43:12][C][ota:086]:   Address: acclimatdr-310w.local:3232
[10:43:12][C][api:138]: API Server:
[10:43:12][C][api:139]:   Address: acclimatdr-310w.local:6053
[10:43:12][C][api:143]:   Using noise encryption: NO
[10:43:20][D][switch:013]: 'read sensor' Turning ON.
[10:43:20][D][switch:037]: 'read sensor': Sending state ON
[10:43:20][D][uart.switch:020]: 'read sensor': Sending data...
[10:43:20][D][switch:037]: 'read sensor': Sending state OFF
[10:43:30][D][switch:013]: 'get measurement' Turning ON.
[10:43:30][D][switch:037]: 'get measurement': Sending state ON
[10:43:30][D][uart.switch:020]: 'get measurement': Sending data...
[10:43:30][D][switch:037]: 'get measurement': Sending state OFF

Connection is good, ESP reacts to HA switch, so I guess you are close. Two things

  • Did you check that your SDI-12 sensor has adress ‘1’ and is actually working?
  • I think you need to feed the modbus with ASCII? Try data: '49 77 33' for your read sensor

Edit: You might need to play around with the ASCII formatting: Convert a String to ASCII Code - Online String Tools
I haven’t looked into the serial connection of the Liudr board for compatibility (maybe Liudr has some documentation about this on his website?)

yes i have confirmed the sensor is working and i have changed the sensor address to 1. i used an android app “usb serial terminal” connected via the usb.

i tried the ‘49 77 33’, no luck, logs look the same as the ones i posted above.

liudr sell a version of his board without the usb port and chip (so only has the serial port for coms) called the SDI-12 TTL adapter, so i presume compatibility shouldnt be an issue?.

I guess that TTL serial is also on your SDI-12 board? Maybe ask Liudr what protocol is used for TTL coms, he seems responsive to these kind of questions.

ok quick update, i have been in contact with dr liu about using the serial connectror on his board as opposed to the usb and it turns out there are a couple of extra steps to hopefully get this to work.

first there is a couple of pads that need bridgeing on the pcb labled “FT_RST” to disable the usb serial port so the uart serial port can be used instead.

next the serial connection on the liudr board has both 3.3v tx and 5v tx pins, the esp32 wants 3.3v but on the usb version of the liudr board the 3.3v tx is not fully populated with the required components it is missing 2 10k resistors, so you need to add 2 resistors or use a seperate logic level converter and use the 5v tx on the uart serial port.

i have went with the level convertor and i am now pretty confident that everything is wired correctly, i have not had chance to try it out yet but fingers crossed this should work.

1 Like

starting to get somewhere, using the code below i have managed to get two basic switches on the dashboard sending the commands 1M! and 1D0! and finally have a response from the sensor!!!.

does everthing look correct?.

any pointers on how i go about seperating out the different data from the sensor and how do i save the data to a csv file to log?.

esphome:
  name: acclimatdr-310w
  platform: ESP32
  board: esp-wrover-kit
  includes:
    - uart_read_line_sensor.h
    
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Acclima Tdr-310W"
    password: "ytxcMUCZwHJt"

captive_portal:

# Enable logging
logger:
  level: VERBOSE #makes uart stream available in esphome logstream
  baud_rate: 0 #disable logging over uart

# Enable Home Assistant API
api:

ota:

uart:
  id: tdr_wc_ec
  tx_pin: 16
  rx_pin: 17
  baud_rate: 9600


text_sensor:
- platform: custom
  text_sensors:
    id: "tdr_wc_ec_uart"
  lambda: |-
    auto tdr_wc_ec_sensor = new UartReadLineSensor(id(tdr_wc_ec));
    App.register_component(tdr_wc_ec_sensor);
    return {tdr_wc_ec_sensor};
    
switch:
  - platform: uart
    name: "read sensor"
    data: '1M!'
    
  - platform: uart
    name: "get measurement"
    data: '1D0!'

[16:37:18][C][logger:233]: Logger:
[16:37:19][C][logger:234]:   Level: VERBOSE
[16:37:19][C][logger:235]:   Log Baud Rate: 0
[16:37:19][C][logger:236]:   Hardware UART: UART0
[16:37:19][C][uart.arduino_esp32:107]: UART Bus:
[16:37:19][C][uart.arduino_esp32:108]:   TX Pin: GPIO16
[16:37:19][C][uart.arduino_esp32:109]:   RX Pin: GPIO17
[16:37:19][C][uart.arduino_esp32:111]:   RX Buffer Size: 256
[16:37:19][C][uart.arduino_esp32:113]:   Baud Rate: 9600 baud
[16:37:19][C][uart.arduino_esp32:114]:   Data Bits: 8
[16:37:19][C][uart.arduino_esp32:115]:   Parity: NONE
[16:37:19][C][uart.arduino_esp32:116]:   Stop bits: 1
[16:37:19][C][uart.switch:040]: UART Switch 'read sensor'
[16:37:19][C][uart.switch:040]: UART Switch 'get measurement'
[16:37:19][C][captive_portal:144]: Captive Portal:
[16:37:19][C][mdns:084]: mDNS:
[16:37:19][C][mdns:085]:   Hostname: acclimatdr-310w
[16:37:19][V][mdns:086]:   Services:
[16:37:19][V][mdns:088]:   - _esphomelib, _tcp, 6053
[16:37:19][V][mdns:090]:     TXT: version = 2022.2.6
[16:37:19][V][mdns:090]:     TXT: mac = 94b97e7b94d0
[16:37:19][V][mdns:090]:     TXT: platform = ESP32
[16:37:19][V][mdns:090]:     TXT: board = esp-wrover-kit
[16:37:19][C][ota:085]: Over-The-Air Updates:
[16:37:19][C][ota:086]:   Address: acclimatdr-310w.local:3232
[16:37:19][C][api:138]: API Server:
[16:37:19][C][api:139]:   Address: acclimatdr-310w.local:6053
[16:37:19][C][api:143]:   Using noise encryption: NO
[16:37:25][D][switch:013]: 'read sensor' Turning ON.
[16:37:25][D][switch:037]: 'read sensor': Sending state ON
[16:37:25][D][uart.switch:020]: 'read sensor': Sending data...
[16:37:25][D][switch:037]: 'read sensor': Sending state OFF
[16:37:25][V][text_sensor:016]: 'tdr_wc_ec_uart': Received new state 10025
[16:37:25][D][text_sensor:067]: 'tdr_wc_ec_uart': Sending state '10025'
[16:37:25][V][text_sensor:016]: 'tdr_wc_ec_uart': Received new state 1
[16:37:25][D][text_sensor:067]: 'tdr_wc_ec_uart': Sending state '1'
[16:37:32][D][switch:013]: 'get measurement' Turning ON.
[16:37:32][D][switch:037]: 'get measurement': Sending state ON
[16:37:32][D][uart.switch:020]: 'get measurement': Sending data...
[16:37:32][D][switch:037]: 'get measurement': Sending state OFF
[16:37:32][V][text_sensor:016]: 'tdr_wc_ec_uart': Received new state 1+0.0+23.0+1.1+0+0
[16:37:32][D][text_sensor:067]: 'tdr_wc_ec_uart': Sending state '1+0.0+23.0+1.1+0+0'

Looking good @sar1! Can you find the ‘tdr_wc_ec_uart’ sensor in home assistant? And does it’s value update with lines like ‘1+0.0+23.0+1.1+0+0’? Than you can point my code towards that sensor. If you go into developer tools in home assistant, and check your entities you should find the full name of your sensor. Probably something like ‘sensor.tdr_wc_ec_uart’

If you look back at my first post, at the configuration.yaml; you can edit the template and use the rest of my code.

So change sensor.serial_sensor to your SDI-12 output sensor here:

  - platform: template
    sensors:
      sensor_number_s1:
        friendly_name: Sensor Address 1
        value_template: >
          {% if '1' in states('sensor.serial_sensor') [0:1] -%}                
            {{ states('sensor.serial_sensor').split('+')[0] }}
          {% else -%}
            {{ states.sensor.sensor_number_s1.state }}
          {% endif -%}

This particular code looks for a ‘1’ inside the SDI-12 raw output from your ESP, then creates another sensor named ‘Sensor Adress 1’ that will simply display the sensor address, since this is the first thing to be extracted from the raw SDI-12 string. Later I repeat these steps with volumetric water, temperature and EC, I basically extract the value between the + signs in the raw string, and convert these to new home assistant sensors seperately. So you do have to change the same sensor for volumetric water content, temperature or which ever value your sensor puts in the SDI-12 string.

Later I combine all the newly created sensors in a home assistant automation, and group them in a message to log them. You can copy the automation and see if it works for you.

hey rik, i had put this on the back burner for a month or two but now i have found some time i am back on it.

i havent done anymore since your last post, only installing all the components in box ready for use.
i did add a 2 channel relay board to control 2 24v irrigation valves and have managed to add the code to get 2 bottons on the home assistant dashboard and they control the valves fine.

once i had everything wired up in the new box i checked the logs from the esp32 and its now no longer displaying the readings from the acclima sensor correctly anymore?, the data is still returned sometimes but now comes in with more odd data?.
i have included some pics of the new logs so you can compare to the old ones, i havent changed any code since our last conversation when it was working correctly?, only adding a little bit of code for gpio pins for the valve relays?.

also in your last post you asked if the ‘tdr_wc_ec_uart’ sensor shows up in home assistant/developertools/entities, the answer is no it does not show up?.

any light you could shed on this would be very much appriciated.

yaml

esphome:
  name: acclimatdr-310w
  platform: ESP32
  board: esp-wrover-kit
  includes:
    - uart_read_line_sensor.h
    
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Acclima Tdr-310W"
    password: "ytxcMUCZwHJt"

captive_portal:

# Enable logging
logger:
  level: VERBOSE #makes uart stream available in esphome logstream
  baud_rate: 0 #disable logging over uart

# Enable Home Assistant API
api:

ota:

uart:
  id: tdr_wc_ec
  tx_pin: 16
  rx_pin: 17
  baud_rate: 9600


text_sensor:
- platform: custom
  text_sensors:
    id: "tdr_wc_ec_uart"
  lambda: |-
    auto tdr_wc_ec_sensor = new UartReadLineSensor(id(tdr_wc_ec));
    App.register_component(tdr_wc_ec_sensor);
    return {tdr_wc_ec_sensor};
    
switch:
  - platform: uart
    name: "read sensor"
    data: '1M!'
    
  - platform: uart
    name: "get measurement"
    data: '1D0!'

  - platform: gpio
    pin: 26
    name: "mix relay"
    inverted: yes
    
  - platform: gpio
    pin: 27
    name: "irrigation relay"
    inverted: yes


[14:09:22][C][logger:233]: Logger:
[14:09:22][C][logger:234]: Level: VERBOSE
[14:09:22][C][logger:235]: Log Baud Rate: 0
[14:09:22][C][logger:236]: Hardware UART: UART0
[14:09:22][C][uart.arduino_esp32:107]: UART Bus:
[14:09:23][C][uart.arduino_esp32:108]: TX Pin: GPIO16
[14:09:23][C][uart.arduino_esp32:109]: RX Pin: GPIO17
[14:09:23][C][uart.arduino_esp32:111]: RX Buffer Size: 256
[14:09:23][C][uart.arduino_esp32:113]: Baud Rate: 9600 baud
[14:09:23][C][uart.arduino_esp32:114]: Data Bits: 8
[14:09:23][C][uart.arduino_esp32:115]: Parity: NONE
[14:09:23][C][uart.arduino_esp32:116]: Stop bits: 1
[14:09:23][C][switch.gpio:050]: GPIO Switch ‘mix relay’
[14:09:23][C][switch.gpio:050]: Inverted: YES
[14:09:23][C][switch.gpio:051]: Pin: GPIO26
[14:09:23][C][switch.gpio:073]: Restore Mode: Restore (Defaults to OFF)
[14:09:23][C][switch.gpio:050]: GPIO Switch ‘irrigation relay’
[14:09:23][C][switch.gpio:050]: Inverted: YES
[14:09:23][C][switch.gpio:051]: Pin: GPIO27
[14:09:23][C][switch.gpio:073]: Restore Mode: Restore (Defaults to OFF)
[14:09:23][C][uart.switch:040]: UART Switch ‘read sensor’
[14:09:23][C][uart.switch:040]: UART Switch ‘get measurement’
[14:09:23][C][captive_portal:144]: Captive Portal:
[14:09:23][C][mdns:084]: mDNS:
[14:09:23][C][mdns:085]: Hostname: acclimatdr-310w
[14:09:23][V][mdns:086]: Services:
[14:09:23][V][mdns:088]: - _esphomelib, _tcp, 6053
[14:09:23][V][mdns:090]: TXT: version = 2022.2.6
[14:09:23][V][mdns:090]: TXT: mac = 94b97e7b94d0
[14:09:23][V][mdns:090]: TXT: platform = ESP32
[14:09:23][V][mdns:090]: TXT: board = esp-wrover-kit
[14:09:23][C][ota:085]: Over-The-Air Updates:
[14:09:23][C][ota:086]: Address: acclimatdr-310w.local:3232
[14:09:23][C][api:138]: API Server:
[14:09:23][C][api:139]: Address: acclimatdr-310w.local:6053
[14:09:23][C][api:143]: Using noise encryption: NO
[14:09:29][D][switch:013]: ‘read sensor’ Turning ON.
[14:09:29][D][switch:037]: ‘read sensor’: Sending state ON
[14:09:29][D][uart.switch:020]: ‘read sensor’: Sending data…
[14:09:29][D][switch:037]: ‘read sensor’: Sending state OFF
[14:09:30][V][text_sensor:016]: ‘tdr_wc_ec_uart’: Received new state \xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff
[14:09:30][D][text_sensor:067]: ‘tdr_wc_ec_uart’: Sending state ‘\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff’
[14:09:30][V][text_sensor:016]: ‘tdr_wc_ec_uart’: Received new state \xff\xff1
[14:09:30][D][text_sensor:067]: ‘tdr_wc_ec_uart’: Sending state ‘\xff\xff1’
[14:09:39][D][switch:013]: ‘get measurement’ Turning ON.
[14:09:39][D][switch:037]: ‘get measurement’: Sending state ON
[14:09:39][D][uart.switch:020]: ‘get measurement’: Sending data…
[14:09:39][D][switch:037]: ‘get measurement’: Sending state OFF
[14:09:39][V][text_sensor:016]: ‘tdr_wc_ec_uart’: Received new state \xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff1+39.4+26.9+24.4+203+734
[14:09:39][D][text_sensor:067]: ‘tdr_wc_ec_uart’: Sending state ‘\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff1+39.4+26.9+24.4+203+734’

I have an Sdi12 Sk16 from Dr Lui And is this the code i would put in to make my teros 12 get readings? I am really new to all of this and just need some help.

hi man, im just a beginer at all this stuff aswell but if i can help i will.

are you using the teros sensor and the sdi-12 adapter directly with a rp4?.

i have the device hooked into the sdi12 usb adapter and thats plugged into my rpi400. I just need help converting it to ec, moisture %, and temp and then that data somehow being read in HA.

have you loaded any code yet?, have you checked the sensor address or assigned one yet?.

i have assigned and checked the address. I can get it to work, i just would like it to read the EC, Water Moisture Content % and Temperature.