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

Publish weather data via MQTT messages #3

Closed
adenoz opened this issue Jan 8, 2023 · 1 comment
Closed

Publish weather data via MQTT messages #3

adenoz opened this issue Jan 8, 2023 · 1 comment
Assignees
Labels
core Basic core functionality
Milestone

Comments

@adenoz
Copy link
Member

adenoz commented Jan 8, 2023

This is core functionality.

To do this, we'll also need a seperate configuration file to set broker details. This is done, in #4

We'll also need to determine topic naming conventions.

Data should probably also be published with one data point to one topic rather than have one MQTT payload with all data in one json message. This will allow for easier later saving of MQTT messages into a database.

@adenoz adenoz added this to the v0.1 milestone Jan 8, 2023
@adenoz adenoz self-assigned this Jan 8, 2023
@adenoz adenoz added the core Basic core functionality label Jan 8, 2023
@adenoz
Copy link
Member Author

adenoz commented Jan 11, 2023

This is now complete. All current weather is now published via hard coded mqtt topics. Later, this should become user configurable but for now it is all working. The program will not allow erroneous data types to be published which is part of the strong data types used via the structs and match statements.

The current mqtt topics, with associated data, are as follows:

  • outside/weather/current-temp
  • outside/weather/temp-feels
  • outside/weather/min-temp
  • outside/weather/max-temp
  • outside/weather/humidity
  • outside/weather/rain-today
  • outside/weather/wind-kms
  • outside/weather/wind-kts
  • outside/weather/wind-dir

The mqtt client is 'rusqttbom'.

One final wrinkle, so far I haven't been able to get the mqtt broker port to take a variable from the configuration file so that is currently hard coded. However, the mqtt broker IP address is read in from the config.toml file.

@adenoz adenoz closed this as completed Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Basic core functionality
Projects
Status: Done
Development

No branches or pull requests

1 participant