davesmeghead / visonic

Visonic Custom Component for integration with Home Assistant
Apache License 2.0
92 stars 20 forks source link

Added sensor 0x93 - Next MCW #122

Closed TomasCorral closed 4 months ago

TomasCorral commented 4 months ago

One of my sensors was not identified, VisonicSensorRef is 0x93. I tested in my panel and it is now displaying correctly.

The sensor is this one: Next_MCW

Also the code for printing the sensor types is commented, even with the debug enabled it won't show. The log message "[Process Settings] Found unknown sensor type ..." did not show to me when I had an unknown sensor, I think the code is not reaching that part.

davesmeghead commented 4 months ago

It tries to find it in the list you added it to and if not then it matches it against the generic type to at least set it as a PIR (motion) in pmZoneSensorMaxGeneric_t, this is what I believe has happened. 0x93 would match to this entry: 0x3 : AlSensorType.MOTION

TomasCorral commented 4 months ago

Oh ok. Did I added the sensor in the right place?

I noticed some difference between Next MCW, K9 MCW and Next K9-85. Aren't they the same? I have choosen Next MCW since it is the print my sensor has in the PCB.

Would it be beneficial if the integration prints an error message in the console even with log debug off about the unknown sensor model. Somthing like:

[Visonic Integration] Could not decode ZXY sensor type. Please open an issue in github with the model of your sensor and code: 0xXY

davesmeghead commented 4 months ago

Oh ok. Did I added the sensor in the right place?

Yes, that list is the PowerMax proper list.

I have choosen Next MCW since it is the print my sensor has in the PCB.

I pretty much go with whatever device name people send me when they send me the hex code that goes with it, I either google it or they send me a link to the sensor on the visonic website or a reseller.

Would it be beneficial if the integration prints an error message

It already does

                log.debug("[Process Settings] Found unknown sensor type " + str(sensor_type))

It then leaves these variables at their default for the HA Frontend

        sensorType = AlSensorType.UNKNOWN
        sensorModel = "Model Unknown"

I think that this is enough as people can easily override it in the Frontend and set it to whatever they want.