To have the script start on boot:
Create a file call switchbot.service
at /etc/systemd/system
add these text to the switchbot.service file. Make sure you change the path to the switchbot.js file base on your setup.
# Switchbot
[Unit]
Description=switchbot.js - Switchbots
After=network.target
[Service]
Type=simple
User=root
ExecStart=/usr/local/bin/node /home/pi/bin/mqtt/switchbot/switchbot.js
Restart=on-failure
[Install]
WantedBy=multi-user.target
Run this cmd to have the script start on every boot.
sudo systemctl enable switchbot.service
i can solve it for the curtain, but running the URL shell_command multiple times.
I am getting this as well. The author has mentioned this and am aware of it. Though there is no fix. I think it is a limitation of the BT on the PI?. A suggestion was to create a longer scan time, but I don’t think this will solve it.
Interference may be another possibility. I run Monitor on a different pi and I notice that pi picks up quite a few BT devices at different intervals. These BT devices are not mine.
How far is the bot to the pi?