-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Option to disable state reporting for discovered devices (Home Assistant) #8655
Comments
LWT topic is hardcoded on Tasmota and can't be disabled. When you enable the deepsleep Tasmota will drop the Wifi and then your MQTT broker will not be reachable until next wakeup. |
That is a nice idea, but should be configurable, at least with a compilation time key, because is just an user preference to have or not the OFFLINE message on a deepsleep sensor. If you agree, we can let as default that if deepsleep is configured, then it is omitted the ONLINE topic for read-only sensors and binary-sensors. What do you think? |
Adrian a compilation time key involves a change on code base, not on Discovery. |
No. But in the discovery message, you can send or not the ONLINE topic for every sensor of the same device. So, one option could be to have a compilation time key to choose or not having that ONLINE topic in that sensor. So, obviously, after this change, you will need to do setoption19 0 to delete the discovery on Home Assistant and enable it again with Setoption19 1. But the new messages that HA will look won't contain the online topic for those sensors. I was just proposing, if you think is ok, to have this by default only IF deepsleep was enabled BEFORE doing setoption19 1. It is just your idea but with the option to enable it or not due to some users want to see the offline on the sensors while others don't. That depends obviously on the setup of each user. |
The PR 7231 was done because, as it was before, if you restart your device, OR if you change the topic (that will make Tasmota to restart) it will remain connected to the mqtt, while the reality was incorrect. So you could end up with a lot of old devices being online. About DeepSleep, it needs some fixes as @effelle have proposed. If you have a relay in a deepsleep device, It should be shown as offline while it is not available. That is why it is here the request to make a DeepSleep sensor to not be shown as OFFLINE or ONLINE. That is easy to implement on the Automatic Discovery. Just for reference, another topic related to this #8599 |
Maybe I failed to explain my proposed solution correctly. |
Have you looked for this feature in other issues and in the docs?
Sure did, even in the code
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.
The problem is sensors showing state=unavailable in home-assistant if I use deepsleep.
I understand the lwt should be offline to show the actual state. Home Assistant with the auto discovery of mqtt devices does not support overriding this behaviour besides the config topic.
(https://www.home-assistant.io/integrations/binary_sensor.mqtt/#configuration)
Describe the solution you'd like
A clear and concise description of what you want to happen.
Let me set an option to remove the availability topic (avty_t) from HASS_DISCOVER_BASE.
That is the recommended (and tested) way to keep the state after entering deep sleep and ignoring the state.
I can set that configuration manually and it works until the next time the device set the config topic.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Manually configuring the mqtt devices, not recommened on Home Assistants side, GUI and integration workflows are preferred. It also doesn't scale and interferes with the charming auto discovery for device groups.
Additional context
Add any other context or screenshots about the feature request here.
You can see the time when i enabled DeepSleepTime 60
(Please, remember to close the issue when the problem has been addressed)
The text was updated successfully, but these errors were encountered: