node-red-contrib-onstar2
Version:
An updated Node-RED Library using OnStarJS2, supporting both v1 and v3 OnStar APIs with automatic version detection
1,084 lines (1,012 loc) • 43.1 kB
HTML
<script type="text/javascript">
RED.nodes.registerType('get-account-vehicles', {
category: 'onstar2',
color: '#7eb0ff',
defaults: {
name: { value: 'Get Account Vehicles' },
onstar2: { value: 'Onstar Config', type: 'onstar2' }
},
inputs: 1,
outputs: 2,
outputLabels: ["Account Vehicle Capabilities","result.response"],
icon: 'onstar.svg',
label: function () {
//return this.name || 'get-account-vehicles';
var configCarName = RED.nodes.node(this.onstar2);
return configCarName.label()+" "+this.name;
},
oneditsave: function() {
var originalName = "Get Account Vehicles";
var editNodeName = $("#node-input-name").val();
if (editNodeName == '') {
$("#node-input-name").val(originalName);
}
$("#node-input-name").val();
},
});
</script>
<script type="text/javascript">
RED.nodes.registerType('get-diagnostics', {
category: 'onstar2',
color: '#7eb0ff',
defaults: {
name: { value: 'Diagnostics' },
onstar2: { value: 'Onstar Config', type: 'onstar2' }
},
inputs: 1,
outputs: 2,
outputLabels: ["Diagnostics","result.response.data"],
icon: 'onstar.svg',
label: function () {
var configCarName = RED.nodes.node(this.onstar2);
return configCarName.label()+" "+this.name;
},
oneditsave: function() {
var editNodeName = $("#node-input-name").val();
if (editNodeName == '') {
$("#node-input-name").val("Diagnostics");
}
$("#node-input-name").val();
},
});
</script>
<script type="text/javascript">
RED.nodes.registerType('lock-myvehicle', {
category: 'onstar2',
color: '#7eb0ff',
defaults: {
name: { value: 'Lock Vehicle' },
onstar2: { value: 'Onstar Config', type: 'onstar2' },
delay: { required: false, validate: RED.validators.regex(/^(|\d)+$/)}
},
inputs: 1,
outputs: 2,
outputLabels: ["Command Status","result.response.data"],
icon: 'onstar.svg',
label: function () {
//return this.name || 'lock-vehicle';
var configCarName = RED.nodes.node(this.onstar2);
return configCarName.label()+" "+this.name;
},
oneditsave: function() {
var editNodeName = $("#node-input-name").val();
if (editNodeName == '') {
$("#node-input-name").val("Lock Vehicle");
}
$("#node-input-name").val();
},
});
</script>
<script type="text/javascript">
RED.nodes.registerType('unlock-myvehicle', {
category: 'onstar2',
color: '#7eb0ff',
defaults: {
name: { value: 'Unlock Vehicle' },
onstar2: { value: 'Onstar Config', type: 'onstar2' },
delay: { required: false, validate: RED.validators.regex(/^(|\d)+$/)}
},
inputs: 1,
outputs: 2,
outputLabels: ["Command Status","result.response.data"],
icon: 'onstar.svg',
label: function () {
//return this.name || 'unlock-vehicle';
var configCarName = RED.nodes.node(this.onstar2);
return configCarName.label()+" "+this.name;
},
oneditsave: function() {
var editNodeName = $("#node-input-name").val();
if (editNodeName == '') {
$("#node-input-name").val("Unlock Vehicle");
}
$("#node-input-name").val();
},
});
</script>
<script type="text/javascript">
RED.nodes.registerType('lock-mytrunk', {
category: 'onstar2',
color: '#7eb0ff',
defaults: {
name: { value: 'Lock Trunk' },
onstar2: { value: 'Onstar Config', type: 'onstar2' },
delay: { required: false, validate: RED.validators.regex(/^(|\d)+$/)}
},
inputs: 1,
outputs: 2,
outputLabels: ["Command Status","result.response.data"],
icon: 'onstar.svg',
label: function () {
//return this.name || 'lock-vehicle';
var configCarName = RED.nodes.node(this.onstar2);
return configCarName.label()+" "+this.name;
},
oneditsave: function() {
var editNodeName = $("#node-input-name").val();
if (editNodeName == '') {
$("#node-input-name").val("Lock Trunk");
}
$("#node-input-name").val();
},
});
</script>
<script type="text/javascript">
RED.nodes.registerType('unlock-mytrunk', {
category: 'onstar2',
color: '#7eb0ff',
defaults: {
name: { value: 'Unlock Trunk' },
onstar2: { value: 'Onstar Config', type: 'onstar2' },
delay: { required: false, validate: RED.validators.regex(/^(|\d)+$/)}
},
inputs: 1,
outputs: 2,
outputLabels: ["Command Status","result.response.data"],
icon: 'onstar.svg',
label: function () {
//return this.name || 'unlock-vehicle';
var configCarName = RED.nodes.node(this.onstar2);
return configCarName.label()+" "+this.name;
},
oneditsave: function() {
var editNodeName = $("#node-input-name").val();
if (editNodeName == '') {
$("#node-input-name").val("Unlock Trunk");
}
$("#node-input-name").val();
},
});
</script>
<script type="text/javascript">
RED.nodes.registerType('start-myvehicle', {
category: 'onstar2',
color: '#7eb0ff',
defaults: {
name: { value: 'Start Vehicle' },
onstar2: { value: 'Onstar Config', type: 'onstar2' }
},
inputs: 1,
outputs: 2,
outputLabels: ["Command Status","result.response.data"],
icon: 'onstar.svg',
label: function () {
//return this.name || 'start-vehicle';
var configCarName = RED.nodes.node(this.onstar2);
return configCarName.label()+" "+this.name;
},
oneditsave: function() {
var editNodeName = $("#node-input-name").val();
if (editNodeName == '') {
$("#node-input-name").val("Start Vehicle");
}
$("#node-input-name").val();
},
});
</script>
<script type="text/javascript">
RED.nodes.registerType('cancel-start-myvehicle', {
category: 'onstar2',
color: '#7eb0ff',
defaults: {
name: { value: 'Cancel Start Vehicle' },
onstar2: { value: 'Onstar Config', type: 'onstar2' }
},
inputs: 1,
outputs: 2,
outputLabels: ["Command Status","result.response.data"],
icon: 'onstar.svg',
label: function () {
//return this.name || 'cancel-start-vehicle';
var configCarName = RED.nodes.node(this.onstar2);
return configCarName.label()+" "+this.name;
},
oneditsave: function() {
var editNodeName = $("#node-input-name").val();
if (editNodeName == '') {
$("#node-input-name").val("Cancel Start Vehicle");
}
$("#node-input-name").val();
},
});
</script>
<script type="text/javascript">
RED.nodes.registerType('alert-myvehicle', {
category: 'onstar2',
color: '#7eb0ff',
defaults: {
name: { value: 'Alert Vehicle' },
onstar2: { value: 'Onstar Config', type: 'onstar2' },
action: { required: false },
delay: { required: false, validate: RED.validators.regex(/^(|\d)+$/)},
duration: { required: false, validate: RED.validators.regex(/^(|\d)+$/)},
override: { required: false }
},
inputs: 1,
outputs: 2,
outputLabels: ["Command Status","result.response.data"],
icon: 'onstar.svg',
label: function () {
//return this.name || 'alert-vehicle';
var configCarName = RED.nodes.node(this.onstar2);
return configCarName.label()+" "+this.name;
},
oneditprepare: function() {
$("#node-input-action").typedInput({
types: [
{
value: "action",
multiple: "true",
options: [
{ value: "Flash" },
{ value: "Honk" }
]
}
]
})
$("#node-input-override").typedInput({
types: [
{
value: "override",
multiple: "true",
options: [
{ value: "DoorOpen" },
{ value: "IgnitionOn" }
]
}
]
})
},
oneditsave: function() {
var editNodeName = $("#node-input-name").val();
if (editNodeName == '') {
$("#node-input-name").val("Alert Vehicle");
}
$("#node-input-name").val();
},
});
</script>
<script type="text/javascript">
RED.nodes.registerType('alert-myvehicle-lights', {
category: 'onstar2',
color: '#7eb0ff',
defaults: {
name: { value: 'Alert Vehicle Lights Only' },
onstar2: { value: 'Onstar Config', type: 'onstar2' }
},
inputs: 1,
outputs: 2,
outputLabels: ["Command Status","result.response.data"],
icon: 'onstar.svg',
label: function () {
//return this.name || 'alert-vehicle';
var configCarName = RED.nodes.node(this.onstar2);
return configCarName.label()+" "+this.name;
},
oneditsave: function() {
var editNodeName = $("#node-input-name").val();
if (editNodeName == '') {
$("#node-input-name").val("Alert Vehicle Lights Only");
}
$("#node-input-name").val();
},
});
</script>
<script type="text/javascript">
RED.nodes.registerType('alert-myvehicle-horn', {
category: 'onstar2',
color: '#7eb0ff',
defaults: {
name: { value: 'Alert Vehicle Horn Only' },
onstar2: { value: 'Onstar Config', type: 'onstar2' }
},
inputs: 1,
outputs: 2,
outputLabels: ["Command Status","result.response.data"],
icon: 'onstar.svg',
label: function () {
//return this.name || 'alert-vehicle';
var configCarName = RED.nodes.node(this.onstar2);
return configCarName.label()+" "+this.name;
},
oneditsave: function() {
var editNodeName = $("#node-input-name").val();
if (editNodeName == '') {
$("#node-input-name").val("Alert Vehicle Horn Only");
}
$("#node-input-name").val();
},
});
</script>
<script type="text/javascript">
RED.nodes.registerType('cancel-alert-myvehicle', {
category: 'onstar2',
color: '#7eb0ff',
defaults: {
name: { value: 'Cancel Alert Vehicle' },
onstar2: { value: 'Onstar Config', type: 'onstar2' }
},
inputs: 1,
outputs: 2,
outputLabels: ["Command Status","result.response.data"],
icon: 'onstar.svg',
label: function () {
//return this.name || 'cancel-alert-vehicle';
var configCarName = RED.nodes.node(this.onstar2);
return configCarName.label()+" "+this.name;
},
oneditsave: function() {
var editNodeName = $("#node-input-name").val();
if (editNodeName == '') {
$("#node-input-name").val("Cancel Alert Vehicle");
}
$("#node-input-name").val();
},
});
</script>
<script type="text/javascript">
RED.nodes.registerType('locate-vehicle', {
category: 'onstar2',
color: '#7eb0ff',
defaults: {
name: { value: 'Get Vehicle Location' },
onstar2: { value: 'Onstar Config', type: 'onstar2' }
},
inputs: 1,
outputs: 2,
outputLabels: ["Location Information","result.response.data"],
icon: 'onstar.svg',
label: function () {
//return this.name || 'location';
var configCarName = RED.nodes.node(this.onstar2);
return configCarName.label()+" "+this.name;
},
oneditsave: function() {
var editNodeName = $("#node-input-name").val();
if (editNodeName == '') {
$("#node-input-name").val("Get Vehicle Location");
}
$("#node-input-name").val();
},
});
</script>
<script type="text/javascript">
RED.nodes.registerType('set-charge-level-target', {
category: 'onstar2',
color: '#7eb0ff',
defaults: {
name: { value: 'Set Charge Level Target' },
onstar2: { value: 'Onstar Config', type: 'onstar2' },
targetlevel: { value: '80', required: false, validate: RED.validators.regex(/^(|[0-9]|[1-9][0-9]|100)$/) }
},
inputs: 1,
outputs: 2,
outputLabels: ["Command Status","result.response.data"],
icon: 'onstar.svg',
label: function () {
var configCarName = RED.nodes.node(this.onstar2);
return configCarName.label()+" "+this.name;
},
oneditsave: function() {
var editNodeName = $("#node-input-name").val();
if (editNodeName == '') {
$("#node-input-name").val("Set Charge Level Target");
}
$("#node-input-name").val();
},
});
</script>
<script type="text/javascript">
RED.nodes.registerType('stop-charging', {
category: 'onstar2',
color: '#7eb0ff',
defaults: {
name: { value: 'Stop Charging' },
onstar2: { value: 'Onstar Config', type: 'onstar2' }
},
inputs: 1,
outputs: 2,
outputLabels: ["Command Status","result.response.data"],
icon: 'onstar.svg',
label: function () {
var configCarName = RED.nodes.node(this.onstar2);
return configCarName.label()+" "+this.name;
},
oneditsave: function() {
var editNodeName = $("#node-input-name").val();
if (editNodeName == '') {
$("#node-input-name").val("Stop Charging");
}
$("#node-input-name").val();
},
});
</script>
<script type="text/javascript">
RED.nodes.registerType('get-ev-charging-metrics', {
category: 'onstar2',
color: '#7eb0ff',
defaults: {
name: { value: 'Get EV Charging Metrics' },
onstar2: { value: 'Onstar Config', type: 'onstar2' }
},
inputs: 1,
outputs: 2,
outputLabels: ["Charging Metrics","result.response.data"],
icon: 'onstar.svg',
label: function () {
var configCarName = RED.nodes.node(this.onstar2);
return configCarName.label()+" "+this.name;
},
oneditsave: function() {
var editNodeName = $("#node-input-name").val();
if (editNodeName == '') {
$("#node-input-name").val("Get EV Charging Metrics");
}
$("#node-input-name").val();
},
});
</script>
<script type="text/javascript">
RED.nodes.registerType('refresh-ev-charging-metrics', {
category: 'onstar2',
color: '#7eb0ff',
defaults: {
name: { value: 'Refresh EV Charging Metrics' },
onstar2: { value: 'Onstar Config', type: 'onstar2' }
},
inputs: 1,
outputs: 2,
outputLabels: ["Charging Metrics","result.response.data"],
icon: 'onstar.svg',
label: function () {
var configCarName = RED.nodes.node(this.onstar2);
return configCarName.label()+" "+this.name;
},
oneditsave: function() {
var editNodeName = $("#node-input-name").val();
if (editNodeName == '') {
$("#node-input-name").val("Refresh EV Charging Metrics");
}
$("#node-input-name").val();
},
});
</script>
<script type="text/javascript">
RED.nodes.registerType('get-vehicle-details', {
category: 'onstar2',
color: '#7eb0ff',
defaults: {
name: { value: 'Get Vehicle Details' },
onstar2: { value: 'Onstar Config', type: 'onstar2' }
},
inputs: 1,
outputs: 2,
outputLabels: ["Vehicle Details","result"],
icon: 'onstar.svg',
label: function () {
var configCarName = RED.nodes.node(this.onstar2);
return configCarName.label()+" "+this.name;
},
oneditsave: function() {
var editNodeName = $("#node-input-name").val();
if (editNodeName == '') {
$("#node-input-name").val("Get Vehicle Details");
}
$("#node-input-name").val();
},
});
</script>
<script type="text/javascript">
RED.nodes.registerType('get-onstar-plan', {
category: 'onstar2',
color: '#7eb0ff',
defaults: {
name: { value: 'Get OnStar Plan' },
onstar2: { value: 'Onstar Config', type: 'onstar2' }
},
inputs: 1,
outputs: 2,
outputLabels: ["OnStar Plan","result"],
icon: 'onstar.svg',
label: function () {
var configCarName = RED.nodes.node(this.onstar2);
return configCarName.label()+" "+this.name;
},
oneditsave: function() {
var editNodeName = $("#node-input-name").val();
if (editNodeName == '') {
$("#node-input-name").val("Get OnStar Plan");
}
$("#node-input-name").val();
},
});
</script>
<script type="text/javascript">
RED.nodes.registerType('get-vehicle-recall-info', {
category: 'onstar2',
color: '#7eb0ff',
defaults: {
name: { value: 'Get Vehicle Recall Info' },
onstar2: { value: 'Onstar Config', type: 'onstar2' }
},
inputs: 1,
outputs: 2,
outputLabels: ["Recall Info","result"],
icon: 'onstar.svg',
label: function () {
var configCarName = RED.nodes.node(this.onstar2);
return configCarName.label()+" "+this.name;
},
oneditsave: function() {
var editNodeName = $("#node-input-name").val();
if (editNodeName == '') {
$("#node-input-name").val("Get Vehicle Recall Info");
}
$("#node-input-name").val();
},
});
</script>
<script type="text/javascript">
RED.nodes.registerType('stop-lights', {
category: 'onstar2',
color: '#7eb0ff',
defaults: {
name: { value: 'Stop Lights' },
onstar2: { value: 'Onstar Config', type: 'onstar2' }
},
inputs: 1,
outputs: 2,
outputLabels: ["Command Status","result.response.data"],
icon: 'onstar.svg',
label: function () {
var configCarName = RED.nodes.node(this.onstar2);
return configCarName.label()+" "+this.name;
},
oneditsave: function() {
var editNodeName = $("#node-input-name").val();
if (editNodeName == '') {
$("#node-input-name").val("Stop Lights");
}
$("#node-input-name").val();
},
});
</script>
<script type="text/javascript">
RED.nodes.registerType('onstar2', {
category: 'config',
defaults: {
carname: { required: true },
username: { required: true },
password: { required: true },
totp: { required: true},
pin: { required: true, validate: RED.validators.number() },
vin: { required: true },
deviceid: { required: true },
tokenlocation: { value: '', required: false },
checkrequeststatus: { value: true, required: true },
requestpollingtimeoutseconds: { value: 90, required: true, validate: RED.validators.number() },
requestpollingintervalseconds: { value: 6, required: true, validate: RED.validators.number() }
},
label: function () {
return this.carname;
},
oneditprepare: function() {
var editNodeValRequestPollingTimeoutSeconds = $("#node-config-input-requestpollingtimeoutseconds").val();
var editNodeValRequestPollingIntervalSeconds = $("#node-config-input-requestpollingintervalseconds").val();
$("#node-config-input-checkrequeststatus").typedInput({
type:"bool"
});
if (editNodeValRequestPollingTimeoutSeconds == '') {
$("#node-config-input-requestpollingtimeoutseconds").val(90);
}
$("#node-config-input-requestpollingtimeoutseconds").val();
if (editNodeValRequestPollingIntervalSeconds == '') {
$("#node-config-input-requestpollingintervalseconds").val(6);
}
$("#node-config-input-requestpollingintervalseconds").val();
},
oneditsave: function() {
var editNodeValRequestPollingTimeoutSeconds = $("#node-config-input-requestpollingtimeoutseconds").val();
var editNodeValRequestPollingIntervalSeconds = $("#node-config-input-requestpollingintervalseconds").val();
if (editNodeValRequestPollingTimeoutSeconds == '') {
$("#node-config-input-requestpollingtimeoutseconds").val(90);
}
$("#node-config-input-requestpollingtimeoutseconds").val();
if (editNodeValRequestPollingIntervalSeconds == '') {
$("#node-config-input-requestpollingintervalseconds").val(6);
}
$("#node-config-input-requestpollingintervalseconds").val();
},
});
</script>
<script type="text/html" data-template-name="get-account-vehicles">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name" />
</div>
<div class="form-row">
<label for="node-input-onstar2"><i class="icon-tag"></i> Config</label>
<input type="text" id="node-input-onstar2" placeholder="Name" />
</div>
</script>
<script type="text/html" data-help-name="get-account-vehicles">
<p>Get list of vehicles in your account and requests supported by the vehicles in your account.</p>
</script>
<script type="text/html" data-template-name="get-diagnostics">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name" />
</div>
<div class="form-row">
<label for="node-input-onstar2"><i class="icon-tag"></i> Config</label>
<input type="text" id="node-input-onstar2" placeholder="Name" />
</div>
</script>
<script type="text/html" data-help-name="get-diagnostics">
<p>Get diagnostic information for the vehicle (v3 API).
<br><br>The v3 API automatically returns all available diagnostic data for your vehicle.
Individual diagnostic item selection is no longer supported.
<br><br>Returns comprehensive health status including battery, fuel, oil, tire pressure, odometer, and other vehicle-specific diagnostics.
</p>
</script>
<script type="text/html" data-template-name="lock-myvehicle">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name" />
</div>
<div class="form-row">
<label for="node-input-onstar2"><i class="icon-tag"></i> Config</label>
<input type="text" id="node-input-onstar2" placeholder="Name" />
</div>
<div class="form-row">
<label for="node-input-delay"><i class="icon-bookmark"></i> Delay (Minutes)</label>
<input type="text" id="node-input-delay" />
</div>
</script>
<script type="text/html" data-help-name="lock-myvehicle">
<p>Lock vehicle doors. Delay parameter is in minutes and is optional, but if not set in the config dialog, defaults to 0 (immediate/no delay) or the value sent to the input via "msg.payload.delay".</p>
</script>
<script type="text/html" data-template-name="unlock-myvehicle">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name" />
</div>
<div class="form-row">
<label for="node-input-onstar2"><i class="icon-tag"></i> Config</label>
<input type="text" id="node-input-onstar2" placeholder="Name" />
</div>
<div class="form-row">
<label for="node-input-delay"><i class="icon-bookmark"></i> Delay (Minutes)</label>
<input type="text" id="node-input-delay" />
</div>
</script>
<script type="text/html" data-help-name="unlock-myvehicle">
<p>Unlock vehicle doors. Delay parameter is in minutes and is optional, but if not set in the config dialog, defaults to 0 (immediate/no delay) or the value sent to the input via "msg.payload.delay".</p>
</script>
<script type="text/html" data-template-name="lock-mytrunk">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name" />
</div>
<div class="form-row">
<label for="node-input-onstar2"><i class="icon-tag"></i> Config</label>
<input type="text" id="node-input-onstar2" placeholder="Name" />
</div>
<div class="form-row">
<label for="node-input-delay"><i class="icon-bookmark"></i> Delay (Minutes)</label>
<input type="text" id="node-input-delay" />
</div>
</script>
<script type="text/html" data-help-name="lock-mytrunk">
<p>Lock vehicle trunk. Locks the trunk but doesn't automatically close it. Delay parameter is in minutes and is optional, but if not set in the config dialog, defaults to 0 (immediate/no delay) or the value sent to the input via "msg.payload.delay".</p>
</script>
<script type="text/html" data-template-name="unlock-mytrunk">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name" />
</div>
<div class="form-row">
<label for="node-input-onstar2"><i class="icon-tag"></i> Config</label>
<input type="text" id="node-input-onstar2" placeholder="Name" />
</div>
<div class="form-row">
<label for="node-input-delay"><i class="icon-bookmark"></i> Delay (Minutes)</label>
<input type="text" id="node-input-delay" />
</div>
</script>
<script type="text/html" data-help-name="unlock-mytrunk">
<p>Unlock vehicle trunk. Unlocks the trunk but doesn't automatically open it. All doors remain locked. Delay parameter is in minutes and is optional, but if not set in the config dialog, defaults to 0 (immediate/no delay) or the value sent to the input via "msg.payload.delay".</p>
</script>
<script type="text/html" data-template-name="start-myvehicle">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name" />
</div>
<div class="form-row">
<label for="node-input-onstar2"><i class="icon-tag"></i> Config</label>
<input type="text" id="node-input-onstar2" placeholder="Name" />
</div>
</script>
<script type="text/html" data-help-name="start-myvehicle">
<p>Start the vehicle remotely.</p>
</script>
<script type="text/html" data-template-name="cancel-start-myvehicle">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name" />
</div>
<div class="form-row">
<label for="node-input-onstar2"><i class="icon-tag"></i> Config</label>
<input type="text" id="node-input-onstar2" placeholder="Name" />
</div>
</script>
<script type="text/html" data-help-name="cancel-start-myvehicle">
<p>Stop the vehicle if it was started remotely.</p>
</script>
<script type="text/html" data-template-name="alert-myvehicle">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name" />
</div>
<div class="form-row">
<label for="node-input-onstar2"><i class="icon-tag"></i> Config</label>
<input type="text" id="node-input-onstar2" placeholder="Name" />
</div>
<div class="form-row">
<label for="node-input-action"><i class="icon-bookmark"></i> Action</label>
<input type="text" id="node-input-action" />
</div>
<div class="form-row">
<label for="node-input-delay"><i class="icon-bookmark"></i> Delay (Minutes)</label>
<input type="text" id="node-input-delay" />
</div>
<div class="form-row">
<label for="node-input-duration"><i class="icon-bookmark"></i> Duration (Minutes)</label>
<input type="text" id="node-input-duration" />
</div>
<div class="form-row">
<label for="node-input-override"><i class="icon-bookmark"></i> Override</label>
<input type="text" id="node-input-override" />
</div>
</script>
<script type="text/html" data-help-name="alert-myvehicle">
<p>Turn on vehicle alert with customizable options.
<br>
<br>• <b>Action</b> parameter is optional, but if not set in the config dialog, defaults to ["Flash", "Honk"] (OnStarJS Defaults) or the value sent to the input via "msg.payload.action".
<br>• <b>Delay</b> parameter is in minutes and is optional, but if not set in the config dialog, defaults to 0 (immediate/no delay - OnStarJS Default) or the value sent to the input via "msg.payload.delay".
<br>• <b>Duration</b> parameter is in minutes and is optional, but if not set in the config dialog, defaults to 1 minute (OnStarJS Default) or the value sent to the input via "msg.payload.duration".
<br>• <b>Override</b> parameter is optional, but if not set in the config dialog, defaults to ["DoorOpen", "IgnitionOn"] (OnStarJS Defaults) or the value sent to the input via "msg.payload.override".
<br><br>
<b>NOTE: </b>This new functionality since v2.1.0 makes the "alert-myvehicle-horn" and "alert-myvehicle-lights" nodes redundant, but still keeping them in for backwards compatibility.
</p>
</script>
<script type="text/html" data-template-name="alert-myvehicle-lights">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name" />
</div>
<div class="form-row">
<label for="node-input-onstar2"><i class="icon-tag"></i> Config</label>
<input type="text" id="node-input-onstar2" placeholder="Name" />
</div>
</script>
<script type="text/html" data-help-name="alert-myvehicle-lights">
<p>Turn on vehicle alert (lights only).</p>
</script>
<script type="text/html" data-template-name="alert-myvehicle-horn">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name" />
</div>
<div class="form-row">
<label for="node-input-onstar2"><i class="icon-tag"></i> Config</label>
<input type="text" id="node-input-onstar2" placeholder="Name" />
</div>
</script>
<script type="text/html" data-help-name="alert-myvehicle-horn">
<p>Turn on vehicle alert (horn only).</p>
</script>
<script type="text/html" data-template-name="cancel-alert-myvehicle">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name" />
</div>
<div class="form-row">
<label for="node-input-onstar2"><i class="icon-tag"></i> Config</label>
<input type="text" id="node-input-onstar2" placeholder="Name" />
</div>
</script>
<script type="text/html" data-help-name="cancel-alert-myvehicle">
<p>Stop the vehicle alert.</p>
</script>
<script type="text/html" data-template-name="locate-vehicle">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name" />
</div>
<div class="form-row">
<label for="node-input-onstar2"><i class="icon-tag"></i> Config</label>
<input type="text" id="node-input-onstar2" placeholder="Name" />
</div>
</script>
<script type="text/html" data-help-name="locate-vehicle">
<p>Get vehicle location information.</p>
</script>
<script type="text/html" data-template-name="set-charge-level-target">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name" />
</div>
<div class="form-row">
<label for="node-input-onstar2"><i class="icon-tag"></i> Config</label>
<input type="text" id="node-input-onstar2" placeholder="Name" />
</div>
<div class="form-row">
<label for="node-input-targetlevel"><i class="icon-bookmark"></i> Target Charge Level (%)</label>
<input type="text" id="node-input-targetlevel" placeholder="80" />
</div>
</script>
<script type="text/html" data-help-name="set-charge-level-target">
<p>Set EV charging target level (v3 API).
<br>• <b>Target Charge Level</b> parameter is the desired battery percentage (0-100). Defaults to 80% if not specified.
<br>• Can also be sent via <code>msg.payload.targetLevel</code> or <code>msg.payload.tcl</code>.
<br><br><b>Note:</b> This replaces the deprecated <code>chargeOverride</code> method from v1 API.
</p>
</script>
<script type="text/html" data-template-name="stop-charging">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name" />
</div>
<div class="form-row">
<label for="node-input-onstar2"><i class="icon-tag"></i> Config</label>
<input type="text" id="node-input-onstar2" placeholder="Name" />
</div>
</script>
<script type="text/html" data-help-name="stop-charging">
<p>Stop the current EV charging session (v3 API).
<br><br><b>Note:</b> This provides functionality previously available via <code>chargeOverride</code> with CANCEL_OVERRIDE mode.
</p>
</script>
<script type="text/html" data-template-name="get-ev-charging-metrics">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name" />
</div>
<div class="form-row">
<label for="node-input-onstar2"><i class="icon-tag"></i> Config</label>
<input type="text" id="node-input-onstar2" placeholder="Name" />
</div>
</script>
<script type="text/html" data-help-name="get-ev-charging-metrics">
<p>Retrieve current EV charging metrics (v3 API).
<br><br>Returns charging status, current battery level, estimated time to full charge, and other EV-specific data.
<br><br><b>Note:</b> This replaces the deprecated <code>getChargingProfile</code> method from v1 API.
</p>
</script>
<script type="text/html" data-template-name="refresh-ev-charging-metrics">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name" />
</div>
<div class="form-row">
<label for="node-input-onstar2"><i class="icon-tag"></i> Config</label>
<input type="text" id="node-input-onstar2" placeholder="Name" />
</div>
</script>
<script type="text/html" data-help-name="refresh-ev-charging-metrics">
<p>Force-refresh and retrieve live EV charging metrics from the vehicle (v3 API).
<br><br>This queries the vehicle for current data rather than using cached metrics. Use this when you need the most up-to-date information.
<br><br><b>Note:</b> May take longer than <code>get-ev-charging-metrics</code> as it actively queries the vehicle.
</p>
</script>
<script type="text/html" data-template-name="get-vehicle-details">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name" />
</div>
<div class="form-row">
<label for="node-input-onstar2"><i class="icon-tag"></i> Config</label>
<input type="text" id="node-input-onstar2" placeholder="Name" />
</div>
</script>
<script type="text/html" data-help-name="get-vehicle-details">
<p>Retrieve detailed vehicle information (v3 API).
<br><br>Returns comprehensive details about the vehicle including model year, make, model, trim, and other vehicle specifications.
</p>
</script>
<script type="text/html" data-template-name="get-onstar-plan">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name" />
</div>
<div class="form-row">
<label for="node-input-onstar2"><i class="icon-tag"></i> Config</label>
<input type="text" id="node-input-onstar2" placeholder="Name" />
</div>
</script>
<script type="text/html" data-help-name="get-onstar-plan">
<p>Retrieve current OnStar subscription plan information (v3 API).
<br><br>Returns details about your active OnStar subscription including plan features and status.
</p>
</script>
<script type="text/html" data-template-name="get-vehicle-recall-info">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name" />
</div>
<div class="form-row">
<label for="node-input-onstar2"><i class="icon-tag"></i> Config</label>
<input type="text" id="node-input-onstar2" placeholder="Name" />
</div>
</script>
<script type="text/html" data-help-name="get-vehicle-recall-info">
<p>Check for any active recalls on your vehicle (v3 API).
<br><br>Returns information about any open recalls for your vehicle including recall descriptions and status.
</p>
</script>
<script type="text/html" data-template-name="stop-lights">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name" />
</div>
<div class="form-row">
<label for="node-input-onstar2"><i class="icon-tag"></i> Config</label>
<input type="text" id="node-input-onstar2" placeholder="Name" />
</div>
</script>
<script type="text/html" data-help-name="stop-lights">
<p>Stop flashing vehicle lights (v3 API).
<br><br>Use this to cancel an active lights alert that was started with the Alert Vehicle Lights node.
</p>
</script>
<script type="text/html" data-template-name="onstar2">
<div class="form-row">
<label for="node-config-input-name"><i class="icon-bookmark"></i> Name</label>
<input type="text" id="node-config-input-name" value="OnStar" />
</div>
<div class="form-row">
<label for="node-config-input-carname"><i class="icon-bookmark"></i> Car Name</label>
<input type="text" id="node-config-input-carname" />
</div>
<div class="form-row">
<label for="node-config-input-username"><i class="icon-bookmark"></i> Username</label>
<input type="text" id="node-config-input-username" />
</div>
<div class="form-row">
<label for="node-config-input-password"><i class="icon-bookmark"></i> Password</label>
<input type="password" id="node-config-input-password" />
</div>
<div class="form-row">
<label for="node-config-input-totp"><i class="icon-bookmark"></i> TOTP</label>
<input type="password" id="node-config-input-totp" />
</div>
<div class="form-row">
<label for="node-config-input-pin"><i class="icon-bookmark"></i> PIN</label>
<input type="password" id="node-config-input-pin" />
</div>
<div class="form-row">
<label for="node-config-input-vin"><i class="icon-bookmark"></i> VIN</label>
<input type="text" id="node-config-input-vin" />
</div>
<div class="form-row">
<label for="node-config-input-deviceid"><i class="icon-bookmark"></i> Device ID (any valid V4 UUID)</label>
<input type="text" id="node-config-input-deviceid" />
</div>
<div class="form-row">
<label for="node-config-input-tokenlocation"><i class="icon-bookmark"></i> Token Location (Optional)</label>
<input type="text" id="node-config-input-tokenlocation" placeholder="Path to store token files" />
</div>
<div class="form-row">
<label for="node-config-input-checkrequeststatus"><i class="icon-bookmark"></i> Set checkRequestStatus Value for OnStarJS</label>
<input type="text" id="node-config-input-checkrequeststatus" />
</div>
<div class="form-row">
<label for="node-config-input-requestpollingtimeoutseconds"><i class="icon-bookmark"></i> Set requestPollingTimeoutSeconds Value for OnStarJS</label>
<input type="text" id="node-config-input-requestpollingtimeoutseconds" />
</div>
<div class="form-row">
<label for="node-config-input-requestpollingintervalseconds"><i class="icon-bookmark"></i> Set requestPollingIntervalSeconds Value for OnStarJS</label>
<input type="text" id="node-config-input-requestpollingintervalseconds" />
</div>
</script>