Sorry, this might be a silly question, but how do i initially connect to a mysql db😔? After installing the mysql client app in homey, i wanted to create a flow, however when adding a card, i dont have the choice of the mysql object, neither in the ‘if’ nor in the ‘then’ section…thanks for your help!
With test version 0.0.7 you can use a SQL query in flow conditions. Select one (!) field from your DB table and use the result (as number or text) in a flow condition. Compare numbers (greater or lower-equal; equal or not equal) or text (equal or not equal).
Too easy … it’s not a bug, but a misinterpretation of your field value by SQL.
You missed the quotes around your date value… See the example in post #2:
With quotes, the date is inserted as string in the format “2022-05-12” and the database is reading this as a valid date.
Without quotes, you will get 2022-05-12 and SQL is interpreting as numbers with substraction - and you get 2005 as result.
So please add quotes arounf the date and it should store the correct date.
Please use simple single quotes, no apostrophe.
Double quotes should be ok, too. But don’t use special Unicode characters. That does not correspond to the SQL syntax.
token update (synchron to work with toke in the next condition).
timezone fix for [date] calculation. The timezone was added two times. That results in a duplicated offset which could affect the result date if the second timezone offset is hitting the 0:00 border.
Why write time related entries to an SQL database? Why not use the influxdb app to export all values to an influxdb instance? Then you dont have to create flows to export values, if a device exists, the info is exported
I do see added value in the possibility to write information to a mysql database, but for an alternative of Insights is the influx app and influxdb much better (including grafana for making dashboards, which can show info from both DB’s).
For status information between enviroments is mqtt a very good choice.