Kevin.
I’ve been working on getting valve_3 to work for a while. Mine is my solar diverter valve. I wanted to have my pump speed go to high rpms when the solar valve was on and back to the scheduled rpms when it went off. I got the valve_3 part working. Don’t remember what finally clicked in my brain to figure it out.
Anyway, you’ll have to modify the file “switch.py” in your Aqualogic custom configuration folder to add valve_3 as a “Monitored Condition”. Here is my modified switch.py:
from __future__ import annotations
from .core import States
import voluptuous as vol
from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchEntity
from homeassistant.const import CONF_MONITORED_CONDITIONS
from homeassistant.core import HomeAssistant
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
from . import DOMAIN, UPDATE_TOPIC
SWITCH_TYPES = {
"lights": "Lights",
"filter": "Filter",
"filter_low_speed": "Filter Low Speed",
"heater_1": "Heater",
"aux_1": "Fountain",
"valve_3": "Solar",
}
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
{
vol.Optional(CONF_MONITORED_CONDITIONS, default=list(SWITCH_TYPES)): vol.All(
cv.ensure_list, [vol.In(SWITCH_TYPES)]
)
}
)
async def async_setup_platform(
hass: HomeAssistant,
config: ConfigType,
async_add_entities: AddEntitiesCallback,
discovery_info: DiscoveryInfoType | None = None,
) -> None:
"""Set up the switch platform."""
switches = []
processor = hass.data[DOMAIN]
for switch_type in config[CONF_MONITORED_CONDITIONS]:
switches.append(AquaLogicSwitch(processor, switch_type))
async_add_entities(switches)
class AquaLogicSwitch(SwitchEntity):
"""Switch implementation for the AquaLogic component."""
_attr_should_poll = False
def __init__(self, processor, switch_type):
"""Initialize switch."""
self._processor = processor
self._state_name = {
"lights": States.LIGHTS,
"filter": States.FILTER,
"filter_low_speed": States.FILTER_LOW_SPEED,
"heater_1": States.HEATER_1,
"aux_1": States.AUX_1,
"valve_3": States.VALVE_3,
}[switch_type]
self._attr_name = f"AquaLogic {SWITCH_TYPES[switch_type]}"
@property
def is_on(self):
"""Return true if device is on."""
if (panel := self._processor.panel) is None:
return False
state = panel.get_state(self._state_name)
return state
def turn_on(self, **kwargs):
"""Turn the device on."""
if (panel := self._processor.panel) is None:
return
panel.set_state(self._state_name, True)
def turn_off(self, **kwargs):
"""Turn the device off."""
if (panel := self._processor.panel) is None:
return
panel.set_state(self._state_name, False)
async def async_added_to_hass(self):
"""Register callbacks."""
self.async_on_remove(
self.hass.helpers.dispatcher.async_dispatcher_connect(
UPDATE_TOPIC, self.async_write_ha_state
)
)
The 2 references to valve_3 are added in the blocks "SWITCH_TYPES = { " and “def init(self, processor, switch_type):” (You’d change “Solar” to “Waterfall” in your case)
Then, you add the valve_3 entity to your configuration.yaml file:
switch:
- platform: aqualogic
monitored_conditions:
- lights
- filter
- aux_1
- valve_3
This should work but like I said I don’t remember how I finally figured it out :). Hope this helps.