Hello,
Sometimes a contactsensor (KaKu AMST-606) signal is missed.
Is it posible to set te corect status of the sensor manualy.
And i do not mean, walk to the door en open or close it a couple of times
Thanks Hans
[Solved] How to set the state of a contact sensor
Hello,
Sometimes a contactsensor (KaKu AMST-606) signal is missed.
Is it posible to set te corect status of the sensor manualy.
And i do not mean, walk to the door en open or close it a couple of times
Thanks Hans
@hansjeu
yes, you can do that via the api of pimatic
http://192.168.0.20/api/device/DummyContactSensor/changeContactTo?contact=true
http://192.168.0.20/api/device/DummyContactSensor/changeContactTo?contact=false
Follow my domotica project on http://maredana.nl
Tthis will only work with the DummyContactSensor
. Other contact sensor device types like the HomeduinoRFContactSensor
do not provide for the changeContactTo
action! Thus, you need to setup the DummyContactSensor
in addition to the Kaku ContactSensor (supposedly a HomeduinoRFContactSensor
) and define some rules to set the DummyContactSensor
when the state of other sensor changes.
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
wow, I thought I’d ask something simple.
It seems to be complex.
mwittig is right i think.
Stupit question, but how do i setup a dummycontactcensor???
Umm… am I in the wrong here, no idea, but I have set my Nexa door contact sensor as a switch (contact mode wasn’t available when i made it). Then I have made a rule:
if Door is turned off then after 10 seconds turn Door on (this is reverse)
This way the door switch automatically resets after 10 seconds. then I have a variable for notifying if door is actually left open (optional):
"if door is turned off then after 10 seconds $doorvari = $doorvari+1"
"if $doorvari = 2 and after 15 sedonds $doorvari = 2 then $doorvari = 0"
"if $doorvari = 4 then push message “Door propably left open”
Sorry im not available to access the actual rules at the moment, but this should give you an idea.
Oh, did not thought about it only works with class DummyContactSensor (thanks mwittig)
Here is an example how you add a DummyContactSensor in the config.json:
{
"class": "DummyContactSensor",
"id": "sensor1",
"name": "Door-Sensor1"
},
then you add some rules like @kitsunen posted (like your needs)
and you can set the state like @incmve posted (replace ‘DummyContactSensor’ (the red part) in his example with your deivceid set in the config.json - in the case above it’s ‘sensor1’)
Thank you all.
Got it working