armed and disarmed state different actions

Begonnen von Guest, 30 Januar 2011, 21:56:46

Vorheriges Thema - Nächstes Thema

Guest

Originally posted by: <email address deleted>

Hi,

I'm getting more security sensors in fhem, like door sensor window
sensor, motion sensor.

The default action is that all the devices react and you can triggger
other devices lamp, sirenes.

It it possible by pressing a button of a remote control, that fhem
uses different actions.

For example.

When  home, fhem is in disarmed state, when a door is opened it's
logged and no lamp on

When I go out, I press a button of a remote, fhem counts down, and
after 30sec it goes in armed state.
When now a door is opened, a lamp or sirene is on.

Is this possible in fhem?

regards Richard


--
Sie haben diese Nachricht erhalten, da Sie der Google Groups-Gruppe FHEM users beigetreten sind.
Wenn Sie Nachrichten in dieser Gruppe posten möchten, senden Sie eine E-Mail an fhem-users@googlegroups.com.
Wenn Sie aus dieser Gruppe austreten möchten, senden Sie eine E-Mail an fhem-users+unsubscribe@googlegroups.com.
Besuchen Sie die Gruppe unter http://groups.google.com/group/fhem-users?hl=de, um weitere Optionen zu erhalten.

Guest

Originally posted by: <email address deleted>

Hi Richard,

> I'm getting more security sensors in fhem, like door sensor window
> sensor, motion sensor.

Pls. be aware that fhem and FS20 are not fully suitable for security
applications at all.
So the whole FS20 concept lacks of any security awareness and it is
vulnarable against replay
 attacks. (So an intruder needs just to snif the button code for
disarming and replay it whenever he wants,)

> It it possible by pressing a button of a remote control, that fhem
> uses different actions.

Yes, but you will need to have a bit knowledge of php programming
language and will be able to write simple notify scripts that will
check if the "arming" state has been set, if so, you will then switch
on lights, sirenes, etc.
But again... there is no guarantee that a switch command on your
remote control or fro fhem will also be received and understood by the
target (light, sirene) so it might be, that there is no light or
sirene even when fhem detects the intruder.

cu
Maz

--
Sie haben diese Nachricht erhalten, da Sie der Google Groups-Gruppe FHEM users beigetreten sind.
Wenn Sie Nachrichten in dieser Gruppe posten möchten, senden Sie eine E-Mail an fhem-users@googlegroups.com.
Wenn Sie aus dieser Gruppe austreten möchten, senden Sie eine E-Mail an fhem-users+unsubscribe@googlegroups.com.
Besuchen Sie die Gruppe unter http://groups.google.com/group/fhem-users?hl=de, um weitere Optionen zu erhalten.

Guest

Originally posted by: <email address deleted>

On Jan 30, 10:18 pm, Maz wrote:
> Hi Richard,
>
> > I'm getting more security sensors in fhem, like door sensor window
> > sensor, motion sensor.
>
> Pls. be aware that fhem and FS20 are not fully suitable for security
> applications at all.
> So the whole FS20 concept lacks of any security awareness and it is
> vulnarable against replay
>  attacks. (So an intruder needs just to snif the button code for
> disarming and replay it whenever he wants,)

I know, but I will use it also, if I go to bed I press a button, the
scheme of fhem changes and now the motion sensor trigger the lamps

>
> > It it possible by pressing a button of a remote control, that fhem
> > uses different actions.
>
> Yes, but you will need to have a bit knowledge of php programming
> language and will be able to write simple notify scripts that will
> check if the "arming" state has been set, if so, you will then switch
> on lights, sirenes, etc.
> But again... there is no guarantee that a switch command on your
> remote control or fro fhem will also be received and understood by the
> target (light, sirene) so it might be, that there is no light or
> sirene even when fhem detects the intruder.

It should be more nice to have it in fhem. You can define for example
2 different action schemes with trigger and of notify, and looks
general of the global state of fhem is armed of disarmed

>
> cu
> Maz

