Skip to content

How to get the current PWM value in RULES #22918

Answered by sfromis
ReinhardDaemon asked this question in Q&A
Discussion options

You must be logged in to vote

In many cases, the way to query some value is to first issue the command to have it printed/logged, and then use a separate rule to pick up the value from the command JSON result, similar to getting sensor values. And then a third rule to act on a calculation result.

Something like
Rule2 on Button6#state==2 do Backlog PWM8 endon on PWM#PWM8 do var1=%value%+5 endon on var1#state do pwm8 %value% endon

Only a very few types can be referenced directly in rules.
https://tasmota.github.io/docs/Rules/#rule-variables

More generally, as you seem to be using ESP32, you also have the Berry language for more flexible and less quirky ways of doing automations.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@ReinhardDaemon
Comment options

@ReinhardDaemon
Comment options

@sfromis
Comment options

Answer selected by ReinhardDaemon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants