Skip to content
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

No longer publishing to binary sensors on MQTT #249

Open
bbluez opened this issue Nov 24, 2024 · 10 comments
Open

No longer publishing to binary sensors on MQTT #249

bbluez opened this issue Nov 24, 2024 · 10 comments

Comments

@bbluez
Copy link

bbluez commented Nov 24, 2024

Error:
2024-11-24 15:55:14.420 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/mqtt_statestream/init.py", line 89, in _state_publisher
await mqtt.async_publish(hass, mybase + key, encoded_val, 1, True)
File "/usr/src/homeassistant/homeassistant/components/mqtt/client.py", line 182, in async_publish
await mqtt_data.client.async_publish(
File "/usr/src/homeassistant/homeassistant/components/mqtt/client.py", line 637, in async_publish
msg_info = self._mqttc.publish(topic, payload, qos, retain)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/paho/mqtt/client.py", line 1233, in publish
raise ValueError('Publish topic cannot contain wildcards.')
ValueError: Publish topic cannot contain wildcards.
2024-11-24 15:55:14.420 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/mqtt_statestream/init.py", line 89, in _state_publisher
await mqtt.async_publish(hass, mybase + key, encoded_val, 1, True)
File "/usr/src/homeassistant/homeassistant/components/mqtt/client.py", line 182, in async_publish
await mqtt_data.client.async_publish(
File "/usr/src/homeassistant/homeassistant/components/mqtt/client.py", line 637, in async_publish
msg_info = self._mqttc.publish(topic, payload, qos, retain)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/paho/mqtt/client.py", line 1233, in publish
raise ValueError('Publish topic cannot contain wildcards.')
ValueError: Publish topic cannot contain wildcards.

This seems new, but I am open to feedback. Tested reinstallation, restart of everything.

@kramttocs
Copy link
Collaborator

What changed? Did you implement new mqtt payloads in BI? Have you checked them all to make sure they are formatted correctly since it's complaining about a wildcard?
I don't use them but can set them up - just need more info.

@kramttocs
Copy link
Collaborator

Also, what indicates this being related to ha-blueiris? Just not seeing it referenced in the logs provided.

@bbluez
Copy link
Author

bbluez commented Nov 25, 2024

It seems that all of my other sensors (for example ESPHome) update as they should through mqtt statestream, however my Blue Iris cameras are stuck after the initial state. I can in the debuf log that the camera list and then I see the error:

image

States also show as unavailable:
image

@bbluez
Copy link
Author

bbluez commented Nov 27, 2024

As one more update, I removed the add-on today and the errors stopped in the logs. Re-adding the integration immediately triggered the MQTT errors again.

@johnjoemorgan
Copy link

Can you place up the topic that you have inserted into the BI camera's MQTT config? Thanks

@kramttocs
Copy link
Collaborator

Maybe I wasn't clear but the post ^ is what I was asking for earlier - I need to know what you are sending from BI when this happens so I can set it up and test.

It could be bad formatting or a weird camera name.
Trigger the actions in BI and see what is causing the error to show.

@bbluez
Copy link
Author

bbluez commented Nov 27, 2024

No worries, thanks for taking a look.

In BI, my topic is "BlueIris/&CAM/alert" in order to segment the alerts by camera. Payload data is "{"id":"&ALERT_DB","object":"&MEMO","camera":"&CAM","name":"&NAME"}"

In HA, I do have an automation that is set to watch "BlueIris/+/alert". My cameras names are simple, no space or character names (back, front, porch, deck, etc).
image

The error seems to appear repetitively once the add on is active:
Logger: homeassistant
Source: components/mqtt/client.py:637
First occurred: November 26, 2024 at 7:42:31 PM (12355 occurrences)
Last logged: 8:02:32 AM

Based on your comment, I also reduced the entities in the Integrations to a single camera and motion sensor (Playroom), and still see the error, though far less frequently.

Logger: homeassistant
Source: components/mqtt/client.py:637
First occurred: 8:09:06 AM (8 occurrences)
Last logged: 8:13:36 AM

@kramttocs
Copy link
Collaborator

Thanks.
It may be similar to #213
Please remove the object/Memo and see.
You can also use the 'typical' payload as seen here: https://github.com/elad-bar/ha-blueiris/blob/master/docs/blueiris-server.md
Recommendation would be to disable all but one of the mqtt actions and work to narrow down what causes it by starting with the one in the doc and then adding to it.

@bbluez
Copy link
Author

bbluez commented Nov 27, 2024

I have been doing a bit more testing and I was able to get rid of the error in MQTT, however the binary sensors are still not updating. The challenge is now is that the logs are empty as to why.
I removed and reinstalled the BI integration entirely.
Current Setup in BI:
image
I also removed all extra sensor data from MQTT stream to see if the formatting of the time or metadata could be interfering.
image

To test the motion detection I have triggered alerts as well as triggered the standard motion detection in BI.

@kramttocs
Copy link
Collaborator

Please read the guide I linked above and follow the mqtt format it shows there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants