tomaae / homeassistant-mikrotik_router

Mikrotik router integration for Home Assistant
Apache License 2.0
301 stars 50 forks source link

[Feature] Use update entity for firmware updates #229

Closed icekom closed 2 years ago

icekom commented 2 years ago

Home Assistant 2022.4 introduced update entities. It would be nice to use them instead of a binary sensor and to allow triggering an upgrade from Home Assistant.

A bit later I can develop the feature myself and create a PR if you'd like.

tomaae commented 2 years ago

yea, I actually only noticed it on friday when my unifi update showed up there. I guess its not commonly implemented in integrations. I certainly want this to be part of all my integrations.

icekom commented 2 years ago

There should be two update entities, actually: one for RouterOS and another one for RouterBOARD firmware upgrade.

Also there's the question of how to handle rebooting. I propose rebooting automatically for the upgrade by default, but allowing to disable reboots when configuring the integration. It would be nice to have a service that reboots the router.

tomaae commented 2 years ago

without reboot, you wont get router updated. so that does not make sense. also everywhere I seen this, it will reboot/reload device to apply the firmware

tomaae commented 2 years ago

There we go image

tomaae commented 2 years ago

image image image

tomaae commented 2 years ago

that should cover it :)

Xitro01 commented 2 years ago

This is awesome, but the binary sensor stopped working that was showing if there was an update or not. It now shows up as unavailable.

tomaae commented 2 years ago

This is awesome, but the binary sensor stopped working that was showing if there was an update or not. It now shows up as unavailable.

Can you reword it please?

Also, check if there is any error in HA log.

Xitro01 commented 2 years ago

This is awesome, but the binary sensor stopped working that was showing if there was an update or not. It now shows up as unavailable.

Can you reword it please?

Also, check if there is any error in HA log.

The binary_sensor.mikrotik_firmware_update is now unavailable since you added the 2 update sensors. I used this in my dashboard logic to show if there was a firmware update or not.

I don’t see any messages regarding this in my logs.

tomaae commented 2 years ago

ah, you mean old binary sensor. yea, that has been replaced by new update sensor. you can use new update sensors in dashboard too, but they show up as alerts, so its not really necessery. thats up to you.

Xitro01 commented 2 years ago

ah, you mean old binary sensor. yea, that has been replaced by new update sensor. you can use new update sensors in dashboard too, but they show up as alerts, so its not really necessery. thats up to you.

My main use of this, is to show a “1” in a red circle to show that there is an update on my dashboard (which I show on my tablet without the menu’s). But I will just remove the old entity and use these instead. Thanks!