SupportsHTTP/HTTPSdevicesonHomebridgePlatform.Thispluginrequires/usesasimpleinterfacewiththeenpoint(onlyasetcolorURIandagetcolorURI).IdecidedtocreatemyownRGBpluginaftertrytousehomebridge-better-http-rgbandhomebridge-http-rgbwithoutgoodresultsduetothecomplexinterfacesandconcurrencyproblems/bugs.
InstallationFollowtheinstructioninhomebridgeforthehomebridgeserverinstallation.
ThepluginispublishedthroughNPMandshouldbeinstalled"globally"bytyping:npminstall-ghomebridge-http-rgb-bulb
Updateyourconfigurationfile.Seeconfig-sample.jsoninthisrepositoryforasample.
ConfigurationExample:
{"accessory":"HttpRGB","name":"RGBBulb","set_url":"https://192.168.1.100/rgb?color=0x%s","get_url":"https://192.168.1.100/rgb?format=hex","http_method":"GET"}Themandatoryoptionsare:
nameAccessoryname.set_urlEndpointtocallwiththerequestedcolor.Themodulereplacesthe'%s'characterswiththehexadecimalcodevalue.get_urlEndpointtorequestthecurrentstate.Theresponsemustbeplaintextwiththehexadecimalcolorcode(withoutanysimbollike'0x'or'#'atthebegining).Theotheravailableoptionsare:
manufacterManufacternametobedisplayed.modelModelnametobedisplayed.serialSerialnumbertobedisplayed.http_methodHttpmetodthatwillbeusedtocalltheurlwhenthestateisrequested.Defaultis'GET'(checkrequestmoduletogettheavailableoptions).timeoutMilisecondstowaitfortheaccessoryresponsebeforesendanerror.Defaultis'5000ms'.
评论