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

Paho MQTT Unsupported callback API #580

Closed
2 tasks done
iLeoLion opened this issue Feb 29, 2024 · 10 comments
Closed
2 tasks done

Paho MQTT Unsupported callback API #580

iLeoLion opened this issue Feb 29, 2024 · 10 comments
Labels
bug 🐛 Something isn't working next release/in dev image🚀 This is coming in the next release or was already released if the issue is Closed.

Comments

@iLeoLion
Copy link

Is there an existing issue for this?

Current Behavior

I noticed that from about 2 weeks Home Assistant isn't updating presence. I ran a manual scan and this is the log:
Unsupported callback API version: version 2.0 added a callback_api_version, see migrations.md for details.

Expected Behavior

To work again

Steps To Reproduce

No response

pialert.conf

No response

docker-compose.yml

No response

What branch are you running?

Production

pialert.log

pialert.log

Debug enabled

  • I have read and followed the steps in the wiki link above and provided the required debug logs and the log section covers the time when the issue occurs.
@iLeoLion iLeoLion added the bug 🐛 Something isn't working label Feb 29, 2024
@jokob-sk
Copy link
Owner

jokob-sk commented Mar 1, 2024

hi @iLeoLion ,

Thanks for the report.

This should be available in the next release. If you can, please have a look at the pi.alert_dev docker image.

It would be great if you could test this on your end by switching to the above image and letting me know if the issue was resolved.

Thanks in advance,
j

@jokob-sk jokob-sk added the next release/in dev image🚀 This is coming in the next release or was already released if the issue is Closed. label Mar 1, 2024
@iLeoLion
Copy link
Author

iLeoLion commented Mar 2, 2024

Hi just tried the dev version. Seems working on pi.alert side but I have no updates in Home Assistant. With MQTT Explorer I can see that values are not changed. Maybe I need to delete all the topics? If so should they reappear?

@jokob-sk
Copy link
Owner

jokob-sk commented Mar 2, 2024

Glad to hear we are getting somewhere :)

I think you can either delete the topics or the values would probably update after the next change. You can also try deleting existing values under Plugins > MQTT which might speed up the refresh.

@iLeoLion
Copy link
Author

iLeoLion commented Mar 3, 2024

Ok so deleted values under Plugins > MQTT and they reappeared but still no updates in MQTT broker via MQTT Explorer.
I deleted a value from binary_sensor with MQTT Explorer and it never reappeared. Should I reinstall Pi.Alert from zero?

@jokob-sk
Copy link
Owner

jokob-sk commented Mar 3, 2024

Hey, please try this sequence:

  1. Enable debug
  2. Delete the values from the MQTT explorer
  3. Delete the values under Plugins > MQTT
  4. Trigger a notification on a device or via Settings -> MQTT_RUN -> Test button
  5. Check the logs

The logs should contain entries similar to the ones below showing that MQTT requests are sent to the broker:

11:37:50 [MQTT] New sensor entry mac          : ba:01:c9:80:8c:78
11:37:50 [MQTT] New sensor entry input_string : mac_ba_01_c9_80_8c_78Device Name Heresensoris_newbell-alert-outline
11:37:50 [MQTT] New sensor entry hash_value   : dcee5d9df23d1131606c1a6193d90852
11:37:50 [MQTT] Publishing sensor number 64
11:37:50 [MQTT] Sending MQTT topic: homeassistant/sensor/mac_ba_01_c9_80_8c_78/is_new/config
11:37:50 [MQTT] Sending MQTT message: {                 "name":"is_new",                 "state_topic":"system-sensors/sensor/mac_ba_01_c9_80_8c_78/state",                 "value_template":"{{value_json.is_new}}",                 "unique_id":"mac_ba_01_c9_80_8c_78_sensor_is_new",                 "device":                     {                         "identifiers": ["mac_ba_01_c9_80_8c_78_sensor"],                         "manufacturer": "PiAlert",                         "name":"Device Name Here"                     },                 "icon":"mdi:bell-alert-outline"                 }
11:37:52 [MQTT] New sensor entry mac          : ba:01:c9:80:8c:78
11:37:52 [MQTT] New sensor entry input_string : mac_ba_01_c9_80_8c_78Device Name Heresensorvendorcog
11:37:52 [MQTT] New sensor entry hash_value   : b85ad03bc952800de297b23ab4f36e1c
11:37:52 [MQTT] Publishing sensor number 65
11:37:52 [MQTT] Sending MQTT topic: homeassistant/sensor/mac_ba_01_c9_80_8c_78/vendor/config

