Jilia + Centralite - Water sensor toggles Appliance module

Configure your water sensor to toggle your appliance module. This can be a great way to ensure a home flood wont damage an appliance.

This flow makes use of three products. 1. A Jilia smart Hub 2. A Centralite Water Sensor 3. A Centralite appliance module.

A Jilia smart hub is connected by Ethernet and configured to communicate with both the water sensor and the appliance module. I suggest using the Quick Start page on Jilia's website and to also test the functionality with the Jilia Browser.

Once all of that is set up drop the code into node-red. You will need to customize a few parameters for this code to work.

First, the websocket water sensor node must have your WSS URL in the URL field. You can find this URL through the Jilia Browser by clicking on the device and scrolling down to the Wss URL under STATUS. This provides the On or Off state to the program. You can test that this works through the first debug node.

Second, the http request node must be configured to POST to your Http URL. This is the URL for the POST within the appliance module. You can also find this code by entering the Jilia Browser and opening the Appliance module device. Scroll through the code until you find the Http URL under the POST request.

With those two modification the code will work. Special thanks to Kenny York

[{"id":"1b949ecf.f33b41","type":"inject","z":"2272ece0.497ba4","name":"","topic":"","payload":"{\"topic\":\"light\",\"value\":\"Wet\"}","payloadType":"json","repeat":"","crontab":"","once":false,"x":441,"y":262,"wires":[["16b8612.36ccb9f"]]},{"id":"314e84eb.c287ac","type":"debug","z":"2272ece0.497ba4","name":"","active":true,"console":"false","complete":"true","x":1022,"y":335,"wires":[]},{"id":"3a63a4d7.bbd84c","type":"websocket in","z":"2272ece0.497ba4","name":"Water Sensor","server":"","client":"3858e3d9.c0d48c","x":214,"y":384,"wires":[["2b393086.6272e","1bf4e50f.af010b"]]},{"id":"16b8612.36ccb9f","type":"switch","z":"2272ece0.497ba4","name":"Wet Only","property":"payload.data","propertyType":"msg","rules":[{"t":"eq","v":"Wet","vt":"str"}],"checkall":"true","outputs":1,"x":578,"y":355,"wires":[["709d6120.9a6d4","da2d7a47.e67738"]]},{"id":"4a5977f.7edb788","type":"http request","z":"2272ece0.497ba4","name":"Turn Off Water Valve","method":"POST","ret":"txt","url":"https://api.jilia.io----CHANGE THIS TO YOURS---","tls":"","x":1049,"y":519,"wires":[["af1a6d1a.ba5c6"]]},{"id":"709d6120.9a6d4","type":"change","z":"2272ece0.497ba4","name":"Set Action","rules":[{"t":"set","p":"payload","pt":"msg","to":"action=Toggle","tot":"str"},{"t":"set","p":"headers","pt":"msg","to":"{\"content-type\":\"application/x-www-form-urlencoded\"}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":746,"y":412,"wires":[["4a5977f.7edb788","314e84eb.c287ac"]]},{"id":"2b393086.6272e","type":"json","z":"2272ece0.497ba4","name":"","x":407,"y":358,"wires":[["16b8612.36ccb9f"]]},{"id":"da2d7a47.e67738","type":"debug","z":"2272ece0.497ba4","name":"","active":true,"console":"false","complete":"true","x":751,"y":327,"wires":[]},{"id":"af1a6d1a.ba5c6","type":"debug","z":"2272ece0.497ba4","name":"","active":true,"console":"false","complete":"true","x":1290,"y":315,"wires":[]},{"id":"1bf4e50f.af010b","type":"debug","z":"2272ece0.497ba4","name":"","active":true,"console":"false","complete":"false","x":193,"y":311,"wires":[]},{"id":"165f0c20.b35ff4","type":"comment","z":"2272ece0.497ba4","name":"This INJECT node can be used to test the program if you do not have a water sensor","info":"","x":432,"y":218,"wires":[]},{"id":"7d230fb6.95545","type":"comment","z":"2272ece0.497ba4","name":"Add your own Wss URL ","info":"","x":205,"y":437,"wires":[]},{"id":"139d76a1.5cfde9","type":"comment","z":"2272ece0.497ba4","name":"Add your own http URL ","info":"","x":1050,"y":565,"wires":[]},{"id":"c506e85e.757538","type":"comment","z":"2272ece0.497ba4","name":"Action=Toggle will toggle the Appliance module","info":"There are other actions available if you would like to turn OFF or turn ON\nNeeded headers are also set","x":733,"y":468,"wires":[]},{"id":"e4628298.43f74","type":"comment","z":"2272ece0.497ba4","name":"More Info","info":"Test if the sensor has returned WET.","x":581,"y":316,"wires":[]},{"id":"3858e3d9.c0d48c","type":"websocket-client","z":"2272ece0.497ba4","path":"wss://api.jilia.io------CHANGE THIS TO YOURS---","wholemsg":"false"}]

Flow Info

Created 9 years ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • change (x1)
  • comment (x5)
  • debug (x4)
  • http request (x1)
  • inject (x1)
  • json (x1)
  • switch (x1)
  • websocket in (x1)
  • websocket-client (x1)

Tags

  • jilia
  • centralite
  • flood
  • water
  • sensor
  • hub
  • appliance
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option