Control Homeyduinio device without flow charts?

I want to control my curtains remotely. The hardware part is almost done. It consist out of a nodemcu, Hbridge motor controller, optical sensor (to count the motor rotations) and a geared down motor connected to the curtains. Hardware-wise it works. Now I need to create the software.

I want to access it on the devices tab, and adjust a percentage (just like controlling a light brightness) that correspond with the position of the blinds (0% fully open, 100% fully closed). Anyhow, playing a bit with the library, I think access to the attributes of the device is only available inside the flow charts? Am I correct?

Do I need to connect it through a virtual device which is linked through flows, or is there a direct way?

I would think that it should work if you give your device the class curtain, and use the windowcoverings_set capability to set its position.

Something like this:

Homey.setClass("curtain");
Homey.addCapability("windowcoverings_set");
...
Homey.setCapabilityValue("windowcoverings_set", position);

However, I haven’t done anything with Homeyduino for a while, nor do I have controlled curtains, so not sure if those will be shown in the devices tab as you wish. If not, a (rather crude) fallback could be to use class light and capability dim (which also is a percentage).

1 Like

Excellent! it works perfectly. Thanks Robert

1 Like