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

Question: why mhi_ac_ctrl_core.loop only when MQTT connected? #144

Closed
glsf91 opened this issue Apr 16, 2023 · 3 comments
Closed

Question: why mhi_ac_ctrl_core.loop only when MQTT connected? #144

glsf91 opened this issue Apr 16, 2023 · 3 comments

Comments

@glsf91
Copy link
Collaborator

glsf91 commented Apr 16, 2023

@absalom-muc
I have a question about:

  if((MQTTStatus==MQTT_RECONNECTED)|(MQTTStatus==MQTT_CONNECT_OK)){
    //Serial.println("MQTT connected in main loop");
    int ret = mhi_ac_ctrl_core.loop(80);
    if (ret < 0)
      Serial.printf_P(PSTR("mhi_ac_ctrl_core.loop error: %i\n"), ret);
  }

I understand MQTT is needed for publishing values and for receiving Troom and other commands.
But if for example a DS18B20 is connected it should also work without MQTT (or even WiFi). Also when using Troom from MQTT it can continue operating with the internal AC temp sensor instead of aborting and let the AC poweroff after 120s when no (temporarily) MQTT/WiFi connection. The AC powering off because of the 120s no response when I'm not at home or sleeping is, I think, not desired.
I think there is no need to abort responding to the MOSI packets if MQTT is not connected (temporarily) anymore.

Is there a specific reason why the mhi_ac_ctrl_core.loop(80) is only called when MQTT is connected ?
Any objections when I change this ?

@absalom-muc
Copy link
Owner

Switching off the AC after 120 seconds w/o SPI communication is - as far as I know - a safety feature. It should prevent a working AC when the user has no more control.
We had in the past already discussions if this feature is a must because several users had the problem that the WiFi/MQTT connection was unstable and this led to switching off the AC after 120 seconds. From my point of view it is a useful feature and effort should be spend for increasing the WiFi/MQTT stability. I can't judge if this feature is a must for safety and if there are rules/standards requiring it.

If you intend to deactivate it, I suggest you make a switch and leave it up to the user if he wants to use the feature or not. In this context please make clear in the description that there might be some safety implication and that the deactivation of this feature is on his own risk.

@glsf91
Copy link
Collaborator Author

glsf91 commented Apr 17, 2023

Thanks.
I think this is depending of a user his situation. Not for every user (like me) Wifi/MQTT is essential.
I will take a look and if I'm going to change it, I will make a switch and keep default current behavior.

@glsf91
Copy link
Collaborator Author

glsf91 commented Apr 24, 2023

Added to pull request #145

@glsf91 glsf91 closed this as completed Apr 24, 2023
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