Open squirtbrnr opened 2 years ago
I downloaded MQTT Explorer for macOS for more troubleshooting.
When I toggle the switch for either of the pumps, I see the topic highlight/flash which indicates there was a change to a topic or attribute. The pumps actually do toggle (finally did some local troubleshooting). However, the state of the pump stays at 0. Same for setting the temperature set point. I see the topic flash and the sub-topic "set" changes to the set point value, but the higher level topic still shows the original set point.
I just pushed a few fixes to main that addressed an issue with settemperature (was a select instead of number) so pull that as a start.
Use MQTT explorer and publish a value of toggle
to topic homie/bwa/spa/pump1/set
and see if your first pump will turn on. Sending toggle
again should turn it back off.
I'll work on the timezone issue.
cloned your main fork and restarted the container with the new code. Nothing seems to have changed. I do not have a topic "set" under either of my pumps (1 or 2). When I publish to it, it creates the topic, but otherwise it's not there. Also right now, my filter 1 cycle is running and it does not show in the entities. In MQTT explorer it shows pump 1 is running and filter cycle 1 is running (boolean true) but the entities in HA show false.
Both of my pumps are two speed so when I toggle it cycles between off, low, high. It's as if I was at the local panel and tapping the icon on the display to cycle through the pump speeds.
Let's work through the issues one by one.
Pump Control The integration is only configured for single-speed pumps (either 0 or 2) so that's why the low/1 speed isn't showing up correctly for you. A switch entity can't accurately show the state of a 3 state device 😄
Can you add the code below to your Home Assistant Configuration and see if it works correctly?
select:
- platform: mqtt
name: "Hot Tub Pump 1 (2-speed)"
state_topic: "homie/bwa/spa/pump1"
availability:
- topic: "homie/bwa/$state"
payload_available: "ready"
payload_not_available: "lost"
command_topic: "homie/bwa/spa/pump1/set"
options:
- "0"
- "1"
- "2"
icon: mdi:chart-bubble
Filter 1 Status Can you expand that branch? Filter1 has 3 topics and I'm not sure which one is actually true. I'd guess maybe it wasn't running then since it's set to run at 11pm for 8 hours (wow!) and your post was around 9pm (not sure if you are in the same timezone).
Here's mine:
homie/bwa/spa/filter1/$name Filter cycle 1 is currently running
homie/bwa/spa/filter1/$datatype boolean
homie/bwa/spa/filter1 false
I've created a multi speed pump branch if that select entity works for your tub. This will create a select entity with the various pump speeds if a multispeed pump is discovered and a switch if a single-speed pump is found.
I've split this issue into the two repositories, we'll address the problems with balboa_worldwide_app here and the docker container over on jshank/bwalink.
The switch works for toggling the pump. I click it once and it goes to low speed. the switch stays off and the binary sensor for pump 1 says it is not running. I toggle it again and it goes to high speed. the switch stays off and the binary sensor for pump 1 says it is not running. I toggle the switch one more time and the pump shuts off. When I toggle the switch for either pump, a new sub-topic appears for both pumps named "set
" with a value of "toggle
" but when I initially connected with MQTT Explorer, these sub-topics did not exist. However, the actual value of the pump stayed at 0 indicating it is not running, but it actually is.
Yes the filter cycle runs two times per day one of them for 8 hours (we use it frequently especially in winter months and this helps keep it pretty clean). When I took the screen shots the actual time was 11pm so the filter cycle running was correct. However, when I first started troubleshooting, the actual time was just after 9pm but the hot tub thought it was 3am due to the docker container time difference and therefore the hot tub was running the filter cycle.
Attached is the MQTT Explorer screenshot, but also the current temperature sensor. You can see the two times I restarted the docker container (last night and about 25 minutes ago). Those are the only two times any of the sensors actually update their values.
I will try your multi-speed branch next and report back. Unfortunately modifying my config and restarting my HA container right now isn't ideal as I have a rather fragile zwave network that starts up properly maybe 1 in 4 restarts. And doesn't look like Selects are considered helpers so they can't be added or reloaded from the frontend.
You shouldn't need to restart home assistant. Just shut down the bwalink docker container, delete the BWA Link Device and then start up the bwalink docker container again. The switch will never work for the multispeed pump, it will change to a select.
Tried the multi-speed pump branch. Yes a select for each pump is created. Setting to 1 does turn the pump on to low speed. However, the state as viewed in MQTT Explorer and the select in HA frontend still show a 0 and never update to 1. Additionally, setting the select to 2 after setting it to 1 actually turns the pump off. and if I set it to 2 with the pump off it goes to high speed, then setting to 1 turns the pump off. I believe what is happening is setting to 1 is as if I am toggling the pump button from the front panel on the hot tub 1 time and setting it to 2 is as if I am toggling twice. So in other words setting to 1 then 2 or 2 then 1 is really like pressing the button on the front panel 3 times which cycles the pump speed through all the speeds then off again.
I noticed the same behavior on my tub but was able to work around it by telling Home Assistant that a status of 2 is on and 0 is off. The toggle follows that logic for single speed pumps but seems to break down with multi speed pumps. I think it's just a limitation of the protocol since you can only call toggle on a pump (button press on control panel) and can't directly assign a value. Maybe Cody can re-examine the code for pumps.
I'd suggest opening an issue upstream and provide the debugs you did here.
continuing discussion that started here: https://community.home-assistant.io/t/balboa-hot-tub-spa-automation-and-power-savings/353032/4?u=squirtbrnr
looking at the debug dump, I have an MXBP20. I cannot confirm right now without taking the outer skirt panel off and removing some insulation, but from the pictures and manual online it looks correct. Also this appears to be the standard control pack in Vita Spa models specifically the Grand.
it did actually take the change in temperature set point, however I had to restart the container twice for the sensors to update. it still showed 90F, I restarted and all sensors went unavailable for a long time, I restarted again and everything came up and showed the new set point I had changed it to about 4 hours ago. What appears to be happening is I have control, but no state feedback after the initial sensor query. I can toggle the pumps between off, low, and high speed. I can change the temperature set point, I can turn the lights on/off. I just have no state feedback.
Attached is a CSV export of the container log after running at DEBUG level for about 30 minutes and pressing a few buttons on the hot tub local panel. bwalink.csv