当前位置:网站首页>Meizu Bluetooth remote control temperature and humidity access homeassistant

Meizu Bluetooth remote control temperature and humidity access homeassistant

2022-07-05 08:24:00 Sharing master

Meizu remote control purchased three , With the efforts of the forum God , Now connected to homeassistant.

1. Download plug-ins , Put it in custom_components/meizu_hygrothermo

git resources

2. install bulepy

  sudo apt-get install python3-pip libglib2.0-dev

  apt-get install -y python3-setuptools

  sudo apt-get install git build-essential libglib2.0-dev

  git clone https://github.com/IanHarvey/bluepy.git

  cd bluepy

  python3 setup.py build

  sudo python3 setup.py install

3. Add to boot process
Write the script in /etc/rc.local file
Enter the command :
sudo vi /etc/rc.local
stay exit 0 Enter on the previous line :
python3 /bluepy/gateway.py( You put gateway.py Path to file )
preservation
Restart to see the effect

4. Use your charm home app Rename the connected Bluetooth 1、2、3……

5. The configuration file

sensor:

  - platform: meizu_hygrothermo

    name: keting #1 

    host: '192.168.99.5' # Be the server of Bluetooth gateway ip, The project is to write gateway mac, I test with ip Can only be

    mac: '68:3E:34:CC:D3:44' # Meizu Bluetooth mac Address

    scan_interval: 30

  - platform: meizu_hygrothermo

    name: zhuwo #2

    host: '192.168.99.5'

    mac: '68:3E:34:CC:DE:D2'

    scan_interval: 30    

homeassistant:        

  customize:

    sensor.keting_humidity:

      friendly_name: Humidity in living room

    sensor.keting_temperature:

      friendly_name: The temperature in the living room     

    sensor.zhuwo_humidity:

      friendly_name: Humidity in master bedroom

    sensor.zhuwo_temperature:

      friendly_name: Master bedroom temperature        

 

group:

  huanjing:      

    name: Indoor environment

    view: no

    entities:

      - sensor.keting_humidity

      - sensor.keting_temperature

      - sensor.zhuwo_humidity

      - sensor.zhuwo_temperature

sudo reboot

6. Configure Bluetooth

bluetoothctl

stay [bluetooth]# Input... In mode
power on # Turn on Bluetooth
scan on  # scanning , Enter this command and you will see your Meizu Bluetooth mac 了

agent on   # open agent, I don't know this either
trust [BT mac address] # Trust Bluetooth mac
pair [BT mac address] # I don't know what it is ,pair A space followed by your Meizu Bluetooth mac, If you want to connect several, just separate pair xx:xx:xx........
connect [BT mac address] # Connect Meizu Bluetooth , Also connect several , Just connect them separately .
quit # sign out bluetoothctl
reboot # restart N1

The effect is as follows

原网站

版权声明
本文为[Sharing master]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202140544214152.html