GetTemperatureSensordataviaMQTTinHomebridge
Installationsudonpminstall-ghomebridge-mqtt-temperatureSampleHomeBridgeConfiguration{"bridge":{"name":"HomeBridge","username":"CC:33:3B:D3:CE:32","port":51826,"pin":"321-45-123"},"description":"","accessories":[{"accessory":"mqtt-temperature","name":"LivingRoomTemperature","url":"mqtt://localhost","topic":"home/livingroom/temperature/value","refresh_topic":"home/livingroom/temperature/get""batt_topic":"home/livingroom/temperature/battery","charge_topic":"home/livingroom/temperature/charge","batt_low_perc":"33","username":"username","password":"password","maxTemperature":"75","minTemperature":"-25","serial":"HMT-34932B"}],"platforms":[]}maxTemperatureandminTemperatureallowyoutochangethedefaulthighandlowtemperatures.
serialallowsyoutochangetheserialnumbertoacustomvalueifyouneedit.
batt_topic,charge_topicandbat_low_percareforbatterypoweredsensors.
batt_low_percoverridesthedefault20%value.charge_topicisforchargingstate.Itrequiresvaluesofeither0or1foroffandonrespectively.refresh_topicletsyoupublishtoatopictorefreshthecurrenttemperaturevalue.Thisisusefulincaseswhereyourdevicepublishesinfrequentlyandyouneedanupdatebetweenintervals.Itrequiresyourdevicetomonitorthistopicforrequests.Arequestwillpublishedeverytimehomebridgemakesarequest,forexampleonopeningtheapp.
Allsevenoptionsareareoptionalaswellasusernameandpasswordifyoudon'tuseMQTTauthentication.
Creditshomebridge-mqttswitch
homebridge-mqttgaragedoor
homebridge-ds18b20
评论