home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.11k stars 29.79k forks source link

OpenTherm Gateaway - no service set_max_ch_setpoint #85422

Closed lloyda closed 1 year ago

lloyda commented 1 year ago

The problem

pyotgw has the function set_max_ch_setpoint, but this does not appear to have been exposed as a service in opentherm_gw integration. Would it possible to expose this? Alternatively, is there a way to send a raw command to the OTGW (eg SH=66)?

What version of Home Assistant Core has the issue?

core-2023.1.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

opentherm-gw

Link to integration documentation on our website

https://www.home-assistant.io/integrations/opentherm_gw

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 1 year ago

Hey there @mvn23, mind taking a look at this issue as it has been labeled with an integration (opentherm_gw) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `opentherm_gw` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Change the title of the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign opentherm_gw` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


opentherm_gw documentation opentherm_gw source (message by IssueLinks)

mvn23 commented 1 year ago

pyotgw has the function set_max_ch_setpoint, but this does not appear to have been exposed as a service in opentherm_gw integration. Would it possible to expose this?

It's definitely possible, but not planned at the moment. PRs are welcome though.

Alternatively, is there a way to send a raw command to the OTGW (eg SH=66)?

This is not implemented in pyotgw, so will be more difficult to do. I'm also not sure if I'd be in favor of such a feature in Home Assistant. Depending on how you connect to the gateway, you may be able to do this via an external command or script.

jan-gerard commented 1 year ago

I was just looking for the same feature. I intend to test what is the minimum water temperature that will still heat the home, especially with the current cold water in NL. So I hope this could be implemented quickly, but I don't know how to do that without breaking the code. The value is readable (as max_ch_setpoint), but not settable. Although with otmonitor.exe I can change it, and in HA I see the value has changed. But I'd rather set it through HA, keep it low when it is not too cold outside, and allow a temporary higher water value when the house is cold after some longer absence, or it's very cold outside and I need to provide more heat. So I would like to request this feature to be implemented.

mvn23 commented 1 year ago

Thanks for the reminder. This has actually moved up on my list of priorities, but first I'm working on a cleanup of the existing code as there's still a lot of legacy code in there to deal with deprecated configurations. After that is done, this one is next. It could take some time though, as I have a holiday planned first.

lloyda commented 1 year ago

@jan-gerard As is usually the way with HA, there is more than one way to achieve something.

In lieu of this service, I did it another way

shell_command:
  send_otgw_command: /bin/bash -c "curl -X POST http://192.168.1.164/api/v1/otgw/command/{{ key }}={{ value }}"

This is called from an automation:

action:
  - service: shell_command.send_otgw_command
    data:
      key: SH
      value: "60"
jan-gerard commented 1 year ago

@jan-gerard As is usually the way with HA, there is more than one way to achieve something.

In lieu of this service, I did it another way

shell_command:
  send_otgw_command: /bin/bash -c "curl -X POST http://192.168.1.164/api/v1/otgw/command/{{ key }}={{ value }}"

This is called from an automation:

action:
  - service: shell_command.send_otgw_command
    data:
      key: SH
      value: "60"

Brilliant! Thanks. This works like a sunnetje. I made a helper variable, that I can set through the GUI, and which then sends the shell command. And the value from the opentherm gateway is updating the helper variable when it changes. Now I'm going to experiment with the hot water limit, and see what is the lowest I can achieve, so I can check if a heatpump will be applicable.

PatrickGlesner commented 1 year ago

Hello,

@lloyda It's not working with my configuration (Nodo gateway v2 with ethernet module USR-TCP232-T2). What one is yours? I tested adding -u "user:pass" and with GET instead PUT, but unsuccessly.

@mvn23 Do you want me to write the set_max_ch_setpoint service? It seems very similar to the set_control_setpoint service.

Best regards, Patrick.

mvn23 commented 1 year ago

PRs are always welcome. I can't merge anything, but I will definitely review any PRs related to the integration.

PatrickGlesner commented 1 year ago

PRs are always welcome. I can't merge anything, but I will definitely review any PRs related to the integration.

Ok. I'll try do that this week.

lloyda commented 1 year ago

@lloyda It's not working with my configuration (Nodo gateway v2 with ethernet module USR-TCP232-T2). What one is yours? I tested adding -u "user:pass" and with GET instead PUT, but unsuccessly.

I'm using Nodo gateway, but with the WiFi module.

PatrickGlesner commented 1 year ago

I'm using Nodo gateway, but with the WiFi module.

Ok, I understood. WiFi module has an API (from rvbreemen, I suppose) not the ethernet module :-(

issue-triage-workflows[bot] commented 1 year ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.