Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[renault] Renault more channels and HVAC ON / toggle charge mode #12095

Merged
merged 34 commits into from
Feb 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
a055c58
[hue] Fixed unicode character in translation (#11519)
cweitkamp Nov 5, 2021
eaa43fe
Merge branch 'main' of github.com:dougculnane/openhab-addons
Dec 31, 2021
656106a
Merge branch 'main' of github.com:dougculnane/openhab-addons
Dec 31, 2021
9618ced
[renault] Add more channels to Renault Binding.
Jan 9, 2022
0805f8c
Merge branch 'main' of github.com:dougculnane/openhab-addons
Jan 9, 2022
b470fd3
Merge branch 'main' into renault-more-channels
Jan 9, 2022
48cff4d
Merge branch 'main' of github.com:dougculnane/openhab-addons into ren…
Jan 10, 2022
7e4d34c
[renault] Add more channels to Renault Binding and document.
Jan 10, 2022
fa7e1a7
Merge branch 'main' of github.com:dougculnane/openhab-addons
Jan 10, 2022
471a7a7
Merge branch 'main' into renault-more-channels
Jan 10, 2022
575f468
[renault] Map status to text.
Jan 10, 2022
0fd2aba
[renault] First implementation of HVAC not read only for testing.
Jan 15, 2022
09955d1
[renault] Add more battery channels.
Jan 15, 2022
df27c28
[renault] Add more channels and fixes to HVAC on.
Jan 16, 2022
6d6de65
[renault] Add more channels and fixes. Set charging mode action.
Jan 16, 2022
f65df17
[renault] Fixes as a result of testing.
Jan 22, 2022
4de1592
[renault] More fixes, documentation and testing.
Jan 22, 2022
63f6aa5
[renault] Readme fixes.
Jan 22, 2022
3ea70b5
Merge branch 'main' of github.com:dougculnane/openhab-addons
Jan 22, 2022
50c7497
Merge branch 'main' into renault-more-channels
Jan 22, 2022
8834742
[renault] Readme improvements.
Jan 22, 2022
3707091
[renault] Fix timestamp format in sitemap. Add trigger to charge limi…
Jan 23, 2022
c18ab50
Merge branch 'main' of github.com:dougculnane/openhab-addons
Jan 23, 2022
a965f15
Merge branch 'main' into renault-more-channels
Jan 23, 2022
ebb4046
[renault] Improve example rule to reduce API use.
Jan 23, 2022
9442b03
[renault] Readme fix from forum.
Jan 24, 2022
466fc5b
Pull Request feedback changes.
Jan 25, 2022
304bdc7
[renault] Channel enums fixes for pull request.
Jan 26, 2022
ed07f64
[renault] Channel enums fixes for api values.
Jan 26, 2022
3f4a177
[renault] Fixes and pull reuest feedback.
Feb 1, 2022
d09555a
[renault] spotless and check style fixes.
Feb 1, 2022
d7e6dde
[renault] remove httpSession = null.
Feb 1, 2022
fd0f23b
[renault] mvn org.openhab.core.tools:i18n-maven-plugin:3.2.0:generate…
Feb 6, 2022
8fe817d
[renault] No generic Exception catch.
Feb 8, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 110 additions & 21 deletions bundles/org.openhab.binding.renault/README.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,132 @@
# Renault Binding

This binding allow MyRenault App. users to get battery status and other data from their cars.
This binding allows MyRenault App. users to get battery status and other data from their cars.
They can also heat their cars by turning ON the HVAC status and toggle the car's charging mode.

A binding that translates the [python based renault-api](https://renault-api.readthedocs.io/en/latest/) in an easy to use binding.
The binding translates the [python based renault-api](https://renault-api.readthedocs.io/en/latest/) in an easy to use openHAB java binding.


## Supported Things

Supports MyRenault registered cars with an active Connected-Services account.

This binding can only retrieve information that is available in the the MyRenault App.
This binding can only retrieve information that is available in the MyRenault App.


## Discovery

No discovery


## Thing Configuration

You require your MyRenault credential, locale and VIN for your MyRenault registered car.

| 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 |

## Channels
| 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 |

Currently all available channels are read only:

| Channel ID | Type | Description |
|--------------|---------------|---------------------------------|
| batterylevel | Number | State of the battery in % |
| hvacstatus | Switch | HVAC status switch |
| image | String | Image URL of MyRenault |
| location | Location | The GPS position of the vehicle |
| odometer | Number:Length | Total distance travelled |

## Channels

| 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.

The "hvactargettemperature" is used by the hvacstatus ON command for pre-conditioning the car.
This seams to only allow values 19, 20 and 21 or else the pre-conditioning command will not work.


## Example

renaultcar.sitemap:
lolodomo marked this conversation as resolved.
Show resolved Hide resolved

```
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)

If you do not have a smart charger and want to limit the charge of the battery you can set up an active 15 minute charge schedule in the MyRenault App.
Then create a Dimmer item "RenaultCar_ChargeLimit" and set it to 80% for example. This rule will change the RenaultCar_ChargingMode to schedule_mode when the limit is reached.
This stops charging after the battery level reaches the charge limit.

ChargeRenaultCarLimit Code

```
configuration: {}
triggers:
- id: "1"
configuration:
itemName: RenaultCar_BatteryLevel
type: core.ItemStateUpdateTrigger
- id: "3"
configuration:
itemName: RenaultCar_ChargeLimit
type: core.ItemStateUpdateTrigger
- id: "4"
configuration:
itemName: RenaultCar_PlugStatus
type: core.ItemStateUpdateTrigger
conditions: []
actions:
- inputs: {}
id: "2"
configuration:
type: application/vnd.openhab.dsl.rule
script: >-
if ( RenaultCar_PlugStatus.state.toString == 'PLUGGED' ) {
if ( RenaultCar_BatteryLevel.state as Number >= RenaultCar_ChargeLimit.state as Number ) {
if (RenaultCar_ChargingMode.state.toString == 'ALWAYS_CHARGING' ) {
RenaultCar_ChargingMode.sendCommand("SCHEDULE_MODE")
}
} else {
if (RenaultCar_ChargingMode.state.toString == 'SCHEDULE_MODE' ) {
RenaultCar_ChargingMode.sendCommand("ALWAYS_CHARGING")
}
}
}
type: script.ScriptAction

```
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,18 @@ public class RenaultBindingConstants {
public static final ThingTypeUID THING_TYPE_CAR = new ThingTypeUID(BINDING_ID, "car");

// List of all Channel ids
public static final String CHANNEL_BATTERY_AVAILABLE_ENERGY = "batteryavailableenergy";
public static final String CHANNEL_BATTERY_LEVEL = "batterylevel";
public static final String CHANNEL_CHARGING_MODE = "chargingmode";
public static final String CHANNEL_CHARGING_STATUS = "chargingstatus";
public static final String CHANNEL_CHARGING_REMAINING_TIME = "chargingremainingtime";
public static final String CHANNEL_ESTIMATED_RANGE = "estimatedrange";
public static final String CHANNEL_EXTERNAL_TEMPERATURE = "externaltemperature";
public static final String CHANNEL_HVAC_STATUS = "hvacstatus";
public static final String CHANNEL_HVAC_TARGET_TEMPERATURE = "hvactargettemperature";
public static final String CHANNEL_IMAGE = "image";
public static final String CHANNEL_LOCATION = "location";
public static final String CHANNEL_LOCATION_UPDATED = "locationupdated";
public static final String CHANNEL_ODOMETER = "odometer";
public static final String CHANNEL_PLUG_STATUS = "plugstatus";
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ public class RenaultConfiguration {
public String locale = "";
public String vin = "";
public int refreshInterval = 10;
public int updateDelay = 30;
}
Loading