Maxbotix distance sensor plugin - questions to get started programming

I bought this:

It talks RS232. I’m planning on using it to monitor the level in one of my septic tanks due to an unfortunate and smelly incident last week. I have a couple of questions:

  1. What should I use for the UPNP service ID for a distance value?
  2. Are there any existing plugins out there that I could modify easily? All this thing does is repeatedly send the distance in centimeters every couple of seconds. If there’s a plugin for a serial temp sensor that just reads repeating input, this would be perfect.
  3. Do I have to do anything special to the plugin to be able to use triggers that will fire on greater/less than or equal to certain values?

Ok, so I have my sensor installed, and here’s the data I’m getting back from it:

tesla2:~ jaustad$ telnet telnet> toggle crmod Will map carriage return on output. telnet> open 10.1.6.16 2002 Trying 10.1.6.16... Connected to 10.1.6.16 (10.1.6.16). Escape character is '^]'. R0686 R0686 R0685 R0686 R0686 R0686 R0686 R0686 R0686

The “R0686” is the distance in millimeters from the sensor to the surface of the water in the tank. Yes, I know, it’s nearly full. That’s not good considering I just had it pumped 17 days ago and I don’t know at what level it starts draining into the drainfield.

In any case, “Rxxxx\r” is sent every 1.5 seconds or so.

Is there a plugin out there right now that makes a network connection to something, and just reads a repeating value? Temperature, humidity, whatever? This would save me a lot of time to just modify that.

You need a plugin that has an block. The RFID one has one, and will give you some starter tips:
ActiveRFID

If you change the from raw to crlf, then Vera will do the line parsing for you, instead of having to deal with the data one character at a time.

[quote=“guessed, post:3, topic:180679”]You need a plugin that has an block. The RFID one has one, and will give you some starter tips:
ActiveRFID

If you change the from raw to crlf, then Vera will do the line parsing for you, instead of having to deal with the data one character at a time.[/quote]

Perfect! That reminds me, I actually have one of these RFID units and like 5 sensors. I should get that hooked up.