Custom Component: Adhoc Mysql Queries

I really wanted something like this for a long time and never found a working one – I have automations I needed to write to various local mysql/mariadb databases from for custom workflows bouncing data around between HA and other web services.

I wrote the quickest, dirtiest one I could manage, it basically let’s you execute any query you want against any database you specify. it’s intended for power users, I guess you could say, because you could really do some damage if you don’t know what you’re doing with it.

if you do, then maybe this will be some use.

right now i have a flow from IFTTT where a trip ending automation there is triggered by bouncie – the info that comes direct from the bouncie API (which kind of sucks) is not great so I had to use IFTTT, that calls a webhook to my HASS instance with the trip details and now I can put this component in that automation which is triggered by the webhook to write the data to my own database. I’m a data horder.

It’s very simple and straight forward and there’s not much to it, and I don’t code very often in python, but many other things, I’m just throwing it out there because some people here helped me figure it out and it seems right to share it back.

thanks.

1 Like