i need help to make a simple switch. I am not a developer so I ask for help too.
I converted an IKEA PS 2014 hanging lamp from manual to automatic operation.
A Pi Zero and a “simple” script that enables the lamp to be controlled via the REST API are used for control.
With curl 0.0.0.0:5000/open and with curl 0.0.0.0:5000/close, I can open and close the lamp from the openHAB.
And now the question comes: How do I build the switch? Sorry for the question, I can only assemble everything, but I have no idea about programming.
Exactly. Write two hash scripts: one contains curl 0.0.0.0:5000/open and the other one curl 0.0.0.0:5000/close. Give permissions to the user openhab so it can execute them with sudo chmod a+x script1.sh script2.sh and then integrate them into openhab with the exec binding. Make sure to not forget the exec.whitelist!
The opening and closing is controlled by a stepper motor if that’s what you mean.
Gradually opening the lampshade would be the next step.
But now I need a simple switch that opens and closes the lamp.
The difficulty here is to build the switch in such a way that when I press the switch on the cell phone the lamp goes on and when I press it again the lamp goes back on.
Theoretically a very simple on / off switch, but I have absolutely no idea how to build this switch so that it works and not when I press the switch again and the switch opens again. Then the lamp is rubbish.