this post was submitted on 16 Nov 2024
9 points (100.0% liked)

homeassistant

12072 readers
21 users here now

Home Assistant is open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server. Available for free at home-assistant.io

founded 1 year ago
MODERATORS
 

But it's not working, where did I mess up?

Currently {{ (states.switch | rejectattr('attributes.light.lamp_left', 'defined') | selectattr('state', 'eq', 'on') | list | count)+(states.switch | rejectattr('attributes.light.lamp_right', 'defined') | selectattr('state', 'eq', 'on') | list | count)+(states.switch | rejectattr('attributes.light.hall', 'defined') | selectattr('state', 'eq', 'on') | list | count)+(states.switch | rejectattr('attributes.switch.bedroom', 'defined') | selectattr('state', 'eq', 'on') | list | count)+(states.switch | rejectattr('attributes.switch.kitchen', 'defined') | selectattr('state', 'eq', 'on') | list | count)+(states.switch | rejectattr('attributes.switch.lounge', 'defined') | selectattr('state', 'eq', 'on') | list | count)+(states.switch | rejectattr('attributes.switch.bath_left', 'defined') | selectattr('state', 'eq', 'on') | list | count)+(states.switch | rejectattr('attributes.switch.bath_right', 'defined') | selectattr('state', 'eq', 'on') | list | count) }}
  lights are on!
you are viewing a single comment's thread
view the rest of the comments
[–] 9point6@lemmy.world 3 points 14 hours ago

This man binary searches