alexdelprete / HA-NeoPool-MQTT

Home Assistant MQTT integration for Tasmota NeoPool module
https://github.com/arendst/Tasmota/discussions/19811
GNU General Public License v2.0
11 stars 4 forks source link

Hydrolyse control + AUX relays #11

Closed DavidAntonin closed 6 months ago

DavidAntonin commented 7 months ago

Hi, thank you for the super add-on to HA. Most of the features work, but I ran into 2 problems:

In the mode settings I have manual/auto/heating/smart/intelligent/backwash. Everything except manual and backwash is controlled by the built-in timer, but I can't control it from HA.

Thank you

curzon01 commented 7 months ago

Stop testing on HA Integration side before we are sure that the corresponding points on Tasmota side are working.

So we must first exclude possible issues on Tasmota side because if it does not work under Tasmota, tests under Home Assistant are pointless. What is your environment:

Regarding your points

The mode is independent of the built-in timers. You can set any mode without this having anything to do with the built-in timers. Timers are only used for the Auto/Heating/Smart modes.

Controlling timers is very new on Tasmota side and also only available using an ESP32xx adding user defined NeoPool commands to Tasmota, so setting timers is currently not implemented with this HA Integration.

gggerdy commented 7 months ago

I use the NPwrite commands provided in the documentation, as I could not get the aux4 switch 0|1 to work. My heatpump is also connected to AUX4 relay, I'm using the M5stack Atom Lite.

This solution works, I use 2 button controls.

type: horizontal-stack
cards:
  - show_name: true
    show_icon: true
    type: button
    tap_action:
      action: call-service
      service: mqtt.publish
      target: {}
      data:
        qos: 0
        retain: false
        topic: cmnd/SmartPool/Backlog
        payload: NPWrite 0x4D9,3;NPExec
    name: Turn ON Pool Heatpump
    icon: mdi:power-plug-outline
    show_state: false
  - show_name: true
    show_icon: true
    type: button
    tap_action:
      action: call-service
      service: mqtt.publish
      target: {}
      data:
        qos: 0
        retain: false
        topic: cmnd/SmartPool/Backlog
        payload: NPWrite 0x4D9,4;NPExec
    name: Turn OFF Pool Heatpump
    icon: mdi:power-plug-off-outline
    show_state: false
curzon01 commented 7 months ago

this does not answer the rest of my questions

alexdelprete commented 7 months ago
  • The hydrolysis setting does not work as expected.

The setting works as we intended and documented. Your expectations are a very subjective thing. ;)

  • My Hydrolife device gives a power output of 0 - 16g/h and so if I select 16 with the slider, after a while it sets 100% and the unit is indeed 16g/h. If I set the value to 8, it displays 50% as expected and the unit produces 8g/h. Is it possible to do something about this to make it more comfortable to use - setting the value 1-16 on a 0-100 scale is quite inconvenient.

In the video it's clear that you're using the % mode, not the g/h setting. So your description is inaccurate in the first part. :)

If you analyze NeoPool documentation, you'll find out some interesting feature of the NPHydrolysis command:

image

So it's flexible, and how you use it (% or g/h) depends on the specific model you have, I can use both % and g/h mode. We chose to use % mode as default in the package because we felt it was the simplest approach, but you can change it, here's the part of the package file that you could customize to work in g/h mode:

image

alexdelprete commented 7 months ago

this does not answer the rest of my questions

Well, DavidAntonin didn't reply yet. :)

Controlling timers is very new on Tasmota side and also only available using an ESP32xx adding user defined NeoPool commands to Tasmota, so setting timers is currently not implemented with this HA Integration.

My bad Norbert, it's been a while since I checked for updates regarding your firmware. I will allocate some time to analyze the new functionalities and, if needed, update the integration.

DavidAntonin commented 7 months ago

Dear friends,

thank you for your advice and insights. I had to travel suddenly and so I am now away from my home. I apologize for my lack of knowledge on the subject, I am new to HA so I am just exploring the possibilities of converting my own facilities under HA. Most of my devices are based on the ESP8266, programmed following the Arduino IDE with simple control via the web interface. Can you please compile custom actual version of Tasmota for ESP8266? David

curzon01 commented 7 months ago

this does not answer the rest of my questions

Well, DavidAntonin didn't reply yet. :)

This also applies for gggerdy, he has the same problems and also no answers that were necessary to help ;-)

Controlling timers is very new on Tasmota side and also only available using an ESP32xx adding user defined NeoPool commands to Tasmota, so setting timers is currently not implemented with this HA Integration.

My bad Norbert, it's been a while since I checked for updates regarding your firmware. I will allocate some time to analyze the new functionalities and, if needed, update the integration.

These extensions are only available with ESP32 and Berry. While trying to extend my HA NeoPool with the timers I realized that the current implementation of NPTimer is not good enough, it is too complicated. But I don't have the time to clean it up at the moment.

alexdelprete commented 7 months ago

This also applies for gggerdy, he has the same problems and also no answers that were necessary to help ;-)

Correct. :)

While trying to extend my HA NeoPool with the timers I realized that the current implementation of NPTimer is not good enough, it is too complicated. But I don't have the time to clean it up at the moment.

I don't think there's any rush. People can live without timers. Take your time and do it when you can, with the usual quality level of your work. As a user, I prefer to wait and have good solutions vs rushing for something that is suboptimal.

