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

Salus Controls PS600 - random "model ID" (zigbeeModel) #16272

Closed
marekbm opened this issue Jan 20, 2023 · 9 comments
Closed

Salus Controls PS600 - random "model ID" (zigbeeModel) #16272

marekbm opened this issue Jan 20, 2023 · 9 comments
Labels
problem Something isn't working

Comments

@marekbm
Copy link

marekbm commented Jan 20, 2023

What happened?

PS600 generates a differen "model ID" (zigbeeModel) after each pairing. And also it changes it between it starts pairing and it is paired. The beginning is always the same but not the end.
Also if I add the whole new name into the "/zigbee-herdsman-converters/devices/salus_controls.js" then for example OTA gives me an error regarding non existing model ID.

What did you expect to happen?

No response

How to reproduce it (minimal and precise)

Is it possible to add something like "end of string" char or sequence? This is the first device that I have that do the mess like this.

Zigbee2MQTT version

1.29.2

Adapter firmware version

20220219

Adapter

LAUNCHXL-CC1352P-2

Debug log

No response

@marekbm marekbm added the problem Something isn't working label Jan 20, 2023
@robertwigley
Copy link

robertwigley commented Feb 16, 2023

I have the same problem. Random characters are generated after PS600 e.g. PS600\u0000\u0000 �\u0001 ��\u0000\u0000\t\u0001@\u0011�u\u0000\u0000\u0018\u0012\n\u0005\u0000B

I've had to create a custom external converter file to be able to add this, but it's very difficult to get the random characters into it correctly. It seems some are simply not recognised at all, even when listed out. Contents of external converter file below in case it helps anyone else get these working.

const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const ota = require('zigbee-herdsman-converters/lib/ota')
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 definition = {
    zigbeeModel: [
        'PS600\u0000\u0000 �\u0001 ��\u0000\u0000\t\u0001@\u0011�u\u0000\u0000\u0018\u0012\n\u0005\u0000B',
        'PS600\u0000\u0000 �\u0001 ��\u0000\u0000\t\u0001@\u0011�u\u0000\u0000\u0018\u0006\n\u0005\u0000B'
    ],
    model: 'PS600',
    vendor: 'Salus Controls',
    description: 'Pipe temperature sensor',
    fromZigbee: [fz.temperature],
    toZigbee: [],
    exposes: [e.temperature()],
    configure: async (device, coordinatorEndpoint, logger) => {
        const endpoint = device.getEndpoint(9);
        await reporting.bind(endpoint, coordinatorEndpoint, ['msTemperatureMeasurement']);
    },
    ota: ota.salus,
};

module.exports = definition;

EDIT: The zigbeeModel can be found in config\zigbee2mqtt\database.db and copied from there.

@mikeyyuen
Copy link

mikeyyuen commented Feb 16, 2023

Having the same problem. It looks like this line https://github.com/Koenkk/zigbee-herdsman-converters/blob/master/index.js#L39 should let us to set the zigbeeModel to just PS600 and it should strip the null bytes from the devise as it registers. However I can't seem to get that to work not sure if anyone smarter might be able to spot why?

    zigbeeModel = zigbeeModel ? zigbeeModel.replace(/\0.*$/g, '').trim() : null;

Incidentally i finally figured out how to get the right model id for a custom converter, I had to open database.db and copy/paste it out of there.

@robertwigley
Copy link

robertwigley commented Feb 16, 2023

Incidentally i finally figured out how to get the right model id for a custom converter, I had to open database.db and copy/paste it out of there.

Nice one! At least that makes getting the correct ID possible on the first attempt. It took me many attempts copying from the log file and some were split across lines and simply didn't work, as I guess the characters were not being displayed properly.

On a separate subject, as I am a novice when it comes to these custom converters, is there a way to bring the battery information in? Apparently there are some battery attributes including voltage available when it's added via ZHA.

@mikeyyuen
Copy link

I'm not sure about battery, ZHA doesn't seem to provide any docs on the PS600 to indicate how it would support it. You could try setting the espose value in your custom converter i.e. exposes: [e.battery(), e.temperature()].

I was able to figure out why the original PS600 config doesn't seem to get picked up, I've pushed a PR to address it! Hopefully it can be merged.

@robertwigley
Copy link

Thanks @mikeyyuen. I tried exposes: [e.battery(), e.temperature()], but it doesn't seem to pull the battery data in. Never mind. The main thing is it's reporting temperature.

@mikeyyuen
Copy link

@robertwigley the following external converter gave me battery support:

const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const ota = require('zigbee-herdsman-converters/lib/ota');
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;

module.exports = {
    zigbeeModel: [
        'PS600<your model id here>',
    ],
    model: 'PS600',
    vendor: 'Salus Controls',
    description: 'Pipe temperature sensor',
    fromZigbee: [fz.temperature, fz.battery],
    toZigbee: [],
    meta: {battery: {voltageToPercentage: '3V_2500'}},
    exposes: [e.battery(), e.temperature()],
    configure: async (device, coordinatorEndpoint, logger) => {
        const endpoint = device.getEndpoint(9);
        await reporting.bind(endpoint, coordinatorEndpoint, ['msTemperatureMeasurement', 'genPowerCfg']);
        await reporting.temperature(endpoint);
        await reporting.batteryVoltage(endpoint);
    },
    ota: ota.salus,
};

I had to change the reporting and binding a little, which i've not played with before so I'm not 100% ready to PR it!

If it doesn't cause me (or anyone else here) any issues, i'll PR the config change. I had to press the "reconfigure" button for the device in the about page to get it to show up immediately, I don't know if that's just me being impatient!

@robertwigley
Copy link

Brilliant @mikeyyuen. I'm now seeing battery info. Thanks.

@mikeyyuen
Copy link

mikeyyuen commented Mar 3, 2023

I think this can now be closed.

@Koenkk
Copy link
Owner

Koenkk commented Mar 4, 2023

Thanks @mikeyyuen !

@Koenkk Koenkk closed this as completed Mar 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
problem Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants