Vistapool control via mqtt with NeoPool on Tasmota in openhab3

I try to find the correct syntax for my things and item-files to be able to handle the control of my Sugarvalley Pool-Equipment via Modbus with a ESP32 with Tastmota + NeoPool-Addon on it!
Data reception is working, i can show ph and redox darta, relay and filter status etc…
But i have no idea how to write via modbus new values or switch a state to turn on a pump or a relay…

this is f.ex. a line of the things-file:

Type number : pHWert [stateTopic=tele/neopool_D7CDB8/SENSOR, transformationPattern=JSONPATH:$.NeoPool.pH.Data]

Type number : pHMax [stateTopic=tele/neopool_D7CDB8/SENSOR, transformationPattern=JSONPATH:$.NeoPool.pH.Max]

the pHMax value is possible to change… here the items-line:

Number pHMax	"pH-Max [%s]"  	(gPool)	 { channel="mqtt:topic:neopool_D7CDB8:pHMax"}

But i have no idea how to manage it. Nobody here who has a running config for this mqtt, Tasmota NeoPool etc. ?

I also have the problem to get the data from a DS18B20 Temperature Sensor connected and configured correct for GPIO5 on the ESP…
Hope to find here some ideas…

The commands are sent to tasmota through MQTT as setout here

In tasmota console change in cosole

SetOption4 Return MQTT response as
0 = RESULT topic (default)
1 = %COMMAND% topic

Change to 1 this will make life easier

You are using files to config sitemap?

Add to your thing

Type string : Mode [ stateTopic ="stat/neopool_D7CDB8/NPFiltrationMode", transformationPattern = "JSONPATH:$.NPFiltrationMode", commandTopic ="cmnd/neopool_D7CDB8/NPFiltrationMode", 0="MANUAL", 1="AUTO", 2="HEATING", 3="SMART", 4="INTELLIGENT", 13="BACKWASH"  ]

Item

String NeoPool_Mode "Mode [%s]"  	(gPool)	 { channel="mqtt:topic:neopool_D7CDB8:Mode"}

No I don’t have a NeoPool to test on

Hi James,
thankyou very much for your help… not it seems a little bit clearer…
i was reading the tasmota mqtt doc… but didnt had an idea how to write this data, additonally only with totally different examples on other pages… the logic here i think i undersand, but its also not working… maybe a syntax error…
this is what i get in sidemap - yes i am working with file config, sitemap etc…

this is what i added…

Type string : NPMode 			[stateTopic="stat/neopool_D7CDB8/NPFiltrationMode", transformationPattern = "JSONPATH:$.NPFiltrationMode", commandTopic ="cmnd/neopool_D7CDB8/NPFiltrationMode", 0="MANUAL", 1="AUTO", 2="HEATING", 3="SMART", 4="INTELLIGENT", 13="BACKWASH"]

my other channels are looking like this for ex.:

Type number : pHWert 			[stateTopic="tele/neopool_D7CDB8/SENSOR", transformationPattern="JSONPATH:$.NeoPool.pH.Data"]

the item like you have sent:

String NeoPoolMode 		"Mode [%s]"  							(gPool)	 { channel="mqtt:topic:neopool_D7CDB8:NPMode"}

only changed he name to NPMode… still something wrong…

Try this sitemap

Switch item=NeoPoolMode label="Mode [%s]" icon="video"mappings=[0="MANUAL", 1="AUTO", 2="HEATING", 3="SMART", 4="INTELLIGENT", 13="BACKWASH"]

It may say Mode 1

The number should be passed to MQTT though thing

I think you should also be able to get Mode to show as text value

Switch item=NeoPoolMode label="Mode [%s]" icon="flow" mappings=[MANUAL="MANUAL", AUTO="AUTO", HEATING="HEATING", SMART="SMART", INTELLIGENT="INTELLIGENT", BACKWASH="BACKWASH"]

Then when the text value is passed to the thing it will map it back to the number

Did you SetOption4 to 1 in tasmota?

edit typo

Yes, i copied this into the console input and hit enter…

but was it only the request and like i see its SetOption4 still off so how to change?

Would have been nice to know that with:

SetOption4 1

i turn it on in the console…
now i did it… lets see whats going on…

nothing! no change at all… will reset openhab and mosquito… but the esp data is coming continuasly in without a prpoblem…

15:55:31.818 MQT: tele/neopool_D7CDB8/SENSOR = {"Time":"2022-07-19T15:55:31","DS18B20":{"Id":"0119384D6663","Temperature":28.6},"NeoPool":{"Time":"2022-07-19T15:54:16","Type":"Hidrolife","Modules":{"pH":1,"Redox":1,"Hydrolysis":1,"Chlorine":0,"Conductivity":0,"Ionization":0},"Power":{"Version":"V3.54","NodeID":"05DA 2D33 3835 4D4E 4301 3B2A","5V": 5,"12V":13,"24-30V":33,"4-20mA":0.070},"pH":{"Data":7.0,"Min":7.0,"Max":7.4,"State":0,"Pump":0,"FL1":0,"Tank":1},"Redox":{"Data":684,"Setpoint":700},"Hydrolysis":{"Data": 0,"Unit":"%","Runtime":{"Total":"39T20:28:33","Part":"39T20:28:33","Pol1":"20T00:01:33","Pol2":"19T20:27:00","Changes":168},"State":"Pol1","Cover":0,"Boost":0,"Low":0},"Filtration":{"State":0,"Speed":1,"Mode":0},"Light":0,"Relay":{"State":[0,0,0,0,0,0,0],"Aux":[0,0,0,0],"Acid":0}},"ESP32":{"Temperature":27.2},"TempUnit":"C"}

data is arriving… but i am not able to fetch it in openhab…

Type number : Wassertemperatur	[stateTopic="tele/neopool_D7CDB8/SENSOR", transformationPattern="JSONPATH:$.DS18B20.Temperature"]

no idea what i am doing wrong…

to change the filtratiom mode and turn on the pump: totally lost! i am using openhab 3.3.o.M5 will try to create another container with to 3.4 snapshot and check what happens…

finally its working now with 3.4.snapshot and all infos i accumulated everywhere!
now i have to make some rules - f.ex. to turn on with a new switch the pool manually, so if mode is auto tu turn of auto mode and turn on filtration in one step with one switch etc… and finally i will try also to turn on relay3 - my heatpump - to be able to mange this later in coordination with my solar plant etc… so if the battery is loaded and i have more solar power, that all rest energy is going into pool heating etc…
so great posibilities if all is working… but still a lot of work. Thanks for help to mange this first step!

It is hard to know what is happening on MQTT

In the tasmota doc you can see how to ask for the mode

Now you know how to change SetOption4 1 or 0
In the tasmotta console with each setting on SetOption4 enter NPFiltrationMode to see the different structure of MQTT

I use http://mqtt-explorer.com/ to see what is going on.

You can also send commands directly to device using rules

In the tasomota console can you enter NPControl
and post the result

Say you want to ask for setopoint of heater you can do that with a rule

rule "Read Heater Setpoint"
when
  Item Dummy received command
then
  
  val actions = getActions("mqtt","mqtt:broker:myMQTTBroker") // myMQTTBroker is the name of my broker yours may be different
  actions.publishMQTT("cmnd/neopool_D7CDB8/", "Backlog NPBit 0x605,15,1;NPSave")    //Not exactly sure of topic

end

This will not display anyting in OpenHAB only the tasmota console