Try it with var1 rather than myval. You may be able to call variables what you like in scripts but var1-16 are valid commands while myval isn’t
Sent from Mail for Windows 10
From: Automater
Sent: 30 July 2021 13:37
To: TasmotaUsers
Subject: websend from device with script to device with rules
I have 2 tasmota devices communication via websend. Sending something from the script device to the rules device works well. But sending
websend [192.168.1.5] myval 123
from the rule device to the script device having
>D
myval=0
>E
print from_rule_device %myval%
stays at "from_rule_device 0.00"
What's wrong? The IP address is correct and can be pinged.
--
You received this message because you are subscribed to the Google Groups "TasmotaUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/sonoffusers/1f233e09-5132-4e2e-bcbe-2eefc5ae2c15n%40googlegroups.com.
RESULT {"WebSend":"Done"}
so I guess it went out well.
WebSend [192.168.1.5] Var8 123
swapping the IP addresses should work then if Var8 is defined in the script define section, right?If you, in my case, websend [192.168.2.120] var1 2
You should see, in Console,
17:08:53.164 MQT: stat/Sonoff-Pump/RESULT = {"Var1":"2"}
So you know that var1 has been updated
If that does appear the issue is with scripting – perhaps you need to set the variable in the script with myval = %var1%?
Perhaps this is may be an easier solution
g:vname
specifies global variable which is linked to all global variables with the same defintion on all devices in the homenet. when a variable is updated in one device it is instantly updated in all other devices. if a section >G exists it is executed when a variable is updated from another device (this is done via UDP-multicast, so not always reliable)
or permanent variables
To view this discussion on the web, visit https://groups.google.com/d/msgid/sonoffusers/6fd2bb02-dd59-4e40-be2d-30b8dc0711f8n%40googlegroups.com.
on Event#PublishTemp do
backlog WebSend [%var2%] Var1 %Var1%; WebSend [192.168.2.5] VAR8 %Var2%
endon
where the frist websend (to a 3rd device running rules) goes fine, the second (to a scripting device) fails.No you need to look in the Console of the receiving device
To view this discussion on the web, visit https://groups.google.com/d/msgid/sonoffusers/c9e27e25-0c86-482d-a6f4-0f23affb8652n%40googlegroups.com.
Makes sense
To view this discussion on the web, visit https://groups.google.com/d/msgid/sonoffusers/b54b3d4c-9e1e-472c-855e-1f359a5c4f8en%40googlegroups.com.