-
Notifications
You must be signed in to change notification settings - Fork 183
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
How save name MQTT topic to mysql #334
Comments
@company-ms Ignore my comment, I'd not woken up. I'm trying your example now. |
Shall we assume that "body MQTT topic" means the MQTT payload? Question is also in which format is that payload, or should it just be put raw into the database? |
@company-ms While setting up the mysql target is not easy, add the topic to your table is. Just add a column called I created my table with that column: I sent this message: And got:
To test my theory, I added a I did not change mqttwarn's config, or restart it. I simply sent the same message, and this was my table:
|
Example my topic which telemetry ( "/79037***/dht/ 23.5 ) - save all to mysql . Now only save 23.5 |
One more test:
So it would seem a column with one of the names of the 'transformation data' fields will cause them to be stored automatically as strings. (I tried making '_dtsio' a timestamp column, but then the value is not set.) |
@rgitzel I think MySQL TIMESTAMP should work if our |
@jpmens I added some logging:
So, no. Some quick googling shows lots of people complaining that they can't insert an ISO-8601 timestamp directly. |
So we leave it as is, or we create a |
Dangerous territory though if we have to start mucking about with timezones. That is one thing we won't do. Zulu (UTC) or bust. |
@jpmens I don't see a need for it at the moment. That said, I'm not using MySQL so I'm biased. ;-) If someone needs it, they can ask. In meantime, I'll update the docs so it's more obvious. Then someone might pipe up. |
The
|
@rgitzel perfect, thank you. |
Hello all!
I want save body MQTT topic to mysql.
How to implement this in mqttwarn.ini ?
My mqttwarn.ini:
The text was updated successfully, but these errors were encountered: