Replies: 4 comments 2 replies
-
You told nothing about what's done around the short bit of Berry code you posted as "does nothing", hence no basis for really guessing might be happening. Anyway, I condensed your lines into an operational test case, and unsurprisingly I'm seeing both the print and the publish work as expected, both from the console and when started via
An operational example triggering the behavior you post about would be useful. And do make sure to read the Tasmota console (not the Berry REPL console) when it executes, to check for any error messages and so on. |
Beta Was this translation helpful? Give feedback.
-
Thank you for your answer. I tested your example an it works, so the binary seams to work. It is self-compiled to use scripting for SML counter together with berry, display and haspmota. here is an operational example with the problem, without all the rest (display-handling, DS18B20 handling, lightsensor) I have a SML counter in tasmota scripting which calls a tasmota-command for the Watermeter-handling. berry-code:
tasmota script:
to simulate the script you have to increase counter1 by 1, lets say after some seconds. Its a counter for pulses with 1liter per pulse. The berry-function calculates the flowrate if a second pulse comes in within a reasonable time (here 15sec). |
Beta Was this translation helpful? Give feedback.
-
Once again, thank you very much for the answer. I already read about the
It is always difficult to give a working example by removing a lot of stuff that makes the example work. At some point it is hard to distinguish what causes the problem. In my case I use scripting, berry, haspmota which all interfer. And it is working, except the publish. Lets see tomorrow...... |
Beta Was this translation helpful? Give feedback.
-
Good morning, its working now. I have to use Another thing (if i might ask) is the topic variable: at the beginning of my code-snippet I use Once more, thank you very much for your time and detailed explanations. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I have a WT32-ETH with tasmota 14.4.1.3 (tasmota32) and a display running and everything works so far (8xDS18B20, a counter in scripting and a lightsensor to drive display background).
receiving commands via mqtt is also working. The final step I try to integrate is the sending of the temperatur and counter-values via mqtt to my homeautomation.
I need the data in a json-like format. For that I put together the values "volume" and "flow" from "Wasseruhr" in a map:
zWtVol is the volume and this is formatted in watermeStr to see 3 digits, flow is formatted to 1 digit
that looks good so far.
In the berryconsole I can type payloadWM or topic and get the values of these variables. When I type
mqtt.publish(topic, json.dump(payloadWM))
the data is published and received from the broker.
But from the berry-script just nothing happens. I print the values just before the publish and see it in the console, but the mqtt.publish does nothing.
I searched a lot and looked at a lot of examples that I found but I can't find out why its not working from inside the berryscript.
Thanks for any help!
Beta Was this translation helpful? Give feedback.
All reactions