How to Send Twice a command to a switch to pilot blinds

Moderator: leecollings

Post Reply
pcc9
Posts: 11
Joined: Tuesday 17 March 2015 15:00
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

How to Send Twice a command to a switch to pilot blinds

Post by pcc9 »

Hi to all,

I have blinds that need to receive some impulsion ( between 200ms and 3 seconds ) to be open or closed.

I have interfaced them with some Chacon 54754 to pilot them with Domoticz. But this swich stay in On or Off position for 2 minutes. This make my blinds to beep as then receive a too long signal.

When I read the notice of the Chacon switch, they say that to make if to go back to neutral position and you need to send again the same order.
So I need to send twice the ON command or the Off command from my Domoticz switch.

I didn't manage to do it using Lua scripting. Can some one help me as I am a newbee in scripting?

thanks a lot for your help,

regards,
Pierre
niceandeasy
Posts: 102
Joined: Thursday 28 January 2016 22:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: NL
Contact:

Re: How to Send Twice a command to a switch to pilot blinds

Post by niceandeasy »

Did you try this?:

commandArray[1]={[devicename]=command}
commandArray[2]={[devicename]=command..' AFTER 1'}

1 is the delay between the first and the second time. It's all documented in https://www.domoticz.com/wiki/Events. Take a look.

EDIT:
I did not try this, so I don't know if it 'll work. Maybe it won't, because the two lines will be controlling the same device.
Devicename and command are strings here and can be replaced by your actual device names, surrounded by 'quotes'. If you do that, the command and the AFTER 1 can be written as one string, like, 'On AFTER 1'.
If this does not work, be sure to also try a delay of 2, instead of 1.

There's also ways to solve this electronically:
industrial timer modules
-or-
a small power supply, a bunch of relais, some NE555 timer chips and some discrete parts, like resistors, condensators, diodes and maybe some transistors (depends on your relays).
pcc9
Posts: 11
Joined: Tuesday 17 March 2015 15:00
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: How to Send Twice a command to a switch to pilot blinds

Post by pcc9 »

Hi,
thanks for this information.

The only way to make it work ( not fully effective anyway ) is to build a scenario including the switch twice with a delay of 1 second for the second event...

Unfortunnatly I have a an issue when I use the remote control that work with Chacon switches.

My dream would be that Domoticz trap the command whereever it comes from ( Remote control, Domoticz, Scripts ) and then dupplicate the command to meet with Blinds specifications.

it would be : when Switch command ON is receive then send ON command again to the switch... but only Once ! If not we will loop.


for electronic solutions, I am not experienced enough to build the appropriate systems.


Best regards,
Pierre
ricorico94
Posts: 94
Joined: Monday 26 October 2015 10:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: How to Send Twice a command to a switch to pilot blinds

Post by ricorico94 »

Hi,

I had kind of similar issue with my blinds, which I control only through a modified remote control soldered to 433MHz relays.. I tried with blockly to send "ON" orders to these relays after some time (icluding 1s) and it was always failing..
I solved my issue by creating a bash script.
My script is as follows, and includes 2 arguments when calling the script (a number for the blind-defining numeb rof times to push "ON", and the order to the blind ("Monter"=up or "Descendre"=down, to define which button to push through relay).

Code: Select all

#!/bin/bash
 # Settings - Edit to your situation
   DOMO_IP="192.168.1.123"             # Domoticz IP Address
   DOMO_PORT="8080"                    # Domoticz Port
   Monter_IDX=11 # numéro ID de l interrupteur du relais
   Droit_IDX=12
   Descendre_IDX=13
   Stop_IDX=14
   duree=1

num_volet=$1
commande=$2
COUNTER=1
         while [  $COUNTER -le $num_volet ]; do
            #echo The counter is $COUNTER
            #Bouton droit On
         curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=switchlight&idx=$Droit_IDX&switchcmd=On"
         # tempo de longueur duree
         perl -e "select(undef,undef,undef,$duree);"
         let COUNTER=COUNTER+1
         done
#if [commande = "Monter" ]
#   then
#      action=Monter_IDX
#fi
case $commande in
   Monter)
      action=$Monter_IDX
      ;;
   Descendre)
      action=$Descendre_IDX
      ;;
   Stop)
      action=$Stop_IDX
      ;;
   *)
      echo 'inconnu'
      ;;
esac
#Bouton Haut/Bas/Stop On
curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=switchlight&idx=$action&switchcmd=On"
Ricorico94
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests