Skip to content

Commit

Permalink
add for Vision head light & cut over slaps
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucky-ESA committed Mar 29, 2024
1 parent 28a6dbc commit a4604fe
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 42 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ The adapter can control the mower and you can change config params like mowtimes
- (Lucky-ESA) Catch publish crash
- (Lucky-ESA) Added for Vision electric height adjustment
- (Lucky-ESA) Added for Vision new calendar
- (Lucky-ESA) Added head light
- (Lucky-ESA) Added cut over slabs
- (Lucky-ESA) Node 18 required

### 2.3.4 (2023-10-19)
Expand Down
13 changes: 10 additions & 3 deletions docs/de/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,20 +106,26 @@

### modules (Draht und Vision)

- Off Limit Module (Draht und Vision)
- Off Limit Modul (Draht und Vision)

- `DF.OLMSwitch_Cutting`: Verhindert das überfahren vom Magnetband - true-an/false-aus
- `DF.OLMSwitch_FastHoming`: Verwendet erstellte Abkürzungen mit Magnetband - true-an/false-aus

- ACS Module (nur Draht)
- ACS Modul (nur Draht)

- `US.ACS`: ACS aktivieren oder deaktivieren - 1-on/0-off

- EA Module (nur Vision)
- EA Modul (nur Vision)

- `EA.h`: Höheneinstellung Mähwerk von 30-60 in 5 Schritte

- HL Modul (nur Vision)
- `HL.HL_Status`: Status Scheinwerfer
- `HL.hl`: Scheinwerfer ein = 1/ausschalten = 0

![Module img/module.png](../en/img/module.png)
![Module img/module_ea.png](../en/img/module_ea.png)
![Module img/module_ea.png](../en/img/module_hl.png)

### mower (Draht und Vision)

Expand All @@ -130,6 +136,7 @@
- `batteryState`: Batteriestatus in % (Draht & Vision/nur lesen)
- `batteryTemperature`: Batterietemperatur in Celsius (Draht & Vision/nur lesen)
- `batteryVoltage`: Batteriespannung in Volt (Draht & Vision/nur lesen)
- `cutOverSlabs`: Über Platten mähen an = true / aus = false (Vision/änderbar)
- `direction`: Richtung in Grad (Draht & Vision/nur lesen)
- `edgecut`: Start EdgeCut (Draht & Vision/änderbar)
- `error`: Errormeldung vom Mäher (Draht & Vision/nur lesen)
Expand Down
7 changes: 7 additions & 0 deletions docs/en/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,16 @@
- `US.ACS`: Enable or disable ACS - 1-on/0-off

- EA Module (Vision only)

- `EA.h`: Height adjustment of mower deck from 30-60 in 5 mm increments

- HL Module (Vision only)
- `HL.HL_Status`: Status head light
- `HL.hl`: Head light on = 1/off = 0

![Module img/module.png](img/module.png)
![Module img/module_ea.png](img/module_ea.png)
![Module img/module_ea.png](img/module_hl.png)

### mower (Wire and Vision)

