This i am using to control the curtains and blinds.
It is possible to run a HTTP event. This controlls the devices, but there was no feed-back.
I made the script to go always back to channel 1 on the remote. So the starting point is always the same on the control.
I want to extend/modify the script.
When a channel is selected, there is a LED flashing. Each channel has it's own LED.
I connected LED channel 1 to A0 on my wemos D1. Without a formula, it changes from 1024 to 470 when LED is flashing.
The problem i have, is changing to the next channel in an event.
This script isn't doing what i like. First i switch gpio16, Than the channel LED is flashing, so i know which channel is selected.
But this changes to state of [test-chanel-1#Analog], but the event is not looking after it. When the event is done, than i see in the log that the value is changed.
Is there a way to read the changing value in an event? or is espeasy stopping whit looking to the A0 when running an event?
Code: Select all
On Test do
gpio,16,1 // Set relay ON to check channel state
delay 200 // Small delay
gpio,16,0 // Set relay OFF
if [test-channel-1#Analog]<500.0 do // Look at the state of A0, it is changed because of GPIO16 switched
gpio,16,1 // Set relay ON to go to the next channel
delay 200 // Small delay
gpio,16,0 // Set relay OFF
endif
endon
Code: Select all
On Test do
gpio,16,1 // Set relay ON to check channel state
delay 200 // Small delay
gpio,16,0 // Set relay OFF
endon
On test-channel-1#Analog do
if [test-channel-1#Analog]<500.0 do // Look at the state of A0, it is changed because of GPIO16 switched
gpio,16,1 // Set relay ON to go to the next channel
delay 200 // Small delay
gpio,16,0 // Set relay OFF
endif
endon