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

Allow changing low/med/high via MQTT #4

Closed
wimb0 opened this issue Nov 24, 2020 · 3 comments
Closed

Allow changing low/med/high via MQTT #4

wimb0 opened this issue Nov 24, 2020 · 3 comments

Comments

@wimb0
Copy link

wimb0 commented Nov 24, 2020

Add MQTT topic to allow changing the speed to low/med/high as set in the web interface setting.
For example something like "itho/speed" and then (off,) low, med or high as values.
This also gives better integration with the Home Assistant Fan component.

@arjenhiemstra
Copy link
Owner

arjenhiemstra commented Nov 24, 2020

Hi Wim, this has already been implemented in the last firmware version, see this piece of code:

  else {
    if (strcmp(s_payload, "low") == 0) {
      val = systemConfig.itho_low;
    }
    else if (strcmp(s_payload, "medium") == 0) {
      val = systemConfig.itho_medium;
    }
    else if (strcmp(s_payload, "high") == 0) {
      val = systemConfig.itho_high;
    }
    else {
      val = strtoul (s_payload, NULL, 10);
    }

So if the MQTT command is not low, medium or high then it will try to translate the input to a number. If that also fails nothing gets processed.

update: formatting was kinda bad, hopefully better readable now

@wimb0
Copy link
Author

wimb0 commented Nov 24, 2020

Nice! Didn't see that, sorry.
I'll update my HA code to work with those values, thanks!
This issue can be closed then.

@arjenhiemstra
Copy link
Owner

No problem! Documentation also needs to be updated on this point. Furthermore I'm working on implementing timer commands and the possibility to queue commands with a time2live on the queue.

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

No branches or pull requests

2 participants