spbrogan / mopeka_pro_check

Python code to read the Mopeka Pro Check Tank Sensor
Other
16 stars 8 forks source link

Cloud polling? #2

Closed borski closed 3 years ago

borski commented 3 years ago

Hi! I'm about to place an order for a couple Mopeka sensors and noticed they had a Wireless bridge. I'm planning on ordering that - have you given any thought to writing an integration for that? If not, perhaps I'll get started on it once I have it. :)

spbrogan commented 3 years ago

I think it would be totally different. Most of the code here is about decoding a BLE advertisement packet and then turning that into a python object. This obviously doesn't require an active internet connection. In fact this project doesn't even depend on anything related to HA. For cloud polling you might use the other part of the project (https://github.com/spbrogan/sensor.mopeka_pro_check) to turn a python object into an HA sensor. The python object would have to come from some new component that queries the cloud server using its API. Anyway if you do something related let me know but I think there might be better starting points like using mqtt. Good luck.

borski commented 3 years ago

Okay, now that I’ve gotten it and have played with it, reversing the AWS Cognito stuff is taking longer than I’d hoped.

What do you run this on? What’s your hardware setup? Are you running something near the sensor or is your HA instance just close enough to it to hear the advertisements?

spbrogan commented 3 years ago

These two projects are designed to run on the HA instance with BLE. I have a rpi (3 and 4 both work) that is my HA and it just runs on that. Since this is for an RV everything is close enough. I am thinking about setting up an esp32 to read the advertisements and then use mqtt to report the data over wifi but I haven't started that. For me this would be useful for my house because i don't want to have HA instances scattered around the back yard.

spbrogan commented 3 years ago

@borski - I did end up writing an EspHome component which reads the BLE and connects them to HA over wifi.
See here: https://github.com/spbrogan/esphome/tree/spbrogan/add_mopeka_pro_check_v1/esphome/components/mopeka_pro_check

hopefully i'll get it into the official EspHome 2021.10.x