so i revisited a little project i started a few weeks ago but never got around to finish, which was to create a Contact/Motion/Temp combined sensor using the Fibaro Universal Sensor, the sensors used were a Reed contact sensor, a HC-SR501 PIR Motion Sensor & a DS18B20 Temperature Sensor
I had a hell of time getting anything more than the contact sensor registering anything. the first reason was that unless the Temp Sensor is installed and wired up before you include the sensor in the zwave network it will not work until the device is excluded and included again…this point stated in the smallest print imaginable is in the manual but i am a bloke i don’t read manuals until i am forced.
as for the PIR, i was trying to attach the PIR’s output pin direct to IN2 and configuring the IN2 fuction to monostable but this didn’t work and that is because the PIR emits low at 0v when idle and 3.3v when motion is detected, it turns out the fibaro wont read any voltage on the input at all, so i had to put in a BC549C transistor to emulate a switch. which switch on the switch when the base leg is triggered by the 3.3v high state.
and here is the very nearly final fitted solution, the PIR dome needs to be glued on the front and the double sided tape holding it at the moment will need to be removed (i just didn’t have any suitable glue to hand.)
Just looking at this myself - I have wired IN1 to a door relay, which when open only returns 3V, and this doesn’t seem to be showing up as a change of state on the binary sensor. Can you explain to me how you managed to get that to register? Not sure I understand about the fact that the sensor doesn’t read voltage?
dont worry if it outputs 3v when open, then the binary sensor will absolutely not read this…it took me ages to figure out, it essentially just detects resistance across the IN1 circuit. if there is voltage this absolutely will not work, it took me weeks to figure it out. with 3v you can use the same transistor as i have used. just connect the output from the panel to the base leg. the IN1 to the emitter leg and ground to the negative. the transistor will then act as a switch and will close when the voltage is applied to the base leg. the UBS will then pick up the transistor status fine.
Wow. Wishing I’d paid more attention in electronics now. I’m struggling to get my head around this one.
So it can’t detect a positive voltage on in1 but if there’s a transistor with the emitter connected to in1 it can. Where/how, therefore, is the in1 circuit completed? And what is the resistance that it’s measuring? If the door relay (connected to base) is at 0v then the transistor switch closes and no voltage into in1. If 3V on base, the emitter is at +3v (?) so the in1 is at +3V. Can’t see a difference, but I think that’s because I have some fundamental gaps in my knowledge of the basics!
Is the second ground (the penultimate wire) used at all?
Also should the Ubs wired in series in the door sensor wiring or can it just be across the terminals of my alarm panel?
Thanks for the quick response and sorry for the total noob questions!
look here for info using a transistor as a switch, the voltage applied to the base leg of a BC549C transistor will not pass to the emitter only the voltage if any applied to the collector will pass to the emitter only when voltage is applied to the base leg. therefore acting as a switch. just as if you put a push button switch attached to IN1 and Ground, the UBS will sense this fine, as there is no voltage applied to the collector in this case, the sensor can sense the difference between an open and closed circuit with no voltage across the circuit.
try it i guarantee this will work as its the same principle as my PIR motion sensor which outputs 0v when no motion and 3.3v when there is motion. wiring this directly to IN1 did not work at all. but when i wired up to the transistor to use as a switch of sorts, bingo i got the correlating state
I have found that the switch will trigger in ST if I connect the IN1 or IN2 to ground.
so I connected the transister up as you suggested, but with the input voltage (+12V in this case, from a cell) connected to base, I found that I had to connect the collector to ground and the emitter to IN1 for it to do anything. nevertheless this seemed to work.
i then wired it all up, and put it inside the alarm panel itself. In the alarm panel is a +12 terminal which denotes set/unset, so I thought that would be a good start. I connected that terminal to the base, and the IN1 to the collector, and the emitter to ground. this seemed to be ok for one of the circuits, but not the other. I removed it all again, and now I can’t get anything to work at all. I suspect I may have blown the transistors by wiring them up wrong, or to a too-large power supply.
I don’t know enough about transistors to know whether I’ve blown it (or at least my bench setup is pretty minimal) so I’m kind of back to square one.
Incidentally, I tried to connect the base to one of the NC terminals of the motion sensor and it did absolutely nothing. I wasn’t too sure why I as had detected +2.54V with a multimeter, which went to 0 when the contact was broken. but then the transistor could have been broken by that point anyway!
all very very frustrating - I thought this UBS was supposed to be clever!
yes its likely you will have blown the transistors, those particular transistors accept only up to 5v on the base leg. as you said it was only 3v output i presumed you would be ok. for 12v you would need to find one that would work, the ratings for transistors are for both Voltage and Current so you will need to properly asses the spec sheet of a transistor.
I have made some progress and now I have worked out how to display each of the four temp readings in different tiles. I am taking the parameter data from the multichannel command line and converting it manually rather than using the sensor command which has no way of working out which end point it comes from.
The problem now though is that the device only shows in CoRE and elsewhere that it has one temperature capability rather than four ie I want to be able to use the data of all four sensors to feed a smartapp rather than just one sensor.
I’ll get there eventually but if anyone has any bright ideas, they would be gratefully received!
As I understand it you need to get the app to mirror the data to a simulated temperature sensor, since for most apps they can only see the first sensor for each device. This is also true of the actual contact sensors in this device - you have to have two simulated contact sensors in order to be able to reference them in other code.
Thanks - Is this the same as using virtual devices?
If I use a smartapp to populate the simulated device, how do I get the end point data across? Ie don’t I still have to use capability again which takes me back to square one or is there some other clever way?