cdpuk / ha-bestway

Home Assistant integration for Bestway / Lay-Z-Spa hot tubs
MIT License
59 stars 14 forks source link

Add support for Error codes #53

Closed justinbyoung closed 1 month ago

justinbyoung commented 4 months ago

Would it be possible to add support for error codes from the pump unit. In particular the E02 Filter error. It's a common error when the filter needs replacing, the frustrating thing is you can't turn the unit off when it gets an E02 and the Bestway app doesn't notify you so the pool sits there beeping forever until you notice.

A Home Assistant sensor for this would be great as you could set up notifications and also track the time between errors and set up a reminder in HA to replace the filter before it errors.

v966732 commented 4 months ago

If the App doesn't have a way of displaying the code then it's unlikely the information is being sent from the pump to the Bestway servers, in which case it would be impossible to get the error codes into HA

justinbyoung commented 4 months ago

The app does display the error, it just doesn't offer any notifications to let you know about the error, so there is communication happening. Not being able to turn the pump off when it's in error maybe a limitation of the pump as it's also impossible to turn it off from the pump panel itself.

cdpuk commented 4 months ago

Hi @justinbyoung, what device make & model are we talking about?

If you're able to capture some debug logs while the device is in an error state, this may be possible.

justinbyoung commented 4 months ago

It's the V01 Airjet pump on a St Moritz spa. I am very happy to capture any logs. Which logs do you need? I will need to wait until the pump errors again.

justinbyoung commented 3 months ago

Hi,

The spa finally errored again and I managed to capture some debug data. Here are the last couple of minutes before it errored.

The change I can see is "E02": 0 changes to "E02": 1.

I looks like the other error codes are also being detected.

