Skip to content

How to get another sensor state in JS #399

Answered by OzGav
WallK asked this question in Q&A
Discussion options

You must be logged in to vote

All entities are exposed. Use the hass entity. For example.

service_data: '${parseFloat(entity.state.replace(/\s{2,}/g,"") / hass.states["sensor.shellyplus1pm_a8032abc17c4_switch_0_voltage"].state).toFixed(1)}A'

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@WallK
Comment options

@exetico
Comment options

@WallK
Comment options

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