Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

device_support(Heiman): add HS8OS #7423

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

mrskycriper
Copy link
Contributor

@mrskycriper mrskycriper commented Apr 21, 2024

Fix Koenkk/zigbee2mqtt#22029

TODO

  • mock up
  • OccupiedToUnoccupied delay
  • radar settings
  • illuminance Threshold
  • diagnostics
  • illuminance SensorStatus
  • image

@mrskycriper mrskycriper marked this pull request as draft April 21, 2024 21:25
@aelsharawi
Copy link

Thanks a lot for your help...I did not know it will take all that effort

@mrskycriper
Copy link
Contributor Author

Thanks a lot for your help...I did not know it will take all that effort

Well, it mostly comes down to the lack of spare time right now to be honest. End of the semester in the uni at its finest. But there are definitely some things that require more time to implement, mostly because we know all of the features from the specification. I hope I'll finish this PR until the next major release :)

@aelsharawi
Copy link

Thanks again for your hard work.. any new update ?

@sactre
Copy link

sactre commented Nov 21, 2024

I have this sensor and the zigbee model that it shows me is simply TS0601

@aelsharawi
Copy link

I have this sensor and the zigbee model that it shows me is simply TS0601

It is working OOB now with z2m...but were you able to change the settings?

@sactre
Copy link

sactre commented Nov 22, 2024

I have this sensor and the zigbee model that it shows me is simply TS0601

It is working OOB now with z2m...but were you able to change the settings?

Sorry, my device is Tuya versión, model HS80S-TY. I have created a Tuya configuration for this. I am in the process of testing it.
TuyaDatapoints info:
tuyaDatapoints: [
[101, 'illuminance', tuya.valueConverter.raw],
[1, 'presence_state', tuya.valueConverterBasic.lookup({none: 0, ocupancy: 1})],
[102, 'indicator', tuya.valueConverter.onOff],
[103, 'tamper', tuya.valueConverter.trueFalse0],
[104, 'motionless_sensitivity', tuya.valueConverter.raw],
[105, 'presence_time', tuya.valueConverter.raw],
],

@kkossev
Copy link

kkossev commented Nov 23, 2024

@sactre, what is your device manufacturer ID? Is it _TZ6210_duv6fhwt ?
Also, do you know what the motionless_sensitivity range is? Is it between 0 and 100 (100 being the maximum) ?
Thanks.

@Toma82
Copy link

Toma82 commented Dec 28, 2024

Has anything changed in terms of detection _TZ6210_duv6fhwt ?

@kilian-f-za
Copy link

kilian-f-za commented Feb 3, 2025

I have this sensor and the zigbee model that it shows me is simply TS0601

It is working OOB now with z2m...but were you able to change the settings?

Sorry, my device is Tuya versión, model HS80S-TY. I have created a Tuya configuration for this. I am in the process of testing it.
TuyaDatapoints info:
tuyaDatapoints: [
[101, 'illuminance', tuya.valueConverter.raw],
[1, 'presence_state', tuya.valueConverterBasic.lookup({none: 0, ocupancy: 1})],
[102, 'indicator', tuya.valueConverter.onOff],
[103, 'tamper', tuya.valueConverter.trueFalse0],
[104, 'motionless_sensitivity', tuya.valueConverter.raw],
[105, 'presence_time', tuya.valueConverter.raw],
],

@sactre Hi, is there any news about the Heiman Tuya version? Can the config be entered in ZigBee2MQTT?

@sactre
Copy link

sactre commented Feb 4, 2025

I have created this file to work with zigbee2mqtt

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 modernExtend = require('zigbee-herdsman-converters/lib/modernExtend');
const legacy = require('zigbee-herdsman-converters/lib/legacy');
const e = exposes.presets;
const ea = exposes.access;
const tuya = require('zigbee-herdsman-converters/lib/tuya');

