piBeacon: 24 - using switchbot family of devices

Posted on
Sun Jul 11, 2021 7:14 pm
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

piBeacon: 24 - using switchbot family of devices

To start w the main objective: to be able to restart a mac (mini) after power failure and soft shutdown, but we added (almost) all switch bot devices

here the list of all supported switchbot devices
  • They all support battery level states
  • They all benefit from having "brother" devices - the beacons device types for each one besides the sensor/ output devs in indigo.
  • They expose mac number and battery level etc. They share that info with the output devices
These devices all send and receive bluetooth messages. The RPI's will be talking bluetooth with them and send / receive commands/ status from to indigo
For the output devices: curtain & bot you need an extra BLE dongle besides the internal bluetooth
not supported is the humidifier, may be in winter when I need one. Now a de-humidifier would make sense

  • indigo sensor dev: temperature + humidity, populates states: temperature, humidity, battery,..
  • indigo sensor dev: contact, populates states: onoff, last open, short open, long open, light, button press count ..
  • indigo sensor dev: motion, populates states: onoff, last motion, light, ...
  • indigo dimmer dev: curtain, you can set mode : slow, fast, and set position of the device between 0/100 = open/closed
    a curtain can be operated with an ssh command, eg through iPhone shortcut
      ssh pi@ip#
      echo '{"mac":mac#,"pos":"0...100"}' > temp/switchbot.cmd (for absolute position)
      echo '{"mac":mac#,"pos":"open"}' > temp/switchbot.cmd (for moving to open )
      echo '{"mac":mac#,"pos":"close"}' > temp/switchbot.cmd (for moving to close)
      echo '{"mac":mac#,"pos":"pause"}' > temp/switchbot.cmd (for stopping any move)
    - only o/c/p are needed (not open close pause and the commands are case neutral)
  • indigo relay dev: bot, you can set modes up/down/ inverse, and send on/ off (down / up) commands
      a bot can be operated with an ssh command, eg through iPhone shortcut
    ssh pi@ip#
    echo '{"mac":mac#,"onOff":"1/0"}' > temp/switchbot.cmd
    then you can switch the bot on/off through the plugin or through you iPhone remotely w a shortcut
Here is how to connect the switchbot bot to a mac mini
You need a block of wood broad enough to hold the bot. Attach the bot to the wood as shown with a double sticky tape
Then put a double sticky tape on the bottom of the flat side of the wood and adjust to the top of the mac mini so that it presses the button when it is set to on.
Set the "hold" time for the bot to 4 seconds. That allows it to turn the mac off (you need to press and hold for 4 secs) as well as restart it = switch it on.


Karl
Attachments
Screen Shot 2021-07-11 at 20.03.36.png
Screen Shot 2021-07-11 at 20.03.36.png (224.95 KiB) Viewed 5545 times
Screen Shot 2021-07-11 at 20.03.50.png
Screen Shot 2021-07-11 at 20.03.50.png (295.31 KiB) Viewed 5545 times

Posted on
Tue Jul 13, 2021 10:43 am
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: 24 - using switchbot family of devices


Posted on
Tue Jul 13, 2021 2:33 pm
Korey offline
User avatar
Posts: 813
Joined: Jun 04, 2008
Location: Henderson, NV

Re: piBeacon: 24 - using switchbot family of devices

Nice work Karl!!

:D :D

--
Korey

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 8 guests

cron