Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Neopool - NPFiltration incorrect behavior #18871

Closed
12 of 14 tasks
fdebrus opened this issue Jun 13, 2023 · 13 comments · Fixed by #18908
Closed
12 of 14 tasks

Neopool - NPFiltration incorrect behavior #18871

fdebrus opened this issue Jun 13, 2023 · 13 comments · Fixed by #18908

Comments

@fdebrus
Copy link

fdebrus commented Jun 13, 2023

PROBLEM DESCRIPTION

When using Tasmota with Neopool, the NPFiltration command accept 0 "OFF" 1 "ON" or 2 "Toggle" as values.

The opposite is reported in MQTT stat

Calling NPFiltration with 0 reports the below in MQTT, the Filtration pool controller is OFF
{
"NPFiltration": "ON",
"Speed": "2"
}
Calling NPFiltration with 1 reports the below in MQTT, the Filtration pool controller is ON
{
"NPFiltration": "OFF",
"Speed": "2"
}

So stat/.../NPFilration is incorrectly set when calling NPFiltration with 0 or 1

REQUESTED INFORMATION

Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!

  • Read the Contributing Guide and Policy and the Code of Conduct
  • Searched the problem in issues
  • Searched the problem in discussions
  • Searched the problem in the docs
  • Searched the problem in the chat
  • Device used (e.g., Sonoff Basic): ESP8266
  • Tasmota binary firmware version number used: 12.4.0
    • Pre-compiled
    • Self-compiled
  • Flashing tools used: OTA
  • Provide the output of command: Backlog Template; Module; GPIO 255:
  Configuration output here:

09:27:46.567 MQT: stat/SmartPool/TEMPLATE = {"NAME":"Aquarite","GPIO":[1,6528,1,6496,1,1,1,1,1,1,1,1,1,1],"FLAG":0,"BASE":18}
09:28:16.099 MQT: stat/SmartPool/MODULE = {"Module":{"0":"Aquarite"}}
09:28:34.296 MQT: stat/SmartPool/GPIO = {"GPIO0":{"0":"None"},"GPIO1":{"6528":"NeoPool Rx"},"GPIO2":{"0":"None"},"GPIO3":{"6496":"NeoPool Tx"},"GPIO4":{"0":"None"},"GPIO5":{"0":"None"},"GPIO9":{"0":"None"},"GPIO10":{"0":"None"},"GPIO12":{"0":"None"},"GPIO13":{"0":"None"},"GPIO14":{"0":"None"},"GPIO15":{"0":"None"},"GPIO16":{"0":"None"},"GPIO17":{"0":"None"}}
  • If using rules, provide the output of this command: Backlog Rule1; Rule2; Rule3:
