[137] Send code more then once
Moderators: leecollings, remb0
[137] Send code more then once
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
-
- Posts: 12
- Joined: Sunday 14 July 2013 21:00
- Target OS: -
- Domoticz version: beta
- Location: Sweden
- Contact:
Re: Send code more then once
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
/jaytee
RPi2 : UPiS, OZW USB Stick, RfxTrx433, Philips HUE, DomoticzRemoteServer (1-wire)
RPi: 1-wire
RPi: 1-wire
Re: Send code more then once
How do you set a delay between signals in blocky?
- 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
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
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.
- 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
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
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
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.
-
- Posts: 12
- Joined: Sunday 14 July 2013 21:00
- Target OS: -
- Domoticz version: beta
- Location: Sweden
- Contact:
Re: Send code more then once
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
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
RPi: 1-wire
-
- 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
PLEASE review what you type before you hit submit.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.
Re: Send code more then once
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.
-
- Posts: 12
- Joined: Sunday 14 July 2013 21:00
- Target OS: -
- Domoticz version: beta
- Location: Sweden
- Contact:
Re: Send code more then once
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
RPi: 1-wire
Re: Send code more then once
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.
im so sorry.
- 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
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.
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
Thanks StanHD.
I shall try the Do statment in blocky thanks for the awnser.
I shall try the Do statment in blocky thanks for the awnser.
-
- 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
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.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.
-
- Posts: 35
- Joined: Wednesday 04 November 2015 20:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: [137] Send code more then once
@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
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:
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
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.
-
- Posts: 35
- Joined: Wednesday 04 November 2015 20:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: [137] Send code more then once
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
}
Who is online
Users browsing this forum: No registered users and 1 guest