Updating an 'at'

Begonnen von franc, 14 Mai 2014, 12:31:08

Vorheriges Thema - Nächstes Thema

franc

Hi, I'm Relatively new to fhem and have come across the first things I did had to do in a ugly way. I have a set of LIFX Wifi light bulbs did I am controlling via PIR sensor. My first setup easy thing to turn lights on when i went in to a room and have the lights in the other rooms turn off, then I wanted to do something fancy.


       
  • If I go in to a room the light turns on and stays on for 30 minutes
  • If I go in to another room then the lights in the room did turn on, but the time-out for the lights in the first room is reduce to 2 minutes
I'm currently doing this with some custom perl and by deleting and recreating the 'at' that turns the lights off Does anyone have any better suggestions? thanks






justme1968

have a look at 'modify'.

it allows you to modify any fhem device including at.
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

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

franc

I probably should have explained the bits I found tricky.

The custom perl checks to see if if the 'at' is already set for a time earlier than time()+delay and if it is then does nothing, if not it modifies the 'at'. Without this check the 'at' keeps getting pushed further in to the future