1
2
mirror of https://github.com/vimagick/dockerfiles synced 2024-06-20 22:08:39 +00:00

update hass (ibeacon)

This commit is contained in:
kev 2017-04-23 11:24:50 +08:00
parent db2e3d5d5a
commit afb6a813cf
3 changed files with 35 additions and 1 deletions

@ -130,6 +130,15 @@ kevin_android:
vendor: unknown
```
## setup ibeacon
Use `vimagick/hass:latest`, and disable bluetooth device tracker.
- https://home-assistant.io/blog/2016/04/30/ibeacons-part-1-making-presence-detection-work-better/
- https://home-assistant.io/blog/2016/05/26/ibeacons-how-to-track-things-that-cant-track-themselves-part-ii/
- http://owntracks.org/
- https://play.google.com/store/apps/details?id=de.flurp.beaconscanner.app&hl=en
[1]: https://home-assistant.io/
[2]: https://home-assistant.io/components/device_tracker/
[3]: http://api.map.baidu.com/lbsapi/getpoint/index.html

@ -1,5 +1,5 @@
hass:
image: easypi/hass-arm:debian
image: easypi/hass-arm
volumes:
- ./data:/etc/hass
net: host

25
hass/arm/ibeacon.service Normal file

@ -0,0 +1,25 @@
# /etc/systemd/system/ibeacon.service
[Unit]
Description=iBeacon Service
Requires=bluetooth.service
After=dbus-org.bluez.service sys-subsystem-bluetooth-devices-hci0.device
[Service]
Type=oneshot
Environment="UUID=88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88"
Environment="MAJOR=00 00"
Environment="MINOR=00 00"
Environment="POWER=C8 00"
ExecStart=/bin/hciconfig hci0 up
ExecStart=/bin/hciconfig hci0 noscan
ExecStart=/usr/bin/hcitool -i hci0 cmd 0x08 0x0008 1E 02 01 1A 1A FF 4C 00 02 15 $UUID $MAJOR $MINOR $POWER
ExecStart=/usr/bin/hcitool -i hci0 cmd 0x08 0x0006 A0 00 A0 00 03 00 00 00 00 00 00 00 00 07 00
ExecStart=/usr/bin/hcitool -i hci0 cmd 0x08 0x000a 01
# See: http://stackoverflow.com/questions/21124993/
# ExecStart=/bin/hciconfig hci0 leadv 3
ExecStop=/bin/hciconfig hci0 noleadv
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target