How to control four relays



  • How do I get Domoticz to control the relays for a swamp cooler? I have a four relay board for Fan-High/Off, Fan Low/Off, Pump On/Off, and Purge Pump On/Off. I currently have an Arduino sketch controlling the relays using a direct wired DHT NOT using MySensors at all and it is working well, but difficult to make changes as it is all mounted inside the swamp housing.

    The plan is to use the MySenors-DHT to send temp/Humidity to Domotics and then have it control the relays with a dumb Mysensors Relay-Sketch on the swamp.

    The change over between fan-speeds needs a delay of about 6-seconds to save undue load when changing speed up/down. That's how it worked from new so the manufacturer thinks it is a good idea.

    I need Domotcz to watch the temp and when it is above the desired set point, turn the Pump on, the Fan on High for about ten minutes then check the temp and see if it needs to go Low or stay High. It needs to run for about ten minutes between each speed change to balance the temps throughout the house. I tried just running off the temp changes but it was hunting badly. It needs some form of Hysteresis and the fixed run time serves both purposes for that.

    I want to also use the same MySensors-DHT to control baseboard heating in Winter and another set of four relays at the main power board. But first I need to understand how to get Domoticz doing the swamp control. IF Domoticz is capable of doing that. I know OpenHab can, but the programming overhead for that is disgraceful!



  • @NotTooTechy
    I think you can do this with a lua script on domoticz:
    https://www.domoticz.com/wiki/Scripts



  • @fleinze said:

    I think you can do this with a lua script on domoticz:

    Thanks, but I have dumped Domoticz and will go with my own Pascal program and serial controller. It's still way too early days for any useful Controllers, although OpenHab 2 seems to be finally getting the memo. Controllers have to be more than just pretty graphs and buttons to be called a controller. Right now they are not much more than software switches.

    Did you notice that Domoticz calls home two times every time you start it? I blocked that in my router. 🙂


  • Hero Member

    @NotTooTechy from your text I read that the the equipment needs some special precautions related to timing. From my perspective you should not use the controller to handle that, but do it local in firmware (MyS node).
    Domoticz is perfectly capable of handling very specific algorithms in lua. Certainly more straightforward than programming it in Pascal. Though it can be more fun to build you own controller if you are into it😄
    Domoticz "calls home" to check for updates. No secrets to what it is doing, the whole source is on git.


Log in to reply
 

Suggested Topics

  • 5
  • 5
  • 1
  • 2
  • 8
  • 2

0
Online

11.2k
Users

11.1k
Topics

112.5k
Posts