Hey all,
need some help with some “if” logic, as per the below.
i cant seem to quite get this right?
There are 4 states the switch can be
- On: running (attributes.current_power_w >2) else
- On: not running else
- Off else
- Unavailable
I think my inital statement for the attributes is wrong? “states.switch.the_beast_2.attributes.current_power_w”
but im also unsure if i have my logic correct overall?
entities:
- label: Studio
type: section
- entity: switch.the_beast_2
icon: 'mdi:volleyball'
name: The Beast Switch (TP Link)
type: 'custom:toggle-control-button-row'
secondary_info: >-
[[ if(states.switch.the_beast_2.attributes.current_power_w > 2,
if(switch.the_beast_2.state != "on", if(switch.the_beast_2.state !="off",
<b style='color:red'>Switch Not Working</b>, <b style='color:green'>Switch
Working - Beast idle </b>) , <b style='color:green'>Switch Working -
Beast Running </b>), <b style='color:green'>?unknown?</b>) ]]
customTheme: true
isOnColor: green
isOffColor: red
show_header_toggle: false
title: Switches
type: entities