homeassistant-mikrotik_router icon indicating copy to clipboard operation
homeassistant-mikrotik_router copied to clipboard

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

Open j0hnby opened this issue 1 year ago • 10 comments

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 version:
  • Mikrotik Router integration version:
  • Mikrotik Hardware:
  • RouterOS version:

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 avatar Sep 05 '22 14:09 j0hnby

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

j0hnby avatar Sep 05 '22 14:09 j0hnby

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

tomaae avatar Sep 05 '22 16:09 tomaae

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

j0hnby avatar Sep 05 '22 18:09 j0hnby

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

tomaae avatar Sep 05 '22 18:09 tomaae

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

j0hnby avatar Sep 05 '22 19:09 j0hnby

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

tomaae avatar Sep 05 '22 19:09 tomaae

image this could be also related

tomaae avatar Sep 06 '22 05:09 tomaae

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!

j0hnby avatar Sep 06 '22 08:09 j0hnby

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.

katiuskt avatar Sep 12 '22 18:09 katiuskt

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.

tomaae avatar Sep 12 '22 21:09 tomaae