WebsocketbasedLoxonepluginforhomebridge
ThisisaLoxonepluginforHomebridgeThepluginwillautomaticallyretrieveandcommunicatewithalltheseitemsfromyourLoxonesetup:
Lights(Switches,DimmersandColorleds)OtherSwitchesPushbuttonsWindowblindsTemperaturesensors(othertypescanbeaddedeasily)TheonlyconfigurationneededisthecredentialstoyourLoxoneminiserver.
BenefitsRealtimeandveryfast2-wayupdatesbyusingthewebsocketconnectionOne-touchdeploymentthroughautomaticimportofLoxonecontrolsPrerequisitesHomebridgeFollowalltheinstallationstepsthere.
InstallationInstallthepluginthroughnpmordownloadthefilesfromhere.
$sudonpminstall-ghomebridge-loxone-wsOrupdatetolatestversionwhenalreadyinstalled:
$sudonpmupdate-ghomebridge-loxone-wsNote:thepluginrequiresextranodemodules,buttheseshouldbeautomaticallyinstalled:
node-lox-ws-apirequestHomebridgeconfig.jsonAddtheplatformsectiontoyourHomebridgeconfig.json(usuallyin~/.homebridge):
{"bridge":{"name":"Homebridge","username":"CA:AA:12:34:56:78","port":51826,"pin":"012-34-567"},"description":"Yourconfigfile.","platforms":[{"platform":"LoxoneWs","name":"Loxone","host":"192.168.1.2","port":"12345","username":"homebridge","password":"somepassword"}]}Replacefields
hostbytheIPofyourloxoneminiserverportbytheportofyourminiserver(use80ifnospecialport)usernamebytheLoxoneusernamepasswordbytheLoxonepasswordIstronglysuggesttocreateadedicateLoxoneuserthroughLoxoneConfig(eghomebridge).Likethisyoucanrestrictaccesstosensitiveitemsorfilteroutunneededcontrols.
Optionalconfigurationfieldsintheplatformsectionrooms
Tospecifyanarrayofinterestedroomstofilteron.Ifemptyornotgiven,allelementsareused.Eg:specifying"rooms":["Kitchen","Bedroom"]willlimityourbridgetoonlyelementsfromthose2rooms.
moodSwitches
CanuseLoxonemoodswhicharepartofLightControllerV2elements.(Inordertousethis,you'llneedtoconvertany'old'LightControllersblocks.)
Has3possiblevalues
none:doesnotincludemoods.Thisisthedefaultincasenotgiven.all:includemoodsasactionableitemonly:onlyincludemoodsandfilteroutanyotherelementAssumptionsTocreatethecorrectaccessorytypefromLoxoneitems,someattributeparsingisrequired.(EgaLoxoneSwitchcanbeaSwitchoraLightBulb,andInfoOnlyAnalogtypecanbeatemperaturesensorbutalsoanythingelse.)ThisiscoveredinthecheckCustomAttrsfunctioninItemFactory.Adaptittoyourneeds.Currentlytheseassumptionsaremade:
temperaturesensornamesstartwith'Temperat'lightswitchesareinaLoxonecategoryusingthelightbulbiconThecontrolswillbenamedlikeyounamedtheminLoxone.RenamethemthroughtheiOSHomeapptomakeitmoreintuitiveforusingwithSiri.EgLIGHT_KITCHENcanberenamedto'mainlight'andaddedtoroomKitchen.ThenyoucanaskSirito'turnonthemainlightinthekitchen'.
LimitationsroomsTheHomebridge/HAPprotocoldoescurrentlynotallowattachingtheLoxoneroomstotheaccessories.ThatisamanualactiontobedoneonceusingtheIOSHomeapp(ortheEveappwhichismuchmoreuser-friendly).
Specialnote:organizingintoroomscanbedonefromEve,butrenamingtheitemsshould(unfortunately)bedonefromtheIOSHomeapp.NamechangesinEvearenotreflectedinHomeandthusnotknownbySiri.
100itemsHomeKithasalimitof100accessoriesperbridge.IfyouhavealargeLoxonesetup,trytofilterunneededitemsouteitherthroughadedicatedLoxoneusergrouporinthecheckCustomAttrsfunction.
pushbuttonsSinceHomekithasnopushbuttonconcept,IimplementedpushbuttonsasswitchesinHomekit.TellingSiritoputthemOnwillsendapulsetothepushbutton.InHomekit,theywillappeartobeOnforasecond.
AdvancedTheEventtypeisforeseenforyourconvenience,butnotcurrentlyused.Itcanbeusedforpushbuttonswhenyou'reonlyinterestedinreadingfromHomekitandnotcontrollingit.Thatcouldbeusefulforsettingtriggers,egaPushbuttoneventwhichcausesaHomekitscenetobecomeactive.
ProblemsolvingIfyourhavetroublesgettingthestatesonyouriOSdevice,tryremovingthefilesinyour'persists'folder(usuallyin~/.homebridge/persist)andrestartinghomebridge.
LicenseThepluginisreleasedunderMITlicense,whichmeansyoucandowhateveryouwantwithitaslongasyougivecredit.
CreditsAttributiongoestowardsTommasoMarchionni.ThestructureofthiscodeisbasedonhisopenHABplugin.
TheoriginalHomeKitAPIworkwasdonebyKhaosTianinhisHAP-NodeJSproject.
ThehomebridgecomponentonwhichthispluginisbuiltwascreatedbyNickFarina.
I'vemadeuseoftheNodeJSLoxonewebsocketAPIcreatedbyLadislavDokulil
Thankstoallcontributors!
评论