I have a similar problem with a driver with a LIGHT proxy binding (5001) and a network connection (6001). Everything works with commands, but I cannot update the user interface with state coming from the network connection...
The first "strange" thing is that the preview popup in Composer does not hilight buttons neither offers any interaction, differently from other lighting drivers (cfr screenshot). The driver comes from the SDK blind proxy template, modified to use the LIGHT proxy/class instead of BLIND; the original one, of course, works well...
When monitored inside a navigator, the corresponding item does not change aspect...
Essentially the driver must act as a ON/OFF light. This is the list of driver proxies...
<proxies qty="1">
<proxy proxybindingid="5001" primary="True">light</proxy>
</proxies>
... and connections:
<connections>
<connection>
<id>5001</id>
<facing>6</facing>
<connectionname>Light</connectionname>
<type>2</type>
<consumer>False</consumer>
<hidden>True</hidden>
<audiosource>False</audiosource>
<videosource>False</videosource>
<linelevel>False</linelevel>
<classes>
<class>
<classname>LIGHT</classname>
</class>
</classes>
</connection>
<connection>
<id>6001</id>
<facing>1</facing>
<connectionname>Commands</connectionname>
<type>4</type>
<consumer>true</consumer>
<audiosource>false</audiosource>
<videosource>false</videosource>
<linelevel>false</linelevel>
<classes>
<class>
<classname>TCP</classname>
<ports>
<port>
<number>1607</number>
<auto_connect>true</auto_connect>
<monitor_connection>true</monitor_connection>
<keep_connection>true</keep_connection>
</port>
</ports>
</class>
</classes>
</connection>
</connections>
Capabilities:
<capabilities>
<on_off>True</on_off>
<set_level>False</set_level>
<ramp_level>False</ramp_level>
<has_single_led>False</has_single_led>
<has_double_led>False</has_double_led>
<can_detach_buttons>False</can_detach_buttons>
<can_detach_led>False</can_detach_led>
<has_press_events>False</has_press_events>
<has_release_events>False</has_release_events>
<single_button>False</single_button>
<double_button>False</double_button>
<do_push>False</do_push>
<do_release>False</do_release>
</capabilities>
The following code is used to notify the proxy of status change:
function NOTIFY.LIGHT_LEVEL(bindingID, level)
LogTrace("NOTIFY.LIGHT_LEVEL(bindingID = %s, level = %s", bindingID, level)
--local tParams = {}
--tParams["LIGHT_LEVEL"] = level
--tParams["LEVEL"] = level
local sLevel = ""
if(level == 0) then
sLevel = "0"
else
sLevel = "100"
end
SendNotify("LIGHT_LEVEL", level, bindingID)
SendNotify("LEVEL", level, bindingID)
end
It calls the following function:
function SendNotify(notifyText, tParams, bindingID)
C4:SendToProxy(bindingID, notifyText, tParams)
end
Can anyone help me in solving the issue?
Thanks