m-pavel / go-tion

Tion Breazer golang API
Apache License 2.0
22 stars 4 forks source link
mqtt tion-breazer

Tion Breazer 3S Go API and Clients

There are thee backend available:

## Control channel
Turn on/off
{
  "payload_template": "{% if is_state('binary_sensor.tion' , 'off') %} \n  { \"on\": true }\n{% else %}\n  { \"on\": false }\n{% endif %}\n",
  "qos": 1,
  "topic": "nn/tion-control"
}
## Building
make GOARCH=<target arch> IMPL=<backend implementation>
GOARCH - https://golang.org/doc/install/source#environment

IMPL - one of below
  - muka https://github.com/muka/go-bluetooth backend implementation, default
  - ppal
  - gatt 
  - fake 
  - mqtt 
## Magic
 When getting 'Unexpected response length' with muka driver, run once with ppal driver
 In fact it performs adaptor reset like below

sudo hciconfig hci0 up sudo hciconfig hci0 reset sudo hciconfig hci0 down sudo hciconfig hci0 up