I am using IOT Link to collect information of windows computers, like drive space ect.
But it is only showing the stats when computer is on. I want to see the last value of a sensor when the computer is offline, like “Last value, besides Unavailable”. I will also make this persist trough reboots of Home-Assistant.
How can this be done? I guess with a template sensor ect.
example:
There’s something wrong with your configuration because a retained message is stored on the broker so it doesn’t matter if the broker restarts or a client disconnects/reconnects, the stored message will continue to be available.
Network
Container Host Description
1883/tcp
1883
Normal MQTT
1884/tcp
1884
MQTT over WebSocket
8883/tcp
8883
Normal MQTT with SSL
8884/tcp
8884
MQTT over WebSocket with SSL
It’s not the broker’s configuration that is suspect, it’s IOT Link’s configuration that may be the problem.
That’s not how a broker handles retained messages.
If a topic’s message is not retained when published, only the subscribers connected to the broker receive it. The next subsciber to connect to the broker doesn’t automatically receive whatever was recently published to the topic.
If a topic’s message is retained when published, subscribers connected to the broker receive it and any future subscribers will also receive it at the moment they connect to the broker. The topic’s message is stored by the broker permanently and disappears only if purged (restarting the broker doesn’t purge retained messages).