No Rules

  • Provide the output of this command: Status 0:
  STATUS 0 output here:
{"Status":{"Module":0,"DeviceName":"SmartPool","FriendlyName":["SmartPool"],"Topic":"SmartPool","ButtonTopic":"0","Power":0,"PowerOnState":3,"LedState":1,"LedMask":"FFFF","SaveData":1,"SaveState":1,"SwitchTopic":"0","SwitchMode":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"ButtonRetain":0,"SwitchRetain":0,"SensorRetain":0,"PowerRetain":0,"InfoRetain":0,"StateRetain":0,"StatusRetain":0}}
{"StatusPRM":{"Baudrate":115200,"SerialConfig":"8N1","GroupTopic":"tasmotas","OtaUrl":"http://ota.tasmota.com/tasmota/release/tasmota.bin.gz","RestartReason":"Hardware Watchdog","Uptime":"0T00:33:16","StartupUTC":"2023-06-14T07:46:12","Sleep":50,"CfgHolder":4617,"BootCount":13,"BCResetTime":"2023-06-13T08:28:53","SaveCount":47,"SaveAddress":"F5000"}}
{"StatusFWR":{"Version":"12.4.0(TasmoCompiler-esp8266generic)","BuildDateTime":"2023-06-13T07:19:01","Boot":20,"Core":"2_7_4_9","SDK":"2.2.2-dev(38a443e)","CpuFrequency":80,"Hardware":"ESP8266EX","CR":"358/699"}}
{"StatusLOG":{"SerialLog":2,"WebLog":2,"MqttLog":0,"SysLog":0,"LogHost":"","LogPort":514,"SSId":["CiscoAir",""],"TelePeriod":300,"Resolution":"558180C0","SetOption":["00008019","2805C80001000600003C5A0A192800000000","00000080","00006000","00004000","00000000"]}}
{"StatusMEM":{"ProgramSize":544,"Free":456,"Heap":26,"ProgramFlashSize":1024,"FlashSize":4096,"FlashChipId":"1620C2","FlashFrequency":40,"FlashMode":"DOUT","Features":["00000809","0FC04582","04260001","00000003","00000000","C000E881","00000004","08001000","54000000","00000080"],"Drivers":"1,2,4,6,8,9,10,12,18,19,22,24,26,29,30,35,37,45,62","Sensors":"1,2,83"}}
{"StatusNET":{"Hostname":"SmartPool","IPAddress":"192.168.XXXX","Gateway":"192.168.XXXXX","Subnetmask":"255.255.255.0","DNSServer1":"192.168.XXXXX","DNSServer2":"0.0.0.0","Mac":"A4:E5:7C:XXXXXX","Webserver":2,"HTTP_API":1,"WifiConfig":4,"WifiPower":17.0}}
{"StatusMQT":{"MqttHost":"192.168.XXXXX","MqttPort":1883,"MqttClientMask":"SmartPool","MqttClient":"SmartPool","MqttUser":"XXXX","MqttCount":1,"MAX_PACKET_SIZE":1200,"KEEPALIVE":30,"SOCKET_TIMEOUT":4}}
{"StatusTIM":{"UTC":"2023-06-14T08:19:28","Local":"2023-06-14T09:19:28","StartDST":"2023-03-26T02:00:00","EndDST":"2023-10-29T03:00:00","Timezone":"+01:00","Sunrise":"04:46","Sunset":"20:54"}}
{"StatusSNS":{"Time":"2023-06-14T09:19:28","NeoPool":{"Time":"2023-06-14T10:17:56","Type":"Generic","Modules":{"pH":1,"Redox":1,"Hydrolysis":1,"Chlorine":0,"Conductivity":0,"Ionization":0},"Temperature":29.6,"Power":{"Version":"V3.57","NodeID":"05DE 2D35 3837 574E 4318 0937","5V":5,"12V":15,"24-30V":35,"4-20mA":0.070},"pH":{"Data":7.2,"Min":7.0,"Max":7.4,"State":0,"Pump":0,"FL1":0,"Tank":1},"Redox":{"Data":682,"Setpoint":700},"Hydrolysis":{"Data":0,"Unit":"g/h","Runtime":{"Total":"42T13:36:18","Part":"42T13:36:18","Pol1":"20T23:25:02","Pol2":"21T14:11:16","Changes":492},"State":"Flow","Cover":0,"Boost":0,"Low":0},"Filtration":{"State":0,"Speed":2,"Mode":0},"Light":0,"Relay":{"State":[0,0,0,0,0,0,0],"Aux":[0,0,0,0],"Acid":0,"Heating ":0}},"TempUnit":"C"}}
{"StatusSTS":{"Time":"2023-06-14T09:19:28","Uptime":"0T00:33:16","UptimeSec":1996,"Heap":26,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"Wifi":{"AP":1,"SSId":"CiscoAir","BSSId":"78:45:58:9F:6E:D5","Channel":1,"Mode":"11n","RSSI":16,"Signal":-92,"LinkCount":1,"Downtime":"0T00:09:29"}}}
  • Set weblog to 4 and then, when you experience your issue, provide the output of the Console log:
  Console output here:

Can see the inversion here, 1-> OFF / 0 -> ON
NPFiltration 1
09:25:17.053 CMD: Grp 0, Cmd 'NPFILTRATION', Idx 1, Len 1, Pld 0, Data '0'
09:25:17.121 MQT: stat/SmartPool/NPFILTRATION = {"NPFiltration":"OFF","Speed":"2"}
NPFiltration 0
09:26:20.924 CMD: Grp 0, Cmd 'NPFILTRATION', Idx 1, Len 1, Pld 1, Data '1'
09:26:20.993 MQT: stat/SmartPool/NPFILTRATION = {"NPFiltration":"ON","Speed":"2"}

