-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Set Operation Mode and Temperature Target #28
Comments
Thanks for the request! I agree this would be a great enhancement. The challenge with this is that I'm using this package from pypi which doesn't expose these abilities currently. The other aquanta custom component linked to does offer this functionality, but it's doing it by making requests to HTTP endpoints manually instead of using a separate python package to handle it (which is the HA best practice). I think the best solution will probably be to fork the pypi package, implement the enhancements into that, and either get the original developer to merge the changes in or release a new package on pypi. Then I can update this integration to make use of the new functionality. I'll plan to work on these changes as time permits, I don't think it should be very difficult as long as the API that the pypi package connects to is either the same or offers similar functionality. |
Additionally, add set_performance_mode |
An update that may be useful to those using aquanta. I have two water heaters. One is in away mode, temperature/manual mode, the other is intelligence with the 'efficient' setting. I wrote a custom program using http requests for setting temperature or intelligence modes, and performance modes (low, efficient, high). Pushing the button will toggle the modes and set the temperature based on the input select. Implemented using templates and 'custom:button-card' One interesting note, is that your implementation doesn't preserve the temperature state, so the history graph is 'unavailable' several times. May need to implement a 'var' or similar to keep the last value then update. |
Thanks for the additional info! Out of curiosity, and in case it might help with the full implementation, would you be willing to share the details of the HTTP requests you're using to make those changes? I'm curious if they're using the same API endpoint as the integration or not. It seems like we should make a separate issue for the statistics gaps to keep this one focused on adding the missing API functionality. I'll create one to continue that discussion. |
Will do. I found a couple of bugs, and working through them. I implemented it with HTTP/python, and a combination of input_numbers, automation, command line sensors and scripts. Seeing if I can simplify it a bit more. |
Here is the core code that seems to be working for me. I borrowed quite a bit from Alex's code, he built the original Aquanta API calls. I also 'import dill' to save the entire session then load it again, to reduce the number of login calls. Keeps the session cache. You would need to get the device IDs for each water heater. I have two, and just hard coded them. I can set temperature, or use intelligence mode. For the latter, I can set less, efficient, or most efficient. You wouldn't need to update the status again, as you have that in your code. API_BASE_URL = "https://portal.aquanta.io/portal" API_SETTINGS_URL = f"{API_BASE_URL}/get/settings" API_SET_SETTINGS_URL = f"{API_BASE_URL}/set/advancedSettings" CONTROL_MODE_INTELLIGENCE = "Aquanta Intelligence" WATER_HEATER_ID_A = 1 VERBOSITY = 0 ################### def check_response(response: requests.Response):
def login(username: str, password: str):
class Aquanta():
set target temperature or intelactive where temperature is ignoredintelactive: True sets aquaintelligence active, False sets temperature control
portal = "portal.aquanta.io/views/" elif setting == "efficiency": elif setting == "temperature": |
Found my way here from the Home Assistant forums. Implemented @bmcclure's awesome integration via HACS and noticed two interesting things: (1) the frequent "unavailable" interrupts (mentioned above); and (2) a good surprise that it appears I can control the thermostat/setpoint from the device (see control immediately below the boost/away toggles) even though Ben mentioned in the OP that only boost and away could be controlled: I'm using the latest version from HACS -- what would you guys recommend to address these two issues? @Mark612's implementation above is square on what I'm trying to do, but I'm not sure if that code has been pulled in, or is available as a separate fork somehow? Appreciate any guidance -- and again, thanks for the awesome work so far! |
I use the process I described above. Var variables to solve the issue of the Aquanta api timing out, to save the last known good value. I also used my own code, independently, to set other parameters not provided in the integration. I hope to help with the integration to merge my code in the future. |
@Mark612 nicely done with your app. Is your app an HA custom component or a freestanding app or? Willing to share? Also, I’ve been scouring the web trying to find the http syntax to control setpoint and other parameters. Sounds like you coded to the http calls — can you point me to a link or something where the syntax is documented? TIA… |
See my posts above, you can see I use a https and sessions library to access the API portal. I use this as a freestanding app, called 'aquanta' in my coding folder, then integrate the commands into home assistant. command_line:
And as a command.yaml to set the efficiency or change the temperature. I have 2 water heaters: aquanta_a_intelligence: /config/coding/aquanta a efficiency {{variables}} |
Ah I think I may have misunderstood. I thought you were saying that Aquanta supports http calls directly (e.g., http:/aquanta.io/user=xyz&tank=xyz&setpoint=125, or whatever syntax). Guess this explains why I couldn’t find documentation anywhere! Since I’m an HA noob, I was going to hack a solution via http calls directly at least temporarily for setpoint temp and efficiency. Candidly I’m not sure where to start with your app code earlier in the thread, nor the commands immediately above. I will happily take any direction and aggressively try to push forward on my own if you’re willing to provide a startpoint? Regardless, very much appreciate the reply. |
I'll see if I can post my code up, and you can get it going. Even better, work with bmcclure to merge in the additional functionality needed, as described in this open issue. |
Checklist
Is your feature request related to a problem? Please describe.
Additional control of the API if possible. Setting the modes and temperature target when setpoint is used.
Describe the solution you'd like
Add the ability through service call methods to set the operation mode and target temperature
service: water_heater.set_operation_mode
data:
entity_id: water_heater.aquanta_a_water_heater
operation_mode: setpoint
service: water_heater.set_temperature
data:
entity_id: water_heater.aquanta_a_water_heater
temperature: 130
Describe alternatives you've considered
Exposing a switch would be ideal.
Additional context
May reference:
https://github.com/alexanv1/customcomponents/tree/master/aquanta
The text was updated successfully, but these errors were encountered: