Hubitat with Homemade Temperature, Humidity, Pressure and Light sensor

is it more difficult comparing to RES005? May be it worth adding a request for support of RES007 and provide a statement of the problem in the description?

(I know that I'm whining, but at this point in run HE only because of RES007))

The main sensor itself is not an issue (the RES007). However, exposing the the child BME680 data is not easy for me.

Are you still making/selling these? I bought a few from you some time ago and love them and could use a couple more. I see the item on eBay but only says "Make an offer" and it errors when I click that.

I am not making them at this moment. I have issue getting reasonable pricing for the BME280 sensor.

I have tracking setup for the BME280 pricing. As soon as they come down in price, I will be making them again.

5 Likes

Hi Iman. I have some of your sensors which have always worked well, but I am now moving some of my Zigbee stuff across to Zigbee2MQTT and one of these sensors is one I would like to move

Do you know if anyone has written a Z2M "driver" for this? I think it is called a shepherd on Z2M, but I've only just started using it so I'm not up to the level of writing my own code for it yet. I've tried connecting one and it pairs OK and it detected as a router, but comes up as unsupported so I get no sensor information etc . If nothing is out there, I might have a try at doing my own, but I don't want to re-invent the wheel if someone has already done it.

1 Like

They work just fine with Z2M.

Initially, yes. I suspect you didn't wait for the interview to complete as that's when it will show as

image

It does take roughly a minute to complete but it depends a lot on where it lands in your mesh and the signal strength it sees. Within a few feet of the controller it will complete the interview in very short time but if it's at the fringe of your mesh it could take a couple minutes.

1 Like

Hi @Geoff_T, if you have the RES005 version, the converter should be built in with Z2M. Unfortunately, if you have other version of Environment Sensor, a custom converter must be created. I don't have a cycle at the moment to support the older version with Z2M.

I had some of the very first batch on general release, (the firmware build date shows as 20180406 in Z2M) so I'm guessing mine are not the RES005 versions.

That is not supported natively in Z2M. However, Z2M support external converter (aka custom driver). The difference between Environment Sensor version is not that much. If you have the time, I think you can make the external converter based on the RES005 converter.

1 Like

OK. Sounds like a project for a rainy Sunday afternoon - I'm in the UK, so I shouldn't have to wait too long!

3 Likes

Some of mine are pre-eBay days but I'm not sure how that fits in here, just FYI

@iharyadi, wow this is some great stuff in this thread. Nice job. I have been looking for a solution to monitor PH in my Hydroponic Greenhouse (it runs away sometimes). Could the the analog expansion input of the Environment Sensor be utilized to monitor PH? I have been searching and see for many years complicated solutions, but this could be very simple with your board. I know a lot of people would be interested in this for temp and PH of pools too with remote sensors.

1 Like

@iharyadi
So if we have the RES001, is there a file we can use in Z2M, or are you saying someone has to make one yet?

I see the code for the RES005, but I don't know what needs to be changed.

For anyone interested I managed to get the RES001 sensor mostly working in Z2M with a external converter. The lux value seems to be having some issues. Also if I populate anything in the tozigbee parameter z2m throws an error and wont start. I think this is related to why the lux isnt working properly.

Here is the code for the external converter if anyone is interested. It is 99.9% the same as @iharyadi code, just with the sensor name changed. @iharyadi I dont know if you are interested but you might be able to take a look and get it officially supported.

const constants = require('zigbee-herdsman-converters/lib/constants');
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 globalStore = require('zigbee-herdsman-converters/lib/store');
const utils = require('zigbee-herdsman-converters/lib/utils')
const e = exposes.presets;
const ea = exposes.access;

const definition = {
    zigbeeModel: ['RES001'],
    model: 'KMPCIL',
    vendor: 'KMPCIL',
    description: 'Environment Sensor',
    fromZigbee: [fz.temperature, fz.humidity, fz.pressure, fz.illuminance], // <-- added here all clusters reported from zigbee
    toZigbee: [], // <-- add here all clusters to send commands to zigbee
    exposes: [e.temperature(), e.humidity(), e.pressure(), e.illuminance().withAccess(ea.STATE_GET), e.illuminance_lux().withAccess(ea.STATE_GET)], // <-- this will de>

configure: async (device, coordinatorEndpoint, logger) => {
            const endpoint = device.getEndpoint(8);
            const binds = ['genPowerCfg', 'msTemperatureMeasurement', 'msRelativeHumidity', 'msPressureMeasurement',
                'msIlluminanceMeasurement', 'genBinaryInput', 'genBinaryOutput'];
            await reporting.bind(endpoint, coordinatorEndpoint, binds);
            await reporting.temperature(endpoint);
            await reporting.humidity(endpoint);
            const payload = [{attribute: 'measuredValue', minimumReportInterval: 5, maximumReportInterval: constants.repInterval.HOUR,
                reportableChange: 200}];
            await endpoint.configureReporting('msIlluminanceMeasurement', payload);
            const payloadPressure = [{
                // 0 = measuredValue, override dataType from int16 to uint16
                // https://github.com/Koenkk/zigbee-herdsman/pull/191/files?file-filters%5B%5D=.ts#r456569398
                attribute: {ID: 0, type: 33}, minimumReportInterval: 2, maximumReportInterval: constants.repInterval.HOUR,
                reportableChange: 3}];
            await endpoint.configureReporting('msPressureMeasurement', payloadPressure);
            const options = {disableDefaultResponse: true};
            await endpoint.write('genBinaryInput', {0x0051: {value: 0x01, type: 0x10}}, options);
            await endpoint.write('genBinaryInput', {0x0101: {value: 25, type: 0x23}}, options);
            const payloadBinaryInput = [{
                attribute: 'presentValue', minimumReportInterval: 0, maximumReportInterval: 30, reportableChange: 1}];
            await endpoint.configureReporting('genBinaryInput', payloadBinaryInput);
            await endpoint.write('genBinaryOutput', {0x0051: {value: 0x01, type: 0x10}}, options);
            const payloadBinaryOutput = [{
                attribute: 'presentValue', minimumReportInterval: 0, maximumReportInterval: 30, reportableChange: 1}];
            await endpoint.configureReporting('genBinaryOutput', payloadBinaryOutput);
        },
    };


module.exports = definition;
3 Likes