pvvx / THB2

Custom firmware for Tuya devices on the PHY622x2 chipset
Other
129 stars 14 forks source link

Standalone Android App #35

Open draekko opened 6 months ago

draekko commented 6 months ago

Not directly related to this firmware but related to the devices, got myself a BTH01, have managed to get the firmware installed (using v1.6 currently) but i was wondering if anyone had knowledge of an Android app to get the data without using Home Assistant or other home server setup and read the devices directly? Preferably open sourced.

My use case for using these is for on the go but after a couple of days of web searches i can't find anything that isn't related to home automation which all seem to require a server setup of some kind which i don't want or need.

Thanks in advance.

pvvx commented 6 months ago

https://apps.rustore.ru/app/ru.kompius.thermo_plung

image

draekko commented 6 months ago

Thanks, that'll get me started.

First full QT5 only app that i've seen ever for Android outside of Chinese apps.

Fits the bill for the basics, guess i'll have to write my own for the other functionality i had in mind. I'll let you know if i ever get anything good to share since i'd like to have something open sourced. Was looking at ArduNet for the basics to get me started for what i had in mind.

https://github.com/a2ruan/ArduNetApp

pvvx commented 6 months ago

BLE scanning works in WEB Bluetooth API on Android. That is, everything can be written in HTML + js.

https://googlechrome.github.io/samples/web-bluetooth/scan.html?namePrefix=BTH01

image

Format - BTHome v2

draekko commented 6 months ago

Thanks for the info, still new to the ble game.

draekko commented 6 months ago

Ended up with a quick and dirty forking of the Sensirion Smart Gadget app and the updated code is in a temprory repo here https://github.com/draekko/BLESensor

The app was super old so spent part of yesterday and all of this morning updating it, works ok to report temp & humidity and gives some charting but its rough and dirty hack to the code base to see whats going but at least it works standalone.

Will probably end up writing one from scratch over time because there aren't many safeguards for permission checks and since its got none of the back end service updates that newer androids require it really needs to be redone from scratch.

Its a nice app too bad they never updated it over the last 8 yrs LOL.

repo is here https://github.com/draekko/BLESensor

Screenshot_20240330_140840_BLE Sensor Screenshot_20240330_140845_BLE Sensor Screenshot_20240330_140857_BLE Sensor Screenshot_20240330_140909_BLE Sensor

draekko commented 6 months ago

OOOps i cropped out the viewpager out of the images by mistake ... oh well it gives an idea of what it looks like.

draekko commented 6 months ago

Oh and right now it only polls the device and it does so too often in my opinion but thats how the original code was, also before i forget it doesn't pull down any history from the device or do anything else.