Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use virtual motion sensor? #61

Closed
igitlin opened this Issue Jun 29, 2018 · 5 comments

Comments

Projects
None yet
4 participants
@igitlin
Copy link

commented Jun 29, 2018

I try to use motion sensor but doesn't work
flow if open contact sensor ( door) then virt motion sensor is true

@igitlin igitlin changed the title How to use virtual motion sensor How to use virtual motion sensor? Jun 29, 2018

@MP-ICT-Diensten

This comment has been minimized.

Copy link

commented Jul 15, 2018

And then with Heimdall support please, like this: https://forum.athom.com/discussion/comment/74831/#Comment_74831

@ArjanKranenburg ArjanKranenburg added the bug label Jul 22, 2018

@daneedk

This comment has been minimized.

Copy link
Contributor

commented Sep 3, 2018

Replacing

// this.log(device.getName() + ' -> Sensor: ' + sensor);
// this.log(device.getName() + ' -> Value: ' + parseFloat(value, 10));
device.setCapabilityValue(sensor, parseFloat(value, 10)) // Fire and forget
.catch(this.error);

with

if( isNaN(value) ) {
  var boolValue = value.toLowerCase() == 'true' ? true : false;
  this.log(device.getName() + ' -> Value:  ' + boolValue); 
  device.setCapabilityValue(sensor, boolValue) // Fire and forget
    .catch(this.error);
} else {
  this.log(device.getName() + ' -> Value:  ' + parseFloat(value, 10));
  device.setCapabilityValue(sensor, parseFloat(value, 10)) // Fire and forget
    .catch(this.error);
}

Will make setting alarm_motion to true or false work.

image

Numbers for other capabilities will work as it was, I did not check if there are other possible values then boolean or numeric for other capabilities, just looked at alarm_motion.

@ArjanKranenburg

This comment has been minimized.

Copy link
Owner

commented Sep 11, 2018

This is now released in the beta-channel with version 0.7.4

@MP-ICT-Diensten

This comment has been minimized.

Copy link

commented Sep 11, 2018

I installed the Beta and now it works.

I made an test button (trigger) and when pressed VirtPir is True and after 10 seconds switched back to False.

2018-09-11_20-17-37

2018-09-11_20-18-00

@ArjanKranenburg

This comment has been minimized.

Copy link
Owner

commented Sep 15, 2018

And now as stable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.