logo elektroda
logo elektroda
X
logo elektroda

How to control 3 relays via Domoticz with ESP8266?

maystero 900 5
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 17603272
    maystero
    Level 24  
    Hello.
    I have an idea to control 3 relays via Domoticz,
    I was looking for a way in Domoticz to switch on all 3 relays at once, or each one individually, with one press.
    And with one button to switch all 3 off at once.
    I found something like this,
    How to control 3 relays via Domoticz with ESP8266? .

    It works but at any given time I can only fully control: GPIO 14

    and I would like to:
    http://192.168.1.84/control?cmd=GPIO,14,1 + GPIO,12,1 + GPIO,16,1

    What should a correctly written script look like? Or am I doing something wrong?
  • ADVERTISEMENT
  • ADVERTISEMENT
  • Helpful post
    #3 17606147
    starob
    Level 29  
    As actions, call script:///action.sh, and in the script enter the commands to be executed
  • ADVERTISEMENT
  • #4 17621032
    maystero
    Level 24  
    starob wrote:
    As actions call script:///action.sh, and in the script enter the commands to execute
    .

    Can a colleague provide an example?
    AND where to save this script "/action.sh"? (in which directory on the raspberry?)
  • ADVERTISEMENT
  • #5 17621332
    starob
    Level 29  
    You have to write the script in bash yourself. Place it in any directory, and specify its path in the switch action definition. Make the script executable beforehand. Off the top of my head, I can't give you the details at the moment. Examples from https://www.domoticz.com/wiki/Scripts may be helpful. I will throw something up in my spare time. You will find all the information you need in the example https://www.domoticz.com/wiki/Daikin_wifi
  • #6 17624816
    Slawek K.
    Level 35  
    You can simply do it like this, you go into Configuration/More options/Events and arrange from the blocks like this :
    How to control 3 relays via Domoticz with ESP8266? .
    Of course, you choose the name of the switch as you have defined at home and the commands in http also your own - here I have given for example. On the right you save as a name and give Event active.
    Standard switch definition :
    How to control 3 relays via Domoticz with ESP8266? .
    The moment you click Off on the switch, the event procedure is executed.

    Greetings
ADVERTISEMENT