Expand All @@ -130,6 +136,7 @@
- `batteryState`: Battery state in % (wire & Vision/readonly)
- `batteryTemperature`: Battery temperature in celsius (wire & Vision/readonly)
- `batteryVoltage`: Battery voltage in Volt (wire & Vision/readonly)
- `cutOverSlabs`: Cut over slabs on = true / off = false (Vision/changeable)
- `direction`: Direction in grad (wire & Vision/readonly)
- `edgecut`: Start EdgeCut (wire & Vision/changeable)
- `error`: Error message from mower (wire & Vision/readonly)
Expand Down
Binary file added docs/en/img/module_hl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/en/img/mower_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 21 additions & 15 deletions lib/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -512,18 +512,28 @@ module.exports = {
desc: "Information for troubleshooting",
};
await this.createDataPoint(`${mower.serial_number}.mower.log_troubleshooting`, common, "state");
/**
common = {
type: "number",
role: "state",
name: "VIS",
desc: "VIS",
name: {
en: "Cut over slabs",
de: "Über Platten schneiden",
ru: "Перерезать плиты",
pt: "Corte sobre lajes",
nl: "Over platen knippen",
fr: "Couper sur les plaques",
it: "Taglio su lastre",
es: "Cortar losas",
pl: "Pocięte na płyty",
uk: "Вирізати плити",
"zh-cn": "划过板子",
},
desc: "Cut over slaps",
type: "boolean",
role: "switch",
read: true,
write: true,
def: 0,
def: false,
};
await this.createDataPoint(`${mower.serial_number}.mower.slab`, common, "state");
*/
await this.createDataPoint(`${mower.serial_number}.mower.cutOverSlabs`, common, "state");
} else {
for (let a = 0; a <= 3; a++) {
await this.setObjectNotExistsAsync(`${mower.serial_number}.areas.area_${a}`, {
Expand Down Expand Up @@ -1605,14 +1615,12 @@ module.exports = {
ack: true,
});
}
/**
if (data.cfg.vis && data.cfg.vis.slab != null) {
await this.setStateAsync(`${mower.serial_number}.mower.slab`, {
val: data.cfg.vis.slab,
await this.setStateAsync(`${mower.serial_number}.mower.cutOverSlabs`, {
val: data.cfg.vis.slab ? true : false,
ack: true,
});
}
*/
if (data.cfg.log && data.cfg.log.diag != null) {
await this.setStateAsync(`${mower.serial_number}.mower.log_troubleshooting`, {
val: data.cfg.log.diag ? true : false,
Expand Down Expand Up @@ -1877,8 +1885,7 @@ module.exports = {
ack: true,
});
}
/**
//HL Module
//HL Module - Head Light
if (data.cfg.modules && data.cfg.modules["HL"]) {
if (!this.modules[mower.serial_number]["HL"]) {
for (const o of objects.HL) {
Expand All @@ -1901,7 +1908,6 @@ module.exports = {
ack: true,
});
}
*/
// Df Module
if (data.cfg.modules && data.cfg.modules.DF) {
if (!this.modules[mower.serial_number].DF) {
Expand Down
46 changes: 23 additions & 23 deletions lib/objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -986,23 +986,23 @@ module.exports = {
type: "state",
common: {
name: {
en: "HL Module",
de: "HL Modul",
ru: "HL модуль",
pt: "Módulo HL",
nl: "HL Module",
fr: "Module HL",
it: "Modulo HL",
es: "Módulo HL",
pl: "HL Module",
uk: "Модуль HL",
"zh-cn": "HL Module",
en: "Head light",
de: "Scheinwerfer",
ru: "Свет",
pt: "Luz de cabeça",
nl: "Hoofdlamp",
fr: "Feu de tête",
it: "Luce di testa",
es: "Luz de la cabeza",
pl: "Światło głowy",
uk: "Головна",
"zh-cn": "头灯",
},
type: "number",
role: "state",
read: true,
write: true,
desc: "HL Module",
desc: "Head light",
states: {
0: "disabled",
1: "enabled",
Expand All @@ -1015,17 +1015,17 @@ module.exports = {
type: "state",
common: {
name: {
en: "Status HL Module",
de: "Status HL Modul",
ru: "Статус HL Module",
pt: "Módulo HL de status",
nl: "Status HL Module",
fr: "Module HL de statut",
it: "Modulo HL di stato",
es: "Módulo HL de estado",
pl: "Status HL Module",
uk: "Статус HL Модуль",
"zh-cn": "现状HL Module。",
en: "Status head light.",
de: "Status Scheinwerfer.",
ru: "Свет головы.",
pt: "Luz de cabeça de estado.",
nl: "Status koplamp.",
fr: "Feu de la tête.",
it: "Fanale di stato.",
es: "Luz de la cabeza del estado.",
pl: "Światła na głowę.",
uk: "Статус на сервери.",
"zh-cn": "状态灯光.",
},
type: "string",
role: "value",
Expand Down
2 changes: 1 addition & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1690,7 +1690,7 @@ class Worx extends utils.Adapter {
const msg = {};
msg.enabled = state.val;
this.sendMessage(`{"modules":{"HL":${JSON.stringify(msg)}}}`, mower.serial_number, id);
} else if (command === "slab") {
} else if (command === "cutOverSlabs") {
const msg = {};
msg.slab = state.val;
this.sendMessage(`{"vis":${msg}}`, mower.serial_number, id);
Expand Down

0 comments on commit a4604fe

Please sign in to comment.