Mi Flora: Add timestamp

Hello guys,

is it possible to get the last successfull timestamp of sync for the mi Flora component?

See:
homeassistant/components/miflora/sensor.py

This would be usefull to get a notification if updates fail for like 12 hours.

Thanks for your help!

FWIW, there’s a useful option in MQTT Sensor called expire_after. If you set it to, for example, 60 seconds then if it does not receive an update within that interval it will set the sensor’s state to unknown. This state can be used to trigger an automation.

The expire_after option might be a useful addition to the Mi Flora plant sensor.

As the list of Codeowners (core/CODEOWNERS at dev · home-assistant/core · GitHub) suggest, @Danielhiversen is familiar with the mi flora component.
Maybe he can help with this.

Alternatively we could try something like

SENSOR_TYPES = {
‘temperature’: [‘Temperature’, ‘°C’, ‘mdi:thermometer’],
‘light’: [‘Light intensity’, ‘lx’, ‘mdi:white-balance-sunny’],
‘moisture’: [‘Moisture’, ‘%’, ‘mdi:water-percent’],
‘conductivity’: [‘Conductivity’, ‘µS/cm’, ‘mdi:flash-circle’],
‘battery’: [‘Battery’, ‘%’, ‘mdi:battery-charging’],
‘last_capture’: [‘Updated’, None, ‘mdi:cached’],
}

Any other suggestions?