I don’t know if this is already possible, but I’d like to check the direct value of a homeduino analog sensor when I execute a rule.
This could also apply to for example ping devices.
Is this possible?
Read analog sensor manually (Homeduino)
I don’t know if this is already possible, but I’d like to check the direct value of a homeduino analog sensor when I execute a rule.
This could also apply to for example ping devices.
Is this possible?
Is there maybe a workaround to do this?
You mean something like this?
https://github.com/pimatic/pimatic-homeduino#analogsensor-example
@Cryonic90 I am using the AnalogSensor to read out a light sensor, but I would like to be able to read it’s value when for example I press a button.
Right now the sensor just periodically checks the light value, and when I press the button I get the latest readout, but I want it to read out the current value.
@FrostedKiwi said:
I’d like to check the direct value of a homeduino analog sensor when I execute a rule.
This could also apply to for example ping devices
Yes. This is possible. Following the AnalogSensor example, you can use something like $homeduino-analog-sensor.voltage > 9
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
@mwittig said:
$homeduino-analog-sensor.voltage
That’s not what I am trying to achieve. Since I don’t want the light sensor to keep spamming, I’ve put it on a refresh rate of 1 minute.
So when the light sensor reads that value, and I press the button (which turns of my light), I want to see the new light value immediately, instead of waiting until the next scheduled readout.
you could try to fiddle with If voltage of $homeduino-analog-sensor gets updated ...
or something like that…
pimatic v0.9 has been released!
Support Pimatic and get some free stickers
Like us on Facebook
make it so !
Isn´t possible at the moment. We need an “force update” event to archive this.
pimatic rocks!!!
@FrostedKiwi said:
That’s not what I am trying to achieve. Since I don’t want the light sensor to keep spamming
Honestly, I don’t see the problem. Reading a sensor every 100ms should not create a huge overhead. Rather than adding “force update” to homeduino I’d would prefer to keep things simple. May be you can use something else than homeduino for your light sensor.
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
@mwittig said:
May be you can use something else than homeduino for your light sensor.
Why not use an esp. Maybe you can try it with espimatic ? It’s possible to read the analoge value over a pin on the esp.
pimatic v0.9 has been released!
Support Pimatic and get some free stickers
Like us on Facebook
make it so !
@Icesory This is indeed what I was looking for. I guess I’ll have to find another way to achieve this then.
Create a mysensors gateway and you can create sensors for anywhere in the house. I also have a light sensor (Arduino pro mini, LDR, NRF24) near the window that is connected to a lot of rules for automatic lightning.
@sweebee Doesn’t MySensors work exactly the same as the Homeduino AnalogSensor? So it just broadcasts every x seconds/minutes?
Yes, it does, but you can also send commands to a node.
Whenever that command is received you can let the node send the values, so you create a send-on-request in the node.
@FrostedKiwi no, that depends on how you program your node. If it’s not battery powered you can check it always like:
int sentValue;
int value = analogRead(A0);
If(value != sentValue){
node.send(msg.set(value));
sentValue = value;
}
Now it only sends If the value has changed.