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 archive and loop records to different topics when both are bound #19

Open
tvandyck opened this issue Apr 16, 2021 · 2 comments
Open

Comments

@tvandyck
Copy link

I tried binding to both loop and archive. But I dont know why they are both send to the weather/loop topic, which makes it (in my case) not very useful.
The reason I wanted to do this is to have frequent updates on one topic for websocket to website connection.
And less frequent updates on another topic that is monitored to be written to a database.
I'm not sure what you think?

@dersgniw
Copy link

Have you happened to figure out a way around this?

@tvandyck
Copy link
Author

The workaround I found is to learn python, then write a small python script that runs every 5 minutes (using crontab) and does the following:

  1. sleep for 10 seconds to make sure the archive record is written to the DB
  2. get the last archive record from the weewx DB and convert it to a json object
  3. publish the archive json object to MQTT on a weather/archive topic

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