-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
HomeAssistant Logfile overflowing with ems-esp-messages #337
Comments
I'm not sure why HA is reporting the errors. The config topics look correct and the data is available in the analogsensor_data topic. It could be a template parsing problem which you can test in HA by going to Developer Tools->Template and in the editor write some Jinja2 code like
but replacing with your real data from those screenshots |
Could it be that HA is confused by number/string of the json? Maybe worth to try renaming from "39" to "io39"? |
it works for me and my sensors. A good check is the HA template editor. Let's see what Marc comes back with |
@proddy:
but that had no effect in the logs. After that, I tried to put it in my: /config/configuration.yaml but - other idea- ... I was just suspecting that it maybe dislikes the double quotes (") instead of the single ones('): Until now i thought, HA accepts both variants.......but maybe it' not that tolerant in all situations than I tought. |
there's no difference between single and double quotes in HA. And you don't need to add anything to the yaml files, it should just work 'out of the box' so to speak. Send me the contents of your ems-esp/analogsensor_data and homeassistant/analogsensor_15 and I'll see if it works on my system and show you what you can cut & paste into the Template tester in ha to verify it works. |
I wanted the copy&paste data from MQTTExplorer so I didn't have to manually type it from those screenshots you sent. But you tested the template and it works, as it showed the value of 7. Note the HA Template editor in the Home Assistant Development Tools is just for trying and testing things out. It has no effect on the running of HA so you would not find anything in the logs. I can't find anything wrong. You config looks fine. It should work. Are you sure you deleted everything in the MQTT broker? When you said
did you really use MQTTExplorer and delete everything under homeassistant/ ? Try that again please. |
@proddy: thanks for your detailed explanation (ah, and sorry for the screenshots. I always prefer to "copy and paste" - and originaly I intended to give you the plain text: I just gave you the pictures because I had trouble copying the text in the left side of MQTT-Explorer.....but now I have discoverd, that I simply could have copied it from the right side to get it in textformat.)
and well: yes, I think I was very accurate in taking care to produce reliable results:
This time I repeated the steps plus did a complete Restart of HA-Server:
in MQTT-Explorer:
and thats what is contained in the data:
I was now thinking of: defining the complete Analog_sensor manually in configuration.yaml (maybe with dummy-startvalue 99) and see if it helps (and hoping, that this won't conflict with the discovery). P.S.: this was my old configuratio.yaml that I used with the tests: |
@marc1de the HA error for the heatingtype and set summer mode I'd like to investigate. Is this happening all the time or only when either MQTT or EMS-ESP is restarted? The other issues are indeed just how HA works with EMS-ESP, if you're using MQTT with persistence and not retaining the messages. HA has the config but can't find the data until its loaded. We could think about not retaining the HA config topics at some point |
Yes after a restart it takes a while to collect all data from ems, the first mqtt messages are not complete. That's by design of the bus, and a few log messages on a restart are not critical. |
@proddy that is correlated with #335 and #305. If we want to be sure to publish only complete messages, we have to wait some minutes before publishing the first device_data, in this case we can also subscribe and remove all retained HA messages from broker, then unsubscribe and start publishing with new HA config. But there will be also lots of complains because emsesp does not start publishing immediatly. |
@proddy: ok, here is my update:
To get clean results I did the following in this order:
My HA is now running since 4 hours and I didn't see any mqtt-related errors. [... or to be absolutely correct: I saw only this error every 10 seconds... So my conclusion is: if you follow exactly this startup-procedure, you won't see any errors, because ems-esp has allready all the values, so that HA "sees" no missing values. To confirm that suspicion I did a restart of ems-esp and got the "typical-startup-errors":
after a while, when all values were discoverd and submitted by ems-esp, the errors stopped @MichaelDvP: I agree with you, that it would be no good idea to wait several minutes to start publishing the mqtt-data.....I think more people will get confused and complaining an error (maybe, a few seconds will be ok and the rest of the errors -if they appear only in the beginning-, will be ok and tolerable) |
You can update to v3.4.0b6, the max. selburnpower is corrected and you can clear old mqtt-discovery entries by disable mqtt-discovery, wait some minutes, enable discovery again. This does not help for temporary missing entries after restarting emsesp, but if you have retained mqtt-entries from older versions giving permanent errors. |
I switched to the MQTT option "as individual topics" and now seeing HA warnings like "Template variable error: 'dict object' has no attribute 'hc1' when rendering '{{ value_json.hc1.seltemp }}'" so something needs fixing. I'll take a look later |
I fully agree!
might cause a little bit confusion: From my point of view I'd expect the first option to enable/disable the reporting of the mqtt-values ... So if someone for example deletes some unwanted entities in HA ....and therefore disables "mqtt-discovery" to prevent this entities coming up again, he will run into a problem because HA starts reporting the missing entities! (I know, that you could disable the unwanted items in "ems/settings"...but unfortunaly, that would disable this values in the ems-ui too. So if someone wants to have some values available in ems-esp but not having them reported to mqtt, he'd run into another problem). In other words: Your idea to "delete old entries" is very good,...but maybe this option should better be connected with the "enable mqtt" and not the "enable mqtt-discovery"? but I think, this are just some ideas with minor priority [for for future enhancements if you are really bored and need some new ideas to change something ;-) ] .... in fact, @ALL programmers and contributers: I'am full of respect for what's already done and how impressive this product is (including the perfect support and service). Thanks for that. |
@proddy I can not reproduce, switching to individual topics removes the entrie and creates a new one, that looks right for me. But i think i will never understand the logic of HA and HA-users. |
@MichaelDvP yes you're correct again. It was an error in some custom sensors I had in HA. |
This may be a good addition to #317, where you can select for each entity whether its visible in the WebUI and/or MQTT payload |
closing this bug |
When I was experimenting with GPIO-inputs and GPIO-counters (see issue #327), I realized, that my HomeAssistant-Log gets spammed with messages:
Diving deeper into the logs I found repeating messages like this:
First I thought, this was due to an unknown state of the inputs, so I toggled the GPIO-Pins at the ems-esp. But that didn't help, the messages continued (One message every 10 sek. and the errorcounter rises by 10. So the event takes place ever 1 sek. / mqtt-reporting interval in ems-esp was set to 10sek!)
I tried to analyse the messages with MQTT-Explorer, but that added more confusion: All reported GPIO's contain a value .... and just more confusing: it contained the GPIO13 - which didn't appear in the HA-Logs ?!?
![image](https://user-images.githubusercontent.com/98427926/151629549-cafc885f-adbf-4cdf-a0c9-3a2e6b39fdd6.png)
I know, that there surely exists the possibility to suppress this messages in HA, but due to the fact, that this messages were caused by the Sensors within ems-esp, I tought it was worth, reporting this here
My system:
Home Assistant: core-2121.12.10 on rpi (image)
HA-Supervisor-2021.12.2
ems-esp: special-Testversion of v3.4.0b2 (see #329) from MichaelDVP
Note: did several restartes of HA and ems-esp, tried to clear logfiles and also tried to delete the entities via MQTT-Browser. Nothing helped. Errormessages always reappear)
GPIO32 is configured as counter, all other GPIOS were inputs
The text was updated successfully, but these errors were encountered: