blind percentage position
Posted: Tuesday 02 October 2018 11:07
hi, i have an nodemcu where i flash espeasy and i connect 2 relays for my blind: 1relay to UP, and 1relay to DOWN
i have also connect 2 wall switch: 1 switch UP 1switch DOWN
in EspEasy rules i create a rule to identify short press or longpress (pression >= 4seconds of wall swith)
if i use shorpres the corrisponding relay is active for 1sec. if i use longpress the corresponding relay is acrived for 46sec. (46sec. = time to all open or all close the blind)
domoticz is ablo to recognize the moviment UP or DOWN if i use wall switch thanks to command inside domoticz blind switch:
http://192.168.0.154/control?cmd=event, ... N_domoticz
http://192.168.0.154/control?cmd=event, ... P_domoticz
now i want to recognize the position of the blind i have in mind to monitoring the seconds, starting from the activation of the switch. for example the idea is:
starting from all close -> i longress UP on wall swith (relay start to UP with a time of 46sec) -> after 15sec i want to stop my blind i press DOWN shortpress on the wall switch and the blind stop in that position that i choose -> script in domoticz should have counting this 15sec passed and give to domoticz that result: (15sec / 46sec ) * 100= 36% and show on the blind with percentage open 36%
if i use a shortpress wall switch -> i will activate the relay for 1sec -> send to domoticz the value 1sec -> domoticz calcolate (1sec / 46 sec) * 100 = 2% open
if i use again a shorpress from wall swith -> domoticz activate the relay for 1sec -> domoticz calcolate (1sec / 46 sec) * 100 = 2% open + 2% of previous position = 4%open
how i can implement that?
i have also connect 2 wall switch: 1 switch UP 1switch DOWN
in EspEasy rules i create a rule to identify short press or longpress (pression >= 4seconds of wall swith)
if i use shorpres the corrisponding relay is active for 1sec. if i use longpress the corresponding relay is acrived for 46sec. (46sec. = time to all open or all close the blind)
domoticz is ablo to recognize the moviment UP or DOWN if i use wall switch thanks to command inside domoticz blind switch:
http://192.168.0.154/control?cmd=event, ... N_domoticz
http://192.168.0.154/control?cmd=event, ... P_domoticz
now i want to recognize the position of the blind i have in mind to monitoring the seconds, starting from the activation of the switch. for example the idea is:
starting from all close -> i longress UP on wall swith (relay start to UP with a time of 46sec) -> after 15sec i want to stop my blind i press DOWN shortpress on the wall switch and the blind stop in that position that i choose -> script in domoticz should have counting this 15sec passed and give to domoticz that result: (15sec / 46sec ) * 100= 36% and show on the blind with percentage open 36%
if i use a shortpress wall switch -> i will activate the relay for 1sec -> send to domoticz the value 1sec -> domoticz calcolate (1sec / 46 sec) * 100 = 2% open
if i use again a shorpress from wall swith -> domoticz activate the relay for 1sec -> domoticz calcolate (1sec / 46 sec) * 100 = 2% open + 2% of previous position = 4%open
how i can implement that?