TO REPRODUCE

send NPFiltration with 0 or 1 over the MQTT command channel and check stat channel

EXPECTED BEHAVIOUR

A clear and concise description of what you expected to happen.

SCREENSHOTS

If applicable, add screenshots to help explain your problem.

ADDITIONAL CONTEXT

Add any other context about the problem here.

(Please, remember to close the issue when the problem has been addressed)

@Jason2866
Copy link
Collaborator

Please add the missing Infos asked in the template.

@Jason2866 Jason2866 added the awaiting feedback Action - Waiting for response or more information label Jun 13, 2023
@barbudor
Copy link
Contributor

@fdebrus
What is the result of command StateText ?

@fdebrus
Copy link
Author

fdebrus commented Jun 14, 2023

StateText
{
"StateText1": "OFF",
"StateText2": "ON",
"StateText3": "TOGGLE",
"StateText4": "HOLD"
}

@fdebrus
Copy link
Author

fdebrus commented Jun 14, 2023

I tried to call

NPFiltration 0 mutiple times in a row

10:09:53.513 CMD: NPFiltration 0
10:09:53.515 SRC: WebConsole from 192.168.XXX
10:09:53.518 CMD: Grp 0, Cmd 'NPFILTRATION', Idx 1, Len 1, Pld 0, Data '0'
10:09:53.587 MQT: stat/SmartPool/NPFILTRATION = {"NPFiltration":"ON","Speed":"2"}
10:09:56.130 CMD: NPFiltration 0
10:09:56.132 SRC: WebConsole from 192.168.XXXX
10:09:56.135 CMD: Grp 0, Cmd 'NPFILTRATION', Idx 1, Len 1, Pld 0, Data '0'
10:09:56.203 MQT: stat/SmartPool/NPFILTRATION = {"NPFiltration":"OFF","Speed":"2"}
10:09:58.656 CMD: NPFiltration 0
10:09:58.658 SRC: WebConsole from 192.168.XXXX
10:09:58.661 CMD: Grp 0, Cmd 'NPFILTRATION', Idx 1, Len 1, Pld 0, Data '0'
10:09:58.730 MQT: stat/SmartPool/NPFILTRATION = {"NPFiltration":"OFF","Speed":"2"}

NPFiltration 1 mutiple times in a row

10:11:11.341 CMD: NPFiltration 1
10:11:11.343 SRC: WebConsole from 192.168.XXXX
10:11:11.345 CMD: Grp 0, Cmd 'NPFILTRATION', Idx 1, Len 1, Pld 1, Data '1'
10:11:11.413 MQT: stat/SmartPool/NPFILTRATION = {"NPFiltration":"OFF","Speed":"2"}
10:11:12.905 CMD: NPFiltration 1
10:11:12.907 SRC: WebConsole from 192.168.XXXX
10:11:12.910 CMD: Grp 0, Cmd 'NPFILTRATION', Idx 1, Len 1, Pld 1, Data '1'
10:11:12.979 MQT: stat/SmartPool/NPFILTRATION = {"NPFiltration":"ON","Speed":"2"}
10:11:14.441 CMD: NPFiltration 1
10:11:14.443 SRC: WebConsole from 192.168.XXXX
10:11:14.446 CMD: Grp 0, Cmd 'NPFILTRATION', Idx 1, Len 1, Pld 1, Data '1'
10:11:14.514 MQT: stat/SmartPool/NPFILTRATION = {"NPFiltration":"ON","Speed":"2"}

So the first call to NPFiltration gives a wrong status while nexts are good.

@barbudor
Copy link
Contributor

Looking at the code I don't see any problem with the logic
The value that is displayed as the status from the command is read back to the device
So I see 2 possible issues:

  • The device take some time to take the command into account
  • The device is missing some commands due to the communication problems (wiring quality ?)

