Closed DerElch87 closed 1 year ago
@RDJ441 I took the liberty to fix a minor typo, this version of the external converter is working for me like a charm.
const fz = require('zigbee-herdsman-converters/converters/fromZigbee'); const tz = require('zigbee-herdsman-converters/converters/toZigbee'); const tuya = require('zigbee-herdsman-converters/lib/tuya'); const exposes = require('zigbee-herdsman-converters/lib/exposes'); const reporting = require('zigbee-herdsman-converters/lib/reporting'); const extend = require('zigbee-herdsman-converters/lib/extend'); const e = exposes.presets; const ea = exposes.access; // you can add this converter to toZigbee.js const devConv = { smart_watering_timer: { key: ['timer'], convertSet: async (entity, key, value, meta) => { meta.logger.debug(JSON.stringify(entity)); meta.logger.debug(JSON.stringify(key)); meta.logger.debug(JSON.stringify(value)); // input in minutes with maximum of 600 minutes (equals 10 hours) const timer = 60 * Math.abs(Math.min(value, 600)); // sendTuyaDataPoint* functions take care of converting the data to proper format await tuya.sendDataPointValue(entity, tuya.dataPoints.frankEverTimer, timer, 'setData', 1); return {state: {timer: value}}; }, convertGet: async (entity, key, meta) => { meta.logger.debug(JSON.stringify(entity)); meta.logger.debug(JSON.stringify(key)); return {state: {timer: key}}; }, }, }; const definition = { fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_htnnfasr'}], model: 'PSBZS A1', vendor: 'Parkside', description: 'Smart Watering Timer', supports: 'switch, timer', fromZigbee: [fz.ignore_basic_report, fz.on_off, devConv.smart_watering_timer], toZigbee: [tz.on_off, devConv.smart_watering_timer], onEvent: tuya.onEventSetTime, exposes: [e.switch(), exposes.numeric('timer', ea.SET).withValueMin(1).withUnit('min').withDescription('Auto off after specific time.')], configure: async (device, coordinatorEndpoint, logger) => {}, }; module.exports = definition;
Good job, do you know if is possible to use your work with deConz?
@RDJ441 I took the liberty to fix a minor typo, this version of the external converter is working for me like a charm.
const fz = require('zigbee-herdsman-converters/converters/fromZigbee'); const tz = require('zigbee-herdsman-converters/converters/toZigbee'); const tuya = require('zigbee-herdsman-converters/lib/tuya'); const exposes = require('zigbee-herdsman-converters/lib/exposes'); const reporting = require('zigbee-herdsman-converters/lib/reporting'); const extend = require('zigbee-herdsman-converters/lib/extend'); const e = exposes.presets; const ea = exposes.access; // you can add this converter to toZigbee.js const devConv = { smart_watering_timer: { key: ['timer'], convertSet: async (entity, key, value, meta) => { meta.logger.debug(JSON.stringify(entity)); meta.logger.debug(JSON.stringify(key)); meta.logger.debug(JSON.stringify(value)); // input in minutes with maximum of 600 minutes (equals 10 hours) const timer = 60 * Math.abs(Math.min(value, 600)); // sendTuyaDataPoint* functions take care of converting the data to proper format await tuya.sendDataPointValue(entity, tuya.dataPoints.frankEverTimer, timer, 'setData', 1); return {state: {timer: value}}; }, convertGet: async (entity, key, meta) => { meta.logger.debug(JSON.stringify(entity)); meta.logger.debug(JSON.stringify(key)); return {state: {timer: key}}; }, }, }; const definition = { fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_htnnfasr'}], model: 'PSBZS A1', vendor: 'Parkside', description: 'Smart Watering Timer', supports: 'switch, timer', fromZigbee: [fz.ignore_basic_report, fz.on_off, devConv.smart_watering_timer], toZigbee: [tz.on_off, devConv.smart_watering_timer], onEvent: tuya.onEventSetTime, exposes: [e.switch(), exposes.numeric('timer', ea.SET).withValueMin(1).withUnit('min').withDescription('Auto off after specific time.')], configure: async (device, coordinatorEndpoint, logger) => {}, }; module.exports = definition;
Good job, do you know if is possible to use your work with deConz?
Don't know, what I do know that deConz community is working on this device as well. https://github.com/dresden-elektronik/deconz-rest-plugin/issues/4958
@Smanar maybe also sth for deconz
Hi @skatehouse, for this moment i use Node Red through Home Assistance to use this "Watering Timer". I send every 30s "true" to open during the time i want and false to close. I thing it's possible to do somthing similar in Home Assistant, take a look dresden-elektronik/deconz-rest-plugin#4958 (comment)
Hi @VentiloFred. I have ioBroker with deconz installed, not home assistent. Could you pls share your thoughts about node red?
I think the issue here is people trying to use it with 1.18 and 1.19 and not knowing whose code was made for which version. Not many people are aware that the old Z2M Home-Assistant plugin stopped updating at 1.18.1 The new repo to add in HA is: https://github.com/zigbee2mqtt/hassio-zigbee2mqtt If I remember well, something with devices.js splitted into seperate .js files per manufacturer.
The valve doesn't seem to report back if it is switched or not and also it switches of autmaticly after about 60 sec. This time intervall can possibly be changed using the lidl gateway but I didn't found any messages that gave me a hint how to do this in z2m. I also tryed to integrate the battery state but this also doesn't seems to be reported.
Does anybody know how to get battery state? If battery dies and valve is open, it remains open (open valve, remove battery). I tried to check what happens if batteries are really low, whether valve opens or not, but valve still opening, may be there is some battery level when valve refuses to open (like Gardena devices do, low battery, don't open valve). That's why I think that battery level is really important.
The valve doesn't seem to report back if it is switched or not and also it switches of autmaticly after about 60 sec. This time intervall can possibly be changed using the lidl gateway but I didn't found any messages that gave me a hint how to do this in z2m. I also tryed to integrate the battery state but this also doesn't seems to be reported.
Does anybody know how to get battery state? If battery dies and valve is open, it remains open (open valve, remove battery). I tried to check what happens if batteries are really low, whether valve opens or not, but valve still opening, may be there is some battery level when valve refuses to open (like Gardena devices do, low battery, don't open valve). That's why I think that battery level is really important.
Currently there is no way to get any information from the device. I think it's possible in some way but for now all attempts failed. I'm sure that device has an ability to report battery state because I've seen this kind of message when paired with Tuya GW
Yes, this is the updated version. Missed something :)
const fz = require('zigbee-herdsman-converters/converters/fromZigbee'); const tz = require('zigbee-herdsman-converters/converters/toZigbee'); const tuya = require('zigbee-herdsman-converters/lib/tuya'); const exposes = require('zigbee-herdsman-converters/lib/exposes'); const reporting = require('zigbee-herdsman-converters/lib/reporting'); const extend = require('zigbee-herdsman-converters/lib/extend'); const e = exposes.presets; const ea = exposes.access; // you can add this converter to toZigbee.js const devConv = { smart_watering_timer: { key: ['timer'], convertSet: async (entity, key, value, meta) => { meta.logger.debug(JSON.stringify(entity)); meta.logger.debug(JSON.stringify(key)); meta.logger.debug(JSON.stringify(value)); // input in minutes with maximum of 600 minutes (equals 10 hours) const timer = 60 * Math.abs(Math.min(value, 600)); // sendTuyaDataPoint* functions take care of converting the data to proper format await tuya.sendDataPointValue(entity, tuya.dataPoints.frankEverTimer, timer, 'setData', 1); return {state: {timer: value}}; }, convertGet: async (entity, key, meta) => { meta.logger.debug(JSON.stringify(entity)); meta.logger.debug(JSON.stringify(key)); return {state: {timer: key}}; }, } }, }; const definition = { fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_htnnfasr'}], model: 'PSBZS A1', vendor: 'Parkside', description: 'Smart Watering Timer', supports: 'switch, timer', fromZigbee: [fz.ignore_basic_report, fz.on_off, devConv.smart_watering_timer], toZigbee: [tz.on_off, devConv.smart_watering_timer], onEvent: tuya.onEventSetTime, exposes: [e.switch(), exposes.numeric('timer', ea.SET).withValueMin(1).withUnit('min').withDescription('Auto off after specific time.')], configure: async (device, coordinatorEndpoint, logger) => {}, };
Hi I using your code but i have still issue with auto off after 60 s. I use zigbee2mqtt 1.19.1-1 and HA. Maybe I'm doing something wrong?
You need to set the timer attribute. I'm still working on that, but if you go to the developer options -> services and use the service 'mqtt: Publish', than you can set the following yaml:
service: mqtt.publish
data:
topic: zigbee2mqtt/0x847127fffecfc28e/set
payload: '{ "state": "ON", "timer": "10" }'
The time options persists, so next time you turn it on, the time option is memorized.
The time options persists, so next time you turn it on, the time option is memorized.
Thank you for the information. Unfortunately this does not work in my case. I see that the timer has been changed, but it is always auto off after 60 sec.
Are you sure the config is right?
const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const tuya = require('zigbee-herdsman-converters/lib/tuya');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const extend = require('zigbee-herdsman-converters/lib/extend');
const e = exposes.presets;
const ea = exposes.access;
// you can add this converter to toZigbee.js
const devConv = {
smart_watering_timer: {
key: ['timer'],
convertSet: async (entity, key, value, meta) => {
meta.logger.debug(JSON.stringify(entity));
meta.logger.debug(JSON.stringify(key));
meta.logger.debug(JSON.stringify(value));
// input in minutes with maximum of 600 minutes (equals 10 hours)
const timer = 60 * Math.abs(Math.min(value, 600));
// sendTuyaDataPoint* functions take care of converting the data to proper format
await tuya.sendDataPointValue(entity, tuya.dataPoints.frankEverTimer, timer, 'setData', 1);
return {state: {timer: value}};
},
convertGet: async (entity, key, meta) => {
meta.logger.debug(JSON.stringify(entity));
meta.logger.debug(JSON.stringify(key));
return {state: {timer: key}};
}
}
}
const definition = {
fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_htnnfasr'}],
model: 'PSBZS A1',
vendor: 'Parkside',
description: 'Smart Watering Timer',
supports: 'switch, timer',
fromZigbee: [fz.ignore_basic_report, fz.on_off, devConv.smart_watering_timer],
toZigbee: [tz.on_off, devConv.smart_watering_timer],
onEvent: tuya.onEventSetTime,
exposes: [e.switch(), e.battery(), exposes.numeric('timer', ea.SET).withValueMin(1).withUnit('min').withDescription('Auto off after specific time.')],
configure: async (device, coordinatorEndpoint, logger) => {
//const endpoint = device.getEndpoint(1);
//await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg']);
//await reporting.batteryPercentageRemaining(endpoint);
},
};
module.exports = definition;
I've just tested it again, and it's working with the timer value.
Are you sure the config is right?
const fz = require('zigbee-herdsman-converters/converters/fromZigbee'); const tz = require('zigbee-herdsman-converters/converters/toZigbee'); const tuya = require('zigbee-herdsman-converters/lib/tuya'); const exposes = require('zigbee-herdsman-converters/lib/exposes'); const reporting = require('zigbee-herdsman-converters/lib/reporting'); const extend = require('zigbee-herdsman-converters/lib/extend'); const e = exposes.presets; const ea = exposes.access; // you can add this converter to toZigbee.js const devConv = { smart_watering_timer: { key: ['timer'], convertSet: async (entity, key, value, meta) => { meta.logger.debug(JSON.stringify(entity)); meta.logger.debug(JSON.stringify(key)); meta.logger.debug(JSON.stringify(value)); // input in minutes with maximum of 600 minutes (equals 10 hours) const timer = 60 * Math.abs(Math.min(value, 600)); // sendTuyaDataPoint* functions take care of converting the data to proper format await tuya.sendDataPointValue(entity, tuya.dataPoints.frankEverTimer, timer, 'setData', 1); return {state: {timer: value}}; }, convertGet: async (entity, key, meta) => { meta.logger.debug(JSON.stringify(entity)); meta.logger.debug(JSON.stringify(key)); return {state: {timer: key}}; } } } const definition = { fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_htnnfasr'}], model: 'PSBZS A1', vendor: 'Parkside', description: 'Smart Watering Timer', supports: 'switch, timer', fromZigbee: [fz.ignore_basic_report, fz.on_off, devConv.smart_watering_timer], toZigbee: [tz.on_off, devConv.smart_watering_timer], onEvent: tuya.onEventSetTime, exposes: [e.switch(), e.battery(), exposes.numeric('timer', ea.SET).withValueMin(1).withUnit('min').withDescription('Auto off after specific time.')], configure: async (device, coordinatorEndpoint, logger) => { //const endpoint = device.getEndpoint(1); //await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg']); //await reporting.batteryPercentageRemaining(endpoint); }, }; module.exports = definition;
I've just tested it again, and it's working with the timer value.
Hi I copied again your code. :( Nothing change. After 60 sec. off. Do you have any idea what's going on?
How did you switch the device on? Via the front-end? Or via the developer tools?
The timer in the last version(s) seems not to be working indeed (Mqqt.publish service, Direct via MQTT Explorer). In a slightly older version the timer is working IF you send the timer command first (so not working when send in same payload), I rather have @RDJ441 version working as it has "exposes" in Z2M.
const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const tuya = require('zigbee-herdsman-converters/lib/tuya');
// you can add this converter to toZigbee.js
const devConv = {
smart_watering_timer: {
key: ['timer'],
convertSet: (entity, key, value, meta) => {
tuya.sendDataPointRaw(
entity,
5,
tuya.convertDecimalValueTo4ByteHexArray(value));
},
},
};
const definition = {
fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_htnnfasr'}],
model: 'PSBZS A1',
vendor: 'Parkside',
description: 'Smart Watering Timer',
supports: 'switch, timer',
fromZigbee: [fz.ignore_basic_report],
toZigbee: [tz.on_off, devConv.smart_watering_timer],
onEvent: tuya.onEventSetTime,
exposes: [],
configure: async (device, coordinatorEndpoint, logger) => {},
};
module.exports = definition;
I've still no luck with the readout of the battery, but I'm looking into it.
In my case I am running zigbee2mqtt without HA in a Raspberry Pi 4. The timer did not work until I used the code in the last topic from lvefferen 41 minutes ago. At the beginning I was able to change state but the timer did not work. I paired again and then it started to work. Maybe that is the different, it is necessary to pair again after changing the code.
I got also this message in the meantime: Zigbee2MQTT:debug 2021-07-01 16:54:14: Received Zigbee message from 'SmartWateringTimer', type 'commandSetTimeRequest', cluster 'manuSpecificTuya', data '{"payloadSize":53510}' from endpoint 1 with groupID 0 Zigbee2MQTT:debug 2021-07-01 16:54:14: No converter available for 'PSBZS A1' with cluster 'manuSpecificTuya' and type 'commandSetTimeRequest' and data '{"payloadSize":53510}'
SmartWateringTimer is the friendly name I gave to the Smart Watering timer in the configuration yaml
By the way, I have a couple of Raspberry Pi 4, another couple of CC2531 bought already flashed so I cannot flash them again by now and a Zigbee Bridge flashed with Tasmota, a Lidl Zigbee gateway with the original firmware and the Lidl Smart Watering Timer. Is there any tutorial to try to learn and how to program this stuff?
I'm sorry, I had way to much experimental code in my config. Try this:
const fz = require('zigbee-herdsman-converters/converters/fromZigbee'); const tz = require('zigbee-herdsman-converters/converters/toZigbee'); const tuya = require('zigbee-herdsman-converters/lib/tuya'); const exposes = require('zigbee-herdsman-converters/lib/exposes'); const reporting = require('zigbee-herdsman-converters/lib/reporting'); const extend = require('zigbee-herdsman-converters/lib/extend'); const e = exposes.presets; const ea = exposes.access; // you can add this converter to toZigbee.js const devConv = { smart_watering_timer: { key: ['timer'], convertSet: (entity, key, value, meta) => { tuya.sendDataPointRaw( entity, 5, tuya.convertDecimalValueTo4ByteHexArray(value)); } } } const definition = { fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_htnnfasr'}], model: 'PSBZS A1', vendor: 'Parkside', description: 'Smart Watering Timer', supports: 'switch, timer', fromZigbee: [fz.ignore_basic_report, fz.on_off, devConv.smart_watering_timer], toZigbee: [tz.on_off, devConv.smart_watering_timer], onEvent: tuya.onEventSetTime, exposes: [e.switch(), e.battery(), exposes.numeric('timer', ea.SET).withValueMin(1).withUnit('min').withDescription('Auto off after specific time.')], configure: async (device, coordinatorEndpoint, logger) => { //const endpoint = device.getEndpoint(1); //await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg']); //await reporting.batteryPercentageRemaining(endpoint); }, }; module.exports = definition;
This one works as expected, the timer work IF you send the { "timer": "2" } payload first, and afterwards { "state": "on"} both state and timer in one payload, does not work.
I receives the parkside device today. but not really understand the steps above very well.. Is it possible to tell me in a few steps what to do?
Great if the device is working in zigbee2mqtt :)
Be sure to be on Z2M version 1.19.1 read this: https://www.zigbee2mqtt.io/how_tos/how_to_support_new_devices.html create a file *****.js and also link it in the Z2M configuration.
I've still no luck with the readout of the battery, but I'm looking into it.
@RDJ441 Have manged to receive any attributes from the device?
Using this file (https://github.com/Koenkk/zigbee2mqtt/issues/7695#issuecomment-872344915) with HA, works fine but had to remove the const extend = require('zigbee-herdsman-converters/lib/extend');
as it complained it could not find it.
And sending the timer first, and then the switch on works as well.
I would love to help on this integration but never done this before so I will read the docs and try to see if I can be useful :)
Thank you all for this effort, cheers :beers:
@rjmsilveira i guess this is because of the version of zigbee2mqtt you use. I guess version 1.18.x? The plugin stopped updating for some reason after that version, but you should add the repo again and then install version 1.19.x. The extend functionality isn't required in this case tho.
I've still no luck with the readout of the battery, but I'm looking into it.
@RDJ441 Have manged to receive any attributes from the device?
Nope, not yet. I will receive the hub soon, so then I can test wether the info is present in the app or not. Might even be an unsupported feature, but i'm not sure.
I've still no luck with the readout of the battery, but I'm looking into it.
@RDJ441 Have manged to receive any attributes from the device?
Nope, not yet. I will receive the hub soon, so then I can test wether the info is present in the app or not. Might even be an unsupported feature, but i'm not sure.
I don't have the hub as well, but I know someone that uses the hub and app. Battery is available in the app
I've still no luck with the readout of the battery, but I'm looking into it.
@RDJ441 Have manged to receive any attributes from the device?
Nope, not yet. I will receive the hub soon, so then I can test wether the info is present in the app or not. Might even be an unsupported feature, but i'm not sure.
@RDJ441 good luck mate! Info is available, and I think it's this zigbee messege sent to Tuya Gateway: 00 22 0b02 00 04 0000005a But I've spent few hours to force the device to start reporting to z2m, but I've failed catastrophicaly. Maybe I've missed something, so I keep my fingers crossed for you.
On the latest version of Z2M I see this device is supported now. Can somebody share some automations? Turning valve on/off with virtual switch is fine for now. Is it possible to get state of valve now?
On the latest version of Z2M I see this device is supported now. Can somebody share some automations? Turning valve on/off with virtual switch is fine for now. Is it possible to get state of valve now?
No it's not possible for now. It's all written above.
On the latest version of Z2M I see this device is supported now. Can somebody share some automations? Turning valve on/off with virtual switch is fine for now. Is it possible to get state of valve now?
This is what I use now, injecting the Time-out and On command. State and Battery are not yet working. Sending Time-out and On command in 1 payload is also not working yet. (That why I delay the On payload 10ms)
Ok, thanx.
But putting this on the list of supported devices is quite a bold statement @Koenkk ..
No Pairing possible here:
Zigbee2MQTT:info 2021-07-08 14:01:44: Successfully interviewed '0x847127fffe1aae14', device has successfully been paired Zigbee2MQTT:info 2021-07-08 14:01:44: Device '0x847127fffe1aae14' is supported, identified as: Lidl Parkside smart watering timer (PSBZS A1) Zigbee2MQTT:info 2021-07-08 14:01:44: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"definition":{"description":"Parkside smart watering timer","exposes":[{"features":[{"access":7,"description":"On/off state of the switch","name":"state","property":"state","type":"binary","value_off":"OFF","value_on":"ON","value_toggle":"TOGGLE"}],"type":"switch"},{"access":2,"description":"Auto off after specific time.","name":"timer","property":"timer","type":"numeric","unit":"min","value_min":1},{"access":1,"description":"Link quality (signal strength)","name":"linkquality","property":"linkquality","type":"numeric","unit":"lqi","value_max":255,"value_min":0}],"model":"PSBZS A1","supports_ota":false,"vendor":"Lidl"},"friendly_name":"0x847127fffe1aae14","ieee_address":"0x847127fffe1aae14","status":"successful","supported":true},"type":"device_interview"}' Zigbee2MQTT:info 2021-07-08 14:01:44: Configuring '0x847127fffe1aae14' Zigbee2MQTT:info 2021-07-08 14:01:44: Successfully configured '0x847127fffe1aae14' Zigbee2MQTT:info 2021-07-08 14:01:44: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":"interview_successful","meta":{"description":"Parkside smart watering timer","friendly_name":"0x847127fffe1aae14","model":"PSBZS A1","supported":true,"vendor":"Lidl"},"type":"pairing"}'
After that - nothing happens.
No Pairing possible here:
Zigbee2MQTT:info 2021-07-08 14:01:44: Successfully interviewed '0x847127fffe1aae14', device has successfully been paired Zigbee2MQTT:info 2021-07-08 14:01:44: Device '0x847127fffe1aae14' is supported, identified as: Lidl Parkside smart watering timer (PSBZS A1) Zigbee2MQTT:info 2021-07-08 14:01:44: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"definition":{"description":"Parkside smart watering timer","exposes":[{"features":[{"access":7,"description":"On/off state of the switch","name":"state","property":"state","type":"binary","value_off":"OFF","value_on":"ON","value_toggle":"TOGGLE"}],"type":"switch"},{"access":2,"description":"Auto off after specific time.","name":"timer","property":"timer","type":"numeric","unit":"min","value_min":1},{"access":1,"description":"Link quality (signal strength)","name":"linkquality","property":"linkquality","type":"numeric","unit":"lqi","value_max":255,"value_min":0}],"model":"PSBZS A1","supports_ota":false,"vendor":"Lidl"},"friendly_name":"0x847127fffe1aae14","ieee_address":"0x847127fffe1aae14","status":"successful","supported":true},"type":"device_interview"}' Zigbee2MQTT:info 2021-07-08 14:01:44: Configuring '0x847127fffe1aae14' Zigbee2MQTT:info 2021-07-08 14:01:44: Successfully configured '0x847127fffe1aae14' Zigbee2MQTT:info 2021-07-08 14:01:44: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":"interview_successful","meta":{"description":"Parkside smart watering timer","friendly_name":"0x847127fffe1aae14","model":"PSBZS A1","supported":true,"vendor":"Lidl"},"type":"pairing"}'
After that - nothing happens.
And what should happen?
As i mentioned the pairing is not successfully. I miss the completion of the paring and that the device will appear in MQTT.
I see, but I think it can be just not enough signal strength. Try closer to coordinator. I've never experienced described problem.
@mgrom not sure if it is the same device, but this might help for adding more features: https://github.com/Koenkk/zigbee-herdsman-converters/issues/2795#issuecomment-882463362
@Koenkk thanks for the link, but there is one important difference. "Our" device is speachless when connected to z2m. So we are not able to get any state from the device. This is something I was trying to figure out, but without any luck... I think the problem is related to version of ... uhh.. I've forgot the name... kind of communication protocol or something like that. Second guess is type of messages sent between Tuya GW and the device during pairing that I wasn't able to replicate.
I've didn't succeed on the reporting fact. It is just not possible to 'see' the state of the parkside switch, but we can work around this. I've quite a decent setup right now. I will share my configs.
This is my zigbee2mqtt config:
const tuya = require('zigbee-herdsman-converters/lib/tuya');
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;
// you can add this converter to toZigbee.js
const devConv = {
smart_watering_timer: {
key: ['timer'],
convertSet: (entity, key, value, meta) => {
tuya.sendDataPointRaw(
entity,
5,
tuya.convertDecimalValueTo4ByteHexArray(value));
},
convertGet: async (entity, key, meta) => {
return { timer: key};
}
}
}
module.exports = [
{
fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_htnnfasr'}],
model: 'PSBZS A1',
vendor: 'Parkside',
description: 'Smart Watering Timer',
supports: 'switch, timer',
fromZigbee: [fz.on_off],
toZigbee: [tz.tuya_switch_state, devConv.smart_watering_timer],
exposes: [e.switch().setAccess('state', ea.STATE_SET),
exposes.numeric('timer', exposes.access.STATE_SET).withValueMin(0).withValueMax(600).withUnit('minutes')
.withDescription('Countdown timer in minutes')],
},
];
My home assistant config consists of the following components:
A timer
timer:
watering_time_remaining:
name: Watering time remaining
duration: 10 # Updated this to the number of seconds you wish
An input slider
input_number:
watering_duration:
name: Besproeitijd voortuin
initial: 60
min: 0
max: 120
step: 1
An input boolean
input_boolean:
bewatering_voortuin:
name: Bewatering voortuin
The automation
The automation exists of 2 parts. First the 'on switch' automation for starting the timer.
alias: Bewatering voortuin
description: ''
trigger:
- platform: state
entity_id: input_boolean.bewatering_voortuin
condition: []
action:
- service: mqtt.publish
data_template:
topic: zigbee2mqtt/0x847127fffecfc28e/set
payload: >
{%- set duration = states("input_number.watering_duration") | int -%}
{%- if is_state("input_boolean.bewatering_voortuin", "on") -%}
{"timer": "{{duration}}" }
{%- else -%}
{}
{%- endif -%}
- service: mqtt.publish
data_template:
topic: zigbee2mqtt/0x847127fffecfc28e/set
payload: >
{%- set value = "ON" if is_state(trigger.entity_id, "on") else "OFF"
-%} {"state": "{{value}}" }
- service: timer.finish
target:
entity_id: timer.watering_time_remaining
- service: timer.start
data:
duration: >
{% set duration = states("input_number.watering_duration") | int * 60
%} {% if is_state("input_boolean.bewatering_voortuin", "off") -%}
{{'00:00:01'}}
{%- else -%}
{{'{:02d}:{:02d}:{:02d}'.format(duration // 3600, (duration % 3600) // 60, (duration % 3600) % 60)}}
{%- endif -%}
target:
entity_id: timer.watering_time_remaining
mode: single
Then the stop function. This is used for stopping the timer.
alias: Bewatering voortuin uit
description: ''
trigger:
- platform: event
event_type: timer.finished
event_data:
entity_id: timer.watering_time_remaining
condition: []
action:
- service: input_boolean.turn_off
target:
entity_id: input_boolean.bewatering_voortuin
- service: timer.cancel
target:
entity_id: timer.watering_time_remaining
mode: single
Why is this 'safe' ? We first send the 'timer' command to the switch en then we switch the controller on. So the controller won't be running longer than the 'time' you send to the device.
Hopefully you guys can use this as well. I have also been able to automate it with HAsmartirrigation (https://github.com/jeroenterheerdt/HAsmartirrigation). So the time is calculated automaticaly!
alias: Bewatering voortuin (automatisch)
description: >-
Start Smart Irrigation at 06:00 and run it only if the adjusted_run_time is >0
and run it for precisely that many seconds
trigger:
- event_data: {}
event_type: smart_irrigation_start
platform: event
- platform: time
at: '06:00:00'
condition:
- above: '0'
condition: numeric_state
entity_id: sensor.smart_irrigation_daily_adjusted_run_time
attribute: adjusted_run_time_minutes
action:
- service: input_number.set_value
data_template:
entity_id: input_number.watering_duration
value: >
{{ (states("sensor.smart_irrigation_hourly_adjusted_run_time") | int /
60) | int }}
- service: input_boolean.turn_on
target:
entity_id: input_boolean.bewatering_voortuin
- service: notify.mobile_app_robert
data:
message: >
En duurt {{ (states("sensor.smart_irrigation_hourly_adjusted_run_time")
| int / 60) | int }} minuten
title: 'Besproeiing gestart '
mode: single
Is there already support for reading out the battery life? Or does someone know if the device closes (and restricts opening) automatically when low battery?
Hi there, good work on supporting this device.
However requesting the current state of the device via zigbee2mqtt/friendlyname/get
with payload: { "state": ""}
as described in the supported Devices list does not work here or me and a friend. In total we ware operating three of these devices and it works on none of them.
Can you please give some advice on how I get this working? Thank you very much in advance!
@careyer answer is very simple. It's not possible. This device is tricky and it don't want to talk to zigbee2mqtt
@mgrom in the comments above some people seems to have had success tough. Would be interesting to know what they did differently (@hdlange / @RDJ441)
@mgrom in the comments above some people seems to have had success tough. Would be interesting to know what they did differently (@hdlange / @RDJ441)
I don't think so, but let them confirm 🙂
Nope, the device is silent somehow 👎 Really anoying. You can use the config I shared earlier. It works solid for me, eventhough I wish there was a better option.
You can use the config I shared earlier. It works solid for me, eventhough I wish there was a better option.
I don't use any custom config... The device works just fine (without any feedback of course) with the defaults as shipped by HA.
Yes the config was merged into the zigbee2mqtt code base :-) I was also talking about the implementation part (automation and so on). Cheers!
Awesome, thanks for the explanation :)
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days
Device still doesn't report back on queries
Device still doesn't report back on queries
Have you read all comments here?
Device still doesn't report back on queries
Have you read all comments here?
Yes I have ... device works fine but does not report back on timer query or when button is pressed manually on the device. There seems to be no solution for that yet, or have I overlooked something?
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days
Hallo, i have the tuya/ Silbercrest hub, could i help to enhance the support for this device? It also support planning watering, (every day at 6.00 for 30 Min) this even work's when the hub is offline. I am going to hack my hub, so I could get root access, or if I buy an debugger, I may get information at the ZigBee module ARM Debug SWDIO / SWCLK.
Dear all, I tried to create support for the Parkside Smart Watering Timer, but failed catastrophically :)
I created a .js file for Tuya like explained in the tutorial - but then Z2M will not start anymore. I copied the content on the bottom of the message. If anyone is willing to help, I'd highly appreciate.
Thanks and best regards
Information about the device + link
Parkside Smart Watering Timer https://www.lidl.de/de/parkside-smarter-bewaesserungscomputer-zigbee-smart-home/p375570
Failure message when starting Z2M
[08:04:41] INFO: Handing over control to Zigbee2mqtt Core ...
PSBZS.js
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 extend = require('zigbee-herdsman-converters/lib/extend'); const e = exposes.presets; const ea = exposes.access;_
const definition = { fingerprint: [ { modelID: 'TS0601', manufacturerName: '_TZE200_c88teujp' }, ], model: 'PSBZS A1', vendor: 'Lidl', description: 'Smart Watering Timer', supports: 'thermostat, temperature', fromZigbee: [ fz.ignore_basic_report, // Add this if you are getting no converter for 'genBasic' fz.tuya_data_point_dump, // This is a debug converter, it will be described in the next part ], toZigbee: [ tz.tuya_data_point_test, // Another debug converter ], onEvent: tuya.setTime, // Add this if you are getting no converter for 'commandSetTimeRequest' configure: async (device, coordinatorEndpoint, logger) => { const endpoint = device.getEndpoint(1); await reporting.bind(endpoint, coordinatorEndpoint, ['genBasic']); }, exposes: [ // Here you should put all functionality that your device exposes ], };
module.exports = definition;
Edit: Link to Zigbee Alliance https://zigbeealliance.org/zigbee_products/smarter-water-computer/