sleevezipper / hass-workstation-service

Provide useful sensors and services from your workstation to Home Assistant.
Apache License 2.0
615 stars 53 forks source link

MQTT Retain Flag? #58

Closed AdmiralRaccoon closed 3 years ago

AdmiralRaccoon commented 3 years ago

Hi there and thanks for this great piece of software. :-D

I´m not a mqtt expert, so I don´t know if this is a MQTT issue, rather than one of hass-workstation-service:

Is it possible to retain the value, for example, "LastActiveSensor", so I could see when the device was last active/online? Right now, when the device goes to sleep or was shutdown, the sensor value goes to "unavailable" or "unknown".

Thank you and keep up the good work

sleevezipper commented 3 years ago

Thanks for the kind words!

Someone else mentioned this too (on the Discord I think) and I think this would be great!

nerdosity commented 3 years ago

everyone is just here because of this sensor! I am just dealing with home assistant error, I was using this in an automation but the template{{ (as_timestamp(states.sensor.workstationonline.state) - (as_timestamp(now())))|int|abs > 300 }} returns error when the PC is turned off.

sleevezipper commented 3 years ago

Hi @nerdosity,

Did you figure it out in the meantime? If not, could you create a new issue?

sleevezipper commented 3 years ago

This has been fixed and will be in the next release!