You can interrogate the device with command NPFiltration without any argument
Starting with a state OFF, what are the result for the following sequence of commands executed one after the other leaving 5-10 seconds between each command:

NPFiltration
NPFiltration 1
NPFiltration
NPFiltration
NPFiltration
NPFiltration 1
NPFiltration
NPFiltration

@barbudor
Copy link
Contributor

Hi @curzon01 I think you were the main contributor on this code
My opinion would be a communication problem which makes the NeoPool device miss commands
What do you think ?

@fdebrus
Copy link
Author

fdebrus commented Jun 14, 2023

Here you go

12:03:18.561 CMD: NPFiltration
12:03:18.563 SRC: WebConsole from 192.168.2.120
12:03:18.565 CMD: Grp 0, Cmd 'NPFILTRATION', Idx 1, Len 0, Pld -99, Data ''
12:03:18.585 MQT: stat/SmartPool/NPFILTRATION = {"NPFiltration":"OFF","Speed":"2"}
12:03:28.126 CMD: NPFiltration 1
12:03:28.128 SRC: WebConsole from 192.168.2.120
12:03:28.130 CMD: Grp 0, Cmd 'NPFILTRATION', Idx 1, Len 1, Pld 1, Data '1'
12:03:28.198 MQT: stat/SmartPool/NPFILTRATION = {"NPFiltration":"OFF","Speed":"2"}
12:03:34.788 WIF: Checking connection...
12:03:35.447 CMD: NPFiltration
12:03:35.449 SRC: WebConsole from 192.168.2.120
12:03:35.452 CMD: Grp 0, Cmd 'NPFILTRATION', Idx 1, Len 0, Pld -99, Data ''
12:03:35.473 MQT: stat/SmartPool/NPFILTRATION = {"NPFiltration":"ON","Speed":"2"}
12:03:42.066 CMD: NPFiltration
12:03:42.068 SRC: WebConsole from 192.168.2.120
12:03:42.071 CMD: Grp 0, Cmd 'NPFILTRATION', Idx 1, Len 0, Pld -99, Data ''
12:03:42.092 MQT: stat/SmartPool/NPFILTRATION = {"NPFiltration":"ON","Speed":"2"}
12:03:42.769 WIF: Sending Gratuitous ARP
12:03:48.051 CMD: NPFiltration
12:03:48.053 SRC: WebConsole from 192.168.2.120
12:03:48.056 CMD: Grp 0, Cmd 'NPFILTRATION', Idx 1, Len 0, Pld -99, Data ''
12:03:48.077 MQT: stat/SmartPool/NPFILTRATION = {"NPFiltration":"ON","Speed":"2"}
12:03:54.782 WIF: Checking connection...
12:03:57.176 CMD: NPFiltration 1
12:03:57.178 SRC: WebConsole from 192.168.2.120
12:03:57.181 CMD: Grp 0, Cmd 'NPFILTRATION', Idx 1, Len 1, Pld 1, Data '1'
12:03:57.249 MQT: stat/SmartPool/NPFILTRATION = {"NPFiltration":"ON","Speed":"2"}
12:04:03.776 CMD: NPFiltration
12:04:03.779 SRC: WebConsole from 192.168.2.120
12:04:03.781 CMD: Grp 0, Cmd 'NPFILTRATION', Idx 1, Len 0, Pld -99, Data ''
12:04:03.802 MQT: stat/SmartPool/NPFILTRATION = {"NPFiltration":"ON","Speed":"2"}
12:04:10.193 CMD: NPFiltration
12:04:10.196 SRC: WebConsole from 192.168.2.120
12:04:10.198 CMD: Grp 0, Cmd 'NPFILTRATION', Idx 1, Len 0, Pld -99, Data ''
12:04:10.221 MQT: stat/SmartPool/NPFILTRATION = {"NPFiltration":"ON","Speed":"2"}
12:04:15.034 WIF: Checking connection...

Note:
When issuing NPFiltration 1 or 0 the pump do react accordingly 1- ON 0-OFF so the command is not "lost" only state is not updated accordingly.

