Skip to content

How to switch %var% to case sensitive? (serial receive data loaded to %var) #23705

Discussion options

You must be logged in to vote

Well, to use tasmota.cmd, you should provide a string, not use print inside it, as the result from the print function call is nil.

While you don't need the step through the format function, it would have worked if you instead of the bytes object (which is what you have in msg) got the string value from it, using the msg.asstring() you were already using other places. This should do it:
tasmota.cmd(msg.asstring())

To use the approach with serial, you'd also need to poll the serial port at short intervals. If you code as a driver, you have callbacks like every_100ms which can work well for that. It can also work with tasmota.set_timer with a function doing the set_timer again for the next c…

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@sfromis
Comment options

Comment options

You must be logged in to vote
4 replies
@sfromis
Comment options

Answer selected by panciunio
@panciunio
Comment options

@sfromis
Comment options

@panciunio
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants