Closed markrad closed 6 years ago
I've been really swamped lately. My plan is to work down the PR and the other issues I've saved up this weekend.
I'll happily accept the PR. My only stipulation would be that the StateCallback not be required and there is some sort of checking and logging if the switchLed.py doesn't exist.
For the other bugs, it will be a lot easier to track if you file a separate issue and PR for each one, though I'll happily accept the lot of them in one go if necessary.
I went ahead and merged the DHT22 code but am keeping the issue open until the install.sh gets updated with the required libraries.
Thanks for that.
I might be able to split the bug fixes out. I'll give it a go. I have a pr for the DHT22 module too. I added an ini option to return the temp in either C or F.
I thought there were two bug fixes but it was only one. Toggle in the rpiactuator code would always be true. I sent you a pull request - https://github.com/rkoshak/sensorReporter/pull/44.
Thanks
Hi @rkoshak,
I often see you in the OpenHab community forum and I saw mention of this project in one of your posts. First off this is a great idea. I love the idea of being able to deploy a sensor with just an ini file.
However, it did not meet all my needs.
First, I would really appreciate it if you would integrate the DHT22 code that you have waiting.
Second, I really needed event detection for a motion sensor. I forked your code and added that functionality (for the Pi sensor only). The other issue that I had is that my original code used an LED to indicate motion. I could have pushed the value to OpenHab and then have it return a value to turn on the LED but that really didn't meet my needs. I want the LED to tell me the local code is working. Pushing it to OpenHab has too many failure points so I wouldn't know if OpenHab was down, my network connection was bad or my code monitoring the sensor was not running.
To address this, I added an option in the sensor options to dynamically load a script that is called when the pin changes state. Here is a snippet of my ini file:
Here is a sample StateCallback function (switchLed.py):
In my scenario I have a RGB LED which I turn on the red LED when no motion is detected and the blue LED when motion is detected. If this is of interest to you then I will send you a pull request. You can check out the code at https://github.com/markrad/sensorReporter.
Anyway, thanks for all your hard work. It works very well.
And by the way, I fixed a couple of bugs too. Toggle was broken, it always came out true and the GPIO was set to low if the msg payload was ON which seemed like it was the wrong way round to me.
M.