const definition = {
// Since a lot of Tuya devices use the same modelID, but use different datapoints
// it's necessary to provide a fingerprint instead of a zigbeeModel
fingerprint: [
{
modelID: 'TS0601',
manufacturerName: '_TZ6210_duv6fhwt',
},
],
model: 'HS80S-TY',
vendor: 'Tuya',
description: 'Human presence sensor',
fromZigbee: [tuya.fz.datapoints],
toZigbee: [tuya.tz.datapoints],
configure: tuya.configureMagicPacket,
extend: [],
exposes: [
e.illuminance().withUnit('lx'),
e.enum('presence_state', ea.STATE, ['none', 'ocupancy', 'sin_estado']).withDescription('Occupancy State'),
e.tamper(),
e.binary('indicator', ea.STATE_SET, 'ON', 'OFF').withDescription('LED indicator'),
e
.numeric('presence_time', ea.STATE_SET)
.withValueMin(1)
.withValueMax(30)
.withValueStep(1)
.withDescription('Presence timeout')
.withUnit('min'),
e
.numeric('motionless_sensitivity', ea.STATE_SET)
.withValueMin(0)
.withValueMax(100)
.withValueStep(1)
.withDescription('Motionless Detection Sensitivity')
.withUnit('%'),

    ],
    meta: {
        tuyaDatapoints: [
            [101, 'illuminance', tuya.valueConverter.raw],
            [1, 'presence_state', tuya.valueConverterBasic.lookup({none: 0, ocupancy: 1, sin_estado: 2})],
            [102, 'indicator', tuya.valueConverter.onOff],
            [103, 'tamper', tuya.valueConverter.trueFalse0],
            [104, 'motionless_sensitivity', tuya.valueConverter.raw],
            [105, 'presence_time', tuya.valueConverter.raw],
        ],
    },

};

module.exports = definition;

@kilian-f-za
Copy link

I have created this file to work with zigbee2mqtt

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 modernExtend = require('zigbee-herdsman-converters/lib/modernExtend');
const legacy = require('zigbee-herdsman-converters/lib/legacy');
const e = exposes.presets;
const ea = exposes.access;
const tuya = require('zigbee-herdsman-converters/lib/tuya');

const definition = {
// Since a lot of Tuya devices use the same modelID, but use different datapoints
// it's necessary to provide a fingerprint instead of a zigbeeModel
fingerprint: [
{
modelID: 'TS0601',
manufacturerName: '_TZ6210_duv6fhwt',
},
],
model: 'HS80S-TY',
vendor: 'Tuya',
description: 'Human presence sensor',
fromZigbee: [tuya.fz.datapoints],
toZigbee: [tuya.tz.datapoints],
configure: tuya.configureMagicPacket,
extend: [],
exposes: [
e.illuminance().withUnit('lx'),
e.enum('presence_state', ea.STATE, ['none', 'ocupancy', 'sin_estado']).withDescription('Occupancy State'),
e.tamper(),
e.binary('indicator', ea.STATE_SET, 'ON', 'OFF').withDescription('LED indicator'),
e
.numeric('presence_time', ea.STATE_SET)
.withValueMin(1)
.withValueMax(30)
.withValueStep(1)
.withDescription('Presence timeout')
.withUnit('min'),
e
.numeric('motionless_sensitivity', ea.STATE_SET)
.withValueMin(0)
.withValueMax(100)
.withValueStep(1)
.withDescription('Motionless Detection Sensitivity')
.withUnit('%'),

    ],
    meta: {
        tuyaDatapoints: [
            [101, 'illuminance', tuya.valueConverter.raw],
            [1, 'presence_state', tuya.valueConverterBasic.lookup({none: 0, ocupancy: 1, sin_estado: 2})],
            [102, 'indicator', tuya.valueConverter.onOff],
            [103, 'tamper', tuya.valueConverter.trueFalse0],
            [104, 'motionless_sensitivity', tuya.valueConverter.raw],
            [105, 'presence_time', tuya.valueConverter.raw],
        ],
    },

};

module.exports = definition;

@sactre Thank you for the file, I also ordered a sensor and will test it when it has arrived. Can you also use it to create bindings with lamps?

@sactre
Copy link

sactre commented Feb 4, 2025

