You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was able to make my Tuya curtain controllable locally using zigbee2Mqtt but the curtains seems to lose connection after 30minute or so. Then has to be relinked. The curtain is next to the coordinator SMlight. This does not happen with Tuya official gateway. How to fix that?
The attached converter works just fine however device activates every 15 minutes but stay awake
// Function to keep the device awake without triggering any actions
const keepDeviceAwake = async (device) => {
const endpoint = device.getEndpoint(0); // Assuming endpoint 0 is used for basic commands
try {
// Send a read request for a non-interfering attribute (e.g., 'powerSource')
setInterval(async () => {
try {
console.log(`Sending periodic read to device ${device.ieeeAddr}`);
// Read a non-actionable attribute, like 'powerSource', to keep the device awake
await endpoint.read('genBasic', ['powerSource']); // PowerSource is typically a non-actionable attribute
} catch (err) {
console.error(`Error reading from device ${device.ieeeAddr}:`, err);
}
}, 60000); // Send a request every 60 seconds to keep the device awake
} catch (error) {
console.error(`Error keeping device awake:`, error);
}
};
// Function to turn off the LED indicator on the device
const turnOffLED = async (device) => {
const endpoint = device.getEndpoint(0); // Assuming endpoint 0 for general controls
try {
// If the device supports controlling the LED, we can try sending an appropriate command to turn it off
console.log(`Turning off LED on device ${device.ieeeAddr}`);
// Attempt using the genOnOff cluster with an onOff command
// Sending "onOff: 0" should turn off the LED if it's controlled by this attribute
await endpoint.write('genOnOff', { onOff: 0 }); // Turn LED off (or adjust for your device)
// If the LED still stays on, try controlling it via other clusters or a different method.
// If it has a separate attribute for LED control, use that. For example:
// await endpoint.write('lightingColorCtrl', { colorX: 0, colorY: 0 });
// or, if using a different attribute or cluster, try it here.
} catch (error) {
console.error(`Error turning off LED for device ${device.ieeeAddr}:`, error);
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I was able to make my Tuya curtain controllable locally using zigbee2Mqtt but the curtains seems to lose connection after 30minute or so. Then has to be relinked. The curtain is next to the coordinator SMlight. This does not happen with Tuya official gateway. How to fix that?
The attached converter works just fine however device activates every 15 minutes but stay awake
const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const e = exposes.presets;
const ea = exposes.access;
const tuya = require('zigbee-herdsman-converters/lib/tuya');
// Function to keep the device awake without triggering any actions
const keepDeviceAwake = async (device) => {
const endpoint = device.getEndpoint(0); // Assuming endpoint 0 is used for basic commands
};
// Function to turn off the LED indicator on the device
const turnOffLED = async (device) => {
const endpoint = device.getEndpoint(0); // Assuming endpoint 0 for general controls
};
// Zigbee device definition
const definition = {
fingerprint: [
{
modelID: 'TS0601',
manufacturerName: '_TZE200_fodv6bkr',
},
],
model: 'TS0601_new',
vendor: 'Tuya',
description: 'Smart Curtain Motor',
fromZigbee: [tuya.fz.datapoints],
toZigbee: [tuya.tz.datapoints],
onEvent: tuya.onEventSetTime,
};
module.exports = definition;
Beta Was this translation helpful? Give feedback.
All reactions