Skip to content

Adding MQTT control and new weather features #81

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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

robotfishe
Copy link
Contributor

@robotfishe robotfishe commented Dec 16, 2023

This PR adds the ability to show forecast as well as current weather. It uses two new variables: weatherMode and weatherTime. weatherMode can be set to 0 (current), 1 (hourly forecast), or 2 (daily forecast); weatherTime sets the number of hours or days to look ahead. For example, if you want the forecasted weather one hour from now, set both weatherMode and weatherTime to 1.

I am not confident of my ability to edit the web GUI, so for now these settings can only be changed via websocket or the second contribution in this PR: MQTT control.

Three MQTT settings are currently available. Topics are "Obegraensad/mode" (changes the plugin), "Obegraensad/weatherMode", and "Obegraensad/weatherTime" (as above). Messages must be integers.

This PR also splits the weather loop into a tick-tock setup, getting updated JSON data on one loop and parsing it on the next, to avoid CPU watchdog timeouts.

@robotfishe
Copy link
Contributor Author

It got cold enough here this week that I noticed an issue with how the weather plugin manages negative numbers - now fixed.

@OldDroid
Copy link

@robotfishe The whole PR is messed up. Please do one with proper commit history and one pr per feature - you simply cant keep track.. I had trouble yesterday implementing your solution because it looks like some things are specifically just implemented for esp8266 instead of making it available for both esp32 and esp8266. So i looked into your code and just merged your MQTT support in my local workspace.

@mrueg
Copy link
Contributor

mrueg commented Oct 16, 2024

mqtt support would be nice. Any plans to continue on this PR?

@robotfishe
Copy link
Contributor Author

mqtt support would be nice. Any plans to continue on this PR?

Not after the attitude I got from OldDroid in that last comment. Feel free to download my files and see if they work for you, and I'm happy to answer any questions.

@eskan
Copy link

eskan commented Dec 6, 2024

@robotfishe as a french guy sometimes my english is not fair as i would have. I think @OldDroid wanted to say that your PR is too big and doesn't reflect best git practice that offer good maintenability effort and code review. Of course its more work (to you :D ) but your work is very interesting so please reconsider to submit it in another more clean way (means one small PR on one functionality) ... We're all from culture and different country i don't think (here) people want to be discourteous.

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.

5 participants