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

mqtt/mqtts is not recognized as valid AppRise URL #2241

Closed
Red96Baron opened this issue Mar 9, 2024 · 4 comments
Closed

mqtt/mqtts is not recognized as valid AppRise URL #2241

Red96Baron opened this issue Mar 9, 2024 · 4 comments
Assignees
Labels

Comments

@Red96Baron
Copy link

Describe the bug
When entereing an mqtt/mqtts URLs as a Notification URL it is not saved wit the error that it would not be an valid AppRise URL, even if it is.

Version
v0.45.16

To Reproduce

  1. Go to 'Settings'
  2. Click on 'Notifications'
  3. Enter an URL starting with 'mqtt://' or 'mqtts://'
  4. See error 'mqtts://...' is not a valid AppRise URL.

Expected behavior
The JSON set as the Notification Body should be sent to the mqtt broker.

@Red96Baron Red96Baron changed the title mqtt/mqtts are not recognized as valid AppRise URLs mqtt/mqtts is not recognized as valid AppRise URL Mar 9, 2024
@dgtlmoon
Copy link
Owner

dgtlmoon commented Mar 9, 2024

Looks like a bug in apprise?

$ pip3 list|grep apprise
apprise                1.7.2
$ ls|apprise  mqtt://home-server/nice-topic
Exception ignored in: <function Client.__del__ at 0x7f8dc2cc0310>
Traceback (most recent call last):
  File "/home/dgtlmoon/.local/lib/python3.10/site-packages/paho/mqtt/client.py", line 874, in __del__
    self._reset_sockets()
  File "/home/dgtlmoon/.local/lib/python3.10/site-packages/paho/mqtt/client.py", line 1133, in _reset_sockets
    self._sock_close()
  File "/home/dgtlmoon/.local/lib/python3.10/site-packages/paho/mqtt/client.py", line 1119, in _sock_close
    if not self._sock:
AttributeError: 'Client' object has no attribute '_sock'
2024-03-09 12:38:53,340 - ERROR - Could not load MQTT Notification URL: mqtt://home-server/nice-topic
2024-03-09 12:38:53,340 - ERROR - There are no service(s) to notify

@dgtlmoon
Copy link
Owner

dgtlmoon commented Mar 9, 2024

@Red96Baron please try to send a mqtt:// from the command line (pip install apprise)

if it persists, please open in caronc/apprise repo

thanks for the report

@Red96Baron
Copy link
Author

@dgtlmoon thanks for the fast reply!

Please refere to caronc's answer from the apprise issue:

This is related to the version of mqtt being installed under the hood. The new version was released (v2.0) and not backwards compatible with its previous. See here.

Your Change detection instance just needs to include the previous version of paho-mqtt and it will work fine.

@dgtlmoon
Copy link
Owner

Just released .17 :)

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

No branches or pull requests

2 participants