alexdelprete commented 7 months ago

I am new to HA so I am just exploring the possibilities of converting my own facilities under HA.

No worries David, we're here to help. But please take your time to properly study the solution before asking/commenting about expectations etc. :)

For example:

Can you please compile custom actual version of Tasmota for ESP8266?

Check here. ;)

gggerdy commented 6 months ago

Sorry for my late reply, after reading your feedback I've noticed I forgot to upload the neopoolcmd.be and autoexec.be files Solution works perfect now.

Thank you @alexdelprete and @curzon01 for your excellent work

DavidAntonin commented 6 months ago

Hi, thank you all for your comments and advice. Sorry for the late reply, I was on holiday. My Hydrolife unit: power unit version: v2.12, display version: v2.16. ESP8266, exactly ESP-01 with 1MB flash. Tasmota 13.3.0.1 - precompiled flash file uploaded here. Here are the data from my device: MQT: tele/SmartPool/SENSOR = {"Time":"2024-03-30T18:51:59","NeoPool":{"Time":"2024-03-30T18:51:58","Type":"Generic","Modules":{"pH":1,"Redox":0,"Hydrolysis":1,"Chlorine":0,"Conductivity":0,"Ionization":0},"Temperature":16.8,"Powerunit":{"Version":"V2.12","NodeID":"XXXX XXXX XXXX XXXX XXXX 3C1E","5V":5,"12V":0,"24-30V":0,"4-20mA":0.000},"pH":{"Data":7.3,"Min":7.0,"Max":8.6,"State":0,"Pump":0,"FL1":0,"Tank":1},"Hydrolysis":{"Data":0,"Unit":"%","Setpoint":8,"Max":16,"Percent":{"Data":0,"Setpoint":50},"Runtime":{"Total":"358T12:34:40","Part":"358T12:34:41","Pol1":"179T00:42:20","Pol2":"179T11:52:23","Changes":1787},"State":"Pol2","Cover":0,"Boost":0,"Low":0,"FL1":0,"Redox":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,"Heating ":0}},"TempUnit":"C"}

curzon01 commented 6 months ago

Sorry for the late reply, I was on holiday.

So think about whether it's a good idea to open an issue and then go on vacation ;-)

ESP8266, exactly ESP-01 with 1MB flash

AUX switching will not work with the integration on your ESP as it requires NPAux as a command extension and this requires Berry scripting which cannot be used on your very small ESP8266.

Regarding to hydrolysis: The default operating mode in HA is always %, regardless of which system is being operated.

How to change this has already been described by Alessandro in this post above.

DavidAntonin commented 6 months ago

As far as setting/displaying the hydrolysis value, I found a problem with what my device reports. It responds to the NPHydrolysis command with {"NPHydrolysis":5, "Unit":"%"}, this means units of % but 5 corresponds to 5g/h.

I solved the problem of turning on the AUX4 relay that controls the heat pump by setting the timer for the whole day and controlling the function by switching the manual/auto/heating modes. This functionality fully suits my needs for now.

curzon01 commented 6 months ago

It responds to the NPHydrolysis command with {"NPHydrolysis":5, "Unit":"%"}, this means units of % but 5 corresponds to 5g/h.

then this would be an issue in Tasmota, I'll have a look

curzon01 commented 6 months ago

@DavidAntonin

pls can you exec the following Tasmota command

Backlog NPRead 0x100,16;NPRead 0x300,16;NPRead 0x500,16;NPRead 0x600,16

and give me the related outputs. I need all four complete lines with ...RESULT = {"NPRead":{"Address":"0x0?00.","Data":"..."}}

DavidAntonin commented 6 months ago

@curzon01 there is an output:

15:41:23.041 MQT: stat/SmartPool/RESULT = {"NPRead":{"Address":"0x0100","Data":["0x0000","0x0000","0x02DB","0x0000","0x0000","0x0000","0x00D4","0xC400","0x0000","0x0000","0x0000","0x0000","0x2000","0x2228","0x0000","0x0000"]}}
15:41:23.248 MQT: stat/SmartPool/RESULT = {"NPRead":{"Address":"0x0300","Data":["0x0807","0x0002","0x0000","0x0000","0x0000","0x0000","0x00A0","0x001E","0x0000","0x0735","0x0000","0x0064","0xB590","0x7880","0x8380","0x0320"]}}
15:41:23.457 MQT: stat/SmartPool/RESULT = {"NPRead":{"Address":"0x0500","Data":["0x0000","0x0000","0x0046","0x0000","0x030C","0x02C6","0x0000","0x0000","0x02BC","0x0000","0x0064","0x0000","0x0000","0x0000","0x1388","0x0000"]}}
15:41:23.679 MQT: stat/SmartPool/RESULT = {"NPRead":{"Address":"0x0600","Data":["0x0009","0x0006","0x5003","0x000F","0x0000","0x0000","0x0000","0x8001","0x6272","0x6900","0x0000","0x0000","0x6C69","0x7800","0x0000","0x0000"]}}
curzon01 commented 6 months ago

oh my, got it, Sugar Valley very very special conditions - I see more often that the SV firmware has 'grown' historically...

let's wait until PR #21098 is merged in Tasmota

curzon01 commented 6 months ago

Ok, PR was merged.

Try the updated firmware, issue should be solved.

DavidAntonin commented 6 months ago

@curzon01 Thank you so much, now it is OK :)