espeasy pir/ldr/rgb finds new home

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
r_255
Normal user
Posts: 32
Joined: 20 Nov 2015, 20:42

espeasy pir/ldr/rgb finds new home

#1 Post by r_255 » 05 Mar 2016, 23:32

easypir.jpg
easypir.jpg (130.02 KiB) Viewed 9302 times
Today i did reinstall my milling machine and decided to take one espeasy project of the bench and mill a case for it.
Esp Witty and a cheap pir sensor, 3 pins 5v vcc, gnd and a signal pin that gives 3v on movement and 0v if there is none.

Fun thing of the esp Witty is the already installed ldr, and the rgb led that could be useful in this case.
As i would like the rgb led switch to red incase of movement, and back to 0 if there is none.

Ofcourse i could do that in domoticz, but i guess... having control from you ha software to swich a led red makes no sence.
So i am trying to find the option that could set

http://192.168.1.202/control?cmd=PWM,15,0 if gpio 5 is 0
http://192.168.1.202/control?cmd=PWM,15,255 if gpio 5 is 1

i did see something about rules, and tried something with the plugin that can launch a action based on a gpio state, but i am kind of confused
as i saw something about level command but cant understand where to set the http command. Also saw and example of some kind of scripting
with a servo motor.

a gentle push in the right direction would be welcome.
:D

User avatar
costo
Normal user
Posts: 500
Joined: 21 Nov 2015, 15:03
Location: NL, zw-NB

Re: espeasy pir/ldr/rgb finds new home

#2 Post by costo » 06 Mar 2016, 02:54

ESPEasy is really just a device that sends values from sensors, connected to inputs, to a server.
Outputting data on ESP-pins is only limited implemented.
From a server or browser you have a few html commands to manipulate outputs.
(GPIO, PWM, Pulse and Servo are the implemented commands)
I think what you want can only be done over a server like domoticz.

On the other hand you can use the level control to switch an output ON or OFF.
When Device Settings are like this:

PIR sensor:
Device: Switch input
1st GPIO: GPIO-5
Inversed: box active.
Switch type: Switch
Switch Button Type: Normal Switch.

Device: Level Control
1st GPIO: GPIO-15
Check Task: 1 - Switch input -
Check Value: Switch
Set Value: 1.00
Hysteresis: 0.00

That will turn the red LED ON when the PIR output gets HIGH and turn LED OFF when PIR output gets LOW.

r_255
Normal user
Posts: 32
Joined: 20 Nov 2015, 20:42

Re: espeasy pir/ldr/rgb finds new home

#3 Post by r_255 » 06 Mar 2016, 07:41

Hi Costo, Thanks for the reply!

I did try the level control, but just setting gpio 15 high does not do the job and there is no red or green light ;o)
Domoticz, on and off http command works fine and led gets red on motion.

But i guess it would be perfect to make the call internal on the esp, as this is just a local device status and isnt that important for
home automation purpose. Just to keep things clean it would be great to keep things local.

I guess if i could set not only GPIO in Levelcontol, but also PWM and a value this could work. ( this led needs pwm )
but sofar i am limited to GPIO only.

Happy anyway with espeasy

r_255
Normal user
Posts: 32
Joined: 20 Nov 2015, 20:42

Re: espeasy pir/ldr/rgb finds new home

#4 Post by r_255 » 06 Mar 2016, 22:38

V2 is done....
making progress to water tight for outdoor usage.

https://plus.google.com/+RobinFrantzen/ ... tz8dbDncAX

Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests