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

Discussion: should Apex switches just be OFF/AUTO? #28

Open
brettonw opened this issue Sep 7, 2022 · 8 comments
Open

Discussion: should Apex switches just be OFF/AUTO? #28

brettonw opened this issue Sep 7, 2022 · 8 comments
Assignees
Labels
enhancement New feature or request

Comments

@brettonw
Copy link
Contributor

brettonw commented Sep 7, 2022

After working with this integration for a week, I find myself having set up a variety of switches where I used an input_boolean and an input_number in pairing to configure the value of an Apex device and then to implement a switch that toggles the Apex switch between OFF and AUTO (i.e. pretty much never ON), because this feels like the desired behavior.

For example, I added an input_boolean for the heater, which I turn OFF during feeding time (because the heater and the thermometer are in different tank chambers and the heater would just turn on and run during feeding time). When I turn the input_boolean on, it sets the Apex heater switch back to AUTO, which enables the temperature program on that switch.

Maybe each HA switch could be configurable whether it turns the Apex switch on, or to auto? Maybe create two switches in the integration? Maybe it's just not a switch?

@FutureGUIs
Copy link

yeah I think a select/dropdown would be more useful

@itchannel
Copy link
Owner

itchannel commented Sep 8, 2022

So I've been looking and going to try using a select entity as you guys mentioned https://developers.home-assistant.io/docs/core/entity/select

I'll try and draft up something this week, just in the Aussie outback at the moment so reception is limited 👍

I'll also leave the switches in place for now.

@brettonw
Copy link
Contributor Author

brettonw commented Sep 11, 2022

yeah I think a select/dropdown would be more useful

I think this is true if you simply want to replace the Apex Fusion dashboard with a HA dashboard that functions exactly the same way, but I disagree in other cases. I want better functionality than Apex provides. My feeling is that the ON aspect of the Apex switches has no semantic usefulness to Home Assistant. Any abstraction other than OFF/AUTO (such as a dropdown/select) will require the user to build input_* helpers to get their intended use case.

In my proposal, if you really want OFF/ON functionality, you could set the Apex switch 'Control Type' to 'Always' and 'State' to 'On' in Apex Fusion, and then it really is just a binary switch (because setting that switch to AUTO on the apex will result in it being on).

On my HA dashboard, I want an OFF/ON switch for most of my devices, but that doesn't mean OFF/ON at the apex:

  • For "variables", I just want them set to AUTO on the Apex because OFF and ON are really just 0 and 100, respectively. I use the set_value service call to change their value. I do this with my Kessil refugium light, for instance. The color variable is just always set to auto on the Apex, and I expose an input_number (slider) to the dashboard. Same with the brightness. My day/night automation adjusts the brightness variable on a sinusoidal cycle (opposed to the tank light). If I turn the switch to off on the HA dashboard, I stop HA from setting the variable to my program value, but I don't interrupt the HA automations.

  • For my Sicce return pump, I expose an input_boolean that toggles the Apex switch OFF/AUTO, and all my automations use the set_value service to set the pump speed. Setting the pump speed to 0 effectively turns it off.

  • For the heater, I expose an input_boolean that toggles the Apex switch OFF/AUTO. In AUTO mode, the Apex runs the heater program that toggles the actual heater on and off depending on the temperature probe reading.

For these OFF/AUTO toggles, turning off the apex switch allows me to keep HA automations running, but have no affect. For instance, I have an automation that will turn on the return pump if it's been off for 10 minutes (feeding mode). But during a water change I don't want to turn the return pump back on in the middle of it. Since the return pump automation is only manipulating the pump speed variable, the switch between OFF/AUTO is similar to going into HA->settings->automations and turning off/on that HA automation.

@brettonw
Copy link
Contributor Author

brettonw commented Sep 11, 2022

I'll try and draft up something this week, just in the Aussie outback at the moment so reception is limited 👍

No hurry - this is a hobby. Enjoy where you are. Will you be able to visit the Great Barrier Reef?

@brettonw
Copy link
Contributor Author

brettonw commented Oct 3, 2022

FYI, I implemented this in my fork, and I've been very happy with the result.

https://github.com/brettonw/apex-ha

@itchannel
Copy link
Owner

I'm back so will take a look at all the issues and the suggested changes you've made and look at merging some bits in this week.

@itchannel itchannel added the enhancement New feature or request label Oct 4, 2022
@itchannel itchannel self-assigned this Oct 4, 2022
@FutureGUIs
Copy link

@brettonw Coming back to this, I'm definitely leaning to your view now that the controls should be 'OFF/Auto' because yeah, I want to override things from HA, but generally leave things in Auto mode on the Apex side since that has direct local control and the failsafes in place.

@brettonw
Copy link
Contributor Author

@FutureGUIs I haven't submitted a pull request to this repos on my changes because I rewrote a lot of it to work the way I wanted and it's not backwards compatible with this integration. If you wanted to try it out, I'd be curious about feedback from my repos (linked above).

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

No branches or pull requests

3 participants