All you have to do is copy the value of the mqtt_state_topic attribute and paste it into MQTT Topic to Clear then do the same with mqtt_config_topic. Once you do that, the sensor should be gone.
That’s a known issue. I’ll update the package as soon as I can to switch to the new method.
Yes, that’s normal.
None of those look like they were created by this package. I’m not familiar with Plant Monitor component, so I’m not sure how much I can help. I suggest creating a new post about that issue.
That being said, if you’re looking for steps to clear retained MQTT topics in general, you can do this:
SSH to a machine that has mosquitto_sub and mosquitto_pub installed.
Hey thanks for that! So it’s specific to the battery package. It just seems impossible sometimes to get rid of ‘old’ devices. I had an option set in Tasmota and it created a sensor I didn’t want and after reflashing, there was just nothing I could do to get rid of the Zombie (which was showing as unavailable) The only way I could kill it was by the method I described.
Surely there is a better way but I cannot find it.
Yes, that’s a feature of the sensors created by this package. I added those attributes to make it easier to do cleanup since I’ve enabled the retain flag.
Hi, can you ask for an addition to the package?
It would be nice to have a binary sensor that activates when it’s battery alarm.
And if it is possible when the mobile phone is charging change the battery icons with that battery-charging-10 20 etc., the example parameters on google tracker is “battery_charging”: false
The icons rely on the device_class: battery, which doesn’t appear to be aware of charging attributes. Adding a charging attribute to the battery sensor can be done, but making that control the icon doesn’t look straight forward.
But since update to 0.86.0b I get this error after adding the script back:
Invalid config for [automation]: [minutes] is an invalid option for [automation]. Check: automation->trigger->0->minutes. (See /config/configuration.yaml, line 174). Please check the docs at https://home-assistant.io/components/automation/ Invalid config for [automation]: [minutes] is an invalid option for [automation]. Check: automation->trigger->0->minutes. (See /config/configuration.yaml, line 174). Please check the docs at https://home-assistant.io/components/automation/ Invalid config for [automation]: [minutes] is an invalid option for [automation]. Check: automation->trigger->1->minutes. (See /config/configuration.yaml, line 174). Please check the docs at https://home-assistant.io/components/automation/ ```
Release 1.2.0 is available. This fixes the deprecation warning about json_attributes in 0.85.0.
There is a breaking change with setting up notifications. The new method should be more flexible now. You just need to enter your notifier name in the Notifier Name input text box and select the format in the Notifier Format input select. So, for Slack, I use Notifier Name = notify.slack_notify with Notifier Format = Slack. Most notifiers (except Slack) should work with Notifier Format = Default.
Full Changelog:
Breaking Changes
Setting up notifications have changed. Enter the name of the notifier in the Notifier Name input text box and select the notifier format using the Notifier Format input select.
Changed
Migrate attributes from json_attributes to json_attributes_topic
Remove % unit for battery level attributes that contain strings
Replaced mqtt_config_topic and mqtt_state_topic attributes with delete_battery_sensor attribute to make deleting battery sensors easier
Renamed MQTT Topic to Clear input text box to Delete a Battery Sensor
Added
Battery attributes containing strings now have dynamic icons that change with battery status
Added Notifier Name input text box to store name of the notifier to use for notifications (defaults to notify.notify)
Added Notifier Format input select to allow selection of notification format. Options are Default and Slack.
Added input_boolean.low_batteries to help with automations. True means there are low batteries.
It looks like making the change below should address the breaking changes in the upcoming 0.86 release. I’m not on 0.86, so I haven’t tested this. Once 0.86 is released, I’ll check in the change.
I updated from 0.82.1 to 0.85.1 and also updated new version of the battery alert.
but i still get this in the log after restart.
do i need to do something more?
configuration variable “json_attributes” is deprecated, replace with “json_attributes_topic”
I had the same issue. I disabled the package and restarted HA. Then removed all the relevant retained MQTT messages and re enabled the package and restarted AH again.