Skip to content

Instantly share code, notes, and snippets.

View lizhineng's full-sized avatar

Li Zhineng lizhineng

View GitHub Profile
@lizhineng
lizhineng / cleargrass.js
Last active July 19, 2023 10:48
HomeBridge MQTT Thing Codec for ClearGrass CSG1 (AIRMX VERSION)
// The threshold to determine whether the battery is low
const LOW_BATTERY_THRESHOLD = 20
// The factor to convert TVOC in ppb to μg/m3
// @see https://leeduser.buildinggreen.com/content/my-device-measures-tvoc-ppb-units-how-do-i-convert-measurements-gm3
const TVOC_CONVERSION_FACTOR = 3.767
module.exports = {
init() {
return {
@lizhineng
lizhineng / response.json
Created July 15, 2023 03:46
Get index response from SLS API, those indices are created by Alibaba Cloud by default for Function Compute.
{
"index_mode": "v2",
"keys": {
"aggPeriodSeconds": {
"doc_value": true,
"type": "long"
},
"concurrentRequests": {
"doc_value": true,
"type": "long"
@lizhineng
lizhineng / airmx.md
Last active October 29, 2024 06:01
Communication with AIRMX MQTT server

Host

Host: tcp://mqtt.airmx.cn:1883

ClientID: amx_{device_id:19}

Android devices: Device ID can be grabbed from the file device_id.xml.xml in shared_prefs folder. ⚠️ Notices this device id is a identifier from your mobile phone, not the one your AIRMX equipment.

Credentials