Package: hubitatcontrol
Hubitat Elevation Maker API InterfaceIntroThis guide assumes you own aHubitat Elevationhome automation controller.If you are interested in purchasing one, you can purchase a unit from the manufactures website athubitat.comor fromAmazon.comChangesSeeCHANGELOG.mdfor current changesSetupTo get the required API keys, you will need to log in to your Hubitat admin interface.SeeMaker API Documentationfor how to add theMakerAPIapplication and to generate new API keysIf you are using the cloud API endpoint for access, you will ALSO need to include the Cloud API key when setting up a new Hub object.InstallpipinstallhubitatcontrolOr if you want a copy direct from sourcepipinstallgit+https://github.com/Jelloeater/hubitatcontrol.gitUsageAPILocal Exampleimporthubitatcontrolashchub=hc.Hub(host='http://192.168.1.100',token='Maker_Token',app_id='Maker_App_ID')# Get Hub object to auth and poll against# If you have a cloud based maker API, you can include the cloud token# hub = hc.get_hub(host='https://cloud.hubitat.com', token='Maker_Token',#                  app_id='Maker_App_ID', cloud_token='Cloud_API_token')TEST_DEVICE='1RGB'device=hc.GetSingleDevice(hub).name(TEST_DEVICE)# Turn on all the switches (includes lights)device.turn_on()# Send command to deviceprint(device.switch)# Get temprature from all sensorsforiinhc.GetDevices(hub).TemperatureSensor():print(f"{i.name}-{i.temperature}")CLI InterfaceIf you have all the needed API keys added to your .env file, all you need to do is add them to your keyringOnce loaded into the keyring, you can run the CLI from anywhere on your systemhubitatcontrol--help
hubitatcontrolload-env-to-keyring
hubitatcontrolls❯ hubitatcontrol

 Usage: hubitatcontrol [OPTIONS] COMMAND [ARGS]...

 Hubitat Control CLI Interface

╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --install-completion        [bash|zsh|fish|powershell|pwsh]  Install completion for the specified shell. │
│                                                              [default: None]                             │
│ --show-completion           [bash|zsh|fish|powershell|pwsh]  Show completion for the specified shell, to │
│                                                              copy it or customize the installation.      │
│                                                              [default: None]                             │
│ --help                                                       Show this message and exit.                 │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────────────────────────────────╮
│ clear-keyring                      Clear Keyring passwords                                               │
│ level                              Turn on a device via it's Device ID                                   │
│ load-env-to-keyring                Load .env file at exec location to keyring                            │
│ ls                                 Prints current devices from system keyring                            │
│ off                                Turn on a device via it's Device ID                                   │
│ on                                 Turn on a device via it's Device ID                                   │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯

 Version: 1.1.2   Project: https://github.com/Jelloeater/hubitatcontrolDocsLocated in /docs folderYou will need a .dot file browser for the class diagramsWIP: Setup ReadTheDocs auto genIssues / FeaturesSee:https://github.com/Jelloeater/hubitatcontrol/issuesStructureClass Modelflowchart LR
Specific_Device --> Abstract_Device_Class --> Device--> HubDevelopment setupTesting is done with PyTest, you will need to set up the correct env vars for your local (or cloud) Hubitat API
See.env.exampleIf you are using a local API endpoint, please leaveHUBITAT_CLOUD_IDblank in the.envfile.SetupInstall Go-Task -->https://taskfile.dev/installation/tasksetup
task