@barbudor
Copy link
Contributor

barbudor commented Jun 14, 2023

So the problem is on the device which do not update it's state quickly

Possibilities:

  • do not display value read back from the device but value from the command. Disadvantage is that if comm is broken and the device do not change it's state a wrong value would be reported
  • delay the read back: but what would be the delay? A delay would block the whole tasmota unless it is implemented asynchronously

@curzon01
Copy link
Contributor

It seems @barbudor are right, the Auarite system might be very slow updating their internal register.

Pls provide "NPControl" and "Teleperiod" (topic .../SENSOR) result to see the system info and FW version number

(pls be patient, I'm busy 'till ne t week)

@fdebrus
Copy link
Author

fdebrus commented Jun 14, 2023

14:10:56.256 MQT: stat/SmartPool/NPCONTROL = {"Modules":{"pH":1,"Redox":1,"Hydrolysis":1,"Chlorine":0,"Conductivity":0,"Ionization":0},"Relay":{"Acid":1,"Base":0,"Redox":0,"Chlorine":0,"Conductivity":0,"Heating":7,"UV":0,"Valve":0}}

14:11:21.778 MQT: stat/SmartPool/TELEPERIOD = {"TelePeriod":300}

tele/SmartPool/SENSOR = {"Time":"2023-06-14T14:11:22","NeoPool":{"Time":"2023-06-14T15:09:49","Type":"Generic","Modules":{"pH":1,"Redox":1,"Hydrolysis":1,"Chlorine":0,"Conductivity":0,"Ionization":0},"Temperature":30.2,"Power":{"Version":"V3.57","NodeID":"05DE 2D35 3837 574E 4318 0937","5V":5,"12V":14,"24-30V":32,"4-20mA":0.120},"pH":{"Data":7.2,"Min":7.0,"Max":7.4,"State":3,"Pump":2,"FL1":0,"Tank":1},"Redox":{"Data":663,"Setpoint":700},"Hydrolysis":{"Data":15,"Unit":"g/h","Runtime":{"Total":"42T17:52:10","Part":"42T17:52:10","Pol1":"21T03:40:54","Pol2":"21T14:11:16","Changes":492},"State":"Pol1","Cover":0,"Boost":0,"Low":0},"Filtration":{"State":1,"Speed":3,"Mode":0},"Light":0,"Relay":{"State":[0,1,0,0,0,0,0],"Aux":[0,0,0,0],"Acid":0,"Heating ":0}},"TempUnit":"C"}

@curzon01
Copy link
Contributor

may be I can fix it, let me check next week

meantime workaround:
for switching pump use Backlog NPFiltration x;Delay 10;NPFiltration - x = 0 or 1, adapt Delay period if necessary

@Jason2866 Jason2866 removed the awaiting feedback Action - Waiting for response or more information label Jun 15, 2023
@fdebrus
Copy link
Author

fdebrus commented Jun 19, 2023

thanks, not sure how to use that workaround from HA but I can code something similar. For the time being this is how I call the command

mqtt:
switch:
- unique_id: "pool_pump_switch"
name: "Pool Pump Switch"
device_class: switch
retain: true
command_topic: "cmnd/SmartPool/NPFiltration"
state_topic: "stat/SmartPool/NPFILTRATION"
value_template: >-
{% set values = { 'OFF':'0', 'ON':'1' } %}
{{ values[value_json["NPFiltration"]] if value_json["NPFiltration"] in values.keys() else 'Error' }}
payload_on: "1"
payload_off: "0"

then an automation is calling NPFiltration again after 5secs

alias: NPFiltration
description: ""
trigger:

  • platform: mqtt
    topic: cmnd/SmartPool/NPFiltration
    condition: []
    action:
  • delay:
    hours: 0
    minutes: 0
    seconds: 5
    milliseconds: 0
  • service: mqtt.publish
    data:
    topic: cmnd/SmartPool/NPFiltration
    mode: single

that works :)

@curzon01
Copy link
Contributor

you're not patient enough :-)
fix is still in test and already on the way...

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

Successfully merging a pull request may close this issue.

4 participants