{"id":26255284,"url":"https://github.com/carsonfenimore/ha_util","last_synced_at":"2025-03-13T19:18:08.247Z","repository":{"id":279814011,"uuid":"940065600","full_name":"carsonfenimore/ha_util","owner":"carsonfenimore","description":"Helper stuff for home assistant","archived":false,"fork":false,"pushed_at":"2025-03-10T13:40:44.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-10T14:35:53.953Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/carsonfenimore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-27T15:01:27.000Z","updated_at":"2025-03-10T13:40:48.000Z","dependencies_parsed_at":"2025-02-27T21:49:05.297Z","dependency_job_id":null,"html_url":"https://github.com/carsonfenimore/ha_util","commit_stats":null,"previous_names":["carsonfenimore/ha_util"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carsonfenimore%2Fha_util","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carsonfenimore%2Fha_util/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carsonfenimore%2Fha_util/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carsonfenimore%2Fha_util/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/carsonfenimore","download_url":"https://codeload.github.com/carsonfenimore/ha_util/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243467009,"owners_count":20295309,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-13T19:18:07.650Z","updated_at":"2025-03-13T19:18:08.237Z","avatar_url":"https://github.com/carsonfenimore.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Home Assistant Utilities\nMore compact home assistant snmp yaml - also supports oid lookup of snmp tables\n\n## ha_snmp_gen.py\nNormally if you want to pull in snmp oids, HA requires you to repeat the host and creds for each oid. This creates a bit of a maintenance problem.  Additionally it requires tedious repetitiion of configuration - sometimes up to 16 lines of yaml per oid.  With this tool each oid takes about 2 lines of yaml.  Here is a sample:\n\n```yaml\nsnmp:\n- host: 10.10.2.2\n  version: '3'\n  auth_level: authPriv\n  auth_key: authpassword\n  auth_protocol: SHA\n  priv_key: privpassword\n  priv_protocol: DES\n  username: user\n  items:\n  - qnap_public_share_x:\n      oid: .1.3.6.1.2.1.25.2.3.1.3.37\n  - qnap_fendocs_x:\n      oid: 1.3.6.1.2.1.25.2.3.1.6\n      search_oid: 1.3.6.1.2.1.25.2.3.1.3\n      search_value: \"/share/NFSv=4/FenDocs2\"\n```\n\nIn the example above two oids are provided.  The first oid showcases how the simple configuration requires only two lines per oid - one for the oid name, another for the oid.  \n\nThe second oid in this example is a table lookup - see below for more details.\nid \n\n\n### snmp table lookups\nWhen a search_oid nd search_value item is provided, the script performs an snmpwalk looking for an oid whose value matches.  If found the last octet of the matching oid is used to form a new oid, based on the \"oid\" param. This is then used as the oid for generating the ha yaml.\n\n### Allowed params\nFor each item we support nearly every param from the snmp page: unit_of_measurement, value_template, accept_errors, default_value, etc.  \n\nFor the host we support v1/2c/3 - however for v3 we only support des as the priv_protocol, and sha as the auth_protocol.  \n\n### Using\nMake a \"sensors\" folder in your ha configuration directory.  \n\nIn your HA config include a list of sensor yamls as follows:\n\n```yaml\nsensor: !include_dir_merge_list sensors/\n```\n\nNow run the utility:\n\n```python\npython ha_snmp_gen.py --infile snmp_input.yaml --outfile \u003chaconfig\u003e/sensors/snmp.yaml\n```\n\nAnd restart HA and you should see the new sensors.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarsonfenimore%2Fha_util","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarsonfenimore%2Fha_util","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarsonfenimore%2Fha_util/lists"}