I’m looking for way to control a dry or wet type zwave relay such as a Linear FS20Z-1 relay. The relay will drive a mister to spray mosquitoes etc. for 30 sec to 90 sec (I want to control). It needs to come on at sunset (with a ± minute variance) the repeat at intervals during the night. Can someone recommend how I can do this?
WebCoRE is one option you can look at…
Does anyone have code or something I can modify? If I described the functionality I need is there someone that could create this app?
Hello, @Jimc1611
One way you can achieve this automation is through the Rules API. The below JSON example describes the next workflow:
- If this Water Sensor’s status is dry.
- And if Now is between Sunset and Sunrise.
- Then Turn On Spray Device for 90 Seconds and Turn it off
{
"name": "Spray - From Sunset to Sunrise - Spray Timer: 90s",
"actions": [
{
"if": {
"and": [
{
"equals": {
"left": {
"device": [ "waterSensorId" ],
"component": "main",
"capability": "waterSensor",
"attribute": "water"
}
},
"right": {
"string": "dry"
}
},
{
"between": {
"value": {
"time": {
"reference": "Now"
}
},
"start": {
"time": {
"reference": "Sunset"
}
},
"end": {
"time": {
"reference": "Sunrise"
}
}
}
}
],
"then": [
{
"command": {
"devices": [ "sprayDeviceId" ],
"commands": {
"component": "main",
"capability": "switch",
"command": "on",
"arguments": []
}
}
},
{
"sleep": {
"duration": {
"value": {
"integer": 90
},
"unit": "Second"
}
}
},
{
"command": {
"devices": [ "sprayDeviceId" ],
"commands": {
"component": "main",
"capability": "switch",
"command": "off",
"arguments": []
}
}
}
],
"else": []
}
}
]
}
For more information about the Rules API, go to: