Thank you - I think that is worth a go even though the real payload is “1” or “0”.
I tried calling the service with both True and 1 but neither was picked up. I shall experiment again tomorrow. Thank you very much!
I tried various combinations of True and true in various cases and enclosed in quotes and otherwise but nothing shows. However, I did notice this in the log if it is relevant…
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
resp = await task
File "/srv/homeassistant/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
resp = await handler(request)
File "/srv/homeassistant/lib/python3.7/site-packages/aiohttp/web_middlewares.py", line 119, in impl
return await handler(request)
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/http/request_context.py", line 18, in request_context_middleware
return await handler(request)
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/http/ban.py", line 72, in ban_middleware
return await handler(request)
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/http/auth.py", line 127, in auth_middleware
return await handler(request)
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/http/view.py", line 129, in handle
result = await result
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/media_player/__init__.py", line 897, in get
data, content_type = await player.async_get_media_image()
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/media_player/__init__.py", line 428, in async_get_media_image
return await _async_fetch_image(self.hass, url)
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/media_player/__init__.py", line 853, in _async_fetch_image
response = await websession.get(url)
File "/srv/homeassistant/lib/python3.7/site-packages/aiohttp/client.py", line 483, in _request
timeout=real_timeout
File "/srv/homeassistant/lib/python3.7/site-packages/aiohttp/connector.py", line 523, in connect
proto = await self._create_connection(req, traces, timeout)
File "/srv/homeassistant/lib/python3.7/site-packages/aiohttp/connector.py", line 859, in _create_connection
req, traces, timeout)
File "/srv/homeassistant/lib/python3.7/site-packages/aiohttp/connector.py", line 963, in _create_direct_connection
assert port is not None
AssertionError
Some more experiments came up with interesting results! I tried to emulate the heat pump being active by publishing messages via MQTT.fx but not one appeared under Events when I attempted to listen to that topic. However, they do appear under Config on the MQTT integrations like we tried yesterday. The last “real” one appeared as 1 and not “True”. I wonder if I have confused it as I noticed that some were published with Retain flag set. (I spent quite a few years supporting Websphere MQ on VMS systems so am not inexperienced on messaging systems. However, I think I am trying to diagnose this issue without having adequate fundamental knowledge! The Retain flag was set on by default on the test interface. Interrogating the broker with MQTT.fx reveals that the broker has 50 messages lying around somewhere!
I am going to have a cup of coffee and a think.
I cleared out the retained messages by deleting the Mosquitto database and restarting the broker. I shall keep an eye on the MQTT integration.
Now we have a real one in…
Message 0 received on heatpump/1A01 at 11:06:
1
QoS: 0 - Retain: false
This is definitely from the heatpump and not me testing anything.
Try your first example again then, once with and once without quotes.
A few more experiments but still nothing. I am wondering whether I could use the normal sensor code instead of the binary sensor.
OK - I know when I am beat for a Friday night. I am sat in an office with the heat pump in the adjacent garage and it has been running for a while but not even the other sensors are now working correctly. This is a screenshot - look at the temp graphs!
Thanks for your help thus far. I am going to shutdown the RPi and reboot it later tonight.
I set the YAML entries for payload_on and off to 1 and 0 - without quotes and emulated the heatpump change by using MQTT.fx. The MQTT settings in the integration picked up the payload but still nothing on the monitoring page. I suspect I may have to do something clever with templates for this as the MQTT binary sensor is not working. I shall see if I can find the code for the integration and take it from there.
I found the mqtt code but not where I was expecting…
/home/homeassistant/.local/lib/python3.5/site-packages/homeassistant/components/cover/mqtt.py
It is not in the python3.7 structure. My lack of Unix knowledge is not helping too. I cannot cd into the folder due to permission problems and FileZilla refuses to look in there too.
I tried to upgrade HA again but it thinks everything is up to date. In desparation I moved the binary sensor for the compressor to the normal MQTT sensor area and it has now detected the value change. Perhaps I should just move them all.
As the original installation was done some years ago under Hassbian I am thinking of building a fresh image and starting again. Frankly, I think that HA has some way to go before Joe Public can make good use of it but that is a shame as it is a brilliantly architected and implemented generally. Just needs some in-depth technical knowledge to get it to work and be resilient.
I have to apologise as I am a bonehead!
I was not changing the live file as I intended as my edits were being done on a PC and not being reflected on the RPi.
I thought I would update this thread in case anyone else had trouble. I do not know what has gone wrong with the embedded broker but Mosquitto is working perfectly!
Sorry!