Skip to content
cflurin edited this page Aug 5, 2016 · 8 revisions

Welcome to the homebridge-mqtt wiki!

Homebridge <-> ESP8266

Example: Temperature Sensor ds18b20

  • Install ESP Easy, Build 108 or newer.

  • Open ESP Easy and add a Device:

Device: Temperature - DS18b20
Name: esp18b20
Delay: 300
Value Name 1: temperature

note: the temperature value is sent with an interval of 300 seconds, change the setting as required.

  • In Tools > Advanced select Rules.

  • Open the tab Rules and add this code:

on ds18b20#temperature do
  Publish homebridge/to/set,{"name":"esp_temp","characteristic":"CurrentTemperature","value":[ds18b20#temperature]}
endon
  • Add the accessory to homebridge-mqtt e.g. with node-red:
topic: homebridge/to/add
payload: {"name":"esp_temp","service":"TemperatureSensor"}

or use mosquitto_sub:

musquitto_pub -h 127.0.0.1 -t homebridge/to/add -m '{"name":"esp_temp","service":"TemperatureSensor"}'

Replace 127.0.0.1 with the ip-address of your mqtt broker.

Clone this wiki locally