Readout for pulsed water meter

Thanks @ogiewon . Per your post I moved a couple PID controllers I have to ESP8266 and ESP32, I wish I tried Arduino sooner as it is much faster than Labview or using Beaglebones etc.

I got a water meter pulse counter that uploads to io.adafruit working with an ESP8266 and am now trying to get your HubDuino project going as this seems to be the holy grail of customized control with Hubitat. Now that I understand what it is, thanks for pointing me in your direction.

In order to get to counting pulses with your code so my first try is to get a simple relay working with your ST_Anything_Relays_ESP8266. It compiles on my LoLin NodeMCU ESP8266 and the microcontroller boots and is pingable at the hard-coded IP address per your code. However, I can't get your Hubduino Parent Ethernet device to work. After installing all your device drivers and two parent drivers in Hubitat, the HPE device installs successfully. But when I configure it for the IP address of my (pingable) microcontroller with your ST_Anything_Relays_ESP8266.ino code running, HPE gives an exception error:

2021-12-30 02:29:44.024 pm errorjava.lang.NullPointerException: Cannot execute null+900000 on line 414 (method checkHubDuinoPresence)

which corresponds to this line in HPE:
<Line 414> if (now() >= state.parseLastRanAt + (tmr * 1000)) {
which tells me state.parseLastRanAt is null for some reason. I looked around the code but don't see what's wrong. Do you have any suggestions? I just updated my Hubitat from 2.2.X to 2.3.0.124 but that didn't help.

Thanks if any ideas, HubDuino looks really cool to implement if I can get this working.

Cheers.

Also, for the guy above asking about pulse counter code this is what got me going:

1 Like

Did you properly update the sketch with your Hubitat hub’s IP address and port # 39501?

Thanks for the speedy reply, @ogiewon. I had missed that line you mentioned and it all "just works" now, very nice. Your project is the silver bullet for quick-making custom IOT (also props to Hubitat).

If you DM me an email address I'll happily paypal you $30 towards your project pizza fund.

Hey there,

I'm planing for a project, where @ogiewon code would come in really handy. But, a noob as I still am at Arduino, I have a few questions:

  1. Where do I have to implement the code, that @ogiewon posted? Is this for the Arduino, and has to be flashed on it using Arduino IDE?

  2. Can I run automations, based on these values? I'm planing on using this to turn a valve automatically off, after it released a certain volume. Would this be possible?

  3. How would this flow meters need to be wired to the Arduino? Could someone be so nice and give me an example? :smiley:

Thank you all, in advance. :slight_smile:

You'll find this thread helpful in understanding HubDuino/ST_Anything.

I am no expert in hubduino but passing what Ogiewon passed to me. Get a couple LoLin ESP8266 12E from ebay or HiLetGo ESP8266 12E from Amazon. Then figure out how to write to your ESP8266 12E via the Arduino interface. After you get something simple actually written, try to get Ogiewon's ST_Anything_Relays_Butttons_ESP8266.ino working to confirm your Hubitat can talk to it.

As a last step, figure out the pulse counter .ino, which I have not gotten to yet.

1 Like

Ok, sounds a little terrifying, but I'll try my best. :slight_smile:

I didn't want to get lost in the details so I started with this kit (linked below) because it includes a getting started manual that was perfect given I hadn't seen it done before either. The kit uses an esp32 which is just a newer version of esp8266. The getting started guide was worth the time savings alone for stepwise directions for your first try and having all the extra parts that came with it seems like a great value in retrospect.

2 Likes

This is really a good option. I'll order one, too. :slight_smile:

1 Like