Skip to content

Collect data from SwitchBot MeterTH S1 with Windows Powershell (Python, Bleak, BT 4.0 BLE)

Notifications You must be signed in to change notification settings

cesar93600/SwitchBot_Thermometer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

SwitchBot_Thermometer

Collect data from SwitchBot MeterTH S1 with Windows Powershell (Python, Bleak, BT 4.0 BLE)
SwitchBot Thermometer and Hygrometer (FCC ID : 2AKXB-METERTH1)

Requirements (Windows)

  • Bluetooth Adaptater 4.0 BLE or USB BT Dongle 4.0 (BLE : Bluetooth Low Energy)
  • Pyhton 3
  • Bleak

Installation (Powershell)

# Pyhton 3
wget "https://www.python.org/ftp/python/3.10.7/python-3.10.7-amd64.exe" -OutFile ".\python-3.10.7-amd64.exe"
.\python-3.10.7-amd64.exe

# Bleak
pip install bleak

# SwitchBot_Thermometer
cd "$env:LOCALAPPDATA\Programs\Python\Python310\Lib\site-packages\bleak\"
wget "https://raw.githubusercontent.com/cesar93600/SwitchBot_Thermometer/main/SwitchBot.py" -OutFile ".\SwitchBot.py"

# Activate your Bluetooth before execution Script
py -3 ".\SwitchBot.py"

Usage (Powershell)

$SwitchBot = $(py -3 ".\SwitchBot.py")
# JSON Output : {'Meter': 'SwitchBot MeterTH S1', 'Mac': 'EA:73:76:7F:55:2C', 'Temperature': 20.1, 'Humidity': 55, 'Battery': 100}

# Convert to Object
$SwitchBot = ConvertFrom-Json($SwitchBot)

# Get Object Properties
$SwitchBot.Meter
# Output : SwitchBot MeterTH S1

Sources

About

Collect data from SwitchBot MeterTH S1 with Windows Powershell (Python, Bleak, BT 4.0 BLE)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages