Just uploaded a new release including the MQTT functions for reading sensors and activating relays.
The release for now is only available in github and can be installed using the "expert user" procedure described in the website "download" page. (https://hydrosysblog.wordpress.com/configuration/)
The guide how to setup MQTT is here. I specifically tested the BH1750 and it works straight away.
If you make any MQTT testing, feedbacks are welcome.
I'd add a couple of options beside the I2C multiplexer.
1) Use analog light sensors and the MCP3008 ADC converter (As in the automation HAT board).
2) Currently working on MQTT integration with Hydrosys4, I've seen quite interesting integrations of sensors with the ESP8266. You can have a look at the Tasmota project page, seems they already integrated the BH1750. Additional benefit, no signal cabling.
Just saw your blog post on the MQTT work, great job! This is a pretty huge development and way smarter than the I2C multiplexer. I just ordered a few of the ESP's to mess around with. I just spent the weekend wiring up my fiancee's greenhouse with sensors, relays, solenoids, and pumps. Some of the stuff would have been much easier with a couple ESP's.
If I would chose a candidate I'll select one sensor which supports I2C interface and has possibility to select multiple addresses (either by pin or programmable).
I haven't found any decent light sensors with multiple addresses, and none with more than 2. Obviously it isn't supported now, but an I2C multiplexer such as the 548A (also handily packaged in an Adafruit breakout board #TCA9548A) I2C 1 to 8 multiplexer may be the best way to achieve this. I've come across a few Pi projects that have used the TCA9548A to connect multiple light sensors and there is a Python driver library for it. I was already looking at this to try to integrate multiple UV sensors as I'm more interested in UV than visible light in my wife's greenhouse and especially in the case of a multiple level hydroponic system I'm thinking about building in our garage.
Interesting discussion here, as Mick pointed out the sensors connected to I2C need to have different Addresses. I think my code currently supports only the sensor default address. Anyway this would be easy to fix. I'll put in to the todo list.
UPDATE: It is now possible to set the I2C address of the BH1750 sensor, in the hardwaresetting table, at the "address" field, just add the I2C address in this format 0xXX. For the BH1750 the default address should be 0x23, the second address when putting the "addr" pin to VCC, should be 0x5C.
I don't know if the software is capable of handling multiple light sensors or not but, the BH1750 only has two possible addresses so I'd guess at best the software would only be able to recognize two. To change the address you connect the address pin of the BH1750 to 3.3v. I have a second one laying around so I may test that out sometime this week.
Just uploaded a new release including the MQTT functions for reading sensors and activating relays.
The release for now is only available in github and can be installed using the "expert user" procedure described in the website "download" page. (https://hydrosysblog.wordpress.com/configuration/)
The guide how to setup MQTT is here. I specifically tested the BH1750 and it works straight away.
If you make any MQTT testing, feedbacks are welcome.
I'd add a couple of options beside the I2C multiplexer.
1) Use analog light sensors and the MCP3008 ADC converter (As in the automation HAT board).
2) Currently working on MQTT integration with Hydrosys4, I've seen quite interesting integrations of sensors with the ESP8266. You can have a look at the Tasmota project page, seems they already integrated the BH1750. Additional benefit, no signal cabling.
If I would chose a candidate I'll select one sensor which supports I2C interface and has possibility to select multiple addresses (either by pin or programmable).
I'm open for suggestions.
Awesome thank you!
Are there any other light sensors you know of that could have multiple used?
Interesting discussion here, as Mick pointed out the sensors connected to I2C need to have different Addresses. I think my code currently supports only the sensor default address. Anyway this would be easy to fix. I'll put in to the todo list.
UPDATE: It is now possible to set the I2C address of the BH1750 sensor, in the hardwaresetting table, at the "address" field, just add the I2C address in this format 0xXX. For the BH1750 the default address should be 0x23, the second address when putting the "addr" pin to VCC, should be 0x5C.
Thank you for the info! Even 2 would be helpful.
Do you know of any light sensors I could have many of?
I don't know if the software is capable of handling multiple light sensors or not but, the BH1750 only has two possible addresses so I'd guess at best the software would only be able to recognize two. To change the address you connect the address pin of the BH1750 to 3.3v. I have a second one laying around so I may test that out sometime this week.