So iv’e been developing simple solar shade controls. I use a micro controller (wemos d1 mini) and some relays. Connection with Homey is done with Homeyduino.
I started of using actions and Virtual devices. And it is working well. But it takes alot of flows to set up just to get manual controls. So now i want to move on to using capabilities instead.
It is working well code wise. But as many others i have trouble getting some capabilities to show up on the device card. For example. I would like to have 2 sliders (Preferably on the same tab). One tab with a toggle button and one tab with different data showing. Like solar intensity and current solar intensity trigger point.
I get that it is a class-problem. Is there an easy way to make your own class. Or is there a class that can display the thins i want already?
Is there some way i can see what capabilites shows up with what classes?
It’s not a class problem. Each type of control always appears on the same tab so nothing to do there.
If you add new capabilities to the json file then you either need to remove and re-add the device or use the device.addCapability method, normally in the init device.
As i look under devices in Homey dev tools. It seems only one of two capabilities are added. No sure why.
This is how i added the capabilities. CondActions(); is called in setup.
void CondActions(){
Homey.addCapability("windowcoverings_set" ,Slider_vardagsrum);
Homey.addCapability("windowcoverings_set" ,Slider_balkong);
}
I have removed it from Homey each time i upload. I also tried restarting the Homeyduino App.
A device can only have one instance of a capability. If you want to “reuse” a capability you can use a sub-capability (I assume Homeyduino supports them, not sure though):
So, i know i have used sub-capabilities with Homeyduino before. With sensors the last time. It does not seem to work with sliders.
It did how ever dawn on me that there are different sliders. So a work around in this case. This worked and just as Adrian mentioned. A drop list apeared.
Thanks @robertklep, I was looking for the same solution.
Follow up question: Do you have any idea if I am able to name these sub-capability in Homeyduino?
I used the code: