Skip to content

Commit

Permalink
add vision multiZones
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucky-ESA committed Apr 15, 2024
1 parent cfb55df commit e509c23
Show file tree
Hide file tree
Showing 8 changed files with 89 additions and 100 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ The adapter can control the mower and you can change config params like mowtimes
- (Lucky-ESA) Added Vision cut over slabs
- (Lucky-ESA) Node 18 required
- (Lucky-ESA) Catch aws_cer error and use old mqtt connection
- (Lucky-ESA) Added rain wait countdown
- (Lucky-ESA) Added Vision Multi Zone

### 2.3.4 (2023-10-19)
Expand Down
6 changes: 3 additions & 3 deletions docs/de/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,11 +303,11 @@
- `multiZone.passages.passage_01.tagIdTo`: RFID id von z2 - Mit Blockly ohne Verzögerung setzen - Änderung wird in `multiZone.multiZone` geschrieben (Vision/änderbar)
- `multiZone.passages.passage_01.zoneIdFrom`: Zone von (muss z1 < z2) - Mit Blockly ohne Verzögerung setzen - Änderung wird in `multiZone.multiZone` geschrieben (Vision/änderbar)
- `multiZone.passages.passage_01.zoneIdTo`: Zone zu (muss z2 > z1) - Mit Blockly ohne Verzögerung setzen - Änderung wird in `multiZone.multiZone` geschrieben (Vision/änderbar)
- `multiZone.zones.zone_1.borderDistance`: Kantenschnitt in mm - erlaubt 10mm, 15mm und 20mm - Mit Blockly ohne Verzögerung setzen - Änderung wird in `multiZone.multiZone` geschrieben (Vision/änderbar)
- `multiZone.zones.zone_1.borderDistance`: Kantenschnitt in mm - erlaubt 50mm, 100mm, 150mm und 20mm - Mit Blockly ohne Verzögerung setzen - Änderung wird in `multiZone.multiZone` geschrieben (Vision/änderbar)
- `multiZone.zones.zone_1.chargingStation`: 1 Wenn sich die Ladestation in diese Zone gefindet. 0 für keine Ladestation - Mit Blockly ohne Verzögerung setzen - Änderung wird in `multiZone.multiZone` geschrieben (Vision/änderbar)
- `multiZone.zones.zone_1.cutOverBorder`: 1 zum Überfahren von Platten, wenn diese erkannt werden, ansonsten 0.Unterschiedliche Werte pro Zone sind nicht zulässig - Mit Blockly ohne Verzögerung setzen - Änderung wird in `multiZone.multiZone` geschrieben (Vision/änderbar)
- `multiZone.zones.zone_1.zone_id`: Nummerierung - Start mit 1 - Mit Blockly ohne Verzögerung setzen - Änderung wird in `multiZone.multiZone` geschrieben (Vision/änderbar)
- `multiZone.rfid`: Anzahl Zonen (nur lesen)
- `multiZone.zones.zone_1.zone_id`: Nummerierung - Start mit 1 - geschrieben (Vision/nur lesen)
- `multiZone.rfid`: Anzahl RF (nur lesen)
- `multiZone.multiZone`: Multizone JSON (Vision/änderbar) [Beispiel](#beispiel-blockly-startsequence-vision)
- `multiZone.sendMultiZoneJson`: Änderungen an Worx senden mit mit einer Verzögerung von 1,1 Sekunden (Vision/änderbar)

Expand Down
Binary file modified docs/de/img/areas_vision.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions docs/en/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,11 +303,11 @@
- `multiZone.passages.passage_01.tagIdTo`: RFID id of z2 - Set with Blockly without delay - Change is written to `multiZone.multiZone` (vision/changeable)
- `multiZone.passages.passage_01.zoneIdFrom`: Zone from (must z1 < z2) - Set with Blockly without delay - Change is written to `multiZone.multiZone` (vision/changeable)
- `multiZone.passages.passage_01.zoneIdTo`: Zone closed (must z2 > z1) - Set with Blockly without delay - Change is written to `multiZone.multiZone` (vision/changeable)
- `multiZone.zones.zone_1.borderDistance`: Edge cut in mm - allowed 10mm, 15mm and 20mm - Set with Blockly without delay - Change is written in `multiZone.multiZone` (vision/changeable)
- `multiZone.zones.zone_1.borderDistance`: Edge cut in mm - allowed 50mm, 100mm, 150mm and 20mm - Set with Blockly without delay - Change is written in `multiZone.multiZone` (vision/changeable)
- `multiZone.zones.zone_1.chargingStation`: 1 If the charging station is found in this zone. 0 for no charging station - Set with Blockly without delay - Change is written to `multiZone.multiZone` (vision/changeable)
- `multiZone.zones.zone_1.cutOverBorder`: 1 to drive over plates if they are detected, otherwise 0. Different values ​​per zone are not permitted - Set with Blockly without delay - Change is written to `multiZone.multiZone` (Vision /changeable)
- `multiZone.zones.zone_1.zone_id`: Numbering - Start with 1 - Set with Blockly without delay - Change is written to `multiZone.multiZone` (vision/changeable)
- `multiZone.rfid`: Total Areas (readonly)
- `multiZone.zones.zone_1.zone_id`: Numbering - Start with 1 - (vision/readonly)
- `multiZone.rfid`: Total RF (readonly)
- `multiZone.multiZone`: Multizone JSON (Vision/changeable) [Example](#example-blockly-startsequence-vision)
- `multiZone.sendMultiZoneJson`: Send changes to Worx with a delay of 1.1 seconds (vision/changeable)

Expand Down
Binary file modified docs/en/img/areas_vision.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 7 additions & 7 deletions lib/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -405,10 +405,10 @@ module.exports = {
await this.createDataPoint(`${mower.serial_number}.${o._id}`, o.common, o.type, o.native);
}
for (const o of objects.zones_channel) {
await this.createDataPoint(`${mower.serial_number}.multiZone.${o._id}`, o.common, o.type, o.native);
await this.createDataPoint(`${mower.serial_number}.multiZonen.${o._id}`, o.common, o.type, o.native);
}
for (const o of objects.passage_channel) {
await this.createDataPoint(`${mower.serial_number}.multiZone.${o._id}`, o.common, o.type, o.native);
await this.createDataPoint(`${mower.serial_number}.multiZonen.${o._id}`, o.common, o.type, o.native);
}
await this.evaluateVisionMultiZone(mower, true);
states_cmd = {
Expand Down Expand Up @@ -439,7 +439,7 @@ module.exports = {
def: 0,
desc: `Mowing zone detection`,
};
await this.createDataPoint(`${mower.serial_number}.multiZone.rfid`, common, "state");
await this.createDataPoint(`${mower.serial_number}.multiZonen.rfid`, common, "state");
common = {
name: {
en: "Add new mowing time",
Expand Down Expand Up @@ -551,7 +551,7 @@ module.exports = {
read: true,
write: true,
};
await this.createDataPoint(`${mower.serial_number}.multiZone.multiZone`, common, "state");
await this.createDataPoint(`${mower.serial_number}.multiZonen.multiZonen`, common, "state");
common = {
type: "boolean",
role: "button",
Expand All @@ -573,7 +573,7 @@ module.exports = {
write: true,
def: false,
};
await this.createDataPoint(`${mower.serial_number}.multiZone.sendMultiZoneJson`, common, "state");
await this.createDataPoint(`${mower.serial_number}.multiZonen.sendmultiZonenJson`, common, "state");
} else {
common = {
name: {
Expand Down Expand Up @@ -1778,7 +1778,7 @@ module.exports = {
data.cfg.sc.slots = await this.evaluateVisionCalendar(mower, data.cfg.sc.slots);
}
if (data.dat && data.dat.rfid) {
await this.setStateAsync(`${mower.serial_number}.multiZone.rfid`, {
await this.setStateAsync(`${mower.serial_number}.multiZonen.rfid`, {
val: data.dat.rfid.status,
ack: true,
});
Expand Down Expand Up @@ -1839,7 +1839,7 @@ module.exports = {
});
}
if (data.cfg.mz != null) {
await this.setStateAsync(`${mower.serial_number}.multiZone.multiZone`, {
await this.setStateAsync(`${mower.serial_number}.multiZonen.multiZonen`, {
val: JSON.stringify(data.cfg.mz),
ack: true,
});
Expand Down
60 changes: 21 additions & 39 deletions lib/objects.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
module.exports = {
multiZones: [
{
_id: "multiZone",
_id: "multiZonen",
type: "channel",
common: {
name: {
en: "Multizone",
de: "Multizone",
ru: "Мультизон",
pt: "Multizona",
nl: "Multizone",
en: "Multizonen",
de: "Multizonen",
ru: "Multizonen",
pt: "Multizonas",
nl: "Multizonen",
fr: "Multizone",
it: "Multizona",
es: "Multizona",
pl: "Multizon",
uk: "Мультизон",
it: "Multizonen",
es: "Multizonen",
pl: "Multizonen",
uk: "Мультизонні",
"zh-cn": "多区",
},
},
Expand Down Expand Up @@ -86,17 +86,9 @@ module.exports = {
type: "number",
role: "value",
read: true,
write: true,
min: 1,
max: 4,
write: false,
def: 1,
desc: "Zonen ID",
states: {
1: "Zone 1",
2: "Zone 2",
3: "Zone 3",
4: "Zone 4",
},
},
native: {},
},
Expand Down Expand Up @@ -153,11 +145,17 @@ module.exports = {
role: "value",
read: true,
write: true,
min: 5,
max: 600,
min: 50,
max: 200,
unit: "mm",
def: 50,
desc: "Border Distance in mm",
states: {
50: "50 mm",
100: "100 mm",
150: "150 mm",
200: "200 mm",
},
},
native: {},
},
Expand Down Expand Up @@ -260,16 +258,8 @@ module.exports = {
role: "value",
read: true,
write: true,
min: 1,
max: 4,
def: 0,
def: 1,
desc: "The mower cut border today",
states: {
1: "Zone 1",
2: "Zone 2",
3: "Zone 3",
4: "Zone 4",
},
},
native: {},
},
Expand All @@ -294,16 +284,8 @@ module.exports = {
role: "value",
read: true,
write: true,
min: 1,
max: 4,
def: 0,
def: 2,
desc: "Zone Id to",
states: {
1: "Zone 1",
2: "Zone 2",
3: "Zone 3",
4: "Zone 4",
},
},
native: {},
},
Expand Down
Loading

0 comments on commit e509c23

Please sign in to comment.