{"id":15286911,"url":"https://github.com/helpfulscripts/libhttpcam","last_synced_at":"2025-04-13T03:57:14.944Z","repository":{"id":62575845,"uuid":"177445854","full_name":"HelpfulScripts/libhttpcam","owner":"HelpfulScripts","description":"Accessing webcams via REST API","archived":false,"fork":false,"pushed_at":"2021-08-03T01:45:38.000Z","size":42,"stargazers_count":5,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T03:57:08.535Z","etag":null,"topics":["foscam","home-assistant","http-camera","wansview"],"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/HelpfulScripts.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}},"created_at":"2019-03-24T17:20:40.000Z","updated_at":"2025-01-23T12:26:01.000Z","dependencies_parsed_at":"2022-11-03T17:33:07.772Z","dependency_job_id":null,"html_url":"https://github.com/HelpfulScripts/libhttpcam","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HelpfulScripts%2Flibhttpcam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HelpfulScripts%2Flibhttpcam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HelpfulScripts%2Flibhttpcam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HelpfulScripts%2Flibhttpcam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HelpfulScripts","download_url":"https://codeload.github.com/HelpfulScripts/libhttpcam/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248661707,"owners_count":21141450,"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":["foscam","home-assistant","http-camera","wansview"],"created_at":"2024-09-30T15:19:04.351Z","updated_at":"2025-04-13T03:57:14.917Z","avatar_url":"https://github.com/HelpfulScripts.png","language":"Python","readme":"# Web Cam Access via HTTP REST-API\n\nA Python3 library that unified acess to various web cams with integrated HTTP servers.\nThe intended use is for connecting cameras with built-in REST servers to the \n[home-assistant](https://www.home-assistant.io/) platform.\n\n## Installation\n### libhttpcam\n    pip3 install libhttpcam\nor as update:\n\n    pip3 install --upgrade libhttpcam \n\n## Usage\nUse `createCam` to create a camera instance.\n\n    from libhttpcam import createCam\n\n    model = 'foscam'\n    ip = '10.0.0.30'\n    cam, port = createCam('foscam', ip)  # use model's default port\n\nNext, you might want to set credentials for the camera:\n\n    user = 'me'\n    password = 'youllneverguess'\n    cam.set_credentials(user, password)\n\n## Support\nCurrently, only `Foscam` and `Wansview` cameras are supported.\n- Foscam C1\n- Wansview K2\n- Wansview Q3S (X Series)\n\n## API\n- `createCam(brand:str, ip:str, port:int=None) -\u003e (HttpCam, int)`\u003cbr\u003e\ncreates a HttpCam instance for the supplied `brand`, `ip` address, and `port`.\nIf `port` is omitted, the camera brand's default port will be used.\n\nreturns the camera instance and the port used as a tuple\n\n\n### Device Properties\n- `brand()`\u003cbr\u003e\nreturns the camera instance's brand\n\n- `model()`\u003cbr\u003e\nreturns the camera instance's model\nNote: for `Wansview` cameras this call returns `'unknown'`\n\n- `host()`\u003cbr\u003e\nreturns the camera instance's ip address\n\n- `port()`\u003cbr\u003e\nreturns the camera instance's port\n\n### Device Configuration\n- `set_credentials(user='', password='')`\u003cbr\u003e\nsets the credentials used to access the camera. \n\n- `set_sensitivities(motion=0, audio=0)`\u003cbr\u003e\n\nSets the sensitivities for motion detection and audio detection. Both take values between 0 (off) and 100 (sensitive).\n\n- `async_reboot() -\u003e Response`\u003cbr\u003e\nreboots the camera. \n\n- `async_set_system_time() -\u003e Response`\u003cbr\u003e\nsets the current local time on the camera. This is used for overlays in the snapshots and feeds.\n\n- `async_set_irled(status: Status) -\u003e Response`\u003cbr\u003e\nsets the status of the active infrared light on the camera. Valid settings are `Status.ON', `Status.OFF`, and `Status.AUTO`\n\n- `async_set_night_mode(status: Status) -\u003e Response`\u003cbr\u003e\nsets the status of the passive infrered sensor. Valid settings are `Status.ON', `Status.OFF`, and `Status.AUTO`\n\n- `async_set_ftp_config(server, port, user, passwd) -\u003e Response`\u003cbr\u003e\nconfigures the ftp client to allow snapshots and recordings to be stored on a server via FTP.\n\n- `async_set_audio_volumes(audio_in=50, audio_out=50) -\u003e Response`\u003cbr\u003e\nconfigures audio volumes for the camera:\n- audio_in: microphone volume\n- audio_out: speaker and alert volume\n\n### Device Queries\n- `async_get_model() -\u003e str`\u003cbr\u003e\nqueries and returns the brand's model number as a string\n\n- `async_get_night_mode() -\u003e IRmode`\u003cbr\u003e\nqueries and returns the sensor night mode setting:\n    - bool result.LED\n    - bool result.Sensor\n\n- `async_get_alarm_trigger() -\u003e Trigger`\u003cbr\u003e\nqueries and returns the alarm trigger setting:\n    - bool result.motion\n    - bool result.audio\n\n- `async_get_alarm_action() -\u003e Action`\u003cbr\u003e   \nqueries and returns the alarm action setting:\n    - bool result.audio    - sound the siren\n    - bool result.ftp_snap - store snapshots to FTP server\n    - bool result.ftp_rec  - store recordings to FTP server\n\n- `async_get_alarm_triggered() -\u003e bool`\u003cbr\u003e\nqueries and returns `True` if an alram was detected.\u003cbr\u003e\n*Currently not implemented, returns `False`*\n\n- `async_get_ftp_config()`\u003cbr\u003e\nqueries and returns the current FTP configuration\n\n\n### Device Actions\n- `async_snap_picture()`\u003cbr\u003e\nsnaps a picture and returns the byte array\n\n- `async_mjpeg_stream(request)`\u003cbr\u003e\nrequests and returns a motion JPEG stream\n\n- `async_set_alarm(trigger: Trigger, action: Action) -\u003e Response`\u003cbr\u003e\nArms or disarms the camera by7 setting the `trigger` and `action` settings \n\n- `async_ptz_preset(preset_pos:int)`\u003cbr\u003e\nmoves the camera to the specified preprogrammed position if PTX is available\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhelpfulscripts%2Flibhttpcam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhelpfulscripts%2Flibhttpcam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhelpfulscripts%2Flibhttpcam/lists"}