Is it possible to make a Group Item with a base type of Dimmer return an Integer from any of the Functions? Alternatively is there a way to make a Sitemap Switch mapping match both 0 and 0.00000000?
I have a group item of base type Dimmer with my lights color items called gFamilyRoom_Lights.
In my sitemap I have:
This makes a nice button to turn On, Off, or set to a predefined dim level all in one line. The problem is since gFamilyRoom_Lights value is a decimal the sitemap won’t show the current state. Luckily at least the light icon will change based on the value of the lights. But it is confusing when looking at the sitemap when a Dimmer item will have On or Off highlighted, but if it is a group of Dimmers it won’t.
In my sitemap. Seems to give me the desired effect. Just a bit more overhead than I was hoping for.
Edit:
postUpdateCheckFirst() wasn’t working for me because of the parallel nature of events. Switched it to events.postUpdate() instead. Also made a group for proxies and proxied items so I could clean up my rule to just:
from core.rules import rule
from core.triggers import when
from core.utils import sendCommandCheckFirst, postUpdateCheckFirst
@rule("Proxies Group received command")
@when("Member of gProxies received command")
def proxy(event):
sendCommandCheckFirst(str(event.itemName)[6:], str(event.itemCommand))
@rule("Proxied Group Changed")
@when("Member of gProxied changed")
def bound(event):
events.postUpdate("proxy_" + str(event.itemName), str(int(event.itemState.floatValue())))