Hello I am trying to register a new sensor as far as I understand I get the sensor this way:
Then I tried with this recommendation by GPT:
response = b'\xaa\xc0\x86\x01\x16\x03\x71\x77\x88\xab'
# Extract the device ID bytes
device_id_bytes = response[6:8]
# Convert to hexadecimal
device_id_hex = device_id_bytes.hex().upper()
print(f"Device ID (Hex): {device_id_hex}")
# Convert to decimal
device_id_decimal = int.from_bytes(device_id_bytes, byteorder='big')
print(f"Device ID (Decimal): {device_id_decimal}")
and got a matching HEX from the ID of the sticker on the part but I still get:
" This sensor ID is already registered."
This is the ID in HEX and Decimal that I get:
root@raspberrypi:/home/ubuntu/pm2-sensor# python3 test.py
Device ID (Hex): 7177
Device ID (Decimal): 29047
Please let me know if this is the ID or I am doing something wrong.