Skip to content

scoleri/EG43000Data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DESS Monitor Data Export Script

This script interacts with the DESS Monitor API to authenticate and fetch the latest device data, exporting the results as JSON.

Features

  • Securely loads authentication credentials from a separate configuration file.
  • Fetches the latest data for a specified device.
  • Supports command-line arguments for querying past data.
  • Outputs results in JSON format for further processing.
  • Implements SHA-1-based authentication as required by the API.

Installation

Prerequisites

Ensure you have the following installed:

  • `` (default on Linux/macOS)
  • `` (for making API requests)
  • `` (for processing JSON data)
  • `` (for hashing operations)

To install missing dependencies:

# Debian/Ubuntu
sudo apt install jq openssl

# macOS (via Homebrew)
brew install jq openssl

Clone the Repository

git clone https://github.com/yourusername/dessmonitor-export.git
cd dessmonitor-export

Configure Authentication

  1. Copy the example config file and edit it:

    cp config.env.example config.env
    nano config.env
  2. Update the following fields in config.env:

    # User credentials
    DESS_USER="[email protected]"
    DESS_PASS="YourSecurePassword"
    DESS_COMPANY_KEY="YourCompanyKey"
    
    # Device-specific details
    DEVICE_PN="YourDevicePN"
    DEVICE_CODE="YourDeviceCode"
    DEVICE_ADDR="YourDeviceAddress"
    DEVICE_SN="YourDeviceSerialNumber"
  3. Important: Prevent accidental leaks by adding config.env to .gitignore:

    echo "config.env" >> .gitignore
  4. Ensure secure file permissions to prevent unauthorized access:

    chmod 600 config.env

Usage

Fetch today's data:

./dessmonitor.sh

Fetch data for a specific date:

./dessmonitor.sh YYYY-MM-DD

Example:

./dessmonitor.sh 2024-03-10

Expected Output

  • **Authentication token is retrieved and stored in **``
  • **Device data is fetched and saved to **``
  • The script logs the results, which can be processed further

API References

This script relies on endpoints from DESS Monitor API, documented at:

Related Projects

For Home Assistant integration, check out:
SilverFire/dessmonitor-homeassistant

Security Considerations

🔒 Storing Credentials Securely

  • DO NOT hardcode secrets in the script. Instead, use config.env as demonstrated.
  • Use environment variables instead of storing credentials in a file if deploying on a server.

🚫 Preventing Accidental Leaks

  • **Ensure **** is added to ** so it is not accidentally committed.
  • If working on a shared system, restrict file access using:
    chmod 600 config.env

Encryption & Secure API Calls

  • The script hashes passwords using SHA-1 before transmission.
  • Communication with the API uses HTTPS for encryption.

License

This script is provided as-is. Feel free to modify and improve it.

Acknowledgments

About

This code will pull information from an EG43000 remotely

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages