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

PiAlert MQTT messages causing warnings in Home Assistant #514

Closed
aheath70 opened this issue Dec 4, 2023 · 8 comments
Closed

PiAlert MQTT messages causing warnings in Home Assistant #514

aheath70 opened this issue Dec 4, 2023 · 8 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

@aheath70
Copy link

aheath70 commented Dec 4, 2023

Describe the issue

Home assistant is throwing warnings regarding PiAlert MQTT entities due to a change in HA 2023.8

https://www.home-assistant.io/blog/2023/08/02/release-20238/ 0 refer to breaking changes - listed in the MQTT section of the release notes

2023-12-04 08:17:02.234 WARNING (MainThread) [homeassistant.components.mqtt.mixins] MQTT entity name starts with the device name in your config {'name': 'Camera Front last_ip', 'state_topic': 'system-sensors/sensor/mac_xx_xx_xx_xx_xx_xx/state', 'value_template': Template<template=({{value_json.last_ip}}) renders=0>, 'unique_id': 'mac_xx_xx_xx_xx_xx_xx_sensor_last_ip', 'device': {'identifiers': ['mac_xx_xx_xx_xx_xx_xx_sensor'], 'manufacturer': 'PiAlert', 'name': 'Camera Front', 'connections': []}, 'icon': 'mdi:ip-network', 'enabled_by_default': True, 'payload_not_available': 'offline', 'encoding': 'utf-8', 'qos': 0, 'payload_available': 'online', 'availability_mode': 'latest', 'force_update': False}, this is not expected. Please correct your configuration. The device name prefix will be stripped off the entity name and becomes 'Last_ip'
2023-12-04 08:17:02.234 WARNING (MainThread) [homeassistant.components.mqtt.mixins] MQTT entity name starts with the device name in your config {'name': 'Camera Front mac_address', 'state_topic': 'system-sensors/sensor/mac_xx_xx_xx_xx_xx_xx/state', 'value_template': Template<template=({{value_json.mac_address}}) renders=0>, 'unique_id': 'mac_xx_xx_xx_xx_xx_xx_sensor_mac_address', 'device': {'identifiers': ['mac_xx_xx_xx_xx_xx_xx_sensor'], 'manufacturer': 'PiAlert', 'name': 'Camera Front', 'connections': []}, 'icon': 'mdi:folder-key-network', 'enabled_by_default': True, 'payload_not_available': 'offline', 'encoding': 'utf-8', 'qos': 0, 'payload_available': 'online', 'availability_mode': 'latest', 'force_update': False}, this is not expected. Please correct your configuration. The device name prefix will be stripped off the entity name and becomes 'Mac_address'
2023-12-04 08:17:02.235 WARNING (MainThread) [homeassistant.components.mqtt.mixins] MQTT entity name starts with the device name in your config {'name': 'Camera Front is_new', 'state_topic': 'system-sensors/sensor/mac_xx_xx_xx_xx_xx_xx/state', 'value_template': Template<template=({{value_json.is_new}}) renders=0>, 'unique_id': 'mac_xx_xx_xx_xx_xx_xx_sensor_is_new', 'device': {'identifiers': ['mac_xx_xx_xx_xx_xx_xx_sensor'], 'manufacturer': 'PiAlert', 'name': 'Camera Front', 'connections': []}, 'icon': 'mdi:bell-alert-outline', 'enabled_by_default': True, 'payload_not_available': 'offline', 'encoding': 'utf-8', 'qos': 0, 'payload_available': 'online', 'availability_mode': 'latest', 'force_update': False}, this is not expected. Please correct your configuration. The device name prefix will be stripped off the entity name and becomes 'Is_new'
2023-12-04 08:17:02.235 WARNING (MainThread) [homeassistant.components.mqtt.mixins] MQTT entity name starts with the device name in your config {'name': 'Camera Front vendor', 'state_topic': 'system-sensors/sensor/mac_xx_xx_xx_xx_xx_xx/state', 'value_template': Template<template=({{value_json.vendor}}) renders=0>, 'unique_id': 'mac_xx_xx_xx_xx_xx_xx_sensor_vendor', 'device': {'identifiers': ['mac_xx_xx_xx_xx_xx_xx_sensor'], 'manufacturer': 'PiAlert', 'name': 'Camera Front', 'connections': []}, 'icon': 'mdi:cog', 'enabled_by_default': True, 'payload_not_available': 'offline', 'encoding': 'utf-8', 'qos': 0, 'payload_available': 'online', 'availability_mode': 'latest', 'force_update': False}, this is not expected. Please correct your configuration. The device name prefix will be stripped off the entity name and becomes 'Vendor'

It continues to work for the moment, but when the entity naming rules are enforced at some point in the future, it will cause the MQTT setup for PiAlert to fail.

e.g.

Paste your pialert.conf (remove personal info)

Not relevant

Paste your docker-compose.yml and .env (remove personal info)

Not relevant

.env

Not relevant

Screenshots

Not relevant

Paste last few lines from pialert.log

Not relevant

@jokob-sk
Copy link
Owner

jokob-sk commented Dec 7, 2023

Hi there,

Thanks for the report. Can you try the pi.alert_dev image and see if this is now fixed?

Cheers,
j

@jokob-sk jokob-sk added Waiting for reply⏳ Waiting for the original poster to respond, or discussion in progress. next release/in dev image🚀 This is coming in the next release or was already released if the issue is Closed. labels Dec 7, 2023
@aheath70
Copy link
Author

aheath70 commented Dec 8, 2023

Updated to the pi.alert_dev image and am getting exactly the same result as with previous version.

@jokob-sk
Copy link
Owner

jokob-sk commented Dec 8, 2023

I assume you would need to remove the old MQTT entities first.

Here is the change in code - I removed the Device name from the sensor so it should not appear on newly added devices. jokob-sk/Pi.Alert@20f847c

@aheath70
Copy link
Author

aheath70 commented Dec 8, 2023

Just realised, I pulled the wrong Docker image. I pulled pialert_dev instead of pi.alert_dev My bad!

So, I stopped the Pi.Alert container, deleted the old MQTT entries for all PiAlert devices, pulled the correct version and started up the container - and it work.

It took a couple of restarts of Home Assistant, but perhaps I was being impatient - no more warnings in the Home Assistant log.

I did notice, though, that I can no longer hit the web site using the fault path of https://192.168.0.42 - it throws a 404 not found error in NGINX. If I put in https://192.168.0.42/devices.php the web site works fine. Looks like the NGINX config has somehow changed,

@jokob-sk
Copy link
Owner

jokob-sk commented Dec 8, 2023

Thanks for that! @lorki97 changed how the installation works slightly in this PR, but I can't see any changes that would influence NGINX behavior.

I also checked and the redirect seems to be working fine on my end. I do however have a custom port configured - maybe that's the difference.

@aheath70
Copy link
Author

aheath70 commented Dec 8, 2023

Looks like the NGINX issue is actually a problem with my proxy provider rather than an issue with PiAlert. Again, apologies.

I am happy this is now working without throwing the warnings in HA.

Thanks for your help - awesome bit of software this one :)

@jokob-sk
Copy link
Owner

Thanks for the update. The fix will be rolled out with the next release.

Consider supporting my work, cheers in advance.

@jokob-sk jokob-sk added bug 🐛 Something isn't working and removed Waiting for reply⏳ Waiting for the original poster to respond, or discussion in progress. labels Dec 11, 2023
@jokob-sk
Copy link
Owner

closing as released 🚀

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