Conditional Filter on device

Begonnen von phedders, 03 Oktober 2013, 16:35:37

Vorheriges Thema - Nächstes Thema


I'm loving FHEM!

However I think I might be overlooking something - or maybe there is something that I want to do that I think is obvious, but maybe it isnt.

So I have a socket that I can control through FEM - and trigger by a remote control or web interface.

But I want this device to only be controllable when it is dark. So I want to add a "if (GetValue("Daylight","light")<3)" or maybe just an "!isday()"

How do I do that? I feel like the EventMap should be programmable such that options have condition code in them.

  Daylight             (6)

And the device I want to add a condition to:
list Power_Flood_Front
   DEF        PT2262 00111000011 pir 0:off,1:on
   IODev      TRX_0
   NAME       Power_Flood_Front
   NR         103
   STATE      off
   TRX_LIGHT_commandcodes 0:off,1:on
   TRX_LIGHT_deviceid 00111000011
   TRX_LIGHT_devicelog pir
   TRX_LIGHT_type PT2262


You could set the ignore attribute for this device at sunrise with a first at device, and deleting it via second at by sunset. Or you would set a dummy via the socket, and build a notify which only forwards the command to the lightsource, when !isday() is true.


Genius on the ignore option! Thanks for the pointers, although its quite a different way of thinking to my default logical flow.

I do think it would be good to have "conditional code" as either part of the DEF or as an attribute, which is code that runs before any triggers and decides if the triggers should run or not.

The ignore option is a bit blunt - I cant for example make it ignore just "on" signals, but still process an "off".

The proxy notify device I had thought of and started working on, but I want to add it to floorplans and look like the actual device - including showing the state of the device (even if the device is triggered by a different notify.) Setting up a network of notify's with setstate's all over the place is going to get very messy and fragile.

So where should I make feature suggestions?

Thanks again!


>  So where should I make feature suggestions?

There is a "Wunschliste" Section here, but be aware, that FHEM is maintained by enthusiasts, who mainly want to implement their own ideas, and are hard to motivate even with small amounts of money.
The  best motivation in my experience is to show them that if they do X, than a lot of other nice things will be possible with the code.

To your problem: I don't think it is frequent enough, and it can be solved, although not as nice as you would wish.