Skip to content

Commit 883510a

Browse files
committed
Update README and document new config options
1 parent 7a3853f commit 883510a

File tree

3 files changed

+24
-7
lines changed

3 files changed

+24
-7
lines changed

README.md

+10
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,16 @@ sudo hciconfig hci0 up
387387
See https://github.com/sandeepmistry/bleno
388388

389389

390+
Home Assistant Integration
391+
--------------------------
392+
393+
Follow the instructions at https://www.home-assistant.io/integrations/mqtt/ to enable Home Assistant to use an external MQTT broker. Assuming you're running on the same device as EspruinoHub, use `localhost` as the IP address for the MQTT server.
394+
395+
Ensure that `homeassistant` is set to `true` in EspruinoHub's `config.json`. It's currently the default.
396+
397+
Now, in the Home Assistant main page you should see new Sensors and Binary sensors which match any devices that EspruinoHub has found!
398+
399+
390400
Troubleshooting
391401
---------------
392402

config.json

+14-4
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,23 @@
5454
"password": "pass",
5555
"clientId": "clientid"
5656
},
57+
5758
"// Define the topic prefix under which the MQTT data will be posted. Defaults to /ble which is not adviced. For new installation, please activate the option below.":0,
5859
"//mqtt_prefix": "ble",
59-
"mqtt_advertise": true,
60-
"mqtt_advertise_manufacturer_data": true,
61-
"mqtt_advertise_service_data": true,
60+
61+
"// These are the types of MQTT topics that are created":0,
62+
63+
"// Send /ble/advertise/ad:dr:es:ss JSON with raw advertising data, as well as /ble/advertise/ad:dr:es:ss/rssi":0,
64+
"mqtt_advertise": false,
65+
"// Send /ble/advertise/ad:dr:es:ss/manufacturer/uuid raw manufacturer data as well as decoded /ble/advertise/ad:dr:es:ss/json_key for json-formatted 0x0590 advertising data":0,
66+
"mqtt_advertise_manufacturer_data": false,
67+
"// Send /ble/advertise/ad:dr:es:ss/uuid raw service data":0,
68+
"mqtt_advertise_service_data": false,
69+
"// Send /ble/json/ad:dr:es:ss/uuid for decoded service data - REQUIRED FOR HOMEASSISTANT":0,
6270
"mqtt_format_json": true,
71+
"// Send /ble/service_name/ad:dr:es:ss for decoded service data":0,
6372
"mqtt_format_decoded_key_topic": true,
73+
74+
"// Whether to enable Home Assistant integration":0,
6475
"homeassistant": true,
65-
"mqtt_cache_state": true
6676
}

lib/config.js

-3
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ exports.mqtt_advertise_service_data = true;
6262
exports.mqtt_format_json = true;
6363
exports.mqtt_format_decoded_key_topic = true;
6464
exports.homeassistant = false;
65-
exports.mqtt_cache_state = false;
6665

6766
function log(x) {
6867
console.log("[Config] " + x);
@@ -128,8 +127,6 @@ exports.init = function () {
128127
exports.mqtt_format_decoded_key_topic = json.mqtt_format_decoded_key_topic;
129128
if (json.hasOwnProperty("homeassistant"))
130129
exports.homeassistant = json.homeassistant;
131-
if (json.hasOwnProperty("mqtt_cache_state"))
132-
exports.mqtt_cache_state = json.mqtt_cache_state;
133130

134131
log("Config " + config_filename + " loaded");
135132
} else {

0 commit comments

Comments
 (0)