Thanks for the quick reply, that has got me a bit closer, I鈥檓 able to get a single additional value on the device - but unable to get another (Signal Strength).
After several hours and lots of messing around, the best I have got is either a single sensor on the cover, or every sensor and cover as their own devices.
Looking in the forums, someone asked something similar here, using device_state_attributes
, but that just adds additional fields to the battery, not the actual cover. What I鈥檓 after is this pane, also showing WiFi strength etc (like for the phone devices in HA):
What I have figured out is this (much of which I think is by side effect):
Returning the same unique_id
for the sensors as the cover will allow a single sensor to be part of the cover device, any others just become their own devices.
Using via_device
in the device_state_attributes
(as per here) does not do anything best I can tell in the UI - but I maybe giving it the wrong ID? There is basically no documentation as to what it should be, this is the only page when searching for via_device
. Looking at other code, best I can tell the value for via_device
should be a tuple of (<DOMAIN>, <identifying id>)
, where identifying id
is the value returned by unique_id
.
The issue with the above maybe the unique_id
- at the moment I鈥檓 using the following for the cover:
@property
def unique_id(self):
"""Return the unique ID of this roller."""
return self.roller.id
Where the self.roller.id
is the ID assigned by the hub (it鈥檚 unique, and always remains the same).
For the battery, this then becomes:
@property
def unique_id(self):
"""Return a unique identifier for this device."""
return f"{self.roller.id}-battery"
Which from this page is my best guess as to what it should be.
Now the issue could be something really dumb such as the id
is not getting set correctly, as in the UI, I see the id
of often sensor.none_battery_6
, rather than what I would expect it to be, something like sensor.automate_d55_battery
- I have no idea how this is calculated. The cover
is doing the right thing, and giving a value of cover.automate_d55
. I can鈥檛 find any documentation on this.
So in short, I鈥檓 feeling like an idiot, and unable to figure out how to combine multiple sensors to a single entity. I have tried every combination I can think of looking at the documentation and other code (so much other code, but it鈥檚 all done a little differently from each other), and just not getting it. I feel like it should be easy, but I鈥檓 apparently missing something.
Thanks again.