@iLeoLion
Copy link
Author

iLeoLion commented Mar 3, 2024

Hi,
Deleted devices from MQTT Explorer
Deleted from plugins
Ran MQTT_RUN

Sensors didn't reappear in MQTT Explorer.
Logs (everyone is the same):

17:27:51 [MQTT] Publishing sensor number 138
17:27:51 [MQTT] Sending MQTT topic: homeassistant/sensor/mac_b4_45_06_94_7e_be/mac_address/config
17:27:51 [MQTT] Sending MQTT message: { "name":"mac_address", "state_topic":"system-sensors/sensor/mac_b4_45_06_94_7e_be/state", "value_template":"{{value_json.mac_address}}", "unique_id":"mac_b4_45_06_94_7e_be_sensor_mac_address", "device": { "identifiers": ["mac_b4_45_06_94_7e_be_sensor"], "manufacturer": "PiAlert", "name":"name not found" }, "icon":"mdi:folder-key-network" }
17:27:53 [Plugin utils] 💬 INFO - Object not found {"Plugin": "MQTT", "Watched_Value3": "a07115757763e1a56b4c226132ba9983"}
17:27:53 [MQTT] New sensor entry mac : b4:45:06:94:7e:be
17:27:53 [MQTT] New sensor entry input_string : mac_b4_45_06_94_7e_bename not foundsensoris_newbell-alert-outline
17:27:53 [MQTT] New sensor entry hash_value : a07115757763e1a56b4c226132ba9983
17:27:53 [MQTT] Publishing sensor number 139
17:27:53 [MQTT] Sending MQTT topic: homeassistant/sensor/mac_b4_45_06_94_7e_be/is_new/config
17:27:53 [MQTT] Sending MQTT message: { "name":"is_new", "state_topic":"system-sensors/sensor/mac_b4_45_06_94_7e_be/state", "value_template":"{{value_json.is_new}}", "unique_id":"mac_b4_45_06_94_7e_be_sensor_is_new", "device": { "identifiers": ["mac_b4_45_06_94_7e_be_sensor"], "manufacturer": "PiAlert", "name":"name not found" }, "icon":"mdi:bell-alert-outline" }
17:27:55 [Plugin utils] 💬 INFO - Object not found {"Plugin": "MQTT", "Watched_Value3": "ca686b92c1e506d78d1564ca55c1f119"}
17:27:55 [MQTT] New sensor entry mac : b4:45:06:94:7e:be
17:27:55 [MQTT] New sensor entry input_string : mac_b4_45_06_94_7e_bename not foundsensorvendorcog
17:27:55 [MQTT] New sensor entry hash_value : ca686b92c1e506d78d1564ca55c1f119
17:27:55 [MQTT] Publishing sensor number 140

This is what is strange:
17:27:55 [Plugin utils] 💬 INFO - Object not found {"Plugin": "MQTT", "Watched_Value3": "ca686b92c1e506d78d1564ca55c1f119"}

@jokob-sk jokob-sk reopened this Mar 4, 2024
@jokob-sk
Copy link
Owner

jokob-sk commented Mar 4, 2024

Hi @iLeoLion ,

Thanks for the additional details.

The issue might be related to the API version used to communicate with the broker, which was previously hard-coded to VERSION2. I've added a new MQTT setting to pick the API version used to communicate with the MQTT broker.

image

This should be available in the next release. If you can, please have a look at the pi.alert_dev docker image, in about 15 minutes (or after the last action finishes) from now.

It would be great if you could test changing the API version to 1, test, 2, and test on your end by switching to the above image and letting me know if the issue was resolved.

Thanks in advance,
j

@iLeoLion
Copy link
Author

iLeoLion commented Mar 6, 2024

Hi @jokob-sk

Updated - tested with V1 - sensors reappeared and updating!!

Many thanks!

P.s. nice ui restyle for the left panel

@jokob-sk
Copy link
Owner

jokob-sk commented Mar 6, 2024

Glad to hear it's working! 😅

Thanks for the feedback. Trying to improve things step-by-step

@jokob-sk
Copy link
Owner

released -> closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working next release/in dev image🚀 This is coming in the next release or was already released if the issue is Closed.
Projects
None yet
Development

No branches or pull requests

2 participants