Ok,
New version of TempF is up. Should now be "update" safe. I'm testing but my system doesn't issue the update command very often so if someone else could give me a hand...
Offset Multisensor
Re: Offset Multisensor
The value of the arithmetic vDev does change, because it is called every minute. It would probably be better to let it update if any of the selected sensors has changed. Since I am not a programmer, I do not have the skills to fix that. Besides Arithmetic was just a toy for me to get some insight on how these modules work.Mike Yeager wrote:pz1,
Does arithmetic allow you to actually change the value of the sensor display???
(Via my signature you can get at the sources without having to install my Apps)
Since 29-12-2016 I am no longer a moderator for this forum
-
- Posts: 160
- Joined: 03 May 2014 07:02
Re: Offset Multisensor
pz1,
And here I thought you were part of the ZWay development team. Setting it to only update when a sensor value changes is easy. Look at how TempF operates. It only runs when the sensor it's getting it's tempC reading from updates. On my system, that sensor updates every minute (it's supposed to, doesn't always do it but that's the sensor itself).
I wish I'd seen your module before I set out on writing my own. I could have saved myself a bit of time. Might not have learned as much though. I took the liberty of modifying it to update on sensor change instead of every minute. Here's the change you need to make:
this.controller.devices.on(self.config.sensor1, 'change:metrics:level', function() {
self.fetchEquation(self);
});
this.controller.devices.on(self.config.sensor2, 'change:metrics:level', function() {
self.fetchEquation(self);
});
// this.timer = setInterval(function () {
// self.fetchEquation(self);
// }, 60 * 1000); //every minute
// self.fetchEquation(self);
I left the original timer routine there so you'd see where to put the rest. Was going to upload it to you but the system wouldn't let me...
And here I thought you were part of the ZWay development team. Setting it to only update when a sensor value changes is easy. Look at how TempF operates. It only runs when the sensor it's getting it's tempC reading from updates. On my system, that sensor updates every minute (it's supposed to, doesn't always do it but that's the sensor itself).
I wish I'd seen your module before I set out on writing my own. I could have saved myself a bit of time. Might not have learned as much though. I took the liberty of modifying it to update on sensor change instead of every minute. Here's the change you need to make:
this.controller.devices.on(self.config.sensor1, 'change:metrics:level', function() {
self.fetchEquation(self);
});
this.controller.devices.on(self.config.sensor2, 'change:metrics:level', function() {
self.fetchEquation(self);
});
// this.timer = setInterval(function () {
// self.fetchEquation(self);
// }, 60 * 1000); //every minute
// self.fetchEquation(self);
I left the original timer routine there so you'd see where to put the rest. Was going to upload it to you but the system wouldn't let me...
Re: Offset Multisensor
No I am happily retiredMike Yeager wrote:pz1,
And here I thought you were part of the ZWay development team.
It isn't really my own. I started with ZwaveMe's Openweather module that served me as a template.[/quote]I wish I'd seen your module before I set out on writing my own.
Feel free to fork my code and improve it. My initial intent was it to be a teaser for more skilled people to take this further. Initially it had the more presumptuous name MathematicaI took the liberty of modifying it to update on sensor change instead of every minute. Here's the change you need to make:
this.controller.devices.on(self.config.sensor1, 'change:metrics:level', function() {
self.fetchEquation(self);
});
this.controller.devices.on(self.config.sensor2, 'change:metrics:level', function() {
self.fetchEquation(self);
});
// this.timer = setInterval(function () {
// self.fetchEquation(self);
// }, 60 * 1000); //every minute
// self.fetchEquation(self);
I left the original timer routine there so you'd see where to put the rest. Was going to upload it to you but the system wouldn't let me...
Pieter
update1 Thanks for the code it seems to work well. I've updated github. App store later after I have fixed the selection of a constant next to a sensor
update2 I am in the process of adding the option where the user can supply one or more constants. I will add a linear calibration with offset like
Code: Select all
sensor1 * constant1 + constant2
-
- Posts: 160
- Joined: 03 May 2014 07:02
Re: Offset Multisensor
I thought about forking your code but I'm not that familiar with Github and it kept bouncing me back to my own site. I've been modifying quite a few of the stock modules, like DummyDevice, so that they have the cool icons and stuff like that. I keep all of that on Github so I don't lose it.
Re: Offset Multisensor
I have added a linear "calibration" function to module Arithmetic. You can find it here on my github. It is still experimental.Osorkon wrote:Exactlypz1 wrote:So in essence for you Aritmetic should have the option to select a "real" value instead of a sensor in the field for sensor b ?
-
- Posts: 160
- Joined: 03 May 2014 07:02
Re: Offset Multisensor
I'll check it out next week. I got a bit done on my newest project but I'm away for the weekend.
Re: Offset Multisensor
I uploaded the extended module 1.0.4 (=added calibration function) to the online App store.pz1 wrote:I have added a linear "calibration" function to module Arithmetic. You can find it here on my github. It is still experimental.
-
- Posts: 160
- Joined: 03 May 2014 07:02
Re: Offset Multisensor
Hopefully yours makes it to the store before mine. They've been reviewing for weeks...
Re: Offset Multisensor
My update has been verified and accepted. Guess something has gone wrong for yours.Mike Yeager wrote:Hopefully yours makes it to the store before mine. They've been reviewing for weeks...