currently trying to create a battery element for my floorplan to show the current percentage of my iPhone, i’m trying to re-create the moisture sensor used in the home example copied the code swapped out for my sensor but nothing happens, can somebody explain what i’m doing wrong, the element displays but the size doesn’t change, I can hover and click on the element but the height is unchanged
- entity: sensor.mac_pro_battery_state
attributes:
foo: bar
state: on
state_action:
action: call-service
service: floorplan.style_set
service_data:
element: mac_book_battery_level
style: |
>
var height = Math.ceil(elements['sensor.mac_pro_battery_state'].getBBox().height);
return `transform: translate(0, ${height - Math.floor(entity.attributes.state / (100 / height))}px)`;