tomaae / homeassistant-mikrotik_router

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

[Bug] Since update to 2.1.2 - CPU temperature entity is missing #243

Open j0hnby opened 2 years ago

j0hnby commented 2 years ago

Describe the issue

Since updating to V 2.1.2, the CPU temperature entity isn't present for my router in homeassistant

How to reproduce the issue

Use previous version, update to v2.1.2, it's gone.

Expected behavior

CPU temperature measurement is present

Screenshots

image

Software versions

Home Assistant 2022.8.7 Supervisor 2022.08.5 Operating System 8.5 Frontend 20220802.0 - latest Mikrotik Router integration version: v2.1.2 Mikrotik Hardware: CRS326-24G-2S+ RouterOS Version: 7.2rc4

j0hnby commented 2 years ago

apologies - I mistakenly pressed enter and it submitted without any details!! Updating now

tomaae commented 2 years ago

I will need debugs to see what is going on there.

j0hnby commented 2 years ago

home-assistant.log Sorry - attached, thought I had done that earlier!

tomaae commented 2 years ago

this will be the reason: 2022-09-05 19:00:26.437 WARNING (SyncWorker_6) [custom_components.mikrotik_router.mikrotik_controller] Mikrotik 192.168.0.1 user hass does not have sufficient access rights. Integration functionality will be limited. Health sensors are not available without write permissions for some reason.

See https://github.com/tomaae/homeassistant-mikrotik_router#setup-integration for both full and limited requirements.

I see you are using 7.5rc1, so they may have finally fixed their issue with health permission requirements there, but based on my experience with mikrotik beta/rc, I wont be updating for 7.5 support until full release. They change significant things even durring rc

j0hnby commented 2 years ago

Up until the update to 2.1.2, the api user didn't have write and showed the temperature. This afternoon I changed it to write to test access as found that detail in the docs while doing troubleshooting. Still no temperature measurement. I changed it back to read then.

image

Those logs were gathered with the read access, attached are ones with write instead home-assistant (with write access).log

tomaae commented 2 years ago

you are missing "policy". but it may be possible that I have forgot to adjust required permissions for system health.

tomaae commented 2 years ago

image this could be also related

j0hnby commented 2 years ago

Adding in "Policy" as the user permission brought it back - what a strange set to requirements from MKT to get env data!
image

Thanks for your help!

katiuskt commented 2 years ago

Same problem here: no temperature sensor after 2.1.2 upgrade

Device: RB4011iGS+5HacQ2HnD User belongs to a group with these permissions. In particular, policy and write ones are enabled: image

Temperature information was reported prior 2.1.2 upgrade. Reverted back to 2.1.1 it works again (under same 7.5 firmware release and with the same permissions).

Taking a look at 2.1.2 vs 2.1.1 diff I just realized that I didn't have "reboot" policy allowed: image

It was properly mentioned at https://github.com/tomaae/homeassistant-mikrotik_router#setup-integration so it is clearly my fault!!

But, just one question if I may: is it really necessary to have "reboot" policy to get /system/health information? It was working on 2.1.1 release without it so I just wondering.

I'll prefer not to enable "reboot" policy only for health information if it is possible.

tomaae commented 1 year ago

no, thats why I'm leaving this open. I will need to crosscheck some permissions as I may have copied some without adjusting them. policy should not be technically needed there as well. but I will test it all manually on several devices before changing it. system health is really messed up on mikrotik side when it comes to persmissions.