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
2023-06-17 12:46:01 +02:00
Supports MyRenault (and MyDacia) registered cars with an active Connected-Services account.
2021-12-05 09:33:32 +01:00
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.
2023-01-05 23:55:38 +01:00
| Parameter | Description | Default |
|-------------------|----------------------------------------------------------------------------|----------------------------------|
2023-06-17 12:46:01 +02:00
| accountType | Account Type. (MYDACIA,MYRENAULT) | MYRENAULT |
2023-01-05 23:55:38 +01:00
| myRenaultUsername | MyRenault Username. | |
| myRenaultPassword | MyRenault Password. | |
| locale | MyRenault Location (language_country). | |
| vin | Vehicle Identification Number. | |
| refreshInterval | Interval the car is polled in minutes. | 10 |
| updateDelay | How long to wait for commands to reach car and update to server in seconds.| 30 |
| kamereonApiKey | Kamereon API Key. | VAX7XYKGfa92yMvXculCkEFyfZbuM7Ss |
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 |
2023-01-05 23:55:38 +01:00
| batterystatusupdated | DateTime | Timestamp of the last battery status update | Yes |
2022-02-12 20:22:35 +01:00
| chargingmode | String | Charging mode. always_charging or schedule_mode | No |
2023-03-10 23:32:24 +01:00
| pause | Switch | Pause the charge. | No |
2022-02-12 20:22:35 +01:00
| 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 |
2023-01-05 23:55:38 +01:00
| locked | Switch | Locked status of the car | Yes |
2022-02-12 20:22:35 +01:00
## 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.
2023-03-10 23:32:24 +01:00
The 'pause' and 'chargingmode' may not work on some cars.
As an example, 'chargingmode' does not work on Dacia Spring cars.
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
2023-01-05 23:55:38 +01:00
Default icon="batterylevel" item=RenaultCar_BatteryLevel
Default item=RenaultCar_BatteryEnergyAvailable
Default item=RenaultCar_BatteryStatusUpdated
Default icon="poweroutlet" item=RenaultCar_PlugStatus
Default icon="switch" item=RenaultCar_ChargingStatus
Selection icon="switch" item=RenaultCar_ChargingMode mappings=[SCHEDULE_MODE="Schedule mode",ALWAYS_CHARGING="Instant charge"]
2023-03-10 23:32:24 +01:00
Default icon="switch" item=RenaultCar_Pause
2023-01-05 23:55:38 +01:00
Default item=RenaultCar_ChargingTimeRemaining
Default icon="pressure" item=RenaultCar_EstimatedRange
Default icon="pressure" item=RenaultCar_Odometer
Selection icon="switch" item=RenaultCar_HVACStatus mappings=[ON="ON"]
Setpoint icon="temperature" item=RenaultCar_HVACTargetTemperature maxValue=21 minValue=19 step=1
Default icon="lock" item=RenaultCar_Locked
Default item=RenaultCar_LocationUpdate
Default icon="zoom" item=RenaultCar_Location
2022-02-12 20:22:35 +01:00
}
}
```
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
```