This is a custom component for Home Assistant that allows the control of the Petoneer SmartDot via bluetooth.
This custom component can be installed in two different ways: manually
or using HACS
This repo is now in HACS.
- Install HACS follow the instructions here
- Search for
Petoneer SmartDot
- Install and enjoy automatic updates
- Download the zip file from the latest release.
- Unpack the release and copy the
custom_components/petoneer_smartdot
directory into thecustom_components
directory of your Home Assistant installation. - Ensure bluez is installed and accessible from HA (refer to next section)
- Add the
petoneer_smartdot
as described in next section.
Since version 1.0.0, this component uses the bleak
python library to access bluetooth (as bluepy is not supported from HA 2022.07+). In order to scan and interact with bluetooth devices, bluez utility needs to be installed and the correct permissions must be given to HA:
-
for Home Assistant Operating System: It should be all setup, at least for HA 2022.7+
-
For Home Assistant Container in docker:
Ensure your host has the
bluetoothctl
binary on the system (coming frombluez
orbluez-util
package, depending on the distro). The docker-compose container (or equivalent docker command) should link /var/run/dbus with host folder through a volume and NET_ADMIN permission is needed. docker compose extract:volumes: - /run/dbus:/run/dbus:ro cap_add: - NET_ADMIN - NET_RAW network_mode: host
-
For Home Assistant Core installed in a Virtualenv:
Ensure your host has the
bluetoothctl
binary on the system (coming frombluez
orbluez-util
package, depending on the distro). Make sure the user running HA belongs to thebluetooth
group.
You must have the bluetooth
integration enabled and configured (HA 2022.8+) or a connected ESPhome device running the bluetooth proxy (HA 2022.10+). The Petoneer SmartDot should be automatically discovered and you will receive a notification prompting you to add it.
The devices can also be added through the integration menu
UI:
- In Configuration/Integrations click on the + button, select
Petoneer SmartDot
and you can either scan for the devices or configure the name and mac address manually on the form. The SmartDot is automatically added and a device is created.
Please ensure the following steps prior to adding a new SmartDot:
- The SmartDot must NOT be connected with the official app (or any other device), else HA will not be able to discover it, nor connect to it.
- Some HA integrations still use some bluetooth libraries that take full control of the physical bluetooth adapter, in that case, other ble integration will not have access to it. So to test this component, best to disable all other ble integrations if you are unsure what ble lib they are using.
Unfortunately, the Petoneer SmartDot does not have a feedback function. Therefore, it is not possible to obtain the current state (on/off).
After installing the integration, you will be able to choose the size of the area within which the dot will move, and there will be two buttons for starting and stopping the dot's movement.
Unfortunately, at some point the manufacturer changed the interaction protocol with the Petoneer Smart Dot. Currently, I have not been able to figure out what the content of the Bluetooth packets that activate each type of game should be.
It is known for certain that this integration works with firmware version 1.09
and does not work with version 1.2
.
More detailed information is provided in the issue.
Please ensure the following:
-
The Petoneer SmartDot integration has been removed from HA.
-
HA has access to the bluetooth adapter (follow the section above in not on HAOS).
-
No other bluetooth integration are using something else than bleak library for bluetooth. If unsure, disable them.
-
The logging has been changed in HA to allow debugging of this component and bleak: In order to get more information on what is going on, the debugging flag can be enabled by placing in the
configuration.yaml
of Home assistant:logger: default: warning logs: custom_components.petoneer_smartdot: debug bleak_retry_connector: debug bleak: debug # homeassistant.components.bluetooth: debug # this can help if needed # homeassistant.components.esphome.bluetooth: debug # this can help if needed
NOTE: this will generate A LOT of debugging messages in the logs, so it is not recommended to use for a long time
-
Restart HA
-
Reinstall the Petoneer SmartDot integration and find the SmartDot through a scan.
-
Check the logs and report. Thanks
Originally based on the work by Marco Colombo hass-addon-petoneer-smartdot.