Skip to content

Torn City API-Integration plugin for HomeAssistant

License

Notifications You must be signed in to change notification settings

xlemmingx/ha-torn

Repository files navigation

Torn City Integration for Home Assistant

A comprehensive Home Assistant integration for Torn City, providing real-time access to your player stats, finances, stocks, travel status, cooldowns, and more.

hacs_badge GitHub Release Downloads License

Installation

HACS (Recommended)

Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.

  1. Open HACS → Integrations → Custom repositories
  2. Add https://github.com/xlemmingx/ha-torn as "Integration"
  3. Search for "Torn City" and install
  4. Restart Home Assistant

Manual Installation

  1. Download from releases page
  2. Copy to config/custom_components/torn/
  3. Restart Home Assistant

Configuration

  1. Settings → Devices & Services → Add Integration
  2. Search "Torn City"
  3. Enter your Torn City API key (Full Access recommended)
  4. Optional: Enable "Throttle API Usage" to reduce API calls if needed
  5. Submit

Features

Player & Stats

  • Name, level, status, battle stats (strength, defense, speed, dexterity)

Bars & Cooldowns

  • Energy, Nerve, Happy, Life, Chain with timers
  • Chain timeout timer
  • Drug, Medical, Booster cooldowns

Finances

  • Wallet, Vault, Banks, Company & Faction funds
  • City Bank investments with profit tracking
  • Daily networth

Stocks (All 35 Torn stocks)

  • Current prices, market cap, owned shares
  • Stock benefit blocks tracking
  • Ready-to-claim benefits

Travel & Activity

  • Destination, method, arrival/departure times
  • Recent activity log

Other

  • Skills (dynamic sensors)
  • Company stats

All sensors prefixed with sensor.torn_ and binary_sensor.torn_.

API Rate Limiting

The integration uses intelligent caching to minimize API calls:

  • High frequency (5s cache): profile, bars, money, travel, log
  • Medium frequency (60s cache): cooldowns, stats, company, stocks
  • Low frequency (600s cache): skills, refills

Total usage: ~64 API calls/minute (64% of the 100/minute limit)

Enable "Throttle API Usage" during setup to reduce this by 10x if you're sharing an API key or approaching limits.

Support

License

MIT License - see LICENSE file for details.

This integration is not affiliated with Torn City Ltd.

About

Torn City API-Integration plugin for HomeAssistant

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages