sonoff to transmit to a receiving sonoff, blue iris camera software.

243 views
Skip to first unread message

peter zwag

unread,
Aug 3, 2018, 8:51:40 PM8/3/18
to SonoffUsers

I am very new to sonoff so need to know where to start.
I like the ewelink app, but there is no support for a PC to drive the app.

There are 3 tasks I want done.
1) A switch to talk to a sonoff(A), then that sonoff(A) to turn a mains light on for two minutes on sonoff(b) (infrared beam switch)
2) A pc (blue iris camera software) to turn on the same sonoff(b) mains spot light.
3) The sonoff (a) to talk to the pc

Basically the camera or driveway beam broken should turn the spot light on.
The drive way been should trigger the camera.


I am time poor and want the fastest solution time wise.
I have the 433 mhz bridge, sonoff development board and some sonoff mains switches.
Peter

Philip Knowles

unread,
Aug 4, 2018, 1:57:32 AM8/4/18
to peter zwag, SonoffUsers

I'm sorry but this type of question annoys me. We're ALL time poor but you expect us to research all this for you without giving us a lot of information.
How far is it from the beam to Sonoff B?
If the beam is mains powered, why can't you run an extra core to the beam (so that the light or Sonoff B can be triggered direct)?
What output does BlueIris software give?
Is the PC on all the time and what OS is it running?
Sonoffs are quite powerful but you're asking a lot without using external intelligence (the PC). If you move away from EweLink you're almost certainly going to have to set up an MQTT broker and something like openHAB. openHAB has got a lot simpler with the Rules Engine but you will need to spend time setting it up. openHAB can probably do what you want to do (it can receive the camera signal, dispay it and control the cameras) without using BlueIris but you'll need to spend time on it. There's an oldish post https://community.openhab.org/t/blue-iris-integration-http-binding-rest-api/10838 on how to integrate BlueIris with openHAB.
Help us to help you.

Regards

Phil K


On Aug 4, 2018 1:51 AM, "peter zwag" <pete...@gmail.com> wrote:

...

Philip Knowles

unread,
Aug 4, 2018, 1:56:17 PM8/4/18
to SonoffUsers

That helps. So the beam runs off 12V and gives you a volt-free contact? You can then connect that directly to a GPIO on a Sonoff (no need for Sonoff A). If you flash the Sonoff with Tasmota you can then create a Rule which says turn on light for 2 minutes when GPIO is triggered. You can then create an HTTP post in BlueIris which tells the same Sonoff to turn on when Blue Iris is triggered http://192.168.0.xxx/cm?cmnd=Backlog%20Power1%20On;%20Delay%20120;Power1%20Off. Again that will turn on the light for 2 minutes.

If you have a Sonoff TH10 you can connect the beam via the temperature jack socket (2.5mm 4 pole) between ring2 and the tip (https://github.com/arendst/Sonoff-Tasmota/wiki/GPIO-Locations) which will ground GPIO14 when the beam is operated. In the module configuration select Switch for GPIO14.

 

Hope that helps

 

Phil K

 

 

Sent from Mail for Windows 10

 

From: peter zwag
Sent: 04 August 2018 07:11
To: Philip Knowles
Subject: Re: sonoff to transmit to a receiving sonoff, blue iris camerasoftware.

 

Hi Philip,

thank you so much for the reply

Sorry if my question annoyed, but the time poor implies not keen to go complex and powerfull solutiions if a simple one will do.

The beam is 10 meters from sonoffB, and its run via at cat5 cable with 12 volt supply. Relay not designed for 240 volts

Im not sure how to run a sonoff th12 for example to trigger off a switch from the beam.

to use a 12 volt relay to mains is not legal for me to wire.

blue iris can run exe and or do http / https. Likely I can get any exe that needs be written via a programer

pc on all the time. windows 7

I have seen the sonoff can be driven by http://ip/turnonlight etc and that could be 1/2 the requirement.

What I dont know is how one sonoff can drive another in this mode.

If this can be done, it will save be mqtt and openhab etc. I know nothing about these yet, so trying to avoid going down this path if the simple path will don

Thanks for the blue iris link.

Peter

 

 




--

Thanks
Peter Zwag
pe...@zwag.id.au

 

 

Phil

unread,
Aug 5, 2018, 2:23:09 PM8/5/18
to SonoffUsers

for the camera to trigger something should be fairly straight forward,

As you know you NEED a mqtt broker to facilitate communication between your sonoffs and controls  so if you host that on the same puter running your camera s/w all your camara s/w need do is publish the relevant mqtt topic/payload which you can set/read from the sonoff web ui. (hint POWER1 ON/OFF/Toggle or 1/2/3- see the wiki commands page)
afaik most of us use a pi or similar to host our mqtt brokers and the web is full of walkthroughs and tests if as i suspect your on windows with the camera sw.. 

a 12v control/sensor circuit attached directly to the sonoffs 3.3v gpio pins would not be a good idea.  at the bare minimum a voltage divider circuit to minimise the voltage to the sonoff to 3.3v would be needed and i am wading out of my comfort zone now..  for an off the shelf plug/solder n go option a 12v to 3.3v logic level converter may suite but it depends on the power of your 12v signal??
 



Philip Knowles

unread,
Aug 5, 2018, 5:38:32 PM8/5/18
to Phil, SonoffUsers

Not wanting to contradict but you don't need MQTT to send information TO the Sonoff only FROM the Sonoff. You can send all the commands via http so he can create a http post from BlueIris to control the Sonoff and, provided there is a volt-free contact from the beam, he can use GPIO to trigger a rule to control it from there.

Regards

Phil K


--
You received this message because you are subscribed to the Google Groups "SonoffUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Phil

unread,
Aug 5, 2018, 6:36:43 PM8/5/18
to SonoffUsers
As always im happy to be corrected, and your right of course, mqtt is the preferred method of communication but not the only method..
I eeven went so far as to use caps for the word NEED!! ho hum..
A case of being too close to the trees this end perhaps.

however i think most would agree if a computer is already running 24/7 hosting camera s/w letting it also host a mqtt broker would probably be the best solution. 
Its a nominal if any overhead, and especially when attempting the first few commands via mqtt the ability to subsctrbe with wildcards and see everything published highlights typos and silly errors within seconds.. 





To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages