Skip to main content

Sync sunrise and sunset on Dahua IP cameras.

Project description

ipc-sun-sync

PyPI - License PyPI

Sync sunrise and sunset on Dahua IP cameras.

Usage

See config.yml.def for a starter configuration.

Example

Create config.yml with the following content.

---
latitude: 34.0522
longitude: -118.2437
timezone: America/Los_Angeles

# IP camera defaults
username: admin
password: password
method: cgi
sunrise_offset: 00:30:00
sunset_offset: -01:20:00

# IP camera list
ipc:
  - ip: 192.168.1.108
  - ip: 192.168.1.109
    sunset_offset: 00:20:00
    method: rpc
  - ip: 192.168.1.110
    name: FriendlyNameForLogging
    username: OverideDefaultUser
    password: OverideDefaultPassword123
    channel: 1

The following command will sync the cameras located at 192.168.1.108, 192.168.1.109, 192.168.1.110.

ipc-sun-sync -c config.yml

Sunrise will be 30 minutes late and sunset will be 1 hour and 20 minutes early.

192.168.1.108 and 192.168.1.109 will use the credentials admin and password.

192.168.1.109 will interact through rpc instead of cgi and sunset will be 20 minutes late.

192.168.1.110 will have it's name, username, password, and channel overridden. name is used for logging. channel is the video channel you want to apply the sun times, default is 0.

The sunrise and sunset times will be calculated using the latitude and longitude variables, then it will be converted to your timezone using the timezone variable.

Check Configuration

ipc-sun-sync -c config.yml --check

Verify IPC Settings

Shows the sunrise time, sunset time, and switch mode currently on the IP cameras.

ipc-sun-sync -c config.yml --verify

Show Timezones

ipc-sun-sync -T

Show Version

ipc-sun-sync -V

Changelog

CHANGELOG.md

Troubleshooting

  • If the program says it is successful but the sunrise and sunset times do not change, try disabling Smart Codec if it is enabled. use rpc.

To Do

  • Add verbose logging.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ipc-sun-sync-0.2.3.tar.gz (9.3 kB view hashes)

Uploaded Source

Built Distribution

ipc_sun_sync-0.2.3-py3-none-any.whl (10.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page