As I have mentioned before and will again at the risk of being redundant... I am not a developer
Sure could use some help to get an MH10-PM2.5 Air Quality sensor working. @matt_k has been very supportive however he/I feel additional eyes on this might be beneficial and thought a new thread for this device type was appropriate
Only place it gets set is in Preferences. It does have a default value of zero, but doesn't seem to have used that value in this instance. A quick fix would be to insert a statement similar to:
@thebearmay Thanks for helping out! I've done some work on this driver, based on an existing driver (see credits in code), but am far from a developer.
My experience to get the MH9 device to report all information is to check the debug logs (don't forget to enable debugging first) for additional sensor information. There is debugging in the code that will show all values and it will make it easier to identify the correct sensor type for air quality. Since Hubitat does not support a capability "Air quality" I've set it to CarbonDioxide to report the value.
Donβt have a device to test against, but have you seen anything in the logs from Case 17 lines: 157-164? Looks to me like those lines, if ever activated, would store a value for carbonDIoxide (you could actually change that to something like airQuality and not break anything).
If youβre not seeing anything there, are you seeing anything in the descriptionText driver state? (If so, you may want to add another debug line to write to the log in case there are multiple values coming through.)