2024-03-23 18:12:09.433 DEBUG (MainThread) [custom_components.bestway.bestway.api] Status for device type 'Airjet_V01' returned: {"E19": 0, "E18": 0, "E32": 1, "E31": 0, "E30": 0, "E11": 0, "E10": 0, "E13": 0, "E12": 0, "E15": 0, "E14": 0, "E17": 0, "E16": 0, "word5": 193, "word4": 0, "word7": 37, "word6": 0, "word1": 0, "word0": 0, "E29": 0, "word2": 193, "option6": 10244, "ver": 1126, "E22": 0, "jet": 0, "E23": 0, "power": 1, "Tnow": 37, "option7": 10260, "option4": 0, "option5": 27175, "option2": 0, "option3": 30, "option0": 59940, "option1": 59940, "E24": 0, "E25": 0, "E26": 0, "E27": 0, "E20": 0, "E21": 0, "E08": 0, "E09": 0, "E06": 0, "E07": 0, "E04": 0, "E05": 0, "E02": 0, "E03": 0, "E01": 0, "bit7": 1, "heat": 5, "Tunit": 1, "wave": 100, "word3": 3, "Tset": 38, "filter": 2, "E28": 0, "bit6": 1, "bit5": 0, "bit4": 0, "bit3": 0, "bit2": 0}
2024-03-23 18:12:09.433 DEBUG (MainThread) [custom_components.bestway.coordinator] Finished fetching Bestway API data in 1.335 seconds (success: True)
2024-03-23 18:12:40.445 DEBUG (MainThread) [custom_components.bestway.bestway.api] New data received for device 9egS9o8vDCLNMzqjIhwz50
2024-03-23 18:12:40.445 DEBUG (MainThread) [custom_components.bestway.bestway.api] Status for device type 'Airjet_V01' returned: {"E19": 0, "E18": 0, "E32": 1, "E31": 0, "E30": 0, "E11": 0, "E10": 0, "E13": 0, "E12": 0, "E15": 0, "E14": 0, "E17": 0, "E16": 0, "word5": 193, "word4": 0, "word7": 37, "word6": 0, "word1": 0, "word0": 0, "E29": 0, "word2": 193, "option6": 10244, "ver": 1126, "E22": 0, "jet": 0, "E23": 0, "power": 1, "Tnow": 37, "option7": 10260, "option4": 0, "option5": 27175, "option2": 0, "option3": 30, "option0": 59940, "option1": 59940, "E24": 0, "E25": 0, "E26": 0, "E27": 0, "E20": 0, "E21": 0, "E08": 0, "E09": 0, "E06": 0, "E07": 0, "E04": 0, "E05": 0, "E02": 0, "E03": 0, "E01": 0, "bit7": 1, "heat": 5, "Tunit": 1, "wave": 100, "word3": 4, "Tset": 38, "filter": 2, "E28": 0, "bit6": 1, "bit5": 0, "bit4": 0, "bit3": 0, "bit2": 0}
2024-03-23 18:12:40.445 DEBUG (MainThread) [custom_components.bestway.coordinator] Finished fetching Bestway API data in 1.348 seconds (success: True)
2024-03-23 18:13:00.350 WARNING (MainThread) [custom_components.localtuya.common] [eb4...2bb] Failed to connect to 192.168.0.225: [Errno 113] Connect call failed ('192.168.0.225', 6668)
2024-03-23 18:13:00.351 WARNING (MainThread) [custom_components.localtuya.common] [ebd...civ] Failed to connect to 192.168.0.118: [Errno 113] Connect call failed ('192.168.0.118', 6668)
2024-03-23 18:13:11.452 DEBUG (MainThread) [custom_components.bestway.bestway.api] New data received for device 9egS9o8vDCLNMzqjIhwz50
2024-03-23 18:13:11.453 DEBUG (MainThread) [custom_components.bestway.bestway.api] Status for device type 'Airjet_V01' returned: {"E19": 0, "E18": 0, "E32": 1, "E31": 0, "E30": 0, "E11": 0, "E10": 0, "E13": 0, "E12": 0, "E15": 0, "E14": 0, "E17": 0, "E16": 0, "word5": 194, "word4": 0, "word7": 37, "word6": 0, "word1": 0, "word0": 0, "E29": 0, "word2": 194, "option6": 10244, "ver": 1126, "E22": 0, "jet": 0, "E23": 0, "power": 1, "Tnow": 37, "option7": 10260, "option4": 0, "option5": 27175, "option2": 0, "option3": 30, "option0": 59940, "option1": 59940, "E24": 0, "E25": 0, "E26": 0, "E27": 0, "E20": 0, "E21": 0, "E08": 0, "E09": 0, "E06": 0, "E07": 0, "E04": 0, "E05": 0, "E02": 0, "E03": 0, "E01": 0, "bit7": 1, "heat": 5, "Tunit": 1, "wave": 100, "word3": 4, "Tset": 38, "filter": 2, "E28": 0, "bit6": 1, "bit5": 0, "bit4": 0, "bit3": 0, "bit2": 0}
2024-03-23 18:13:11.453 DEBUG (MainThread) [custom_components.bestway.coordinator] Finished fetching Bestway API data in 1.354 seconds (success: True)
2024-03-23 18:13:42.450 DEBUG (MainThread) [custom_components.bestway.bestway.api] New data received for device 9egS9o8vDCLNMzqjIhwz50
2024-03-23 18:13:42.450 DEBUG (MainThread) [custom_components.bestway.bestway.api] Status for device type 'Airjet_V01' returned: {"E19": 0, "E18": 0, "E32": 1, "E31": 0, "E30": 0, "E11": 0, "E10": 0, "E13": 0, "E12": 0, "E15": 0, "E14": 0, "E17": 0, "E16": 0, "word5": 194, "word4": 0, "word7": 37, "word6": 0, "word1": 0, "word0": 0, "E29": 0, "word2": 194, "option6": 10244, "ver": 1126, "E22": 0, "jet": 0, "E23": 0, "power": 1, "Tnow": 37, "option7": 10260, "option4": 0, "option5": 27175, "option2": 0, "option3": 30, "option0": 59940, "option1": 59940, "E24": 0, "E25": 0, "E26": 0, "E27": 0, "E20": 0, "E21": 0, "E08": 0, "E09": 0, "E06": 0, "E07": 0, "E04": 0, "E05": 0, "E02": 0, "E03": 0, "E01": 0, "bit7": 1, "heat": 5, "Tunit": 1, "wave": 100, "word3": 5, "Tset": 38, "filter": 2, "E28": 0, "bit6": 1, "bit5": 0, "bit4": 0, "bit3": 0, "bit2": 1}
2024-03-23 18:13:42.450 DEBUG (MainThread) [custom_components.bestway.coordinator] Finished fetching Bestway API data in 1.352 seconds (success: True)
2024-03-23 18:14:00.382 WARNING (MainThread) [custom_components.localtuya.common] [eb4...2bb] Failed to connect to 192.168.0.225: [Errno 113] Connect call failed ('192.168.0.225', 6668)
2024-03-23 18:14:00.383 WARNING (MainThread) [custom_components.localtuya.common] [ebd...civ] Failed to connect to 192.168.0.118: [Errno 113] Connect call failed ('192.168.0.118', 6668)
2024-03-23 18:14:13.452 DEBUG (MainThread) [custom_components.bestway.bestway.api] New data received for device 9egS9o8vDCLNMzqjIhwz50
2024-03-23 18:14:13.453 DEBUG (MainThread) [custom_components.bestway.bestway.api] Status for device type 'Airjet_V01' returned: {"E19": 0, "E18": 0, "E32": 1, "E31": 0, "E30": 0, "E11": 0, "E10": 0, "E13": 0, "E12": 0, "E15": 0, "E14": 0, "E17": 0, "E16": 0, "word5": 195, "word4": 0, "word7": 36, "word6": 0, "word1": 0, "word0": 0, "E29": 0, "word2": 195, "option6": 10244, "ver": 1126, "E22": 0, "jet": 0, "E23": 0, "power": 1, "Tnow": 37, "option7": 10260, "option4": 0, "option5": 27175, "option2": 0, "option3": 30, "option0": 59940, "option1": 59940, "E24": 0, "E25": 0, "E26": 0, "E27": 0, "E20": 0, "E21": 0, "E08": 0, "E09": 0, "E06": 0, "E07": 0, "E04": 0, "E05": 0, "E02": 0, "E03": 0, "E01": 0, "bit7": 1, "heat": 5, "Tunit": 1, "wave": 100, "word3": 5, "Tset": 38, "filter": 2, "E28": 0, "bit6": 1, "bit5": 0, "bit4": 0, "bit3": 0, "bit2": 1}
2024-03-23 18:14:13.453 DEBUG (MainThread) [custom_components.bestway.coordinator] Finished fetching Bestway API data in 1.354 seconds (success: True)
2024-03-23 18:14:44.463 DEBUG (MainThread) [custom_components.bestway.bestway.api] New data received for device 9egS9o8vDCLNMzqjIhwz50
2024-03-23 18:14:44.463 DEBUG (MainThread) [custom_components.bestway.bestway.api] Status for device type 'Airjet_V01' returned: {"E19": 0, "E18": 0, "E32": 1, "E31": 0, "E30": 0, "E11": 0, "E10": 0, "E13": 0, "E12": 0, "E15": 0, "E14": 0, "E17": 0, "E16": 0, "word5": 195, "word4": 0, "word7": 36, "word6": 0, "word1": 0, "word0": 0, "E29": 0, "word2": 195, "option6": 10244, "ver": 1126, "E22": 0, "jet": 0, "E23": 0, "power": 1, "Tnow": 37, "option7": 10260, "option4": 0, "option5": 27175, "option2": 0, "option3": 30, "option0": 59940, "option1": 59940, "E24": 0, "E25": 0, "E26": 0, "E27": 0, "E20": 0, "E21": 0, "E08": 0, "E09": 0, "E06": 0, "E07": 0, "E04": 0, "E05": 0, "E02": 0, "E03": 0, "E01": 0, "bit7": 1, "heat": 5, "Tunit": 1, "wave": 100, "word3": 6, "Tset": 38, "filter": 2, "E28": 0, "bit6": 1, "bit5": 0, "bit4": 0, "bit3": 0, "bit2": 1}
2024-03-23 18:14:44.463 DEBUG (MainThread) [custom_components.bestway.coordinator] Finished fetching Bestway API data in 1.365 seconds (success: True)
2024-03-23 18:15:00.350 WARNING (MainThread) [custom_components.localtuya.common] [eb4...2bb] Failed to connect to 192.168.0.225: [Errno 113] Connect call failed ('192.168.0.225', 6668)
2024-03-23 18:15:00.350 WARNING (MainThread) [custom_components.localtuya.common] [ebd...civ] Failed to connect to 192.168.0.118: [Errno 113] Connect call failed ('192.168.0.118', 6668)
2024-03-23 18:15:15.555 DEBUG (MainThread) [custom_components.bestway.bestway.api] New data received for device 9egS9o8vDCLNMzqjIhwz50
2024-03-23 18:15:15.555 DEBUG (MainThread) [custom_components.bestway.bestway.api] Status for device type 'Airjet_V01' returned: {"E19": 0, "E18": 0, "E32": 1, "E31": 0, "E30": 0, "E11": 0, "E10": 0, "E13": 0, "E12": 0, "E15": 0, "E14": 0, "E17": 0, "E16": 0, "word5": 196, "word4": 0, "word7": 36, "word6": 0, "word1": 0, "word0": 0, "E29": 0, "word2": 196, "option6": 10244, "ver": 1126, "E22": 0, "jet": 0, "E23": 0, "power": 1, "Tnow": 37, "option7": 10260, "option4": 0, "option5": 27175, "option2": 0, "option3": 30, "option0": 59940, "option1": 59940, "E24": 0, "E25": 0, "E26": 0, "E27": 0, "E20": 0, "E21": 0, "E08": 0, "E09": 0, "E06": 0, "E07": 0, "E04": 0, "E05": 0, "E02": 0, "E03": 0, "E01": 0, "bit7": 1, "heat": 5, "Tunit": 1, "wave": 100, "word3": 6, "Tset": 38, "filter": 2, "E28": 0, "bit6": 1, "bit5": 0, "bit4": 0, "bit3": 0, "bit2": 1}
2024-03-23 18:15:15.555 DEBUG (MainThread) [custom_components.bestway.coordinator] Finished fetching Bestway API data in 1.456 seconds (success: True)
2024-03-23 18:15:46.743 DEBUG (MainThread) [custom_components.bestway.bestway.api] New data received for device 9egS9o8vDCLNMzqjIhwz50
2024-03-23 18:15:46.743 DEBUG (MainThread) [custom_components.bestway.bestway.api] Status for device type 'Airjet_V01' returned: {"E19": 0, "E18": 0, "E32": 0, "E31": 0, "E30": 0, "E11": 0, "E10": 0, "E13": 0, "E12": 0, "E15": 0, "E14": 0, "E17": 0, "E16": 0, "word5": 0, "word4": 0, "word7": 37, "word6": 0, "word1": 0, "word0": 0, "E29": 0, "word2": 0, "option6": 10244, "ver": 1126, "E22": 0, "jet": 0, "E23": 0, "power": 1, "Tnow": 37, "option7": 10260, "option4": 0, "option5": 27175, "option2": 0, "option3": 30, "option0": 59940, "option1": 59940, "E24": 0, "E25": 0, "E26": 0, "E27": 0, "E20": 0, "E21": 0, "E08": 0, "E09": 0, "E06": 0, "E07": 0, "E04": 0, "E05": 0, "E02": 1, "E03": 0, "E01": 0, "bit7": 1, "heat": 0, "Tunit": 1, "wave": 0, "word3": 0, "Tset": 38, "filter": 0, "E28": 0, "bit6": 1, "bit5": 0, "bit4": 0, "bit3": 0, "bit2": 0}
2024-03-23 18:15:46.743 DEBUG (MainThread) [custom_components.bestway.coordinator] Finished fetching Bestway API data in 1.495 seconds (success: True)
justinbyoung commented 3 months ago

For reference I found a page that lists the error codes https://www.manualslib.com/manual/1850942/Bestway-Lay-Z-Spa.html?page=27#manual

cdpuk commented 1 month ago

The upcoming v1.6.0 release will include this. To cater for the widest range of device types, there will be just one binary_sensor for errors, and the attributes of that sensor will list all error codes relevant to your model.

With this, it would be possible to create a template sensor to pick out specific error codes if that's useful for your setup.