I’ve a connected a Xiaomi Vibration Sensor to hass. It can measure it’s angle and I want do place it on my mailbox so whenever the lid opens I can get a notification that mail has been delivered. The Device outputs an attribute called orientation. Orientation is in format of 3 values seperated by 2 commas. See:
I need to access the last value behind the second comma. This value can also be negative. Can anyone help me? I’ve tried with a template sensor using regex but no success.
It would appear that the attribute’s value is understood to be a list and not a string. That’s why the error message reports a list object doesn’t support split.
In the following example, I set value to 75, 3, 14 which the Jinja2 interpreter understood as (75, 3, 14) thereby allowing me to address items within the list.