-
Hello, i am working through berry (trying to move rules on my ZB Bridge Pro to berry) and am at the very beginning of my berry journey. For one of my door sensors i executed following berry functions in berry console:
The berry variable "value" is not passed to tasmota. How can i pass the content of "value" to tasmota (and not the string "value")? Sorry for the beginner question and thanks in advance! One additional question: if i use "tasmota.add_rule" like above do i have the same space limits as if i would use native tasmota rules?? Kind Regards Rainer |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 10 replies
-
Short answer, no you cannot use a Berry variable in a Tasmota command, as these are executed outside of Berry. What you can do instead is to put the value of the variable in the command, like this use of f-strings: Using f-strings can also be quite handy for debugging print like: As Berry integration |
Beta Was this translation helpful? Give feedback.
Short answer, no you cannot use a Berry variable in a Tasmota command, as these are executed outside of Berry.
What you can do instead is to put the value of the variable in the command, like this use of f-strings:
tasmota.cmd(f'WebSend [m] script>D=16;P1={value}')
Using f-strings can also be quite handy for debugging print like:
print(f"-BE- DS1Handler ({value=} / {trigger=})")
As Berry integration
tasmota.add_rule
is unrelated to "classic" Tasmota rules, there are no similar space restrictions, and you need to make sure to have the Berry code setting uptasmota.add_rule
(as with other Berry code) saved in the file system, as they are not persistent otherwise.