Hello clever people and please forgive me if I have missed something fundamental!
For about three years I have been using the embedded MQTT broker to monitor a ground source heat pump - HA running on Raspberry Pi. Also MQTT is used to transport data from another RPi with the BME680 environmental sensor. Apart from some annoying micro-sd hassles (broken 3 of them and 2 USB drives!), things have been running well. Then I recently upgraded HA to Home Assistant 0.116.4 and the MQTT stopped working. Some research here led to me install the Mosquitto broker and disable the embedded MQTT broker.
After some farting about I know have the “normal” sensors working. Here is a snippet for two of the working sensors:
I can see that there have been big changes with MQTT in HA and I understand the drive to put more into discovery and via the GUI as I assume this would require less technical skills. Do I need to set up some complex template to do this now?
Using MQTT.fx on a separate laptop I can see that the heat pump interface is generating the correct data and that is being published. Even using the mqtt.publish service within HA does not switch any of the binary sensors. I cannot find any error in the HA logfile too.
I was hoping that I could persuade Mosquitto to show me which subscriptions are in place but that has defeated me too!
I apologise profusely if I have missed something obvious or indeed a post where this is covered. Any help would be gratefully received!
Do you get any error in the logs? Do you maybe have binary_sensor: twice in your configuration.yaml? Can you show a snippet from MQTT.fx for one of the non working sensors?
The first two sensors you showed, are these temperature sensors? If so, change unit of measurement to “°C”.
The switch valve, is this a switch you want to be able to control from HA or only get the state of it? If you want to control it, you need to make an MQTT switch, not a binary_sensor.
Thank you very much for the quick response!
I do not want to control any of the config only monitor and store some history. The temperature sensors work ok. For example the Rad Return sensor shows 25.1 c at the moment.
The payload for the binary sensors is “1” for when it is active and “0” for when it is off. That is ASCII 1, and not a binary integer value.
The code to publish the MQTT message originates from the heat pump manufacturer and it would take some tweaks to convert the data to JSON from what I can see. Although it is written in Python. The interface is on the same Rpi as HA.
I also use HA to display data from a Bosch BME680 running on another Rpi. As that is not using a binary sensor then that works ok too. Here is the YAML for the temp part of the payload…
Logger: homeassistant.components.websocket_api.http.connection.1239969616
Source: core.py:1289
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 21 October 2020, 19:49:19 (2 occurrences)
Last logged: 21 October 2020, 19:49:23
two or more values in the same group of exclusion 'payload' @ data[<payload>]
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/websocket_api/commands.py", line 143, in handle_call_service
connection.context(msg),
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/core.py", line 1289, in async_call
processed_data = handler.schema(service_data)
File "/srv/homeassistant/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 272, in __call__
return self._compiled([], data)
File "/srv/homeassistant/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 576, in validate_dict
raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: two or more values in the same group of exclusion 'payload' @ data[<payload>]
That could have been when I was modifying the config yesterday as there is nothing of relevance in there today.
Here is a section from today…
[Bedroom clock(192.168.0.225):8009] Failed to connect to service Lenovo-Smart-Clock-4be7cc59d56b2cfc178688408efe609c._googlecast._tcp.local., retrying in 5.0s
12:17:08 – /srv/homeassistant/lib/python3.7/site-packages/pychromecast/socket_client.py (ERROR) - message first occurred at 21 October 2020, 15:43:47 and shows up 4 times
[Bedroom clock(192.168.0.225):8009] Heartbeat timeout, resetting connection
12:16:52 – /srv/homeassistant/lib/python3.7/site-packages/pychromecast/socket_client.py (WARNING) - message first occurred at 21 October 2020, 15:43:17 and shows up 5 times
Error handling request
12:07:35 – components/media_player/__init__.py (ERROR) - message first occurred at 10:54:04 and shows up 8 times
Update for sensor.efergy_728324 fails
09:47:59 – components/efergy/sensor.py (ERROR) - message first occurred at 21 October 2020, 15:07:22 and shows up 122 times
Update of sensor.per_device_usage is taking over 10 seconds
09:47:01 – /usr/local/lib/python3.7/asyncio/events.py (WARNING) - message first occurred at 21 October 2020, 15:32:03 and shows up 25 times
Could not update status for Per-Device Usage
09:44:34 – efergy (WARNING) - message first occurred at 21 October 2020, 15:37:40 and shows up 3 times
Retrying (Retry(total=6, connect=6, read=10, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x49eb6cf0>, 'Connection to datapoint.metoffice.gov.uk timed out. (connect timeout=1)')': /public/data/val/wxfcs/all/json/353311?key=f95c7d68-a5b2-4f4a-850e-a7ede003d2a9&res=3hourly
09:43:49 – /srv/homeassistant/lib/python3.7/site-packages/urllib3/connectionpool.py (WARNING) - message first occurred at 09:42:19 and shows up 8 times
Updating efergy sensor took longer than the scheduled update interval 0:00:30
09:38:51 – Sensor (WARNING) - message first occurred at 21 October 2020, 15:36:49 and shows up 5 times
I am awaiting the pump to restart before I can get the entry from MQTT.fx.
Heatpump is active at the moment and the boolean data is indeed being generated for the broker. I wonder if there is a way to determine what topics are being subscribed to?
When you go to Configuration -> Integrations and click on the Configure button of the MQTT integration, and subscribe to the topic of the pump, do you see the packets there?