Open pruvi9019 opened 5 months ago
Below are the Datapoint I found for the device using Tuya
{"1":"Control", "2":"Curtain position setting", "3":"Current curtain position", "4":"Mode", "5":"Motor Direction", "11":"Situation_set", "12":"Fault", "16":"Border", "19":"Best Position", "20":"Click Control"}
Same issue as I am having, but I also have the shades exposed to Alexa via HA and they are reversed as well.
There is a way to reverse the motor for Alexa by programming the controller using key combinations, but that changes the reporting in HA.
For example: HA shows blinds closed, Alexa shows them as opened, and vice versa.
I just installed a Smartwings zigbee roller shade and had the same issue. With the motor in the default position (so the up button on the remote opens the shade), the shade would report CLOSED to Home Assistant.
I found this external converter that corrected the issue so that the remote works in the correct direction and Home Assistant reports OPEN 100% when the shade is fully open.
note that the end of the file in the reddit comment has a syntax error at the end, here is the correct syntax:
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 reporting = require('zigbee-herdsman-converters/lib/reporting');
const e = exposes.presets;
const utils = require('zigbee-herdsman-converters/lib/utils');
backwards_cover_state = {
key: ['state'],
convertSet: async (entity, key, value, meta) => {
const lookup = {'open': 'downClose', 'close': 'upOpen', 'stop': 'stop', 'on': 'downClose', 'off': 'upOpen'};
value = value.toLowerCase();
utils.validateValue(value, Object.keys(lookup));
await entity.command('closuresWindowCovering', lookup[value], {}, utils.getOptions(meta.mapped, entity));
},
};
module.exports = [
{
zigbeeModel: ['WM25/L-Z'],
model: 'WM25L-Z',
vendor: 'Smartwings',
description: 'Roller shade',
fromZigbee: [fz.cover_position_tilt, fz.battery],
toZigbee: [backwards_cover_state, tz.cover_position_tilt],
meta: {battery: {dontDividePercentage: true}, coverInverted: false},
configure: async (device, coordinatorEndpoint) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg', 'closuresWindowCovering']);
await reporting.batteryPercentageRemaining(endpoint);
await reporting.currentPositionLiftPercentage(endpoint);
},
exposes: [e.cover_position(), e.battery()],
}
];
I just installed a Smartwings zigbee roller shade and had the same issue. With the motor in the default position (so the up button on the remote opens the shade), the shade would report CLOSED to Home Assistant.
I found this external converter that corrected the issue so that the remote works in the correct direction and Home Assistant reports OPEN 100% when the shade is fully open.
note that the end of the file in the reddit comment has a syntax error at the end, here is the correct syntax:
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 reporting = require('zigbee-herdsman-converters/lib/reporting'); const e = exposes.presets; const utils = require('zigbee-herdsman-converters/lib/utils'); backwards_cover_state = { key: ['state'], convertSet: async (entity, key, value, meta) => { const lookup = {'open': 'downClose', 'close': 'upOpen', 'stop': 'stop', 'on': 'downClose', 'off': 'upOpen'}; value = value.toLowerCase(); utils.validateValue(value, Object.keys(lookup)); await entity.command('closuresWindowCovering', lookup[value], {}, utils.getOptions(meta.mapped, entity)); }, }; module.exports = [ { zigbeeModel: ['WM25/L-Z'], model: 'WM25L-Z', vendor: 'Smartwings', description: 'Roller shade', fromZigbee: [fz.cover_position_tilt, fz.battery], toZigbee: [backwards_cover_state, tz.cover_position_tilt], meta: {battery: {dontDividePercentage: true}, coverInverted: false}, configure: async (device, coordinatorEndpoint) => { const endpoint = device.getEndpoint(1); await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg', 'closuresWindowCovering']); await reporting.batteryPercentageRemaining(endpoint); await reporting.currentPositionLiftPercentage(endpoint); }, exposes: [e.cover_position(), e.battery()], } ];
Tried that but didn't work for me.
Stilll says open when it is closed.
What side of the shade is your charge port on? I'm wondering if that's related to the issue since the reported behaviour seems really inconsistent between owners. Mine is on the right.
What side of the shade is your charge port on? I'm wondering if that's related to the issue since the reported behaviour seems really inconsistent between owners. Mine is on the right.
Mine is also on right. Are you using Alexa as well?
No, I have it connected to Home Assistant through zigbee2mqtt only.
What happened?
When controlling the Smartwings WM25L-Z roller shade manually via the device's remote, Zigbee2MQTT and Home Assistant report conflicting states and positions. Reversing the motor direction aligns the reports with the actual position but inversely affects the remote control commands, leading to operational inconsistencies.
What did you expect to happen?
I expected the state and position in Zigbee2MQTT to consistently reflect the actual physical state of the roller shade, aligning correctly with manual controls and Home Assistant without needing to invert motor directions, which inversely affects the usability of the remote control.
How to reproduce it (minimal and precise)
Manually close the blinds using the remote; observe the reported state in Zigbee2MQTT as OPEN and position as 100%, while Home Assistant indicates OPEN at 0%.
Manually open the blinds using the remote; observe the reported state in Zigbee2MQTT as CLOSE and position as 0%, while Home Assistant shows CLOSED at 100%.
Use the remote to reverse the motor direction.
Repeat the above steps and notice that while the reported states now align with the physical state, the remote control commands work inversely.
Zigbee2MQTT version
1.37.1 (commit: cda867a3)
Adapter firmware version
20240316
Adapter
SLZB-06p7
Setup
Raspberry Pi 5
Debug log
log1.log log.log