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:
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
- Wemo D1 pinouts: VCC-5V, Trig-D6, Echo-D7, Grnd-Grnd
- Modify Basic Setup section. Note: distance_topic and subscribe_topic are key to matching. Example: distance_topic - wardhome/salt-tank/distance subscribe_topic wardhome/salt-tank/delay
- Upload sketch
- Runs initially every hour unless sent a message through Salt Tank Driver
Hope this is fun for others!