When the relay closes the circuit, it makes a very distinct “TICK” sound. For clarity, i’ll just say the circuit closes or something. I know it works, the hardware is fine. Its the code. I was able to get a version of the code above to leave the circuit open, however, when I went to add the function into IFTTT, there was an error, even though the code compiled… something is wrong and I don’t know enough to figure it out.
The 3.3 vs. the 5v, its worked before.
You are right on the connection to the switch setup with the steam room, i want it to work in parallel. It’ll be wired very much like the garage setup I had.
I am purchasing this as a workaround. As much as I enjoy the particle board, I just don’t have the time to troubleshoot the code given my experience level. Thanks for the help all!
If anyone has any further ideas with the coding, let me know.
with either device you might want to consider a waterproof enclosure of some kind or bare minimum a somewhat sealing plastic box since steam and/or high relative humidity has a way of negatively affecting electronics. good luck with the project. and remember the desiccant pouches inside the box.
// This #include statement was automatically added by the Particle IDE.
void resetAll()
{
digitalWrite(D0, LOW);
}
Timer switchOffTimer(1000, resetAll, true); // create a 1-second-one-shot timer that calls resetAll()
int Steam (String command);
void setup()
{
Particle.function("SteamOn", SteamOn);
Serial.begin(9600);
pinMode(D0, OUTPUT);
}
void loop()
{
}
//Function to turn on steam room
int SteamOn (String command)
{
command.trim(); // remove possible leading/trailing white space
int retVal = 0;
if(command == "SteamRoomOn")
{
digitalWrite(D0, HIGH);
retVal = 1;
}
else // something went wrong, so be save and switch off immedeately
{
switchOffTimer.stop();
resetAll();
}
if (retVal > 0)
switchOffTimer.start();
return retVal;
}