Read from MySQL table on Raspberry Pi

Hi all

Ok, so I started my home automation journey by building a dashboard on my Pi that did various things like controlling lights and heating using Flask/Python.

One of the things it does is occupancy detection using BLE by scanning for the MAC addresses of our mobile phones and writing the result to a MySQL table.

My goal would be to read that data into Smartthings and display the data maybe like sensors to show who’s in and out.

Is this doable, or am I barking up the wrong tree for what ST can achieve.

Yes, this is possible. Bits and pieces of what you want to do are scattered cross the forum. You are def going to have to write your own smart app and most likely custom devices as well. I think it would be easier and cheaper to set up a solid Zigbee mesh and use the Zigbee presence sensors, but if you’re looking for a challenge what you have describe will fit that bill nicely.
I wish you the best of luck on your endeavor.

Thanks @sidjohn. Yeah, I know there would be much simpler ways of doing it :slight_smile: But there’s no fun in that.

I’ve already got the Pi doing the BLE bit and writing to the database so it just seemed a waste to not use it for something. I did have Hive heating which has an API so I could turn the heating down when the house was empty and things like that - all written in Python - which worked well. I’ve now swapped to a Netatmo thermostat and ultimately want to see if I can do the same with Smartthings.

I’d be happy just displaying a tile with “Hello world” to start with!