Skip to content

Sygaro/se.cohen.renaultze-master

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

47 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Renault & Dacia Homey App v3.0

Node.js Version TypeScript Homey SDK License

Modern, type-safe Homey app for Renault and Dacia electric vehicles built with TypeScript.

🎯 Features

  • βœ… Full TypeScript support with strict type checking
  • βœ… Homey SDK 4.x - Latest platform support
  • βœ… Node.js 25+ - Modern JavaScript runtime
  • βœ… TypeScript 7-ready - Future-proof module configuration
  • βœ… Comprehensive test coverage with Jest
  • βœ… Modern API client based on renault-api Python library
  • βœ… Automatic token management and caching
  • βœ… Model-specific capabilities detection
  • βœ… Fallback mechanisms for API changes
  • βœ… ESLint + Prettier for code quality

πŸ“¦ Supported Vehicles

  • Renault Zoe Phase 1 (X101VE)
  • Renault Zoe Phase 2 (X102VE)
  • Renault Megane E-Tech (XCB1VE)
  • Dacia Spring (XBG1VE)
  • Renault Kangoo EV (XJA1VP)

πŸš€ Quick Start

Prerequisites

  • Node.js >= 25.0.0 (we recommend using nvm)
  • Homey CLI: npm install -g homey

Installation

# Install dependencies
npm install

# Build TypeScript
npm run build

# Run tests
npm test

# Deploy to Homey
homey app run

πŸ—οΈ Project Structure

src/
β”œβ”€β”€ api/                    # API client implementation
β”‚   β”œβ”€β”€ renault-api-client.ts
β”‚   └── __tests__/
β”œβ”€β”€ config/                 # Configuration files
β”‚   └── renault-config.ts
β”œβ”€β”€ drivers/               # Homey device drivers
β”‚   β”œβ”€β”€ renault-zoe/
β”‚   └── dacia-spring/
└── types/                 # TypeScript type definitions
    └── renault-api.types.ts

πŸ“ Available Scripts

npm run build           # Compile TypeScript
npm run watch           # Auto-rebuild on changes
npm test                # Run all tests
npm run test:watch      # Run tests in watch mode
npm run test:coverage   # Generate coverage report
npm run lint            # Check code quality
npm run lint:fix        # Fix linting issues
npm run format          # Format code with Prettier
npm run format:check    # Check code formatting
npm run type-check      # Type check without building
npm run clean           # Clean build artifacts
npm run validate        # Validate Homey app
npm run ci              # Run all checks (CI pipeline)

πŸ§ͺ Testing

Tests are written using Jest with 50%+ coverage threshold:

# Run all tests
npm test

# Run specific test file
npm test -- renault-api-client.test.ts

# Coverage report
npm run test:coverage

οΏ½ API Testing with Postman

A complete Postman collection is available in the postman/ directory for testing all Renault API endpoints:

  • πŸ” Authentication flow (Gigya login, JWT tokens)
  • πŸš— Vehicle data endpoints (battery, location, HVAC, etc.)
  • πŸŽ›οΈ Control commands (charge mode, climate control, etc.)
  • 🌍 Pre-configured environments for 7+ countries

See postman/README.md for setup instructions.

οΏ½πŸ› οΈ Development Tools

  • TypeScript 5.9 - Type safety with nodenext module resolution
  • ESLint 9 - Code quality and consistency
  • Prettier 3 - Automatic code formatting
  • Jest 29 - Comprehensive testing framework
  • EditorConfig - Consistent coding styles across editors

πŸ”§ Configuration

Vehicle capabilities are automatically detected based on model code. The app supports multiple locales including:

  • Sweden (sv-SE)
  • Norway (nb-NO, no-NO)
  • Denmark (da-DK)
  • Finland (fi-FI)
  • UK (en-GB)
  • Germany (de-DE)
  • France (fr-FR)
  • Netherlands (nl-NL)
  • Italy (it-IT)
  • Spain (es-ES)

πŸ“– Usage

  1. Install the app on your Homey
  2. Add a new device and select Renault/Dacia
  3. Login with your My Renault credentials
  4. Select your vehicle from the list (identified by VIN)
  5. The app will sync battery status, location, charging state, etc.

Note: This app uses the unofficial Renault API which may change without notice. Updates will be made as quickly as possible if changes occur.

πŸ†˜ Troubleshooting

Having problems? Check these common issues:

"Another pair session is already active"

Solution: Restart the app in Homey settings or run homey app restart

"Wrong credentials" or authentication fails

Most common cause: Wrong locale/region selected!

Each country has different API keys. Using Swedish API key with Norwegian account will fail immediately.

Solution:

  1. Default is now Norway (nb-NO). If you're in Sweden, Denmark, or Finland, you may need to change this in the code
  2. Verify you can log in to my.renault.no (or your country's site)
  3. Check that your account region matches the selected locale
  4. See TROUBLESHOOTING.md for detailed debugging steps

Important: The authentication must follow exact API order:

  1. Login β†’ Get Account Info β†’ Get JWT β†’ Get Person Details

Wrong order will cause immediate failure. The app now follows correct Postman flow (v3.0+).

API errors or "not supported" messages

Some features depend on your vehicle model. Not all Renault/Dacia models support all features.

πŸ“– Full troubleshooting guide: TROUBLESHOOTING.md

πŸ§ͺ Test API manually: See postman/QUICKSTART.md

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Write tests for new features
  4. Ensure all tests pass
  5. Submit a pull request

For detailed file structure and development guidelines, see FILE_GUIDE.md.

πŸ“„ License

LGPL-3.0-only

πŸ‘₯ Authors & Contributors

πŸ™ Acknowledgments

Special thanks to:

πŸ“š Documentation

About

Homey Pro 2023 app to manage Renault and Dacia connected cars

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 78.4%
  • HTML 19.9%
  • JavaScript 1.7%