-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug with MH-Z19B and Home Assistant #4992
Comments
Nice find. The MHZ19 sensor can either be a MHZ19 or a MHZ19B. At restart init time the sensor is being forced as MHZ19 as it cannot be detected at that time as either MHZ19 or MHZ19B. Once some reading has been taking from the device the correct version can be detected and the name might change to MHZ19B. The problem with Hass detection is that it runs before the correct MHZ19 hardware version could be detected and you get the issue you noticed here. Delaying HASS discovery is not really a solution as one never knows when the correct MHZ19 is detected so if someone comes up with a solution the Hass community would be happy. |
One solution could be to keep the sensor name at MHZ19 and add a type variable to the JSON containing the data if anyone feels the need to use it then it will not cause the sensor name to change type not yet determined:
Type identified as A (or not B)
Type identified as B
|
That's why I love this issue list. Will make the change as suggested. |
I'm in a room that has < 410ppm :) |
Problem is if I change the name to MHZ19 sec it will probably rain issues of people who had a MHZ19B configured in Node-Red, OpenHab,... I think the easiest solution is to name all MHZ19 types just MHZ19B. MHZ19 is an "older" model and I hope not many people are using this... |
Yeah was just thinking I'd have to change my node-red... and we know how good us users are at reading release notes so probably best to assume MHZ19B irrespective which type is detected - I don't think the type has much use for end-user use case as the user would know which type is deployed and there isn't anything different to do on the home automation side whether its an A or B type - its just the data that matters. |
Right. So I make it best of both worlds. I'll add the type field too and keep the name fixed at MHZ19B |
6.4.1.10 20190121 * Fix Hass discovery of MHZ19(B) sensors (#4992)
Thank you! Works for me |
6.4.1.10 20190121 * Fix Hass discovery of MHZ19(B) sensors (arendst#4992)
Hi,
there is a bug with MQTT, Home Assistant, Home Assistant MQTT Discovery and the MH-Z19B (link).
It can be seen at the log files:
The name of the json parameter is MHZ19, but the device name is MHZ19B (ending with B!). This results to Home Assistant not finding the correct json element which was announced and to 0 values.
Best regards,
The text was updated successfully, but these errors were encountered: