In order to make this work in Hubitat and use my RPi Mosquito MQTT Broker. I use Hubitat's MQTT Client connectivity to read and display the Salt Tank level. I wanted to use a NodeMCU for the Arduino but unfortunately the HC-SR04 requires 5v to operate and the NodeMCU I have only has pinouts for 3.3v. So now using a Wemo D1.
I created an Arduino sketch that establishes a connection to WiFi, connects to your MQTT Broker, sends the current salt level distance to the topic and also accepts incoming delay time variances from the Salt Tank Driver.
Last piece was using the built-in Notification app to send me a PushOver message (removed need for WATO app).
Setup is fairly simple and documentation is in the Arduino sketch for what pins you need to use.
Arduino Code location:
Hubitat Driver:
Setup - Salt Tank Driver
Set your Salt Tank capacity based on # of salt blocks (default = 4)
MQTT Broker Address: IP or DNS name of MQTT Broker (I use Mosquito on a RPi)
MQTT Username: your broker username account
MQTT Password: your broker password for above username account
Topic to Subscribe: this is your root/device topic. Example: wardhome/salt-tank/#
Topic to Publish: this is the value you want to publish for a MQTT device to subscribe to. Example: wardhome/salt-tank/delay
Not sure why i'm getting this error in the Logs for the Salt Tank driver
java.lang.NullPointerException: Cannot invoke method toInteger() on null object on line 141 (updated)
The salt tank driver is in the root github drivers section.
After you install the driver code, add a new virtual device. Assign the driver to that device. Then follow instructions to listen to MQTT topic you set in the Arduino sketch.
Yeah the salt driver doesnt work for some reason on my system. I added the mqttt driver as well just to test and it works fine and it picks up the subscribed information no problem