Package: libhttpcam
Web Cam Access via HTTP REST-APIA Python3 library that unified acess to various web cams with integrated HTTP servers.
The intended use is for connecting cameras with built-in REST servers to thehome-assistantplatform.Installationlibhttpcampip3 install libhttpcamor as update:pip3 install --upgrade libhttpcamUsageUsecreateCamto create a camera instance.from libhttpcam import createCam

model = 'foscam'
ip = '10.0.0.30'
cam, port = createCam('foscam', ip)  # use model's default portNext, you might want to set credentials for the camera:user = 'me'
password = 'youllneverguess'
cam.set_credentials(user, password)SupportCurrently, onlyFoscamandWansviewcameras are supported.Foscam C1Wansview K2Wansview Q3S (X Series)APIcreateCam(brand:str, ip:str, port:int=None) -> (HttpCam, int)creates a HttpCam instance for the suppliedbrand,ipaddress, andport.
Ifportis omitted, the camera brand's default port will be used.returns the camera instance and the port used as a tupleDevice Propertiesbrand()returns the camera instance's brandmodel()returns the camera instance's model
Note: forWansviewcameras this call returns'unknown'host()returns the camera instance's ip addressport()returns the camera instance's portDevice Configurationset_credentials(user='', password='')sets the credentials used to access the camera.set_sensitivities(motion=0, audio=0)Sets the sensitivities for motion detection and audio detection. Both take values between 0 (off) and 100 (sensitive).async_reboot() -> Responsereboots the camera.async_set_system_time() -> Responsesets the current local time on the camera. This is used for overlays in the snapshots and feeds.async_set_irled(status: Status) -> Responsesets the status of the active infrared light on the camera. Valid settings areStatus.ON',Status.OFF, andStatus.AUTO`async_set_night_mode(status: Status) -> Responsesets the status of the passive infrered sensor. Valid settings areStatus.ON',Status.OFF, andStatus.AUTO`async_set_ftp_config(server, port, user, passwd) -> Responseconfigures the ftp client to allow snapshots and recordings to be stored on a server via FTP.async_set_audio_volumes(audio_in=50, audio_out=50) -> Responseconfigures audio volumes for the camera:audio_in: microphone volumeaudio_out: speaker and alert volumeDevice Queriesasync_get_model() -> strqueries and returns the brand's model number as a stringasync_get_night_mode() -> IRmodequeries and returns the sensor night mode setting:bool result.LEDbool result.Sensorasync_get_alarm_trigger() -> Triggerqueries and returns the alarm trigger setting:bool result.motionbool result.audioasync_get_alarm_action() -> Actionqueries and returns the alarm action setting:bool result.audio    - sound the sirenbool result.ftp_snap - store snapshots to FTP serverbool result.ftp_rec  - store recordings to FTP serverasync_get_alarm_triggered() -> boolqueries and returnsTrueif an alram was detected.Currently not implemented, returnsFalseasync_get_ftp_config()queries and returns the current FTP configurationDevice Actionsasync_snap_picture()snaps a picture and returns the byte arrayasync_mjpeg_stream(request)requests and returns a motion JPEG streamasync_set_alarm(trigger: Trigger, action: Action) -> ResponseArms or disarms the camera by7 setting thetriggerandactionsettingsasync_ptz_preset(preset_pos:int)moves the camera to the specified preprogrammed position if PTX is available