DO GPIO polling - unsure of existing capability #2794
Replies: 2 comments 1 reply
-
|
It's possible to use The current challenge is there are no sensor slots left in the User Sensors to assign the Rain sensor. I will have to work on making more sensor slots available. As for the replace, that would not be necessary. I would just create a lookup table dictionary in RAIN_MAP_STR = {
0 : 'No Rain',
1 : 'Raining',
}Then you can dedicate an overlay variable that looks up that dictionary: rain_sensor_value = self.sensors_user_av[constants.SENSOR_USER_RAIN_SENSOR] # float
# use round() to cast to an int
rain_overlay_variable = constants.RAIN_MAP_STR[round(rain_sensor_value)] |
Beta Was this translation helpful? Give feedback.
-
|
Just did a quick test of the existing infrastructure in indi it seems when I attribute D17 in sensors thats enough to 'hold' the sensor but obviously the system doesn't interpret what's coming from it. I tried polling in a terminal myself with a command and the output looks the above is happening ^ |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
As of late i have been on a flurry of adding sensors to my rig.
The latest is a FC-37 Rain sensor. This has a digital output to GPIO. Albeit merely a 1 or 0. What i would like to know is there any scope to open up the current polling of sensors up to also DO GPIO? If it isnt already?
Apologies if it is and I cant see the right way of doing it. I would be willing to help establish this with a crap PR to you that you could polish further.
Extending on this i have thought, how would you feel about a *.replace() function being made available in the overlay input?
With this capability one could poll a rain sensor and then do something like *.replace(0,"Raining").replace(1,"Not raining"). I would also be willing to help in this regard also.
Kind Regards,
Sam
Beta Was this translation helpful? Give feedback.
All reactions