Skip to main content

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.

Metadata

Release files for ipc-sun-sync 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ipc-sun-sync 0.2.3
File Size Uploaded
ipc-sun-sync-0.2.3.tar.gz 9.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ipc-sun-sync 0.2.3
File Interpreter ABI Platform
ipc_sun_sync-0.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 19.9 kB

Release files / ipc-sun-sync-0.2.3.tar.gz

Download URL ipc-sun-sync-0.2.3.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
bc1f70d197ed52e9f286cca3edef097e321822e813ef8488793e4367911783ef
BLAKE2b-256 checksum
How to use checksums
b21306ed6cdf7bbb2b04f1a47a4807c7d2e827378579659101a500e6eb555031
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.0 CPython/3.10.6 Linux/5.15.0-1017-azure

Release files / ipc_sun_sync-0.2.3-py3-none-any.whl

Download URL ipc_sun_sync-0.2.3-py3-none-any.whl
Size 10.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
97a8117dbd10c6dc0e2abc38bb58ef7a753cb1cd3581c3259a6c340f499fe0b1
BLAKE2b-256 checksum
How to use checksums
63c982c85b8305a008184d596253ca89a2127d8f91f08a2d8d841995f71af58e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.0 CPython/3.10.6 Linux/5.15.0-1017-azure

Release history Release notifications | RSS feed

This release

0.2.3 This release

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page