Git Product home page Git Product logo

go-tion's Introduction

Tion Breazer 3S Go API and Clients

There are thee backend available:

Pairing

Device must be paired. E.g. using bluetoothctrl

Reading state

    t = tionm.New("MAC")
    ts.t.Connect(timeout)
    defer ts.t.Disconnect()
    s, err := ts.t.ReadState(timeout)
    fmt.Println(s)

Tion Breazer Home Assistant MQTT integration

Sensors

- platform: mqtt
  name: "Temperature Inside (Tion)"
  state_topic: "nn/tion"
  value_template: "{{ value_json.temp_out }}"
  availability_topic: "nn/tion-aval"
  icon: "mdi:thermometer"
  unit_of_measurement: '°C'

- platform: mqtt
  name: "Temperature Outside (Tion)"
  state_topic: "nn/tion"
  value_template: "{{ value_json.temp_in }}"
  availability_topic: "nn/tion-aval"
  icon: "mdi:thermometer"
  unit_of_measurement: '°C'

- platform: mqtt
  name: "Temperature Target (Tion)"
  state_topic: "nn/tion"
  value_template: "{{ value_json.temp_target }}"
  availability_topic: "nn/tion-aval"
  icon: "mdi:thermometer"
  unit_of_measurement: '°C'

- platform: mqtt
  name: "Speed (Tion)"
  state_topic: "nn/tion"
  value_template: "{{ value_json.speed }}"
  availability_topic: "nn/tion-aval"
  icon: "mdi:fan"

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

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

go-tion's People

Contributors

m-pavel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

go-tion's Issues

Expecting 20 bytes array. Got 1

Hi there!
First of all, thanks for your project, it's been working perfectly stable!.. until today, when the short circuit happened in my flat and the entire electrical system was down. After restoring it, I notices that the go-tion (running via MQTT on a separate machine inside a docker container) seemed broken: container works, the app is running, but no updates in MQTT broker. Well, actually there ARE updates, but only about "offline" status in "nn/tion-aval" topic.
I've rebooted everything but still getting these errors in logs:

MQTT WARNING  22:31:50 memstore.go:137: [store]    memorystore wiped
2020/12/19 22:31:50 hassio.go:260: MQTT Connected to cube:1883. Topic is 'nn/tion'. Control topic is 'nn/tion-control'. Availability topic is 'nn/tion-aval'
2020/12/19 22:31:51 hassio.go:187: Starting main loop with 30 s. interval.
2020/12/19 22:32:21 hassio.go:202: [0] R6: Expecting 20 bytes array. Got 1
2020/12/19 22:32:52 hassio.go:202: [1] R6: Expecting 20 bytes array. Got 1
2020/12/19 22:33:22 hassio.go:202: [2] R6: Expecting 20 bytes array. Got 1
2020/12/19 22:33:53 hassio.go:202: [3] R6: Expecting 20 bytes array. Got 1
2020/12/19 22:34:23 hassio.go:202: [4] R6: Expecting 20 bytes array. Got 1
2020/12/19 22:34:54 hassio.go:202: [5] R6: Expecting 20 bytes array. Got 1
2020/12/19 22:35:24 hassio.go:202: [6] R6: Expecting 20 bytes array. Got 1
2020/12/19 22:35:54 hassio.go:202: [7] R6: Expecting 20 bytes array. Got 1
2020/12/19 22:36:25 hassio.go:202: [8] R6: Expecting 20 bytes array. Got 1
2020/12/19 22:36:55 hassio.go:202: [9] R6: Expecting 20 bytes array. Got 1
2020/12/19 22:37:26 hassio.go:202: [10] R6: Expecting 20 bytes array. Got 1
2020/12/19 22:37:56 hassio.go:202: [11] R6: Expecting 20 bytes array. Got 1
2020/12/19 22:38:26 hassio.go:202: [12] R6: Expecting 20 bytes array. Got 1
2020/12/19 22:38:57 hassio.go:202: [13] R6: Expecting 20 bytes array. Got 1
2020/12/19 22:39:27 hassio.go:202: [14] R6: Expecting 20 bytes array. Got 1
2020/12/19 22:39:57 hassio.go:195: Fail limit reached (15). Exiting.

Could you please help me to solve this issue?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.