--
Sie haben diese Nachricht erhalten, da Sie der Google Groups-Gruppe FHEM users beigetreten sind.
Wenn Sie Nachrichten in dieser Gruppe posten möchten, senden Sie eine E-Mail an fhem-users@googlegroups.com.
Wenn Sie aus dieser Gruppe austreten möchten, senden Sie eine E-Mail an fhem-users+unsubscribe@googlegroups.com.
Besuchen Sie die Gruppe unter http://groups.google.com/group/fhem-users?hl=de, um weitere Optionen zu erhalten.

rudolfkoenig

                                                   

> When I go out, I press a button of a remote, fhem counts down, and
> after 30sec it goes in armed state.
> When now a door is opened, a lamp or sirene is on.
>
> Is this possible in fhem?

I think we had this already, but here is another (untested :) version:

attr global userattr armed triggered

define alarm_btn FS20 1234 50       # the button on the remote

define alarm_activate notify alarm_btn:on define alarm_delayed +00:00:30 \
  attr alarm_btn armed yes;; attr alarm_btn triggered no

define alarm_deactivate notify alarm_btn:off attr alarm_btn armed no

define piri.room1 FS20 1234 51
define piri.room2 FS20 1234 52
...

define alarm_trigger notify piri.* {\
  if($attr{alarm_btn}{armed} eq "yes" && $attr{alarm_btn}{triggered} eq "no") {\
    $attr{alarm_btn}{triggered} = "yes";;\
    fhem("set lamp,sirene on");;\
  }\
}

--
Sie haben diese Nachricht erhalten, da Sie der Google Groups-Gruppe FHEM users beigetreten sind.
Wenn Sie Nachrichten in dieser Gruppe posten möchten, senden Sie eine E-Mail an fhem-users@googlegroups.com.
Wenn Sie aus dieser Gruppe austreten möchten, senden Sie eine E-Mail an fhem-users+unsubscribe@googlegroups.com.
Besuchen Sie die Gruppe unter http://groups.google.com/group/fhem-users?hl=de, um weitere Optionen zu erhalten.

Guest

Originally posted by: <email address deleted>

Rudolf,

I'm testing it. but I have a question

this part works (and I understand)


define alarm_btn FS20 4631 00       # the button on the remote

define alarm_activate notify alarm_btn:on define alarm_delayed at
+00:00:30 \
attr alarm_btn armed yes;; attr alarm_btn triggered no

define alarm_deactivate notify alarm_btn:off attr alarm_btn armed no

Then I want if there is motion and the state is armed It should put a
lamp on
Only that part I don't know how to set this. I have this

I have a motion sensor defined

define motion_sensor RFXX10REC ms14a L11 motion L12 light

fhem> l motion_sensor
Internals:
   DEF        ms14a L11 motion L12 light
   IODev      RFXCOM
   NAME       motion_sensor
   NR         80
   RFXX10REC_deviceid L11
   RFXX10REC_deviceid2 L12
   RFXX10REC_devicelog motion
   RFXX10REC_devicelog2 light
   RFXX10REC_type ms14a
   STATE      alert
   TIME       2011-02-06 19:58:41
   TYPE       RFXX10REC
   Readings:
     2011-02-06 19:58:45   light           on
     2011-02-06 19:58:41   motion          alert

