Skip to content

How to set style of an entity displayed on floor plan based on state of another #172

Answered by exetico
vlaryn asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,

That should be possible to do. Just use the entity you want to pull the data from, and element as the SVG-element from your floorplan.

Add some logics on top. Here's a simple solution, not fully working, nor fitted for your needs - but I guess you'll be able to get the point of it. I'm sorry for any formatting-issues. I'm currently not as my primary machine. I can't even remember if the below code works as expected :-D...

 entity: binary_sensor.wark_trough_38234
 element: Sensor.Walkthrough
 state_action:
   action: call-service
   service: floorplan.style_set
   service_data:
     element: Sensor.Walkthrough

     style: |
       >
       var secounds = (new Date().getTime() - new Da…

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by vlaryn
Comment options

You must be logged in to vote
1 reply
@exetico
Comment options

Comment options

You must be logged in to vote
1 reply
@exetico
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants