2021-12-05 09:33:32 +01:00
# Renault Binding
2022-12-14 16:52:43 +01:00
This binding allows MyRenault App. users to get battery status and other data from their cars.
2022-02-12 20:22:35 +01:00
They can also heat their cars by turning ON the HVAC status and toggle the car's charging mode.
2021-12-05 09:33:32 +01:00
2022-12-14 16:52:43 +01:00
The binding translates the [python based renault-api ](https://renault-api.readthedocs.io/en/latest/ ) in an easy to use openHAB java binding.
2021-12-05 09:33:32 +01:00
## Supported Things
Supports MyRenault registered cars with an active Connected-Services account.
2022-02-12 20:22:35 +01:00
This binding can only retrieve information that is available in the MyRenault App.
2021-12-05 09:33:32 +01:00
## Discovery
No discovery
## Thing Configuration
You require your MyRenault credential, locale and VIN for your MyRenault registered car.
2022-02-12 20:22:35 +01:00
| Parameter | Description | Required |
|-------------------|----------------------------------------------------------------------------|----------|
| myRenaultUsername | MyRenault Username. | yes |
| myRenaultPassword | MyRenault Password. | yes |
| locale | MyRenault Location (language_country). | yes |
| vin | Vehicle Identification Number. | yes |
| refreshInterval | Interval the car is polled in minutes. | no |
| updateDelay | How long to wait for commands to reach car and update to server in seconds.| no |
2022-12-14 16:52:43 +01:00
| kamereonApiKey | Kamereon API Key. | no |
2021-12-05 09:33:32 +01:00
2022-02-12 20:22:35 +01:00
## Channels
2021-12-05 09:33:32 +01:00
2022-02-12 20:22:35 +01:00
| Channel ID | Type | Description | Read Only |
|------------------------|--------------------|-------------------------------------------------|-----------|
| batteryavailableEnergy | Number:Energy | Battery Energy Available | Yes |
| batterylevel | Number | State of the battery in % | Yes |
| chargingmode | String | Charging mode. always_charging or schedule_mode | No |
| chargingstatus | String | Charging status | Yes |
| chargingremainingtime | Number:Time | Charging time remaining | Yes |
| plugstatus | String | Status of charging plug | Yes |
| estimatedrange | Number:Length | Estimated range of the car | Yes |
| odometer | Number:Length | Total distance travelled | Yes |
| hvacstatus | String | HVAC status HVAC Status (ON, OFF, PENDING) | No |
| hvactargettemperature | Number:Temperature | HVAC target temperature (19 to 21) | No |
| externaltemperature | Number:Temperature | Temperature outside of the car | Yes |
| image | String | Image URL of MyRenault | Yes |
| location | Location | The GPS position of the vehicle | Yes |
| locationupdated | DateTime | Timestamp of the last location update | Yes |
## Limitations
Some channels may not work depending on your car and MyRenault account.
The "externaltemperature" only works on a few cars.
2022-12-14 16:52:43 +01:00
The "hvactargettemperature" is used by the hvacstatus ON command for pre-conditioning the car.
2022-02-12 20:22:35 +01:00
This seams to only allow values 19, 20 and 21 or else the pre-conditioning command will not work.
2022-04-23 09:10:33 +02:00
The Kamereon API Key changes periodically, which causes a communication error.
To fix this error update the API Key in the bindings configuration.
The new key value can hopefully be found in the renault-api project: [KAMEREON_APIKEY value ](https://github.com/hacf-fr/renault-api/blob/main/src/renault_api/const.py ) or in the openHAB forums.
2022-02-12 20:22:35 +01:00
## Example
renaultcar.sitemap:
2022-12-14 16:52:43 +01:00
```perl
2022-02-12 20:22:35 +01:00
sitemap renaultcar label="Renault Car" {
Frame {
Image item=RenaultCar_ImageURL
Default item=RenaultCar_BatteryLevel icon="batterylevel"
Default item=RenaultCar_BatteryEnergyAvailable icon="energy"
Default item=RenaultCar_PlugStatus icon="poweroutlet"
Default item=RenaultCar_ChargingStatus icon="switch"
Selection item=RenaultCar_ChargingMode mappings=[SCHEDULE_MODE="Schedule mode",ALWAYS_CHARGING="Instant charge"] icon="switch"
Default item=RenaultCar_ChargingTimeRemaining icon="time"
Default item=RenaultCar_EstimatedRange
Default item=RenaultCar_Odometer
Selection item=RenaultCar_HVACStatus mappings=[ON="ON"] icon="switch"
Setpoint item=RenaultCar_HVACTargetTemperature minValue=19 maxValue=21 step=1 icon="temperature"
Default item=RenaultCar_LocationUpdate icon="time"
Default item=RenaultCar_Location
}
}
```
![Sitemap ](doc/sitemap.png )
2022-12-14 16:52:43 +01:00
If you want to limit the charge of the car battery to less than 100%, this can be done as follows.
2022-04-23 09:10:33 +02:00
2022-12-14 16:52:43 +01:00
- Set up an active dummy charge schedule in the MyRenault App.
2022-04-23 09:10:33 +02:00
2022-12-14 16:52:43 +01:00
- Create a Dimmer item "RenaultCar_ChargeLimit" and set it to 80% for example.
2022-04-23 09:10:33 +02:00
2022-12-14 16:52:43 +01:00
- Add the ChargeRenaultCarLimit rule using the code below.
The rule will change the RenaultCar_ChargingMode to schedule_mode when the limit is reached.
2022-04-23 09:10:33 +02:00
This stops charging after the battery level goes over the charge limit.
2022-02-12 20:22:35 +01:00
ChargeRenaultCarLimit Code
2022-12-14 16:52:43 +01:00
```javascript
2022-02-12 20:22:35 +01:00
configuration: {}
triggers:
- id: "1"
configuration:
itemName: RenaultCar_BatteryLevel
type: core.ItemStateUpdateTrigger
2022-04-23 09:10:33 +02:00
- id: "2"
2022-02-12 20:22:35 +01:00
configuration:
itemName: RenaultCar_ChargeLimit
type: core.ItemStateUpdateTrigger
2022-04-23 09:10:33 +02:00
- id: "3"
2022-02-12 20:22:35 +01:00
configuration:
itemName: RenaultCar_PlugStatus
type: core.ItemStateUpdateTrigger
conditions: []
actions:
- inputs: {}
2022-04-23 09:10:33 +02:00
id: "4"
2022-02-12 20:22:35 +01:00
configuration:
type: application/vnd.openhab.dsl.rule
2022-04-23 09:10:33 +02:00
script: >
2022-02-12 20:22:35 +01:00
if ( RenaultCar_PlugStatus.state.toString == 'PLUGGED' ) {
if ( RenaultCar_BatteryLevel.state as Number >= RenaultCar_ChargeLimit.state as Number ) {
2022-04-23 09:10:33 +02:00
if (RenaultCar_ChargingMode.state.toString != 'SCHEDULE_MODE' ) {
2022-02-12 20:22:35 +01:00
RenaultCar_ChargingMode.sendCommand("SCHEDULE_MODE")
}
} else {
2022-04-23 09:10:33 +02:00
if (RenaultCar_ChargingMode.state.toString != 'ALWAYS_CHARGING' ) {
2022-02-12 20:22:35 +01:00
RenaultCar_ChargingMode.sendCommand("ALWAYS_CHARGING")
}
}
2022-04-23 09:10:33 +02:00
} else {
if (RenaultCar_ChargingMode.state.toString != 'ALWAYS_CHARGING' ) {
RenaultCar_ChargingMode.sendCommand("ALWAYS_CHARGING")
}
2022-02-12 20:22:35 +01:00
}
type: script.ScriptAction
```