Parse bytes received by zwave component

Hi,

I am fairly new at this, and I d like to ask a simple question. I have a z wave door sensor, and the action on the sensor return a bytes string.

How are we supposed, or is there a tutorial, to parse those bytes? I cannot figure out how it is even done in the HASS source code.

eg: “Detail, Node003, Received: 0x01, 0x0f, 0x00, 0x04, 0x00, 0x03, 0x09, 0x71, 0x05, 0x00, 0x00, 0x00, 0xff, 0x06, 0x17, 0x00, 0x64”

Thank for your help,

You shouldn’t need to, because the state of a matching sensor. and possibly binary_sensor. entity will be updated automatically.

On a device where there isn’t necessarily a clear open/closed, on/off I find it easiest to run tail and grep against the OZW_Log.txt.

something like
tail -f OZW_log.txt | grep Node003 >Node003.txt
Then operate the Zwave device to trigger the behavior (open the door/trip the PIR etc).
CTRL C will kill the grep process. You can now view the Node003.txt file and look for changing state from likely “0” to “255” and back again to “0”. It could be the reverse, and it could well be a different number pair.

Thank you, Yes you are right, the state changes from 22 to 23 and reverse.

Now I get another sensor linked to it which shows 254, probably the battery, but I do not know how what would be the value if the battery was near the end.

Probably not the battery, that’s an attribute of the zwave entity instead (battery_level, which is a percentage of the remaining charge).

If you look in the dev-states section (<>) you’ll see the names of the entities - what’s it called?

sensor.kaipule_im20_doorwindow_sensor_burglar

I tried to test for anti tampering thing, but nothing was sent.

Of course you are right, battery_level is shown in the main node zwave.__2

If you’re seeing things named zwave.__2 then you need to restart HA to get the name coming through correctly.

Burglar is likely some form of tamper or vibration detection, but without knowing the brand and model of sensor, we’d just be guessing :wink:

Ho yes, I did not specify, sorry.
I did not configure anything as I previously thought something was missing.

It is a Kaipule im20 door sensor. (the cheapest on amazon in France).

If I create an element, shouldn’t it all gathered?


What should all be gathered? HA exposes each of the sensors and controls for each device separately, to make life easier for writing automations.

As for the burglar entity, that does appear to be for the tamper sensor, but the manual doesn’t make it clear what triggers it (probably opening the case).

Yes! Actually when I opened it the button inside got release and sent the 254. Normal value is 0.

What I thought is that I could get everything looking for node_id:2. Should I get a name if I did not configure any?

I was thinking of replicating this: Best way to convert or format Zwave responses?

Btw, Thank you for your tips!

You’ve got a name, it’s kaipule_im20_doorwindow_sensor. If you restart that’ll also show for the zwave. entity. You should also find a matching binary_sensor entity you can use to tell if the door is open or closed.

Yes, actually everything works! I have a nice on/off status.

I am going to start playing as I should with this.

Thank you