Im successfully using the following, to populate a list of items as switches. This works great but if you want to use a Dimmer, which also has an ON/OFF, effectively still a switch, the code fails.
<div class="widget" ng-if="item.type=='Dimmer' && itemValue(item.name)=='OFF'" ng-click="sendCmd(item.name, 'ON')">
if I replace Dimmer, with Switch and change the item type it works.
@ysc any suggestions?
Just a guess here but have you tried a value of 0 instead of OFF. If I’m right dimmer items can accept ON or Off as commands but interpret them as 100 or 0. So 0 might be the State value the RestApi gives you for a switched off dimmer and you have to use that to check.
Best regards Johannes
I havent, but i will. Its not so much the command doesnt work, its the code doesnt even display the item.
EDIT: that doesnt work either. Its almost as if it doesnt understand the item type
Looks like dimmer is not a supported type in Habpanel. But have a look here:
Most of my lights are on dimmers, so would like to use this to display all of the Dimmer items, however, Dimmer is not a supported type. Also interested in showing groups of type Contact to cover doors and windows. Any plans to add? Thank you.
Update: I have been able to add Dimmer and Contact type support to the widget. For simplicity, I made Dimmer just like Switch - on/off only.
<div style="height:30px;"><label cla…
Thanks Johannes! Looks like he’s managed to get something to work using 0/100 like you’d mentioned. Hm