Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,7 @@ Supported devices:
- Siren
_TZE200_d0yu2xgi / TS0601
_TZE204_t1blo2bj / TS0601
_TZE200_t1blo2bj / TS0601

- Finger Bot
_TZ3210_j4pdtz9v / TS0001 (MOES)
Expand Down
7 changes: 4 additions & 3 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -1415,7 +1415,7 @@
"type": "dropdown",
"values": [
{
"id": "2",
"id": "0",
"label": {
"en": "Low",
"nl": "Laag",
Expand All @@ -1435,7 +1435,7 @@
}
},
{
"id": "0",
"id": "2",
"label": {
"en": "High (default)",
"nl": "Hoog (standaard)",
Expand Down Expand Up @@ -6572,7 +6572,8 @@
},
"zigbee": {
"manufacturerName": [
"_TZE204_t1blo2bj"
"_TZE204_t1blo2bj",
"_TZE200_t1blo2bj"
],
"productId": [
"TS0601"
Expand Down
28 changes: 14 additions & 14 deletions drivers/siren/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,32 +110,32 @@ class siren extends TuyaSpecificClusterDevice {
}
return true;
});

const actionSirenVolume = this.homey.flow.getActionCard('siren_volume_setting');
actionSirenVolume.registerRunListener(async (args, state) => {
this.log('FlowCardAction Set Alarm volume to: ', args.siren_volume_setting);
args.device.sendAlarmVolume(args.siren_volume_setting);
this.log('FlowCardAction Set Alarm volume to: ', args.siren_volume);
args.device.sendAlarmVolume(args.siren_volume);
});

const actionAlarmDuration = this.homey.flow.getActionCard('siren_alarm_duration');
actionAlarmDuration.registerRunListener(async (args, state) => {
this.log('FlowCardAction Set Alarm Duration to: ', args.duration);
args.device.sendAlarmDuration(args.duration);
});

const actionAlarmTune = this.homey.flow.getActionCard('siren_alarm_tune');
actionAlarmTune.registerRunListener(async (args, state) => {
this.log('FlowCardAction Set Alarm Tune to: ', args.siren_alarm_tune);
args.device.sendAlarmTune(args.siren_alarm_tune);
});
}

async processResponse(data) {
this.log('########### Response: ', data);
const parsedValue = getDataValue(data);
this.log('Parsed value ', parsedValue);
}

async processReporting(data) {
this.log('########### Reporting: ', data);
const parsedValue = getDataValue(data);
Expand Down Expand Up @@ -171,17 +171,17 @@ class siren extends TuyaSpecificClusterDevice {
this.log('DP ', data.dp, ' not handled!');
}
}

async processDatapoint(data) {
this.log('########### Datapoint: ', data);
const parsedValue = getDataValue(data);
this.log('Parsed value ', parsedValue);
}

onDeleted() {
this.log('ZigbeeSiren removed');
}

async onSettings({ oldSettings, newSettings, changedKeys }) {
changedKeys.forEach((updatedSetting) => {
this.log('########### Updated setting: ', updatedSetting, ' => ', newSettings[updatedSetting]);
Expand All @@ -201,24 +201,24 @@ class siren extends TuyaSpecificClusterDevice {
}
});
}

sendAlarmVolume(volume) { // (05) volume [ENUM] 0:high 1:mid 2:low
const volumeName = volumeMapping.get(Number(volume));
this.log('Sending alarm volume: ', volumeName, ' (', volume, ')');
this.writeEnum(dataPoints.TUYA_DP_VOLUME, volume);
}

sendAlarmDuration(duration) {
this.log('Sending alarm duration: ', duration, 's');
this.writeData32(dataPoints.TUYA_DP_DURATION, duration);
}

sendAlarmTune(tune) {
const tuneNr = Number(tune);
this.log('Sending alarm tune: ', melodiesMapping.get(tuneNr), ' (', tuneNr, ')');
this.writeEnum(dataPoints.TUYA_DP_MELODY, tuneNr);
}

}

module.exports = siren;
5 changes: 3 additions & 2 deletions drivers/siren/driver.compose.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
},
"zigbee": {
"manufacturerName": [
"_TZE204_t1blo2bj"
"_TZE204_t1blo2bj",
"_TZE200_t1blo2bj"
],
"productId": [
"TS0601"
Expand Down Expand Up @@ -58,4 +59,4 @@
}
}
}
}
}
8 changes: 4 additions & 4 deletions drivers/siren/driver.flow.compose.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,13 @@
"type": "dropdown",
"values": [
{
"id": "2",
"id": "0",
"label": {
"en": "Low",
"nl": "Laag",
"de": "Niedrig",
"sv": "Låg",
"it": "Basso"
"it": "Basso"
}
},
{
Expand All @@ -171,7 +171,7 @@
}
},
{
"id": "0",
"id": "2",
"label": {
"en": "High (default)",
"nl": "Hoog (standaard)",
Expand Down Expand Up @@ -397,4 +397,4 @@
]
}
]
}
}