Alexa sonoff hot tub thermostatic voice temp control

Flow uses alexa remote2 node and Hardhill virtual devices to control by voice for setting, getting and heat or not a hot tub with a sonoff th10/16 and dh temp sensor. RBE temp changes announced and safety switches wired in flow to prevent heater operating while pump is not circulating water.

I very proud of this flow as it was a complete learning experience from no knowledge to a superb flow that does everything and more than I could have initially hoped for.

The flow works effortlessly and i have other flows connected that monitor connection status and errors that reinitialise and catch any errors and reboot the appropriate problem.

The function nodes will need editing to the names of your echo devices. As will the virtual devices added using the alexa hardhill smart home node and skill with your named devices. The sonoffs are using the standard sonoff firmware and I have had no need to tasmoasize them. Temp is gained from ewelink node. Temp is then exported to alexa.

The temp set point is set as a global context and is also able to be changed anytime by voice.

If the flow is any use to you or you are just interested in similar projects. Message me and I will be happy to hear from you. and share the knowledge.

Please note as well as the safety flows I have also suitable contactors and protection circuits as the heater is rated at much higher than 16 amps the th16 is rated at max. Additional circuit breakers also have been physically wired up as you cant be to careful with electric and water.

Next project is alexaing the steam and sauna room !!

[{"id":"eb207cb5.93f24","type":"tab","label":"Bath Alexa thermostat","disabled":false,"info":""},{"id":"185af96.c50b507","type":"debug","z":"eb207cb5.93f24","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":730,"y":80,"wires":[]},{"id":"3871c53e.5e060a","type":"comment","z":"eb207cb5.93f24","name":"THERMOSTAT","info":"","x":100,"y":20,"wires":[]},{"id":"16d7f8a5.8cf7a7","type":"change","z":"eb207cb5.93f24","name":"","rules":[{"t":"set","p":"targettemp","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":510,"y":80,"wires":[["185af96.c50b507"]]},{"id":"21803167.f65d7e","type":"switch","z":"eb207cb5.93f24","name":"","property":"payload.temperature","propertyType":"msg","rules":[{"t":"gt","v":"targettemp","vt":"flow"},{"t":"lt","v":"targettemp","vt":"flow"}],"checkall":"true","repair":false,"outputs":2,"x":230,"y":500,"wires":[["8032b78c.f4b2c8","85d9db65.ac2a68"],["1f909ae3.f6d095","f9d3df9.3b6932"]]},{"id":"d3da57d2.0c1008","type":"ewelink-temperature","z":"eb207cb5.93f24","name":"","deviceId":"10007c2879","auth":"eb3b6077.50435","x":180,"y":220,"wires":[["5608d454.41d43c","ee5a7264.1118d","26ec9095.3dcea","78788496.e168bc"]]},{"id":"8032b78c.f4b2c8","type":"debug","z":"eb207cb5.93f24","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":390,"y":440,"wires":[]},{"id":"1f909ae3.f6d095","type":"debug","z":"eb207cb5.93f24","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":370,"y":560,"wires":[]},{"id":"d7863c8d.f2a4f","type":"inject","z":"eb207cb5.93f24","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":120,"y":680,"wires":[["3c05a201.771d2e"]]},{"id":"5608d454.41d43c","type":"debug","z":"eb207cb5.93f24","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":410,"y":220,"wires":[]},{"id":"1ba981e9.1c28ae","type":"alexa-home","z":"eb207cb5.93f24","conf":"2cd25a0f.b3e5b6","device":"138365","acknoledge":true,"name":"bath water","topic":"","x":80,"y":80,"wires":[["791445e6.0e03cc"]]},{"id":"1a3c815a.e6c2bf","type":"debug","z":"eb207cb5.93f24","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":350,"y":20,"wires":[]},{"id":"791445e6.0e03cc","type":"switch","z":"eb207cb5.93f24","name":"","property":"command","propertyType":"msg","rules":[{"t":"eq","v":"SetTargetTemperatureRequest","vt":"str"},{"t":"eq","v":"GetTemperatureReadingRequest","vt":"str"},{"t":"eq","v":"TurnOnRequest","vt":"str"},{"t":"eq","v":"TurnOffRequest","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":290,"y":100,"wires":[["16d7f8a5.8cf7a7"],["1a3c815a.e6c2bf","3c05a201.771d2e"],["ad346311.dd7bf","d85eeca6.8bb09","5a450525.770dec"],["d42de11e.4c3b1","f65cc77c.3a5688","da7eb495.5e6888","82e2552e.a15948"]]},{"id":"ee5a7264.1118d","type":"alexa-home-resp","z":"eb207cb5.93f24","x":480,"y":260,"wires":[]},{"id":"9d849252.ebd26","type":"msg-resend","z":"eb207cb5.93f24","interval":"35","intervalUnit":"secs","maximum":"1000","bytopic":false,"clone":false,"firstDelayed":false,"addCounters":false,"waitForResend":false,"highRate":true,"outputCountField":"","outputMaxField":"","name":"","x":670,"y":120,"wires":[["d3da57d2.0c1008"]]},{"id":"d42de11e.4c3b1","type":"change","z":"eb207cb5.93f24","name":"","rules":[{"t":"set","p":"resend_ignore","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":680,"y":200,"wires":[["9d849252.ebd26","20425540.d45efa"]]},{"id":"c0297970.b14808","type":"function","z":"eb207cb5.93f24","name":"","func":"msg.payload = { \"type\": \"speakAtVolume\", \n                \"payload\": { \"type\": \"regular\", \n                             \"text\": \"the bath water is  \" + msg.payload + \" degrees\",\n                              \"volume\": 100, \n                              \"devices\": \"Bathroom input\"\n                            }\n                }\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":580,"y":320,"wires":[["a1884572.22f6f8"]]},{"id":"a1884572.22f6f8","type":"alexa-remote-routine","z":"eb207cb5.93f24","name":"","account":"149ea61b.2e576a","routineNode":{"type":"custom","payload":{"type":"msg","value":"payload"}},"x":780,"y":320,"wires":[[]]},{"id":"9f197a01.04a0d8","type":"change","z":"eb207cb5.93f24","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.temperature","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":320,"wires":[["c0297970.b14808"]]},{"id":"da7eb495.5e6888","type":"alexa-remote-smarthome","z":"eb207cb5.93f24","name":"","account":"149ea61b.2e576a","config":{"option":"action","value":[{"entity":"09674b19-7a36-4dcf-8942-328225d8d7f3","action":"turnOff"}]},"outputs":1,"x":640,"y":500,"wires":[[]]},{"id":"65d9b37a.002b8c","type":"alexa-remote-smarthome","z":"eb207cb5.93f24","name":"","account":"149ea61b.2e576a","config":{"option":"action","value":[{"entity":"09674b19-7a36-4dcf-8942-328225d8d7f3","action":"turnOn"}]},"outputs":1,"x":760,"y":560,"wires":[[]]},{"id":"d1042a13.768158","type":"alexa-remote-routine","z":"eb207cb5.93f24","name":"","account":"149ea61b.2e576a","routineNode":{"type":"speakAtVolume","payload":{"type":"regular","text":{"type":"str","value":"heater off"},"volume":{"type":"num","value":"100"},"mode":"set","devices":["G090VP04843201KE"]}},"x":950,"y":360,"wires":[[]]},{"id":"f3a21624.60b178","type":"alexa-remote-routine","z":"eb207cb5.93f24","name":"","account":"149ea61b.2e576a","routineNode":{"type":"speakAtVolume","payload":{"type":"regular","text":{"type":"str","value":"heater is on"},"volume":{"type":"num","value":"100"},"mode":"set","devices":["G090VP04843201KE"]}},"x":1050,"y":440,"wires":[[]]},{"id":"7239aada.9224e4","type":"delay","z":"eb207cb5.93f24","name":"","pauseType":"delay","timeout":"4","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":580,"y":360,"wires":[["d1042a13.768158"]]},{"id":"ad346311.dd7bf","type":"alexa-remote-smarthome","z":"eb207cb5.93f24","name":"","account":"149ea61b.2e576a","config":{"option":"action","value":[{"entity":"25927bde-8baa-441c-aa0e-f4d5eac5199e","action":"turnOn"}]},"outputs":1,"x":620,"y":40,"wires":[[]]},{"id":"20425540.d45efa","type":"msg-resend","z":"eb207cb5.93f24","interval":"20","intervalUnit":"secs","maximum":"1000","bytopic":false,"clone":false,"firstDelayed":false,"addCounters":false,"waitForResend":false,"highRate":true,"outputCountField":"","outputMaxField":"","name":"","x":150,"y":400,"wires":[["34ab746c.0d8f4c"]]},{"id":"34ab746c.0d8f4c","type":"ewelink-temperature","z":"eb207cb5.93f24","name":"","deviceId":"10007c2879","auth":"eb3b6077.50435","x":160,"y":440,"wires":[["21803167.f65d7e"]]},{"id":"c66163e4.29bfe","type":"switch","z":"eb207cb5.93f24","name":"","property":"payload.temperature","propertyType":"msg","rules":[{"t":"gt","v":"targettemp","vt":"flow"},{"t":"lt","v":"targettemp","vt":"flow"}],"checkall":"true","repair":false,"outputs":2,"x":390,"y":380,"wires":[["7239aada.9224e4"],["64267119.e401e"]]},{"id":"64267119.e401e","type":"delay","z":"eb207cb5.93f24","name":"","pauseType":"delay","timeout":"4","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":560,"y":400,"wires":[["2a0daad6.a30236","a23dfe22.89c9e"]]},{"id":"d85eeca6.8bb09","type":"delay","z":"eb207cb5.93f24","name":"","pauseType":"delay","timeout":"15","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":500,"y":120,"wires":[["9d849252.ebd26","20425540.d45efa"]]},{"id":"f65cc77c.3a5688","type":"alexa-remote-routine","z":"eb207cb5.93f24","name":"","account":"149ea61b.2e576a","routineNode":{"type":"speakAtVolume","payload":{"type":"regular","text":{"type":"str","value":"Alexa is no longer monitoring the bath water temperature"},"volume":{"type":"num","value":"100"},"mode":"set","devices":["G090VP04843201KE"]}},"x":190,"y":160,"wires":[[]]},{"id":"5a450525.770dec","type":"alexa-remote-routine","z":"eb207cb5.93f24","name":"","account":"149ea61b.2e576a","routineNode":{"type":"speakAtVolume","payload":{"type":"regular","text":{"type":"str","value":"Alexa is now powering up bath pump and is monitoring the bath water temperature. Remember to turn off safety by voice command"},"volume":{"type":"num","value":"100"},"mode":"set","devices":["G090VP04843201KE"]}},"x":810,"y":280,"wires":[[]]},{"id":"26ec9095.3dcea","type":"rbe","z":"eb207cb5.93f24","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":270,"y":360,"wires":[["c66163e4.29bfe"]]},{"id":"78788496.e168bc","type":"rbe","z":"eb207cb5.93f24","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":350,"y":280,"wires":[["9f197a01.04a0d8"]]},{"id":"1dc6f80a.a18668","type":"ewelink-temperature","z":"eb207cb5.93f24","name":"","deviceId":"10007c2879","auth":"eb3b6077.50435","x":160,"y":620,"wires":[["3a5aa581.adbcba"]]},{"id":"3a5aa581.adbcba","type":"change","z":"eb207cb5.93f24","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.temperature","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":620,"wires":[["e42f6587.822828"]]},{"id":"e42f6587.822828","type":"function","z":"eb207cb5.93f24","name":"","func":"msg.payload = { \"type\": \"speakAtVolume\", \n                \"payload\": { \"type\": \"regular\", \n                             \"text\": \"the bath water is  \" + msg.payload + \" degrees\",\n                              \"volume\": 100, \n                              \"devices\": \"Bathroom input\"\n                            }\n                }\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":560,"y":620,"wires":[["b11ca2df.20ff1"]]},{"id":"b11ca2df.20ff1","type":"alexa-remote-routine","z":"eb207cb5.93f24","name":"","account":"149ea61b.2e576a","routineNode":{"type":"custom","payload":{"type":"msg","value":"payload"}},"x":780,"y":620,"wires":[[]]},{"id":"3c05a201.771d2e","type":"change","z":"eb207cb5.93f24","name":"","rules":[{"t":"delete","p":"command","pt":"msg"},{"t":"set","p":"payload","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":120,"y":540,"wires":[["1dc6f80a.a18668"]]},{"id":"85d9db65.ac2a68","type":"delay","z":"eb207cb5.93f24","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":420,"y":500,"wires":[["da7eb495.5e6888"]]},{"id":"6b59d0de.6088f","type":"switch","z":"eb207cb5.93f24","name":"","property":"payload","propertyType":"msg","rules":[{"t":"false"},{"t":"true"}],"checkall":"true","repair":false,"outputs":2,"x":350,"y":680,"wires":[["314bd43c.a8142c"],["82e2552e.a15948"]]},{"id":"31aca30f.89a9cc","type":"debug","z":"eb207cb5.93f24","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":790,"y":680,"wires":[]},{"id":"f9d3df9.3b6932","type":"gate","z":"eb207cb5.93f24","name":"","controlTopic":"control","defaultState":"closed","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","statusCmd":"status","persist":false,"x":570,"y":560,"wires":[["65d9b37a.002b8c"]]},{"id":"314bd43c.a8142c","type":"function","z":"eb207cb5.93f24","name":"","func":"msg.topic = \"control\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":240,"y":780,"wires":[["24bb9635.b6058a"]]},{"id":"24bb9635.b6058a","type":"change","z":"eb207cb5.93f24","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"open","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":780,"wires":[["f9d3df9.3b6932","2a0daad6.a30236","c9cf1e22.4464b"]]},{"id":"82e2552e.a15948","type":"function","z":"eb207cb5.93f24","name":"","func":"msg.topic = \"control\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":240,"y":820,"wires":[["8e166251.11ce2"]]},{"id":"8e166251.11ce2","type":"change","z":"eb207cb5.93f24","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"close","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":820,"wires":[["f9d3df9.3b6932","2a0daad6.a30236","fc77e0f1.02c94"]]},{"id":"4d9c7739.1b6338","type":"alexa-home","z":"eb207cb5.93f24","conf":"2cd25a0f.b3e5b6","device":"138406","acknoledge":true,"name":"safety","topic":"","x":100,"y":740,"wires":[["6b59d0de.6088f","31aca30f.89a9cc"]]},{"id":"2a0daad6.a30236","type":"gate","z":"eb207cb5.93f24","name":"","controlTopic":"control","defaultState":"closed","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","statusCmd":"status","persist":false,"x":810,"y":440,"wires":[["f3a21624.60b178"]]},{"id":"a23dfe22.89c9e","type":"gate","z":"eb207cb5.93f24","name":"","controlTopic":"control","defaultState":"open","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","statusCmd":"status","persist":false,"x":770,"y":400,"wires":[["c7775dc0.94b4a"]]},{"id":"c7775dc0.94b4a","type":"alexa-remote-routine","z":"eb207cb5.93f24","name":"","account":"149ea61b.2e576a","routineNode":{"type":"speakAtVolume","payload":{"type":"regular","text":{"type":"str","value":"heater off because the safety is on. Turn off safety is wanting to heat bath water"},"volume":{"type":"num","value":"100"},"mode":"set","devices":["G090VP04843201KE"]}},"x":990,"y":400,"wires":[[]]},{"id":"fc77e0f1.02c94","type":"function","z":"eb207cb5.93f24","name":"","func":"msg.topic = \"control\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":820,"y":760,"wires":[["24bf8b57.813604"]]},{"id":"24bf8b57.813604","type":"change","z":"eb207cb5.93f24","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"open","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1000,"y":760,"wires":[["a23dfe22.89c9e"]]},{"id":"c9cf1e22.4464b","type":"function","z":"eb207cb5.93f24","name":"","func":"msg.topic = \"control\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":820,"y":800,"wires":[["b405dcb3.3678b"]]},{"id":"b405dcb3.3678b","type":"change","z":"eb207cb5.93f24","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"close","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1000,"y":800,"wires":[["a23dfe22.89c9e"]]},{"id":"eb3b6077.50435","type":"ewelink-credentials"},{"id":"2cd25a0f.b3e5b6","type":"alexa-home-conf","username":"Robmak"},{"id":"149ea61b.2e576a","type":"alexa-remote-account","name":"","authMethod":"proxy","proxyOwnIp":"localhost","proxyPort":"3457","cookieFile":"","refreshInterval":"7","alexaServiceHost":"alexa.amazon.co.uk","amazonPage":"amazon.co.uk","acceptLanguage":"en-UK","userAgent":"","useWsMqtt":"on","autoInit":"on"}]

Flow Info

Created 4 years, 4 months ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • change (x9)
  • comment (x1)
  • debug (x6)
  • delay (x4)
  • function (x6)
  • inject (x1)
  • rbe (x2)
  • switch (x4)
Other
  • alexa-home (x2)
  • alexa-home-conf (x1)
  • alexa-home-resp (x1)
  • alexa-remote-account (x1)
  • alexa-remote-routine (x7)
  • alexa-remote-smarthome (x3)
  • ewelink-credentials (x1)
  • ewelink-temperature (x3)
  • gate (x3)
  • msg-resend (x2)
  • tab (x1)

Tags

  • alexa
  • sonoff
  • hot
  • tub
  • bath
  • heater
  • ewelink
  • jacuzzi
  • thermostat
  • thermostatic
  • water
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option