MQTT, S31 Sensor

Trying more baby steps with oH. Have an S31/Tasmota configured and working as a switch with MQTT but haven’t found what I need to get the sensors working. Initially, want amperage, perhaps voltage too. So in PaperUI: Configuration > Things > S31_06825F click the blue plus sign to add another channel.

Add channel dialog:
Channel type: Number Value
Channel id: Amperage_S31_06825F
Label: Amperage_S31_06825F

How/where do I find MQTT State & Command Topics?
Enter anything in Absolute Min Max?

Probably obvious but I’m not seeing it yet. Hunted through this Community and googled it, so far nothing.

Thanks!

How does Tasmota sends the amperage value to the MQTT broker? On what topic, and what does the message look like?

If you don’t know the above, you’ll need to find out. Type in the IP address of your device into a browser, and click on the Console button. Then watch that to see what it does. I suspect your sensor data gets sent on a tele/your_device_mqtt_name/STATE topic, but couldn’t guess what the message itself looks like.

1 Like

I guess that’s part of what I’m looking for. This is my first attempt at MQTT, seems like a rather steep learning curve without much documentation/examples for a nube like me. I can see the results using MQTT.fx, just don’t understand much about it all yet. Actually, kinda surprised that I even got the switch to work, not sure if I know enough to do it again

OK - post a screenshot from mqtt.fx, or copy paste an extract?

Even as a nube you should notice that you are using openHAB ( and its mqtt binding) and Tasmota. Both opensource projects are documented well enough. In order to understand how they work together read both!

Yup, been reading for days with lots of trial and retrial with oH and the S31. Guess not where I need to read though, huh? Maybe need to look into Tasmota more

Post a screenshot or copy an extract from mqtt.fx or the Tasmota console when the ampere reading occurs, and we can help.


Thanks

OK, so to answer your questions from the OP:

  • Incoming state topic: tele/tasmota-0682ED/SENSOR
  • Incoming transformation: JSONPATH:$.ENERGY.Current

Make sure you have the JSONPath transformation installed from the add-ons selection in PaperUI.

That’s it. You don’t need an outgoing command, nor min and max. Tasmota sends tele topics every 300 seconds by default, so no need to request them.

If you wanted to grab another value, create another channel, and just change the transformation from, for example, Current to Voltage.

1 Like

Great, more studying ahead. No knowledge/experience of JSONPath transformation whatsoever. Just installed it, gonna read and play with it for a while.

Thanks for your help!

Yeah, there’s a bit to learn, but it should hopefully make sense. Tasmota sends most information as JSON messages, so we use the JSONPath transformation to grab the information we need out of that message.

In your example, the Current information is within the ENERGY group (defined by the curly braces {} ).

Still learning. Added the two references you gave, I see that the channel is linked now. Where can I go to see the current displayed? Looking at Control in PaperUI and can see both the switch and the amperage, though it shows NaN, no number, even with a load on the switch and sensor

As mentioned, it probably updates every 300 seconds, so you may have to be patient!

(Though, I would have thought for a sensor showing instantaneous data it would also send out that data more frequently. I dunno - don’t have one of these devices!)

I’ve gone back through and rechecked everything, don’t see what I’ve done wrong. Still no numerical output, only NaN, been was past the 300 secs.

Wow, just showed up as I was getting ready to post. Took over 20 minutes. Will take it as progress! Side note: can 300 secs be changed? If so, is there a downside to lowering it?

Thanks again, you pointed me in directions I would have had a hard time finding (not sure I would have ever looked there)!

From what I can tell, it sounds like Tasmota won’t report values if the power consumption is below a particular value. See Known Issues on this page. Perhaps that’s why it took so long - not enough load?

Yes - see here. Essentially, go into your Tasmota Console, type TelePeriod X (where X is the number of seconds that you want to wait between messages), and hit Enter on your keyboard.

I’d be interested to know whether you get more data, and what type of data, on the Console. 5 minutes for instantaneous data is a bit strange!

OK, thanks. Will try a larger load, see if that makes any diff. Nevertheless, I can’t see any downside to shortening it (as opposed to battery powered nodes) other than presenting more traffic

Sorry, yes, I never answered that part of the question. I don’t know the answer, but I would have thought that you’re correct!

Are the power values really only broadcast on the tele topic?

From my limited perspective (first stab at MQTT, so much yet to learn) it would seem so. I see no stat having to do with values of interest

1 Like