iobroker.bluelink
Advanced tools
Comparing version 2.3.9 to 3.0.1
@@ -1,5 +0,2 @@ | ||
/*global systemDictionary:true */ | ||
'use strict'; | ||
systemDictionary = { | ||
{ | ||
'bluelink adapter settings': { | ||
@@ -185,3 +182,16 @@ 'en': 'Adapter settings for bluelink', | ||
'zh-cn': 'Language' | ||
} | ||
}, | ||
'Resolve the address from coordinates using openstreetmap':{ | ||
"en": "Resolve the address from coordinates using openstreetmap", | ||
"de": "Lösen Sie die Adresse auf mithilfe der openstreetmap", | ||
"ru": "Удалить адрес из координат с помощью openstreetmap", | ||
"pt": "Resolver o endereço das coordenadas usando o openstreetmap", | ||
"nl": "Oplossen van het adres van coördinaten via openstreetmap", | ||
"fr": "Résoudre l'adresse des coordonnées en utilisant openstreetmap", | ||
"it": "Risolvere l'indirizzo dalle coordinate utilizzando openstreetmap", | ||
"es": "Resolver la dirección desde coordenadas usando openstreetmap", | ||
"pl": "Rozwiąż adres ze współrzędnych używając mapy openstreetmap", | ||
"uk": "Вирішити адресу з координат за допомогою openstreetmap", | ||
"zh-cn": "使用 Opentreetmap 从坐标解析地址" | ||
} | ||
}; |
{ | ||
"common": { | ||
"name": "bluelink", | ||
"version": "2.3.9", | ||
"version": "3.0.1", | ||
"news": { | ||
"3.0.1": { | ||
"en": "activate jsonconfig", | ||
"de": "jsonconfig aktivieren", | ||
"ru": "активировать jsonconfig", | ||
"pt": "ativar o jsonconfig", | ||
"nl": "jsonconfig activeren", | ||
"fr": "activer jsonconfig", | ||
"it": "attivare jsonconfig", | ||
"es": "activar jsonconfig", | ||
"pl": "aktywacja jsonconfig", | ||
"uk": "активувати jsonconfig", | ||
"zh-cn": "激活 json配置" | ||
}, | ||
"3.0.0": { | ||
"en": "new structure jsonconfig", | ||
"de": "neue struktur jsonconfig", | ||
"ru": "новая структура jsonconfig", | ||
"pt": "nova estrutura jsonconfig", | ||
"nl": "nieuwe structuur jsonconfig", | ||
"fr": "nouvelle structure jsonconfig", | ||
"it": "nuova struttura jsonconfig", | ||
"es": "nueva estructura jsonconfig", | ||
"pl": "nowa struktura jsonconfig", | ||
"uk": "нова структура jsonconfig", | ||
"zh-cn": "新结构json配置" | ||
}, | ||
"2.3.11": { | ||
"en": "redesign", | ||
"de": "neugestaltung", | ||
"ru": "редизайн", | ||
"pt": "rede de rede", | ||
"nl": "herontwerp", | ||
"fr": "remaniement", | ||
"it": "riprogettare", | ||
"es": "rediseño", | ||
"pl": "przeprojektowanie", | ||
"uk": "редизайн", | ||
"zh-cn": "重新设计" | ||
}, | ||
"2.3.10": { | ||
"en": "add address as text using openstreetmap", | ||
"de": "adresse als text hinzufügen mit opentreetmap", | ||
"ru": "добавить адрес как текст с помощью opentreetmap", | ||
"pt": "adicionar endereço como texto usando o opentreetmap", | ||
"nl": "adres toevoegen als tekst met openstreetmap", | ||
"fr": "ajouter l'adresse comme texte en utilisant openstreetmap", | ||
"it": "aggiungere l'indirizzo come testo usando openstreetmap", | ||
"es": "añadir dirección como texto usando openstreetmap", | ||
"pl": "dodaj adres jako tekst używając openstreetmap", | ||
"uk": "додати адресу як текст за допомогою openstreetmap", | ||
"zh-cn": "使用 opentreetmap 添加地址为文本" | ||
}, | ||
"2.3.9": { | ||
@@ -18,50 +70,2 @@ "en": "add ccs2 car status", | ||
"zh-cn": "添加 ccs2 车位" | ||
}, | ||
"2.3.8": { | ||
"en": "corr steerWheelHeat", | ||
"de": "korr Steer Radauftrieb", | ||
"ru": "угловое WheelHeat", | ||
"pt": "direção de cor Heat de roda", | ||
"nl": "corrostuur WheelHeat", | ||
"fr": "tête de corbeille Chauffe-roue", | ||
"it": "sterzo Rivestimento della ruota", | ||
"es": "corr steer WheelHeat", | ||
"pl": "korrsteel Koła Ciepło", | ||
"uk": "стюардеси Колеса", | ||
"zh-cn": "旋转方向盘 轮热" | ||
}, | ||
"2.3.7": { | ||
"en": "set default force_update to server", | ||
"de": "set default force_update to server", | ||
"ru": "настройка параметра force_update_", | ||
"pt": "set default force_update to server", | ||
"nl": "set default force_update to server", | ||
"fr": "définir force_update par défaut au serveur", | ||
"it": "set default force_update al server", | ||
"es": "set default force_update to server", | ||
"pl": "ustaw domyślny force _ update do serwera", | ||
"uk": "встановити значення за замовчуванням_update на сервер", | ||
"zh-cn": "设置默认强制值_ 更新到服务器" | ||
}, | ||
"2.3.6": { | ||
"en": "corr crash", | ||
"uk": "збій", | ||
"de": "korrektur crash", | ||
"ru": "корр аварии", | ||
"pt": "quebra de corrimento", | ||
"nl": "vertaling:", | ||
"fr": "corr crash", | ||
"it": "crash del corpo", | ||
"es": "colisión", | ||
"pl": "cor crash", | ||
"zh-cn": "意外事故" | ||
}, | ||
"2.3.2": { | ||
"en": "force update only selected vin\n add buttons for force_refresh_from_server and force_refresh_from_car" | ||
}, | ||
"2.3.1": { | ||
"en": "see Readme" | ||
}, | ||
"2.2.8": { | ||
"en": "force update" | ||
} | ||
@@ -97,3 +101,3 @@ }, | ||
"adminUI": { | ||
"config": "materialize", | ||
"config": "json", | ||
"tab": "materialize" | ||
@@ -146,3 +150,4 @@ }, | ||
"errorCounter": 5, | ||
"language": "DE" | ||
"language": "DE", | ||
"resAddress": false | ||
}, | ||
@@ -149,0 +154,0 @@ "objects": [], |
@@ -53,15 +53,29 @@ const axios = require('axios').default; | ||
*/ | ||
async function translateYandex(text, targetLang, apiKey) { | ||
if (targetLang === 'zh-cn') { | ||
targetLang = 'zh'; | ||
async function getResolvedAddress(latitude,longitude) { | ||
try { | ||
const url = `https://nominatim.openstreetmap.org/reverse.php?format=json&lat=${latitude}&lon==${longitude}&zoom=18`; | ||
const response = await axios({url, timeout: 5000}); | ||
if (response.data) { | ||
const addr = ([strasse ? strasse : null,hausnummer ? [' ',hausnummer,''].join('') : null,strasse ? ', ' : null,plz ? String(plz) + ' ' : null,stadt ? String(stadt) + '' : null,stadtteil ? [' (',stadtteil,')'].join('') : null,kreis ? ', ' + String(kreis) : null,bundesland ? ', ' + String(bundesland) : null,land ? ', ' + String(land) : null,!land ? 'not found.' : null].join('')); | ||
return addr; | ||
} | ||
} catch (err) { | ||
throw new Error(`Could not find address: ${err}`); | ||
} | ||
} | ||
async function getResolveAddress(latitude,longitude) { | ||
try { | ||
const url = `https://translate.yandex.net/api/v1.5/tr.json/translate?key=${apiKey}&text=${encodeURIComponent(text)}&lang=en-${targetLang}`; | ||
const response = await axios({url, timeout: 15000}); | ||
if (response.data && response.data.text && isArray(response.data.text)) { | ||
return response.data.text[0]; | ||
const url = `https://nominatim.openstreetmap.org/reverse.php?format=json&lat=${latitude}&lon=${longitude}&zoom=18`; | ||
const response = await axios({url, timeout: 5000}); | ||
if (response.data) { | ||
const addrDetails = response.data.address; | ||
const addr = ([addrDetails.road ? addrDetails.road : null,addrDetails.house_number ? [' ',addrDetails.house_number,''].join('') : null,addrDetails.road ? ', ' : null,addrDetails.postcode ? String(addrDetails.postcode) + ' ' : null,addrDetails.town ? String(addrDetails.town) + '' : null,addrDetails.village ? [' (',addrDetails.village,')'].join('') : null,addrDetails.county ? ', ' + String(addrDetails.county) : null,addrDetails.state ? ', ' + String(addrDetails.state) : null,addrDetails.country ? ', ' + String(addrDetails.country) : null,!addrDetails.country ? 'not found' : null].join('')); | ||
return addr; | ||
} | ||
throw new Error('Invalid response for translate request'); | ||
} catch (e) { | ||
throw new Error(`Could not translate to "${targetLang}": ${e}`); | ||
return '' | ||
} catch (err) { | ||
return ''; | ||
} | ||
@@ -99,3 +113,4 @@ } | ||
isObject, | ||
translateText | ||
translateText, | ||
getResolveAddress | ||
}; |
776
main.js
@@ -6,2 +6,4 @@ 'use strict'; | ||
const Json2iob = require('./lib/json2iob'); | ||
const tools = require('./lib/tools'); | ||
const Create_tools = require('./lib/create_tools').Create_tools; | ||
@@ -20,4 +22,4 @@ const adapterIntervals = {}; //halten von allen Intervallen | ||
const POSSIBLE_CHARGE_LIMIT_VALUES = [50, 60, 70, 80, 90, 100]; | ||
let create_tools; | ||
/* seat states from bluelinky | ||
@@ -47,2 +49,3 @@ 1: Unknown | ||
this.vehicles = []; | ||
this.json2iob = new Json2iob(this); | ||
@@ -268,5 +271,8 @@ adapterIntervals.evHistoryInterval = null; | ||
await this.setControlObjects(vin); | ||
await this.setStatusObjects(vin); | ||
create_tools = new Create_tools(this); | ||
await create_tools.setControlObjects(vin); | ||
await create_tools.setStatusObjects(vin); | ||
await this.json2iob.parse(`${vin}.general`, vehicle.vehicleConfig); | ||
@@ -585,32 +591,31 @@ | ||
if (newStatus.vehicleStatus.hasOwnProperty('evStatus')) { | ||
if (newStatus.vehicleStatus.evStatus.reservChargeInfos.hasOwnProperty('targetSOClist[0]')) { | ||
if (newStatus.vehicleStatus.evStatus.reservChargeInfos.targetSOClist[0].plugType == 1) { | ||
//Slow = 1 -> Index 0 ist slow | ||
slow_charging = newStatus.vehicleStatus.evStatus.reservChargeInfos.targetSOClist[0].targetSOClevel; | ||
await this.setStateAsync(vin + '.control.charge_limit_slow', { | ||
val: slow_charging, | ||
ack: true, | ||
}); | ||
if (newStatus.vehicleStatus.evStatus.reservChargeInfos.targetSOClist[0].plugType == 1) { | ||
//Slow = 1 -> Index 0 ist slow | ||
slow_charging = newStatus.vehicleStatus.evStatus.reservChargeInfos.targetSOClist[0].targetSOClevel; | ||
await this.setStateAsync(vin + '.control.charge_limit_slow', { | ||
val: slow_charging, | ||
ack: true, | ||
}); | ||
fast_charging = newStatus.vehicleStatus.evStatus.reservChargeInfos.targetSOClist[1].targetSOClevel; | ||
await this.setStateAsync(vin + '.control.charge_limit_fast', { | ||
val: fast_charging, | ||
ack: true, | ||
}); | ||
} else { | ||
//fast = 0 -> Index 0 ist fast | ||
slow_charging = newStatus.vehicleStatus.evStatus.reservChargeInfos.targetSOClist[1].targetSOClevel; | ||
await this.setStateAsync(vin + '.control.charge_limit_slow', { | ||
val: slow_charging, | ||
ack: true, | ||
}); | ||
fast_charging = newStatus.vehicleStatus.evStatus.reservChargeInfos.targetSOClist[1].targetSOClevel; | ||
await this.setStateAsync(vin + '.control.charge_limit_fast', { | ||
val: fast_charging, | ||
ack: true, | ||
}); | ||
} else { | ||
//fast = 0 -> Index 0 ist fast | ||
slow_charging = newStatus.vehicleStatus.evStatus.reservChargeInfos.targetSOClist[1].targetSOClevel; | ||
await this.setStateAsync(vin + '.control.charge_limit_slow', { | ||
val: slow_charging, | ||
ack: true, | ||
}); | ||
fast_charging = newStatus.vehicleStatus.evStatus.reservChargeInfos.targetSOClist[0].targetSOClevel; | ||
await this.setStateAsync(vin + '.control.charge_limit_fast', { | ||
val: fast_charging, | ||
ack: true, | ||
}); | ||
} | ||
fast_charging = newStatus.vehicleStatus.evStatus.reservChargeInfos.targetSOClist[0].targetSOClevel; | ||
await this.setStateAsync(vin + '.control.charge_limit_fast', { | ||
val: fast_charging, | ||
ack: true, | ||
}); | ||
} | ||
//Nur für Elektro Fahrzeuge - Battery | ||
@@ -677,31 +682,23 @@ await this.setStateAsync(vin + '.vehicleStatus.dte', { | ||
//Location | ||
const latitude = newStatus.ccs2Status.state.Vehicle.Location.GeoCoord.Latitude; | ||
const longitude = newStatus.ccs2Status.state.Vehicle.Location.GeoCoord.Longitude; | ||
const positionUrl = `${positionUrlConst}${latitude}+${longitude}`; | ||
const latitude = newStatus.ccs2Status.state.Vehicle.Location.GeoCoord.Latitude; | ||
const longitude = newStatus.ccs2Status.state.Vehicle.Location.GeoCoord.Longitude; | ||
const speed = newStatus.ccs2Status.state.Vehicle.Location.Speed.Value; | ||
await this.setStateAsync(vin + '.vehicleLocation.lat', {val: latitude, ack: true}); | ||
await this.setStateAsync(vin + '.vehicleLocation.lon', {val: longitude, ack: true}); | ||
await this.setStateAsync(vin + '.vehicleLocation.speed', { | ||
val: newStatus.ccs2Status.state.Vehicle.Location.Speed.Value, | ||
ack: true | ||
}); | ||
await this.setStateAsync(vin + '.vehicleLocation.position_url', {val: positionUrl, ack: true}); | ||
this.locationResolve(vin, latitude, longitude, speed); | ||
//Odometer | ||
await this.setStateAsync(vin + '.odometer.value', {val: newStatus.ccs2Status.state.Vehicle.Drivetrain.Odometer, ack: true}); | ||
if (newStatus.ccs2Status.state.Vehicle.Green.ChargingInformation.hasOwnProperty('TargetSoC')) { | ||
//fast = 0 -> Index 0 ist fast | ||
slow_charging = newStatus.ccs2Status.state.Vehicle.Green.ChargingInformation.TargetSoC.Standard; | ||
await this.setStateAsync(vin + '.control.charge_limit_slow', { | ||
val: slow_charging, | ||
ack: true, | ||
}); | ||
slow_charging = newStatus.ccs2Status.state.Vehicle.Green.ChargingInformation.TargetSoC.Standard; | ||
await this.setStateAsync(vin + '.control.charge_limit_slow', { | ||
val: slow_charging, | ||
ack: true, | ||
}); | ||
fast_charging = newStatus.ccs2Status.state.Vehicle.Green.ChargingInformation.TargetSoC.Quick; | ||
await this.setStateAsync(vin + '.control.charge_limit_fast', { | ||
val: fast_charging, | ||
ack: true, | ||
}); | ||
} | ||
fast_charging = newStatus.ccs2Status.state.Vehicle.Green.ChargingInformation.TargetSoC.Quick; | ||
await this.setStateAsync(vin + '.control.charge_limit_fast', { | ||
val: fast_charging, | ||
ack: true, | ||
}); | ||
} else { | ||
@@ -721,13 +718,8 @@ if (newStatus.vehicleStatus.hasOwnProperty('battery')) { | ||
if (newStatus.hasOwnProperty('vehicleLocation')) { | ||
const latitude = newStatus.vehicleLocation.coord.lat; | ||
const longitude = newStatus.vehicleLocation.coord.lon; | ||
const positionUrl = `${positionUrlConst}${latitude}+${longitude}`; | ||
await this.setStateAsync(vin + '.vehicleLocation.lat', {val: latitude, ack: true}); | ||
await this.setStateAsync(vin + '.vehicleLocation.lon', {val: longitude, ack: true}); | ||
await this.setStateAsync(vin + '.vehicleLocation.speed', { | ||
val: newStatus.vehicleLocation.speed.value, | ||
ack: true | ||
}); | ||
await this.setStateAsync(vin + '.vehicleLocation.position_url', {val: positionUrl, ack: true}); | ||
const latitude = newStatus.vehicleLocation.coord.lat; | ||
const longitude = newStatus.vehicleLocation.coord.lon; | ||
const speed = newStatus.vehicleLocation.speed.value; | ||
this.locationResolve(vin, latitude, longitude, speed); | ||
} | ||
@@ -828,658 +820,18 @@ | ||
async setControlObjects(vin) { | ||
await this.setObjectNotExistsAsync(vin + '.control.charge', { | ||
type: 'state', | ||
common: { | ||
name: 'Start charging', | ||
type: 'boolean', | ||
role: 'button', | ||
read: true, | ||
write: true, | ||
def: true, | ||
}, | ||
native: {}, | ||
}); | ||
this.subscribeStates(vin + '.control.charge'); | ||
async locationResolve(vin, latitude, longitude, speed){ | ||
const positionUrl = `${positionUrlConst}${latitude}+${longitude}`; | ||
await this.setObjectNotExistsAsync(vin + '.control.charge_stop', { | ||
type: 'state', | ||
common: { | ||
name: 'Stop charging', | ||
type: 'boolean', | ||
role: 'button', | ||
read: true, | ||
write: true, | ||
def: true, | ||
}, | ||
native: {}, | ||
}); | ||
this.subscribeStates(vin + '.control.charge_stop'); | ||
await this.setObjectNotExistsAsync(vin + '.control.lock', { | ||
type: 'state', | ||
common: { | ||
name: 'Lock the vehicle', | ||
type: 'boolean', | ||
role: 'button', | ||
read: true, | ||
write: true, | ||
def: true, | ||
}, | ||
native: {}, | ||
}); | ||
this.subscribeStates(vin + '.control.lock'); | ||
await this.setObjectNotExistsAsync(vin + '.control.unlock', { | ||
type: 'state', | ||
common: { | ||
name: 'Unlock the vehicle', | ||
type: 'boolean', | ||
role: 'button', | ||
read: true, | ||
write: true, | ||
def: true, | ||
}, | ||
native: {}, | ||
}); | ||
this.subscribeStates(vin + '.control.unlock'); | ||
if (this.config.motor == 'EV') { | ||
await this.setObjectNotExistsAsync(vin + '.control.force_checkDriveInfo', { | ||
type: 'state', | ||
common: { | ||
name: 'Force load Drive Infos', | ||
type: 'boolean', | ||
role: 'button', | ||
read: true, | ||
write: true, | ||
def: true, | ||
}, | ||
native: {}, | ||
}); | ||
this.subscribeStates(vin + '.control.force_checkDriveInfo'); | ||
await this.setObjectNotExistsAsync(vin + '.control.clima.start', { | ||
type: 'state', | ||
common: { | ||
name: 'Start clima for the vehicle', | ||
type: 'boolean', | ||
role: 'button', | ||
read: true, | ||
write: true, | ||
def: true, | ||
}, | ||
native: {}, | ||
}); | ||
this.subscribeStates(vin + '.control.clima.start'); | ||
await this.setObjectNotExistsAsync(vin + '.control.clima.set.defrost', { | ||
type: 'state', | ||
common: { | ||
name: 'set defrost function for clima', | ||
type: 'boolean', | ||
role: 'state', | ||
read: true, | ||
write: true, | ||
def: false, | ||
}, | ||
native: {}, | ||
}); | ||
await this.setObjectNotExistsAsync(vin + '.control.clima.set.heating', { | ||
type: 'state', | ||
common: { | ||
name: 'set heating 1 or 0', | ||
type: 'number', | ||
role: 'state', | ||
read: true, | ||
write: true, | ||
def: 0, | ||
}, | ||
native: {}, | ||
}); | ||
await this.setObjectNotExistsAsync(vin + '.control.clima.set.airTemp', { | ||
type: 'state', | ||
common: { | ||
name: 'set Vehicle air tempereature', | ||
type: 'number', | ||
role: 'indicator', | ||
read: true, | ||
write: true, | ||
def: 18, | ||
}, | ||
native: {}, | ||
}); | ||
await this.setObjectNotExistsAsync(vin + '.control.clima.stop', { | ||
type: 'state', | ||
common: { | ||
name: 'Stop clima for the vehicle', | ||
type: 'boolean', | ||
role: 'button', | ||
read: true, | ||
write: true, | ||
def: true, | ||
}, | ||
native: {}, | ||
}); | ||
this.subscribeStates(vin + '.control.clima.stop'); | ||
await this.setStateAsync(vin + '.vehicleLocation.lat', {val: latitude, ack: true}); | ||
await this.setStateAsync(vin + '.vehicleLocation.lon', {val: longitude, ack: true}); | ||
if (speed > 250) { | ||
speed = 0; | ||
} | ||
await this.setObjectNotExistsAsync(vin + '.control.force_refresh_from_car', { | ||
type: 'state', | ||
common: { | ||
name: 'Force refresh vehicle status from car', | ||
type: 'boolean', | ||
role: 'button', | ||
read: true, | ||
write: true, | ||
def: true, | ||
}, | ||
native: {}, | ||
}); | ||
this.subscribeStates(vin + '.control.force_refresh_from_car'); | ||
await this.setStateAsync(vin + '.vehicleLocation.speed', {val: speed, ack: true}); | ||
await this.setStateAsync(vin + '.vehicleLocation.position_url', {val: positionUrl, ack: true}); | ||
await this.setObjectNotExistsAsync(vin + '.control.force_refresh_from_server', { | ||
type: 'state', | ||
common: { | ||
name: 'Force refresh vehicle status from server', | ||
type: 'boolean', | ||
role: 'button', | ||
read: true, | ||
write: true, | ||
def: true, | ||
}, | ||
native: {}, | ||
}); | ||
this.subscribeStates(vin + '.control.force_refresh_from_server'); | ||
const addressText = await tools.getResolveAddress(latitude, longitude); | ||
await this.setObjectNotExistsAsync(vin + '.control.force_refresh', { | ||
type: 'state', | ||
common: { | ||
name: 'Force refresh vehicle status', | ||
type: 'boolean', | ||
role: 'button', | ||
read: true, | ||
write: true, | ||
def: true, | ||
}, | ||
native: {}, | ||
}); | ||
this.subscribeStates(vin + '.control.force_refresh'); | ||
await this.setObjectNotExistsAsync(vin + '.control.force_update', { | ||
type: 'state', | ||
common: { | ||
name: 'true = car, false = server', | ||
type: 'boolean', | ||
role: 'state', | ||
read: true, | ||
write: true, | ||
def: false, | ||
}, | ||
native: {}, | ||
}); | ||
this.subscribeStates(vin + '.control.force_update'); | ||
await this.setObjectNotExistsAsync(vin + '.control.force_login', { | ||
type: 'state', | ||
common: { | ||
name: 'Force login', | ||
type: 'boolean', | ||
role: 'button', | ||
read: true, | ||
write: true, | ||
def: true, | ||
}, | ||
native: {}, | ||
}); | ||
this.subscribeStates(vin + '.control.force_login'); | ||
await this.setObjectNotExistsAsync(vin + '.control.batteryControlState12V', { | ||
type: 'state', | ||
common: { | ||
name: 'Set battery monitoring', | ||
type: 'number', | ||
role: 'state', | ||
read: true, | ||
write: true, | ||
def: 65, | ||
}, | ||
native: {}, | ||
}); | ||
this.subscribeStates(vin + '.control.batteryControlState12V'); | ||
//Charge | ||
await this.setObjectNotExistsAsync(vin + '.control.charge_limit_slow', { | ||
type: 'state', | ||
common: { | ||
name: 'Vehicle charge limit for slow charging', | ||
type: 'number', | ||
role: 'indicator', | ||
read: true, | ||
write: true, | ||
def: 100, | ||
}, | ||
native: {}, | ||
}); | ||
this.subscribeStates(vin + '.control.charge_limit_slow'); | ||
await this.setObjectNotExistsAsync(vin + '.control.charge_limit_fast', { | ||
type: 'state', | ||
common: { | ||
name: 'Vehicle charge limit for fast charging', | ||
type: 'number', | ||
role: 'indicator', | ||
read: true, | ||
write: true, | ||
def: 100, | ||
}, | ||
native: {}, | ||
}); | ||
this.subscribeStates(vin + '.control.charge_limit_fast'); | ||
await this.setStateAsync(vin + '.vehicleLocation.position_text', {val: addressText, ack: true}); | ||
} | ||
async setStatusObjects(vin) { | ||
await this.setObjectNotExistsAsync(vin + '.lastInfoUpdate', { | ||
type: 'state', | ||
common: { | ||
name: 'Date/Time of last information update', | ||
type: 'number', | ||
role: 'value.time', | ||
read: true, | ||
write: false | ||
}, | ||
native: {}, | ||
}); | ||
await this.setObjectNotExistsAsync(vin + '.error_counter', { | ||
type: 'state', | ||
common: { | ||
name: 'error_counter', | ||
type: 'number', | ||
role: 'state', | ||
read: true, | ||
write: false, | ||
def: 0, | ||
}, | ||
native: {}, | ||
}); | ||
await this.setObjectNotExistsAsync(vin + '.vehicleStatusRaw', { | ||
type: 'channel', | ||
common: { | ||
name: 'Unformatted vehicle status', | ||
}, | ||
native: {}, | ||
}); | ||
//Bereicht vehicleStatus | ||
await this.setObjectNotExistsAsync(vin + '.vehicleStatus.doorLock', { | ||
type: 'state', | ||
common: { | ||
name: 'Vehicle doors locked', | ||
type: 'boolean', | ||
role: 'indicator', | ||
read: true, | ||
write: false, | ||
}, | ||
native: {}, | ||
}); | ||
await this.setObjectNotExistsAsync(vin + '.vehicleStatus.trunkOpen', { | ||
type: 'state', | ||
common: { | ||
name: 'Trunk open', | ||
type: 'boolean', | ||
role: 'indicator', | ||
read: true, | ||
write: false, | ||
}, | ||
native: {}, | ||
}); | ||
await this.setObjectNotExistsAsync(vin + '.vehicleStatus.hoodOpen', { | ||
type: 'state', | ||
common: { | ||
name: 'Hood open', | ||
type: 'boolean', | ||
role: 'indicator', | ||
read: true, | ||
write: false, | ||
}, | ||
native: {}, | ||
}); | ||
//Doors open | ||
await this.setObjectNotExistsAsync(vin + '.vehicleStatus.doorOpen.frontLeft', { | ||
type: 'state', | ||
common: { | ||
name: 'Door open front left open', | ||
type: 'boolean', | ||
role: 'indicator', | ||
read: true, | ||
write: false, | ||
}, | ||
native: {}, | ||
}); | ||
await this.setObjectNotExistsAsync(vin + '.vehicleStatus.doorOpen.frontRight', { | ||
type: 'state', | ||
common: { | ||
name: 'Door open front right open', | ||
type: 'boolean', | ||
role: 'indicator', | ||
read: true, | ||
write: false, | ||
}, | ||
native: {}, | ||
}); | ||
await this.setObjectNotExistsAsync(vin + '.vehicleStatus.doorOpen.backLeft', { | ||
type: 'state', | ||
common: { | ||
name: 'Door open back left open', | ||
type: 'boolean', | ||
role: 'indicator', | ||
read: true, | ||
write: false, | ||
}, | ||
native: {}, | ||
}); | ||
await this.setObjectNotExistsAsync(vin + '.vehicleStatus.doorOpen.backRight', { | ||
type: 'state', | ||
common: { | ||
name: 'Door open back right open', | ||
type: 'boolean', | ||
role: 'indicator', | ||
read: true, | ||
write: false, | ||
}, | ||
native: {}, | ||
}); | ||
await this.setObjectNotExistsAsync(vin + '.vehicleStatus.airCtrlOn', { | ||
type: 'state', | ||
common: { | ||
name: 'Vehicle air control', | ||
type: 'boolean', | ||
role: 'indicator', | ||
read: true, | ||
write: false, | ||
}, | ||
native: {}, | ||
}); | ||
await this.setObjectNotExistsAsync(vin + '.vehicleStatus.airTemp', { | ||
type: 'state', | ||
common: { | ||
name: 'Vehicle air tempereature', | ||
type: 'number', | ||
role: 'indicator', | ||
read: true, | ||
write: false, | ||
}, | ||
native: {}, | ||
}); | ||
await this.setObjectNotExistsAsync(vin + '.vehicleStatus.smartKeyBatteryWarning', { | ||
type: 'state', | ||
common: { | ||
name: 'Smart key battery Warning', | ||
type: 'boolean', | ||
role: 'indicator', | ||
read: true, | ||
write: false, | ||
}, | ||
native: {}, | ||
}); | ||
await this.setObjectNotExistsAsync(vin + '.vehicleStatus.washerFluidStatus', { | ||
type: 'state', | ||
common: { | ||
name: 'Washer fluid status', | ||
type: 'boolean', | ||
role: 'indicator', | ||
read: true, | ||
write: false, | ||
}, | ||
native: {}, | ||
}); | ||
await this.setObjectNotExistsAsync(vin + '.vehicleStatus.breakOilStatus', { | ||
type: 'state', | ||
common: { | ||
name: 'Breal oil status', | ||
type: 'boolean', | ||
role: 'indicator', | ||
read: true, | ||
write: false, | ||
}, | ||
native: {}, | ||
}); | ||
await this.setObjectNotExistsAsync(vin + '.vehicleStatus.steerWheelHeat', { | ||
type: 'state', | ||
common: { | ||
name: 'Steer wheel heat', | ||
type: 'boolean', | ||
role: 'indicator', | ||
read: true, | ||
write: false, | ||
}, | ||
native: {}, | ||
}); | ||
await this.setObjectNotExistsAsync(vin + '.vehicleStatus.sideBackWindowHeat', { | ||
type: 'state', | ||
common: { | ||
name: 'Side back window heat', | ||
type: 'number', | ||
role: 'indicator', | ||
read: true, | ||
write: false, | ||
}, | ||
native: {}, | ||
}); | ||
await this.setObjectNotExistsAsync(vin + '.vehicleStatus.dte', { | ||
type: 'state', | ||
common: { | ||
name: 'Vehicle total available range', | ||
type: 'number', | ||
role: 'indicator', | ||
read: true, | ||
write: false, | ||
}, | ||
native: {}, | ||
}); | ||
await this.setObjectNotExistsAsync(vin + '.vehicleStatus.evModeRange', { | ||
type: 'state', | ||
common: { | ||
name: 'Vehicle total available range for ev', | ||
type: 'number', | ||
role: 'indicator', | ||
read: true, | ||
write: false, | ||
}, | ||
native: {}, | ||
}); | ||
await this.setObjectNotExistsAsync(vin + '.vehicleStatus.gasModeRange', { | ||
type: 'state', | ||
common: { | ||
name: 'Vehicle total available range for gas', | ||
type: 'number', | ||
role: 'indicator', | ||
read: true, | ||
write: false, | ||
}, | ||
native: {}, | ||
}); | ||
await this.setObjectNotExistsAsync(vin + '.vehicleStatus.battery.minutes_to_charged', { | ||
type: 'state', | ||
common: { | ||
name: 'Vehicle minutes to charged', | ||
type: 'number', | ||
role: 'indicator', | ||
read: true, | ||
write: false, | ||
}, | ||
native: {}, | ||
}); | ||
//Battery | ||
await this.setObjectNotExistsAsync(vin + '.vehicleStatus.battery.soc', { | ||
type: 'state', | ||
common: { | ||
name: 'Vehicle battery state of charge', | ||
type: 'number', | ||
role: 'indicator', | ||
read: true, | ||
write: false, | ||
}, | ||
native: {}, | ||
}); | ||
await this.setObjectNotExistsAsync(vin + '.vehicleStatus.battery.charge', { | ||
type: 'state', | ||
common: { | ||
name: 'Vehicle charging', | ||
type: 'boolean', | ||
role: 'indicator', | ||
read: true, | ||
write: false, | ||
}, | ||
native: {}, | ||
}); | ||
await this.setObjectNotExistsAsync(vin + '.vehicleStatus.battery.plugin', { | ||
type: 'state', | ||
common: { | ||
name: 'Charger connected (UNPLUGED = 0, FAST = 1, PORTABLE = 2, STATION = 3)', | ||
type: 'number', | ||
role: 'indicator', | ||
read: true, | ||
write: false, | ||
}, | ||
native: {}, | ||
}); | ||
await this.setObjectNotExistsAsync(vin + '.vehicleStatus.battery.soc-12V', { | ||
type: 'state', | ||
common: { | ||
name: 'Vehicle 12v battery state of charge', | ||
type: 'number', | ||
role: 'indicator', | ||
read: true, | ||
write: false, | ||
}, | ||
native: {}, | ||
}); | ||
await this.setObjectNotExistsAsync(vin + '.vehicleStatus.battery.state-12V', { | ||
type: 'state', | ||
common: { | ||
name: 'Vehicle 12v battery State', | ||
type: 'number', | ||
role: 'indicator', | ||
read: true, | ||
write: false, | ||
}, | ||
native: {}, | ||
}); | ||
await this.setObjectNotExistsAsync(vin + '.vehicleStatus.battery.smartKeyBatteryWarning', { | ||
type: 'state', | ||
common: { | ||
name: 'Key battery', | ||
type: 'boolean', | ||
role: 'indicator', | ||
read: true, | ||
write: false, | ||
}, | ||
native: {}, | ||
}); | ||
//Bereich vehicleLocation | ||
await this.setObjectNotExistsAsync(vin + '.vehicleLocation.lat', { | ||
type: 'state', | ||
common: { | ||
name: 'Vehicle position latitude', | ||
type: 'number', | ||
role: 'value.gps.latitude', | ||
unit: '°', | ||
read: true, | ||
write: false, | ||
def: 0, | ||
}, | ||
native: {}, | ||
}); | ||
await this.setObjectNotExistsAsync(vin + '.vehicleLocation.lon', { | ||
type: 'state', | ||
common: { | ||
name: 'Vehicle position longitude', | ||
type: 'number', | ||
role: 'value.gps.longitude', | ||
unit: '°', | ||
read: true, | ||
write: false, | ||
def: 0, | ||
}, | ||
native: {}, | ||
}); | ||
await this.setObjectNotExistsAsync(vin + '.vehicleLocation.speed', { | ||
type: 'state', | ||
common: { | ||
name: 'Vehicle speed', | ||
type: 'number', | ||
role: 'value.speed', | ||
unit: 'km/h', | ||
read: true, | ||
write: false, | ||
}, | ||
native: {}, | ||
}); | ||
await this.setObjectNotExistsAsync(vin + '.vehicleLocation.position_url', { | ||
type: 'state', | ||
common: { | ||
name: 'Position URL', | ||
type: 'string', | ||
role: 'text.url', | ||
read: true, | ||
write: false, | ||
}, | ||
native: {}, | ||
}); | ||
//Bereich Odometer | ||
await this.setObjectNotExistsAsync(vin + '.odometer.value', { | ||
type: 'state', | ||
common: { | ||
name: 'Odometer value', | ||
type: 'number', | ||
role: 'indicator', | ||
read: true, | ||
write: false, | ||
}, | ||
native: {}, | ||
}); | ||
await this.setObjectNotExistsAsync(vin + '.general', { | ||
type: 'channel', | ||
common: { | ||
name: 'General Information', | ||
}, | ||
native: {}, | ||
}); | ||
} | ||
async cleanObjects() { | ||
@@ -1486,0 +838,0 @@ const controlState = await this.getObjectAsync('control.charge'); |
{ | ||
"name": "iobroker.bluelink", | ||
"version": "2.3.9", | ||
"version": "3.0.1", | ||
"description": "Adapter to control Hyundai or Kia vehicle", | ||
@@ -5,0 +5,0 @@ "author": { |
@@ -38,2 +38,14 @@ ![Logo](admin/bluelink.png) | ||
## Changelog | ||
### 3.0.1 (2024-09-27) | ||
* (arteck) activate jsonconfig | ||
### 3.0.0 (2024-09-27) | ||
* (arteck) new structure jsonconfig | ||
### 2.3.11 (2024-09-27) | ||
* (arteck) redesign | ||
### 2.3.10 (2024-09-27) | ||
* (arteck) add address as text using openstreetmap | ||
### 2.3.9 (2024-09-26) | ||
@@ -40,0 +52,0 @@ * (arteck) add ccs2 car status |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
2173
159
116873
14
1