I will like to share my recent addition to the home assistant projects that I have. I was tired of having to manually set the sprinklers based on time of the year or weather so I decided to automate them. I wrote a blog post and here you can find it. Questions, comments, feature requests are welcome!
Trying to work your code. Do you have an example of the private.h file that is in the code?
Yes, the private.h is optional and it just hosts your credentials. This is an example:
const char* WIFI_SSID = “my ssid”;
const char* WIFI_PASSWORD = “my wifi password”;
const char* MQTT_USERNAME = “mqttusername”;
const char* MQTT_PASSWORD = “mqttpassword”;
The idea behind it is to share the code easy without sending your private info to github
I get that. I never used a private.h file.
Im getting an error trying to compile the code.
sprinklers:28: error: ‘MQTTClient’ does not name a type
MQTTClient mqtt;
is your yaml on a github for the sprinkler?
You need to install the third party libraries in your Arduino IDE. The only external I use is:
name=MQTT
version=2.4.1
author=Joel Gaehwiler <[email protected]>
maintainer=Joel Gaehwiler <[email protected]>
sentence=MQTT library for Arduino
paragraph=This library bundles the lwmqtt client and adds a thin wrapper to get an Arduino like API.
category=Communication
url=https://github.com/256dpi/arduino-mqtt
architectures=*
You can install it from the menu
Hi can u use this controller if my system has a pump it draws water from the canal?
Yes, it does not matter what its controlling since it opens and closes a relay. The difference will be that instead of using the transformer you just use the power line
This is awesome! I can’t wait to do this. I’m definitely adding this to my project list! Can I ask a couple of questions for my own benefit? For the 110v - 5v power supply, could I just use a cell phone charger base? Also, for the 3.3v to 5v to the relay, could you just use a logic level converter?
1-> Yes you can
2-> Totally, a logic level converter is much more complicated (internally) but its actually based on some transistors