jimz011 / homekit-infused

Homekit Infused 5 2023
https://jimz011.github.io/homekit-infused/
Other
874 stars 137 forks source link

[FR] Add attribute to Battery Add-on #93

Closed E020 closed 3 years ago

E020 commented 3 years ago

I have a couple of Hue sensors. These sensor don't have an entity for the battery_level. To get the battery_level there's a workaround with the HACS Attribute Integration. It places the battery_level as an attribute in the light_level entity of the sensor. So to display this battery_level need to use this code in the view:

battery:

Could you add this to the extra options of the Battery Add-on?

E020 commented 3 years ago

And supporting this with the entity card would also be nice; MeteoAlarm.eu uses attributes for the weather alarms.

jimz011 commented 3 years ago

Ah ofc didnt account for the fact that people still use the hue bridge 🤣. Not sure if this is easily possible with button card. But I guess it should be easy enough.

For now you could create a template sensor out of it if you cant wait for the fix 🤣

sensor:
  - platform: template
    sensors:
      battery_hue_kitchen:
        value_template: "{{ state_attr('sensor.hue_whatever', 'battery_level') }}"
E020 commented 3 years ago

I didn't know people still use android 😇

Found the workaround yesterday thanks. In version 3 it was possible with the custom:auto-entities so I do have a custom view that also works.

But it would be nice the skip this. But no big issue.

jimz011 commented 3 years ago

Yes I prefer not to use auto entities too much.

I actually went from iOS to Android last year. I had a lot of em, 4, 5, 5S, 6, 6 Plus, 7 Plus, X and XS.

I have a Galaxy Note 10+ and sure compared to iOS it does have some flaws, but the flexibility of the device, making everything and every button do whatever I want makes up for it big time (oh and actually it was the S-Pen that got me here) I was waiting for an iphone to do the same, but it never came..., sure I believe the latest iPhone has pen support? But nothing compares to actually having a dedicated bay for the pen inside of the phone. The screen is massive.

At first I have to say, it felt weird, having used iOS for 10 years (and never really had a good android experience). It actually felt like I was missing something (strange what stuff can do to you). But now.... I am using Google Home and Spotify which both seem to work much better on Androids, I have a nvidia shield tv pro which is IMHO much better than my atv4k. I use android auto, which I find a bit easier to use since it doesnt have the useless 3 window dashboard carplay has. I can run almost anything I want, installing windows from my phone like a usb drive does? You got it, Nintendo and PS emulators? No problem. Mouse for Remote Desktop? (s-pen is great as a mouse). Taking notes, drawing diagrams, it is all so nice imho. Even file managing is awesome with a decent and fast file manager that does literally everything (mixplorer for the android users that read this). As a windows user I actually like the tight integration samsung has with microsoft. Last but not least, I find the gestures on Android (notably Samsungs) a little bit better, it is actually almost the same as Apples, but it is better organised for large screens (unlike iOS where you need to reach all the way from the left to go back or from the top right to get to the action center). Lets say if you have a phone sized like an iPhone Max or Plus model, than Androids will be a lot easier to use one handed.

Having that said, the Apple Watch is miles better than the best android smartwatch and some things are easier to setup/use like findmy which Android does have but its different. E.g. I can't ring my partners phone remotely like was possible with findmy. I can however ask any of the google home speakers to make it ring (which I couldn't do with ios).

I will however never say that Apple makes bad stuff, because they make great stuff, I will always recommend Apple simply because you can't really screw up an iPhone. But now after a year of no Apple I came to realise that these phones are much much better than what I used to see in the past and the freedom to well.... buy anything I want is a big big bonus, if next year I dislike Samsung, I'd maybe get a pixel or something who knows. Or maybe even an iPhone since I mostly use Microsoft 365 now and they work fine on both Android and iOS.

Long story short, you should get whatever you prefer, not what some numbers say.

To come back to the original question 🤣, I will look into this.

E020 commented 3 years ago

Hahah long story indeed I was just joking about Android ;-) If it works and your happy with it no reason to switch.

For the same reason I still use two Hue motions sensors because the Xiaomi motion sensors that I bought after the hue sensors, don’t update their status rapidly. So still looking for motion sensors that update almost immediately when there’s no motion.

jimz011 commented 3 years ago

Yes the hue sensors are great, I meant the bridge. I always assume everyone uses a conbee or z2m or ZHA which will give you a separate battery entity.

I personally use xiaomi sensors, simply because those were the first I bought and they work fine. With a little workaround you can make them work good. You need to put a 2 min delay in your sequence, since that is the blind spot of these xiaomis.

E020 commented 3 years ago

Switched to ZHA and added the sensors. Missed the fact that Hue Bridge not needed anymore. So I'll close this. Thx!