I have created this file to work with zigbee2mqtt
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 modernExtend = require('zigbee-herdsman-converters/lib/modernExtend');
const legacy = require('zigbee-herdsman-converters/lib/legacy');
const e = exposes.presets;
const ea = exposes.access;
const tuya = require('zigbee-herdsman-converters/lib/tuya');
const definition = {
// Since a lot of Tuya devices use the same modelID, but use different datapoints
// it's necessary to provide a fingerprint instead of a zigbeeModel
fingerprint: [
{
modelID: 'TS0601',
manufacturerName: '_TZ6210_duv6fhwt',
},
],
model: 'HS80S-TY',
vendor: 'Tuya',
description: 'Human presence sensor',
fromZigbee: [tuya.fz.datapoints],
toZigbee: [tuya.tz.datapoints],
configure: tuya.configureMagicPacket,
extend: [],
exposes: [
e.illuminance().withUnit('lx'),
e.enum('presence_state', ea.STATE, ['none', 'ocupancy', 'sin_estado']).withDescription('Occupancy State'),
e.tamper(),
e.binary('indicator', ea.STATE_SET, 'ON', 'OFF').withDescription('LED indicator'),
e
.numeric('presence_time', ea.STATE_SET)
.withValueMin(1)
.withValueMax(30)
.withValueStep(1)
.withDescription('Presence timeout')
.withUnit('min'),
e
.numeric('motionless_sensitivity', ea.STATE_SET)
.withValueMin(0)
.withValueMax(100)
.withValueStep(1)
.withDescription('Motionless Detection Sensitivity')
.withUnit('%'),

    ],
    meta: {
        tuyaDatapoints: [
            [101, 'illuminance', tuya.valueConverter.raw],
            [1, 'presence_state', tuya.valueConverterBasic.lookup({none: 0, ocupancy: 1, sin_estado: 2})],
            [102, 'indicator', tuya.valueConverter.onOff],
            [103, 'tamper', tuya.valueConverter.trueFalse0],
            [104, 'motionless_sensitivity', tuya.valueConverter.raw],
            [105, 'presence_time', tuya.valueConverter.raw],
        ],
    },

};
module.exports = definition;

@sactre Thank you for the file, I also ordered a sensor and will test it when it has arrived. Can you also use it to create bindings with lamps?

Yes, the sensor works perfectly as a zigbee router.

@kilian-f-za
Copy link

I have created this file to work with zigbee2mqtt
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 modernExtend = require('zigbee-herdsman-converters/lib/modernExtend');
const legacy = require('zigbee-herdsman-converters/lib/legacy');
const e = exposes.presets;
const ea = exposes.access;
const tuya = require('zigbee-herdsman-converters/lib/tuya');
const definition = {
// Since a lot of Tuya devices use the same modelID, but use different datapoints
// it's necessary to provide a fingerprint instead of a zigbeeModel
fingerprint: [
{
modelID: 'TS0601',
manufacturerName: '_TZ6210_duv6fhwt',
},
],
model: 'HS80S-TY',
vendor: 'Tuya',
description: 'Human presence sensor',
fromZigbee: [tuya.fz.datapoints],
toZigbee: [tuya.tz.datapoints],
configure: tuya.configureMagicPacket,
extend: [],
exposes: [
e.illuminance().withUnit('lx'),
e.enum('presence_state', ea.STATE, ['none', 'ocupancy', 'sin_estado']).withDescription('Occupancy State'),
e.tamper(),
e.binary('indicator', ea.STATE_SET, 'ON', 'OFF').withDescription('LED indicator'),
e
.numeric('presence_time', ea.STATE_SET)
.withValueMin(1)
.withValueMax(30)
.withValueStep(1)
.withDescription('Presence timeout')
.withUnit('min'),
e
.numeric('motionless_sensitivity', ea.STATE_SET)
.withValueMin(0)
.withValueMax(100)
.withValueStep(1)
.withDescription('Motionless Detection Sensitivity')
.withUnit('%'),

    ],
    meta: {
        tuyaDatapoints: [
            [101, 'illuminance', tuya.valueConverter.raw],
            [1, 'presence_state', tuya.valueConverterBasic.lookup({none: 0, ocupancy: 1, sin_estado: 2})],
            [102, 'indicator', tuya.valueConverter.onOff],
            [103, 'tamper', tuya.valueConverter.trueFalse0],
            [104, 'motionless_sensitivity', tuya.valueConverter.raw],
            [105, 'presence_time', tuya.valueConverter.raw],
        ],
    },

};
module.exports = definition;

@sactre Thank you for the file, I also ordered a sensor and will test it when it has arrived. Can you also use it to create bindings with lamps?

Yes, the sensor works perfectly as a zigbee router.

@sactre Thanks, is it possible to bind lamps direct with the presence sensor for onoff action?

@kilian-f-za
Copy link

@sactre The sensor arrived today and it works with your file. Is there a way to change the presence time to the unit seconds? I find a minute for a long time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[New device support]: Heiman PIR
6 participants