[137] Send code more then once

Use this forum to discuss possible implementation of a new feature before opening a ticket.
A developer shall edit the topic title with "[xxx]" where xxx is the id of the accompanying tracker id.
Duplicate posts about the same id. +1 posts are not allowed.

Moderators: leecollings, remb0

Post Reply
ace2
Posts: 10
Joined: Sunday 02 February 2014 13:34
Target OS: Linux
Domoticz version:
Contact:

[137] Send code more then once

Post 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
jaytee
Posts: 12
Joined: Sunday 14 July 2013 21:00
Target OS: -
Domoticz version: beta
Location: Sweden
Contact:

Re: Send code more then once

Post 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
RPi2 : UPiS, OZW USB Stick, RfxTrx433, Philips HUE, DomoticzRemoteServer (1-wire)
RPi: 1-wire
spiderrob
Posts: 13
Joined: Saturday 13 July 2013 8:28
Target OS: -
Domoticz version:
Contact:

Re: Send code more then once

Post by spiderrob »

How do you set a delay between signals in blocky?
User avatar
CopyCatz
Developer
Posts: 123
Joined: Thursday 11 July 2013 17:28
Target OS: -
Domoticz version:
Location: Outer Heaven
Contact:

Re: Send code more then once

Post 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.
ace2
Posts: 10
Joined: Sunday 02 February 2014 13:34
Target OS: Linux
Domoticz version:
Contact:

Re: Send code more then once

Post 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.
User avatar
CopyCatz
Developer
Posts: 123
Joined: Thursday 11 July 2013 17:28
Target OS: -
Domoticz version:
Location: Outer Heaven
Contact:

Re: Send code more then once

Post 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.
ace2
Posts: 10
Joined: Sunday 02 February 2014 13:34
Target OS: Linux
Domoticz version:
Contact:

Re: Send code more then once

Post 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.
ace2
Posts: 10
Joined: Sunday 02 February 2014 13:34
Target OS: Linux
Domoticz version:
Contact:

Re: Send code more then once

Post 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.
jaytee
Posts: 12
Joined: Sunday 14 July 2013 21:00
Target OS: -
Domoticz version: beta
Location: Sweden
Contact:

Re: Send code more then once

Post 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
RPi2 : UPiS, OZW USB Stick, RfxTrx433, Philips HUE, DomoticzRemoteServer (1-wire)
RPi: 1-wire
commodore white
Posts: 63
Joined: Sunday 14 July 2013 11:19
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Ipswich, UK
Contact:

Re: Send code more then once

Post 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.
ace2
Posts: 10
Joined: Sunday 02 February 2014 13:34
Target OS: Linux
Domoticz version:
Contact:

Re: Send code more then once

Post 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. :(
jaytee
Posts: 12
Joined: Sunday 14 July 2013 21:00
Target OS: -
Domoticz version: beta
Location: Sweden
Contact:

Re: Send code more then once

Post by jaytee »

Capitals letters and periods (.) and commas (,) do exist in the Swedish language also ;-) It gets a lot more readable...
RPi2 : UPiS, OZW USB Stick, RfxTrx433, Philips HUE, DomoticzRemoteServer (1-wire)
RPi: 1-wire
ace2
Posts: 10
Joined: Sunday 02 February 2014 13:34
Target OS: Linux
Domoticz version:
Contact:

Re: Send code more then once

Post 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.
User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Send code more then once

Post 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.
ace2
Posts: 10
Joined: Sunday 02 February 2014 13:34
Target OS: Linux
Domoticz version:
Contact:

Re: Send code more then once

Post by ace2 »

Thanks StanHD.
I shall try the Do statment in blocky thanks for the awnser.
kimhav
Posts: 148
Joined: Tuesday 01 October 2013 8:31
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Sweden
Contact:

Re: Send code more then once

Post 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.
Dirk
Posts: 35
Joined: Wednesday 04 November 2015 20:59
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: [137] Send code more then once

Post 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)'.
Dirk
Posts: 35
Joined: Wednesday 04 November 2015 20:59
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: [137] Send code more then once

Post 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
}
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests