I’m using a automation hat to monitor moisture level in a planter. When it gets dry a pump is turned on. All is done in a python program. I tried to use a second python program to read the state of the relay that is driving the pump so I can send that state to my openHab program but it never sees an active relay (.is_on() always returns a false). If I run .is_on() in same python program that turns on the relay, it works as expected.
This tells me that the pimoroni library is not saving the state of the relays in a global sense. Anyone know if this is the truth or am I missing something about the library and python?
Thanksinadvance, JimB
We do! It’s been a while since I did anything with Automation HAT but think there might be some hardware locking in the library which means running multiple scripts that use the same hardware won’t work. Is it not possible to combine the two Python scripts into one?
I was hoping to use two different programs - one running constantly to monitor inputs and set outputs. The second program runs from a cron task to send data collected to a server at a different interval. I did finally combined the two functions. I am using the cron task on several pi’s so wanted to keep it separate so updates would be simpler.
Thanks for replying.