Page 1 of 1

[137] Send code more then once

Posted: Monday 10 February 2014 21:13
by ace2
I noted that sam times the swiches miss an action. so i wishes a tjoise where i can set how meny times to repete the action in timer funktion. Is this possible

Re: Send code more then once

Posted: Monday 10 February 2014 22:53
by jaytee
I have solved my similar problems by creating scenes and on/off actions in blockly. In blockly I send the command 3 times with a delay in between. Seems to work for me.

/jaytee

Re: Send code more then once

Posted: Monday 10 February 2014 23:07
by spiderrob
How do you set a delay between signals in blocky?

Re: Send code more then once

Posted: Tuesday 11 February 2014 9:33
by CopyCatz
Technically it is possible, but it is not wise to implement this in the code. If you need to send a signal multiple times you probably have interference from other devices. When you start sending signals multiple times you block other devices from communicating at the same time, resulting in a bigger chance that other devices aren't heard/don't respond either. You're better off fixing the cause instead of working with the symptoms.

Re: Send code more then once

Posted: Tuesday 11 February 2014 10:25
by ace2
There are a lote wifi to day evry were så working whit the problem i think we most acept that we have more inteferens not ust att home we have naburs to that have wifi så to solv the problem is to send the event multipel times. and i have done this whit Switch King whit out problems but i think Domoticz is a way more better program and i hade hopt there can be a way to do this i Domoticz to.

Re: Send code more then once

Posted: Tuesday 11 February 2014 13:01
by CopyCatz
Wifi is on a completely different frequency than RF. If you have trouble switching RF try the bigger antenna that is discussed on these forums or try to find devices that interfere your RF frequency.

Re: Send code more then once

Posted: Tuesday 11 February 2014 15:07
by ace2
I no that. The point was way not inplement this funktion and let the users dicide to use it, all program that i have hade this funktion is just good experiense of.

Re: Send code more then once

Posted: Tuesday 11 February 2014 15:31
by ace2
My antenna is not the problem its just 5 meters away ether thers a program ore a hardware mal funktion it works 20 times then just one time nothing hapens but i f i kud send the code twise ore 3 times i now it work just one mis is not good. now i have to do 3 jobbs whit 1 min betwin them that light upp my aqvarium 3 jobbs that ligth off and becurse i have difrent time on sat and sunday then i have to do 12 jobbs just for the aquarium. but even if i like this program i can not trust the funktion i hade the same problem whit swhitch king but swich king have a funktion i can activate to send more times upp to 4 times thats solvd the problem. and for info the resiver and antenna is in the same rom doint think i have resiver problem.

Re: Send code more then once

Posted: Wednesday 12 February 2014 0:47
by jaytee
OK, I checked how I did it. There is no delay timer, I just placed 3 copies of ON/OFF command after each other inside a IF-clause (Scene). There will be a natural "delay" between the commands executed.

Certainly it will block other outgoing/incoming events but I don't care if a temperature reading etc is missed. Its more important for me to be sure to turn on my lighting outside my house. All automated on/off action "groups" I have scheduled with a discrepancy of a minute or so to avoid occupying the rfxtrx too long (Domoticz and/or Rfxtrx seems to queue the commands if executed simultaneously).

/jaytee

Re: Send code more then once

Posted: Friday 14 February 2014 0:02
by commodore white
ace2 wrote:My antenna is not the problem its just 5 meters away ether thers a program ore a hardware mal funktion it works 20 times then just one time nothing hapens but i f i kud send the code twise ore 3 times i now it work just one mis is not good. now i have to do 3 jobbs whit 1 min betwin them that light upp my aqvarium 3 jobbs that ligth off and becurse i have difrent time on sat and sunday then i have to do 12 jobbs just for the aquarium. but even if i like this program i can not trust the funktion i hade the same problem whit swhitch king but swich king have a funktion i can activate to send more times upp to 4 times thats solvd the problem. and for info the resiver and antenna is in the same rom doint think i have resiver problem.
PLEASE review what you type before you hit submit.

Re: Send code more then once

Posted: Friday 14 February 2014 13:47
by ace2
I'am sorry for i'am Swedish and i doint wright english so good, but is dis forum just for them ho wrights good and not for Domoticz. It not nice to pick on sambody befor you now the fackts. All can not be perfeckt. :(

Re: Send code more then once

Posted: Saturday 15 February 2014 10:39
by jaytee
Capitals letters and periods (.) and commas (,) do exist in the Swedish language also ;-) It gets a lot more readable...

