Skip to content

EM300-DI Payload Codec Pulse #69

@Keelan

Description

@Keelan

Shouldn't the below be pulse not water? If i've configured the sensor as counter/pulse but in the payload JSON the pulse is missing and in bacnet the pulse value is always 0, but i see the water go up. The pulses i am receiving to the sensor are gas and electrical not water. So makes sense its called pulse rather than water

decoded.water = readFloatLE(bytes.slice(i + 4, i + 8));

What i changed my codec too:
decoded.pulse = readFloatLE(bytes.slice(i + 4, i + 8));

Also in the pulse context do we need the following?
decoded.water_conv = readUInt16LE(bytes.slice(i, i + 2)) / 10;

We already have
decoded.pulse_conv = readUInt16LE(bytes.slice(i + 2, i + 4)) / 10;

Similarly, do we need pulse_conv in the water alarm section?

from

        // WATER ALARM
        else if (channel_id === 0x85 && channel_type === 0xe1) {
            decoded.water_conv = readUInt16LE(bytes.slice(i, i + 2)) / 10;
            decoded.pulse_conv = readUInt16LE(bytes.slice(i + 2, i + 4)) / 10;
            decoded.water = readFloatLE(bytes.slice(i + 4, i + 8));
            decoded.water_alarm = readWaterAlarm(bytes[i + 8]);
            i += 9;
        }

to

        // WATER ALARM
        else if (channel_id === 0x85 && channel_type === 0xe1) {
            decoded.water_conv = readUInt16LE(bytes.slice(i, i + 2)) / 10;
            decoded.water = readFloatLE(bytes.slice(i + 4, i + 8));
            decoded.water_alarm = readWaterAlarm(bytes[i + 8]);
            i += 9;
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions