Hubitat with Homemade Temperature, Humidity, Pressure and Light sensor

@iharyadi, I don't think I understand the digital out. I want to hook a relay to it so I can trigger my garage door opener so I measured the voltage from the DO contact to gnd and it's 1.75V and the On and Off tiles on the device page don't change it and no event is registered. Is this normal? What am I missing?

@LosinIt,

Here is what you need to setup. On the Environment Sensor that you want to attach the relay, please go into the driver detail page.

  1. Please enable the Digital Output
  2. Please type switch for the driver. Please install the following switch DTH on your driver page.
  1. Save the preference.

You will find a new switch device as the child of Environment Sensor.

You can the on/off command of the switch to toggle the DO.

Or you can use the switch DTH just as an example. You can extend (improve it) to make it as Garage door controller.

Let me know if these are not working out for you. I have used the switch device and connect it to a relay.

Thanks
Iman

1 Like

Terrific! Thanks again, Iman.

I'm still not seeing any events from clicking the On/OFF tiles and the (open circuit) voltage doesn't change. I did this setup on the device that has the BT board attached. Can they not coexist?

They should be able to co-exist.

Do you have the switch child device created?

Yes

@LosinIt, The on/off tile on Environment Page is not the one that will control the relay.

The on/off should be on the child device page.

BTW, I want to reach out to you as quickly as possible. The 1.75v is concerning. The voltage on the DO should be close to 0 and 3.3V. If you have 1.75v, something is pulling the voltage up. There may be some wiring issue. Before, turning on/off the switch, is it possible to double check on the wiring?

Your relay can draw power from the 5V and GND. The relay digital input should connect to the Environment Sensor DO. With this wiring, you should not see 1.75V.

Thanks
Iman

Right...

There is no wiring. I have connected nothing, which is why I said "(open circuit) voltage"

OK, I'll need to know what to buy for this (I was going to ask next anyway) as I envisioned using a small relay powered directly from the DO. But it makes sense that would draw too much power for that configuration. BTW, I haven't worked with electronics since the vacuum tube transistor days where powering a small relay directly was doable.

If it is not too much of a problem, please double check if there are any connection loose. I will do the same on my end. The DO should not generate 1.75v.

I use the following relay. This is not exactly the same as what I have. But, it is very close.

https://www.amazon.com/SunFounder-Channel-Optocoupler-Expansion-Raspberry/dp/B00E0NTPP4

Any variant of such relay should work.

Thanks
Iman

Not that I can tell but everything is so tiny...

Thanks for the device reccommend. I'll order it now.

BTW, I just double check the DO on one of my device. It does not show 1.75v.

When Environment Sensor is powered on, it should be 3.3V. When the Switch DTH is configured, I can go to the child Switch device. The voltage on DO will be 0 or 3.3V depending when the on/off state.

I forgot to mention that before the previous test I unplugged the BT board from the USB supply and it didn't make a difference.

I can't explain this but I just tried again and it reads 3.27V whether on or off and there are still no events registered in the HE list on the Switch child page. Are you seeing events there?

I'm going to reboot HE. Perhaps there is something funky with the added driver that HE needs to straighten out.

For Pete's sake! Now it's back to 1.75!!!

No change after rebooting HE

Yes, I just checked on mine.

The log file on the Environment Sensor will show the following when you click on/off

Do you use this module? If you like, you can send it back. I will give you a new one. I am very curious on what is going on with that module.

I'm not seeing anything under Current States like you are.

Not really. It's the one with your BT board connected to it and I've only used it for trying to find BT devices (no love there) so I can easily send it back.

I only used this module because it's handy, right here on my desk. I'll try another one and let you know what happens with it. But first I'm going to re-install the switch driver code... Nope, no change.

Since I also have a BT device connected to the Environment Sensor, I test the switch on that device.

Going into the switch device...

BTW, if you like to get it replaced, please PM me. I am interested to see what is going on with your module. I can try to help you setup with the switch there.

I grabbed the module from the garage since it's the one I'll be hooking the relay to. After I added the Switch child driver it was acting the same as the other one except the device page showed info under Current States.

I pulled the module from the USB, waited a few seconds, plugged it back in and got a successful switch to ON with the event logged and the DO at 3.3V but then it stopped switching so I again pulled the USB power, waited, re-plugged and now it's working as you said it should... 0V off, 3.3V on and events are logged.

Yes, please. I'll PM in a moment.

@iharyadi, this morning my Zigbee mesh stopped working. I found this in the HE logs every 30 seconds: errorjava.lang.IllegalStateException: Queue full (refresh) from one of your environment sensors.

I found nothing in the Zigbee log and there was some other strangeness like the /hub/zigbee/getChildAndRouteInfo link showed the html instead of the expected info. I suspect this is the result of the hub being trashed and not directly related to your sensor.

I guess I don't know that it was your sensor that started this and maybe it was just the first victim of the situation. :man_shrugging:

I had to reboot the HE to restore normalcy.

I believe that if you are seeing this page, the zigbee is offline. Since my dth sensor depend on a working zigbee radio on the hub, the queue error above may happen. I personally have not seen this happen. My zigbee has been working just fine so far.

Which version of hub and hubitat firmware version do you use? Has it changed recently? I am curious whether there is something lurking that bring down the hub zigbee.

Screenshot_2020-11-22_10-44-41

No, it's been 3-4 months since I updated to 135 and I've had no problems with it until now. It's been the best release to date for me. I'm not aware of any place I can look on HE to see when the update was applied. BTW, I don't plan to upgrade again until there is a stable version to go to. :roll_eyes:

Yeah, I really don't know what started the Queue Full problem but there was a much earlier report of a similar experience: Hubitat with Homemade Temperature, Humidity, Pressure and Light sensor - #85 by veeceeoh I guess it could be something entirely unrelated to your device or even the Zigbee radio/mesh and they just happened to be front and center when the issue came up. :man_shrugging: