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

Add support to change demand control parameters #269

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Matze2
Copy link
Contributor

@Matze2 Matze2 commented Mar 16, 2024

This PR is on top of #268.
It is already functional. I change the maxPower percentage change in my iobroker scripts.

@Apollon77
Copy link
Owner

@Matze2 Please rebase after merge of the read PR

@Matze2
Copy link
Contributor Author

Matze2 commented Oct 4, 2024

Will do tonight.

@Matze2
Copy link
Contributor Author

Matze2 commented Oct 4, 2024

Hi @Apollon77,

as requested, I rebased this PR against master. Some notes on the implementation:

Most of the code is copied from setACControlInfo and adjusted.

Based on the minimal set_demand_control API (without program schedules support) the following fields must exist:

  • "type" must be 1. There is no documentation available about the type field, but it seems that demand control change is only supported if type==1
  • "en_demand" must be set to 0 (OFF) or 1 (ON). In case of OFF, the API call is much simpler.
  • "mode" must be set to 0 (MANUAL) or 2 (AUTO). 1 (TIMER) is in conjunction with program schedule and not supported currently to have a simple start.
  • "max_power" as the demand control value itself - the reason for this PR; for now only values from 40-100 in steps of 5 are accepted. My Stylish FTXA does not accept any other value. This is checked in getRequestDict() method. It can be relaxed later IF there are models who support different ranges and steps.

This means, the following parameters can be changed with this PR:

  • demand control can be activated or deactivated ("en_demand")
  • the mode can be switched between MANUAL and AUTO
  • the demand control limitation can be changed which is only effective for MANUAL mode

Copy link
Owner

@Apollon77 Apollon77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a snmall thing ... wdyt?

src/models/DemandControl.ts Outdated Show resolved Hide resolved
... and round it to the nearest multiple of 5 for API call.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants