Another message split issue

Ok im sure im missing something simple here.
I am trying to for now get the power settings from an esp8266 with tasmota here is the mqtt message.

{"Time":"2022-08-03T07:44:49","Uptime":"0T04:10:13","UptimeSec":15013,"Heap":23,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":38,"MqttCount":2,"POWER1":"OFF","POWER2":"OFF","POWER3":"OFF","POWER4":"OFF","Wifi":{"AP":1,"SSId":"Newmannest","BSSId":"6C:CD:D6:02:7B:03","Channel":5,"Mode":"11n","RSSI":100,"Signal":-45,"LinkCount":2,"Downtime":"0T00:00:11"}}

on all my other esp8266 I only have 1 relay controlling a valve , this one I have multiple you can see the difference in mqtt explorer. I am not sure why its different but it is .
whyisthisdifferent
The device I'm confused about is tas04 it shows logging in stat instead of result and power like eferm cferm and so on.
I should know what do do with the message but I need a kick in the arse direction to see what im forgetting.

This is what your MQTT message looks like that you posted above.
mqtt_object
So if you want, for example the value of POWER4, you just use...
msg.payload.POWER4

If you wanted to "listen" to a particular ESP8266, you could use a dedicated MQTT-In like this.
mqtt_listen
You will need to change /node54/ etc.. to match what you have in your Tasmota settings.

I use this method to get feedback from my home security lighting system.

1 Like

Thanks for fast reply @dynamicdave
so I have tried that however if you look at mqtt messages coming in.
it does not have a "POWER" message coming from my tas04.
why is it different then the others? see picture
tas04isdif
The esp in question is only sending sensor and logging messages. the power portion seems to be imbedded in the logging message.

I did get message set the way I needed. I used function node
here is flow

[{"id":"c68e95a9daba011e","type":"mqtt in","z":"a83eb32ba827c55d","name":"valve status","topic":"tele/tas04/STATE","qos":"2","datatype":"json","broker":"8db3fac0.99dd48","nl":false,"rap":true,"rh":0,"inputs":0,"x":712,"y":725,"wires":[["1b56672ceb1fdc4f","f03e45e260f969c1"]]},{"id":"f03e45e260f969c1","type":"function","z":"a83eb32ba827c55d","name":"Fermenters Pressure","func":"let msg0 = {};\nlet msg1 = {};\nlet msg2 = {};\nlet msg3 = {};\n\nmsg0.payload = msg.payload.POWER1;\nmsg1.payload = msg.payload.POWER2;\nmsg2.payload = msg.payload.POWER3;\nmsg3.payload = msg.payload.POWER4;\n\nmsg0.topic = \"POWER1\"\nmsg1.topic = \"POWER2\"\nmsg2.topic = \"POWER3\"\nmsg3.topic = \"POWER4\"\nreturn [msg0, msg1, msg2, msg3];\n","outputs":4,"noerr":0,"initialize":"","finalize":"","libs":[],"x":810,"y":890,"wires":[["40cc6491facd9bb6"],["06aa6bf4b71bc3d0"],["e5cf61990eb748fa"],["dd12bbf24019c3bd"]]},{"id":"8db3fac0.99dd48","type":"mqtt-broker","name":"","broker":"localhost","port":"1883","clientid":"RailPI","autoConnect":true,"usetls":false,"compatmode":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"1","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""}]

here is function I wrote

let msg0 = {};
let msg1 = {};
let msg2 = {};
let msg3 = {};

msg0.payload = msg.payload.POWER1;
msg1.payload = msg.payload.POWER2;
msg2.payload = msg.payload.POWER3;
msg3.payload = msg.payload.POWER4;

msg0.topic = "POWER1"
msg1.topic = "POWER2"
msg2.topic = "POWER3"
msg3.topic = "POWER4"
return [msg0, msg1, msg2, msg3];

however im still stumped on why this esp sends a logging message instead of a power message.
I guess ill have to play with commands to see if i can turn each valve on and off by themselves when i get back to brewery.

I just used the MQTT message you posted as I thought that was what you were trying to isolate.
The rest of your post looks like something that MQTT Explorer might be showing.

Sounds like a setting in Tasmota is affecting that. I don't use Tasmota, so I hope someone else jumps in.

yes your correct except for you are able to use "stat/node55/POWER" in my case if I was receiving a "POWER" message node55 would be changed to tas04.
however im not receiving the power message.
instead i am having to use "tele/tas04/STATE" for my mqtt in
if I use stat/tas04/LOGGING it cant parse the jason object and gives me further issues.
at least I did figure out how to get my info out thanks to your help.
I think I have another issue or I'm just simply overthinking it. lol

when I get back to taproom this morning, ill look at settings on the esp devices.
I do know this one has different firmware because of the ADS1115 (analog to digital converter) and the need for I2c bus comms.

just a little note, I have added these electric ball valves so when im carbonating the beer, I can set a specific pressure goal and hit start. It should in theory open and allow the proper amount of co2 carbonate the beer to a precise amount rather then the norm where I start carbonating, start drinking and yes squirrel and forget what the hell I was doing lol.

If I click the Console option on the main menu on one of my Tasmota nodes.
tasmota_main
I get this report...
tasmota_report
I then used one of those lines as the topic setting in the MQTT-In node.

If you look at the various lines in the report, you can see stat/.../RESULT is an object and stat/.../POWER is a string. Also tele/.../STATE is an object.

lol and your showing me tasmota
when i have the relays set to relay in tasmota 4 toggle buttons.
on that screen you screen shotted,
however when I do not see a toggle buttons.
I bet that is why. I'm logging off here and headed to brewery to challenge that theory.

Ha, ha - well spotted.
I only use Tasmota in a very simplistic way as a mains switch driven by MQTT commands.

mytasmotamsg
this is my screen in console
this is my mainscreen see how i have toggle buttons.


in configure module is your toggle a switch or a relay ?
relayorswtich

Neither of those - it just a simple (old) S20 Sonoff.


I think you have a lot more options selected than I do.
That's why I said - I don't use Tasmota much.

I think I've spotted the difference - I think you are using an ESP8266 device flashed with Tasmota.
I'm using a Sonoff mains switch - which I re-flashed with Tasmota.
sonoff_s26

yes i see that.
I found out why im getting a logging mqtt from the one esp can you see the difference


theothers

Yep - - Mqtt log level is different between the two devices.

its just amazing whats out there for us to automate home, shop, brewery whatever
incredibles-the

1 Like

This is my settings for logging.

yes for somereason the syslog level was set to 2 info
here is my console of tas04 and the fermenters



im wondering if its because i have more then one relay.
not sure why I am not getting the Power message
baffling

I'm sure one of the guys that use Tasmota in more depth than me will probably jump in with some ideas.

1 Like

so when i activate the co2 valve i do get the power message.
whala