Re: Send code more then once

Posted: Saturday 15 February 2014 16:47
by ace2
No it exists in swedish, thats me thats wrong to have a siknes that i doint se ore here when its wrong, i doint no the name on that in english. but im sorry i shod not wright here any more becurse so meny take it so hard.
im so sorry.

Re: Send code more then once

Posted: Saturday 15 February 2014 18:01
by StanHD
Hi, I am English and I do understand your post. Your English is good compared to my Swedish (none) :) . We should be more tolerant, welcoming and less critical of all users that wish to join in with the Domoticz community.

Regarding the problem, I overcome this by sending some on / off commands with a 1 minute delay (where it doesn't matter much like sunrise / sunset ) and repeat the set command in blockly "Do" statements where a more immediate response is needed. I think it works ok.

Not sure that helps but wanted to try and answer.

Re: Send code more then once

Posted: Saturday 15 February 2014 18:56
by ace2
Thanks StanHD.
I shall try the Do statment in blocky thanks for the awnser.

Re: Send code more then once

Posted: Wednesday 07 May 2014 21:25
by kimhav
CopyCatz wrote:Technically it is possible, but it is not wise to implement this in the code. If you need to send a signal multiple times you probably have interference from other devices. When you start sending signals multiple times you block other devices from communicating at the same time, resulting in a bigger chance that other devices aren't heard/don't respond either. You're better off fixing the cause instead of working with the symptoms.
I agree with you that it's always better to fix the root cause of the issues why the transmitted signal isn't working; but I still second that it would be nice with an option that can be enabled whether a signal shold be resend and how many times. There might be situations where this is the only solutions, to resend the command, and therefor it shouldn't be ruled out.

Re: [137] Send code more then once

Posted: Saturday 05 December 2015 14:46
by Dirk
@Jaytee could you please explain in detail how to create a 'burst' of three on-signals? I'm entirely new to blocky. I now use the simple on/off signal that you get when you add a switch.

I tried to make a blocky, but I am
  • not sure how to use it when I succeed; how do I tell my switch to use this event instead of the regular on/off
  • not able to use the 'else if': I can't seen to be able to drag the 'else if' to the 'if do' block
I tried to make this blocky:
If 'on'
do [set [name switch] = 'on' after 0:01 seconds
else if 'on'
do [set [name switch] = 'on' after 0:01 seconds

Am i heading in the right direction with this?

EDIT: Jaytee responded in a PM. Thanks!
You can make a group (or scene) to achieve this:
  • Go to Groups
  • Add group
  • Add your switch with Onset delay (not sure what the exact English label is) set to 0 seconds
  • Add the same switch with Onset delay (not sure what the exact English label is) set to 1 seconds
  • Repeat as often as needed. With the el-cheapo Action on/off switches I need 5 signals to get 100% certainty (or 99,99% probability) that the command is processed correctly.
Would still be nice to have a 'send burst of 5 signals' as an extra option in the Timers dialog imho. So next to the regular 'on' and 'off' you would have 'on (5 times)' and 'off (5 times)'.

Re: [137] Send code more then once

Posted: Tuesday 10 October 2017 20:45
by Dirk
UPDATE: I used dzVents to write this little script. So everytime an 'On' of 'Off' command is sent to the selected devices it is repeated 5 times, to ensure it reaches the device:

Code: Select all

local attempts = 5

return {
        active = true,
        on = {
            devices = { 46, 85 } -- add the list of devices you want to boost here
        },
        data = {
            counter = {initial=0} -- initiate the counter to zero
        },
        execute = function(domoticz, currentSwitch) -- gives a burst of On/Off signals
            if (currentSwitch.state == 'On') then
                if (domoticz.data.counter < (attempts-1)) then -- if the nr of attempts has not been reached yet
                    domoticz.data.counter =  domoticz.data.counter + 1 -- add 1 to the nr of attempts
                    currentSwitch.switchOn() -- switch the device on (this will trigger the script again)
                else -- the number of attempts has been reached
                    domoticz.data.counter = 0   -- reset the counter
                    end
            end
            if (currentSwitch.state == 'Off') then
                if (domoticz.data.counter < (attempts-1)) then
                    domoticz.data.counter =  domoticz.data.counter + 1
                    currentSwitch.switchOff()
                else 
                    domoticz.data.counter = 0   
                    end
            end
        end
}