define alarm_trigger notify motion_sensor {\
  if($attr{alarm_btn}{armed} eq "yes" && $attr{alarm_btn}{triggered}
eq "no") {\
    $attr{alarm_btn}{triggered} = "yes";;\
    fhem("set Schemerlamp on");;\
  }\


Where must i put the read motion state alert etc?

regards Richard


On Jan 30, 11:34 pm, Rudolf Koenig wrote:
> > When I go out, I press a button of a remote, fhem counts down, and
> > after 30sec it goes inarmedstate.
> > When now a door is opened, a lamp or sirene is on.
>
> > Is this possible in fhem?
>
> I think we had this already, but here is another (untested :) version:
>
> attr global userattrarmedtriggered
>
> define alarm_btn FS20 1234 50       # the button on the remote
>
> define alarm_activate notify alarm_btn:on define alarm_delayed +00:00:30 \
>   attr alarm_btnarmedyes;; attr alarm_btn triggered no
>
> define alarm_deactivate notify alarm_btn:off attr alarm_btnarmedno
>
> define piri.room1 FS20 1234 51
> define piri.room2 FS20 1234 52
> ...
>
> define alarm_trigger notify piri.* {\
>   if($attr{alarm_btn}{armed} eq "yes" && $attr{alarm_btn}{triggered} eq "no") {\
>     $attr{alarm_btn}{triggered} = "yes";;\
>     fhem("set lamp,sirene on");;\
>   }\
>
> }
>
>

--
Sie haben diese Nachricht erhalten, da Sie der Google Groups-Gruppe FHEM users beigetreten sind.
Wenn Sie Nachrichten in dieser Gruppe posten möchten, senden Sie eine E-Mail an fhem-users@googlegroups.com.
Wenn Sie aus dieser Gruppe austreten möchten, senden Sie eine E-Mail an fhem-users+unsubscribe@googlegroups.com.
Besuchen Sie die Gruppe unter http://groups.google.com/group/fhem-users?hl=de, um weitere Optionen zu erhalten.

Guest

Originally posted by: <email address deleted>

I also have this. But whenever the state is armed of not, the
schemerlamp won't be triggered

fhem> l alarm_btn
Internals:
   BTN        00
   CUL_MSGCNT 4
   CUL_RAWMSG F4631001107
   CUL_RSSI   -70.5
   CUL_TIME   2011-02-06 21:35:16
   DEF        4631 00
   IODev      CUL
   LASTIODev  CUL
   MSGCNT     4
   NAME       alarm_btn
   NR         98
   STATE      on
   TYPE       FS20
   XMIT       4631
   Code:
     1          4631 00
   Readings:
     2011-02-06 21:35:16   state           on
Attributes:
   armed      yes
   triggered  no


define alarm_btn FS20 4631 00       # the button on the remote

define testje FS20 4631 01

define alarm_activate notify alarm_btn:on define alarm_delayed at
+00:00:30 \
attr alarm_btn armed yes;; attr alarm_btn triggered no

define alarm_deactivate notify alarm_btn:off attr alarm_btn armed no

define alarm_trigger notify testje {\
  if($attr{alarm_btn}{armed} eq "yes" && $attr{alarm_btn}{triggered}
eq "no") {$attr{alarm_btn}{triggered} = "yes";;\
  fhem("set Schemerlamp on");;\
}\


On Jan 30, 11:34 pm, Rudolf Koenig wrote:
> > When I go out, I press a button of a remote, fhem counts down, and
> > after 30sec it goes in armed state.
> > When now a door is opened, a lamp or sirene is on.
>
> > Is this possible in fhem?
>
> I think we had this already, but here is another (untested :) version:
>
> attr global userattr armed triggered
>
> define alarm_btn FS20 1234 50       # the button on the remote
>
> define alarm_activate notify alarm_btn:on define alarm_delayed +00:00:30 \
>   attr alarm_btn armed yes;; attr alarm_btn triggered no
>
> define alarm_deactivate notify alarm_btn:off attr alarm_btn armed no
>
> define piri.room1 FS20 1234 51
> define piri.room2 FS20 1234 52
> ...
>
> define alarm_trigger notify piri.* {\
>   if($attr{alarm_btn}{armed} eq "yes" && $attr{alarm_btn}{triggered} eq "no") {\
>     $attr{alarm_btn}{triggered} = "yes";;\
>     fhem("set lamp,sirene on");;\
>   }\
>
> }
>
>

--
Sie haben diese Nachricht erhalten, da Sie der Google Groups-Gruppe FHEM users beigetreten sind.
Wenn Sie Nachrichten in dieser Gruppe posten möchten, senden Sie eine E-Mail an fhem-users@googlegroups.com.
Wenn Sie aus dieser Gruppe austreten möchten, senden Sie eine E-Mail an fhem-users+unsubscribe@googlegroups.com.
Besuchen Sie die Gruppe unter http://groups.google.com/group/fhem-users?hl=de, um weitere Optionen zu erhalten.

rudolfkoenig

                                                   

On Sun, Feb 06, 2011 at 12:43:33PM -0800, kroon040 wrote:
> I also have this. But whenever the state is armed of not, the
> schemerlamp won't be triggered

Are the attributes armed and triggered set correctly after the activate?
-> check it with list alarm_btn

If yes, please add some
  Log 1, "Hello";;\
to the alarm_trigger and then use "trigger testje on" to pinpoint the problem.

--
Sie haben diese Nachricht erhalten, da Sie der Google Groups-Gruppe FHEM users beigetreten sind.
Wenn Sie Nachrichten in dieser Gruppe posten möchten, senden Sie eine E-Mail an fhem-users@googlegroups.com.
Wenn Sie aus dieser Gruppe austreten möchten, senden Sie eine E-Mail an fhem-users+unsubscribe@googlegroups.com.
Besuchen Sie die Gruppe unter http://groups.google.com/group/fhem-users?hl=de, um weitere Optionen zu erhalten.

Guest

Originally posted by: <email address deleted>

I get only errors
Rudolf

2011.02.07 21:37:40 2: FS20 testje on
2011.02.07 21:37:40 3: Unknown command {\
if($attr{alarm_btn}{armed}, try help
2011.02.07 21:37:40 3: Unknown command \, try help
2011.02.07 21:37:40 3: Unknown command \, try help
2011.02.07 21:37:40 3: Unknown command {\
if($attr{alarm_btn}{armed}, try helpUnknown command \, try helpUnknown
command \, try help


fhem> l alarm_trigger
Internals:
   DEF        testje {\
if($attr{alarm_btn}{armed} eq "yes" && $attr{alarm_btn}{triggered} eq
"no") {\
$attr{alarm_btn}{triggered} = "yes";\
fhem("set Schemerlamp on");\
}\

   NAME       alarm_trigger
   NR         102
   REGEXP     testje
   STATE      active
   TYPE       notify
Attributes:




On Feb 6, 10:28 pm, Rudolf Koenig wrote:
> On Sun, Feb 06, 2011 at 12:43:33PM -0800, kroon040 wrote:
> > I also have this. But whenever the state is armed of not, the
> > schemerlamp won't be triggered
>
> Are the attributes armed and triggered set correctly after the activate?
> -> check it with list alarm_btn
>
> If yes, please add some
>   Log 1, "Hello";;\
> to the alarm_trigger and then use "trigger testje on" to pinpoint the problem.

--
Sie haben diese Nachricht erhalten, da Sie der Google Groups-Gruppe FHEM users beigetreten sind.
Wenn Sie Nachrichten in dieser Gruppe posten möchten, senden Sie eine E-Mail an fhem-users@googlegroups.com.
Wenn Sie aus dieser Gruppe austreten möchten, senden Sie eine E-Mail an fhem-users+unsubscribe@googlegroups.com.
Besuchen Sie die Gruppe unter http://groups.google.com/group/fhem-users?hl=de, um weitere Optionen zu erhalten.

rudolfkoenig

                                                   

On Mon, Feb 07, 2011 at 12:39:52PM -0800, kroon040 wrote:
> I get only errors

There were some typos in the script. Please try the following fhem.cfg, it does
not need any attached hardware. This time I have tested it by starting fhem
from the fhem source directory.

##################
attr global logfile -
attr global modpath .
attr global port 7073 global
attr global statefile ./fhem.state
attr global verbose 5
 
define dCUL CUL none 0000
 
attr global userattr armed triggered
 
define alarm_btn  FS20 1234 50      # the button on the remote
define piri.room1 FS20 1234 51      # The motion sensor
define lamp       FS20 1234 52      # The alarm signal
attr alarm_btn armed no
attr alarm_btn triggered no

define alarm_activate notify alarm_btn:on \
  define alarm_delayed at +00:00:03 \
  attr alarm_btn armed yes;; attr alarm_btn triggered no

define alarm_deactivate notify alarm_btn:off \
  attr alarm_btn armed no;; set lamp off
 
define alarm_trigger notify piri.* {\
  if($attr{alarm_btn}{armed} eq "yes" && \
     $attr{alarm_btn}{triggered} eq "no") {\
    $attr{alarm_btn}{triggered} = "yes";;\
    fhem("set lamp on");;\
  }\
}  
##################

Telnet to fhem, and try following commands one by one and watch the log in the
fhem window:

fhem> trigger alarm_btn on
(wait 3 seconds)
fhem> trigger piri.room1 on
fhem> trigger alarm_btn off


Regards,
  Rudi

--
Sie haben diese Nachricht erhalten, da Sie der Google Groups-Gruppe FHEM users beigetreten sind.
Wenn Sie Nachrichten in dieser Gruppe posten möchten, senden Sie eine E-Mail an fhem-users@googlegroups.com.
Wenn Sie aus dieser Gruppe austreten möchten, senden Sie eine E-Mail an fhem-users+unsubscribe@googlegroups.com.
Besuchen Sie die Gruppe unter http://groups.google.com/group/fhem-users?hl=de, um weitere Optionen zu erhalten.

Guest

Originally posted by: <email address deleted>

Rudolf,

That works, maybe a good option fot in the FAQ?

Richard

On Feb 12, 1:04 pm, Rudolf Koenig wrote:
> On Mon, Feb 07, 2011 at 12:39:52PM -0800, kroon040 wrote:
> > I get only errors
>
> There were some typos in the script. Please try the following fhem.cfg, it does
> not need any attached hardware. This time I have tested it by starting fhem
> from the fhem source directory.
>
> ##################
> attr global logfile -
> attr global modpath .
> attr global port 7073 global
> attr global statefile ./fhem.state
> attr global verbose 5
>
> define dCUL CUL none 0000
>
> attr global userattr armed triggered
>
> define alarm_btn  FS20 1234 50      # the button on the remote
> define piri.room1 FS20 1234 51      # The motion sensor
> define lamp       FS20 1234 52      # The alarm signal
> attr alarm_btn armed no
> attr alarm_btn triggered no
>
> define alarm_activate notify alarm_btn:on \
>   define alarm_delayed at +00:00:03 \
>   attr alarm_btn armed yes;; attr alarm_btn triggered no
>
> define alarm_deactivate notify alarm_btn:off \
>   attr alarm_btn armed no;; set lamp off
>
> define alarm_trigger notify piri.* {\
>   if($attr{alarm_btn}{armed} eq "yes" && \
>      $attr{alarm_btn}{triggered} eq "no") {\
>     $attr{alarm_btn}{triggered} = "yes";;\
>     fhem("set lamp on");;\
>   }\}  
>
> ##################
>
> Telnet to fhem, and try following commands one by one and watch the log in the
> fhem window:
>
> fhem> trigger alarm_btn on
> (wait 3 seconds)
> fhem> trigger piri.room1 on
> fhem> trigger alarm_btn off
>
> Regards,
>   Rudi

--
Sie haben diese Nachricht erhalten, da Sie der Google Groups-Gruppe FHEM users beigetreten sind.
Wenn Sie Nachrichten in dieser Gruppe posten möchten, senden Sie eine E-Mail an fhem-users@googlegroups.com.
Wenn Sie aus dieser Gruppe austreten möchten, senden Sie eine E-Mail an fhem-users+unsubscribe@googlegroups.com.
Besuchen Sie die Gruppe unter http://groups.google.com/group/fhem-users?hl=de, um weitere Optionen zu erhalten.

rudolfkoenig

                                                   

> That works, maybe a good option fot in the FAQ?

Even better: could you please make an entry in the fhemwiki?

--
Sie haben diese Nachricht erhalten, da Sie der Google Groups-Gruppe FHEM users beigetreten sind.
Wenn Sie Nachrichten in dieser Gruppe posten möchten, senden Sie eine E-Mail an fhem-users@googlegroups.com.
Wenn Sie aus dieser Gruppe austreten möchten, senden Sie eine E-Mail an fhem-users+unsubscribe@googlegroups.com.
Besuchen Sie die Gruppe unter http://groups.google.com/group/fhem-users?hl=de, um weitere Optionen zu erhalten.