for each true lights

Begonnen von Lectere, 19 Mai 2014, 13:25:29

Vorheriges Thema - Nächstes Thema

Lectere

I have around 15 lamps controlled with FHEM. I've also made a system to know there is nobody home.

I'd like to 'for each' true all my lights so see if I left one of them on while no one is home.

I've made all my lights member of a group called lights, they are all FS20.
SMSPassword redundant two-factor authentication for Netscaler, Vmware View, Cisco, Juniper, etc via SMS

http://www.smspassword.com

justme1968

you can use a normal list command so list devices that meet certain conditons. search for devspec in the commandref.

or have a look readingsGroup to habe a list in the webfrontend of all lights that are still on. there is an example in the wiki for this near the end of the readingsGroup page.

or use a structure and combine the display with an all off button.
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968

Lectere

#2
Thanks for the responce!,

I've checked the commandref, and this works fine;

list TYPE=FS20 STATE

But when I use;

list GROUP=lights STATE

FHEM does not return anything.

Also, how should I contruct the 'if' statement to test if one of the lights are still on?

Thanks
SMSPassword redundant two-factor authentication for Netscaler, Vmware View, Cisco, Juniper, etc via SMS

http://www.smspassword.com

justme1968

group ist not an internal but an attribute and has to be written in lower case. solist group=lights STATEwill work.

to get only the lights that are not off you can use something like this:list group=lights:FILTER=STATE!=off
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968

Lectere

Thanks Justme,

That part with the group works fine if I use lower case.

I'd like to send a notification if one of the lights are still on, how would one construct the IF statement.

if [one of the lights are still on] {
  (code to send message)
}
SMSPassword redundant two-factor authentication for Netscaler, Vmware View, Cisco, Juniper, etc via SMS

http://www.smspassword.com

justme1968

use a structure to combine all lights in to ohne state and then query this state with Value(...).
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968