Hi Guys,
I am moving the control of an air-to-air heatpump from an RM rule to an app. The purpose of the rule/app is to automatically control the heat pump. In adittion to the automatic rules I also have created a dashboard with some buttons to control the heat pump. The purpose of the dashboard is to be able to override the automatic rules and change the settings on the heat pump manually. The tiles in the dashbaord are pointing to one virtual devices each, which represents a command, for instance 'TurnHeatPumpON'.
To make the script aware of what the dashboard does I want to subscribe to the events created by the virtual devices behind the dashboard buttons/tiles.
So I tried the following coding for that to happen, but the app is not picking up the events.
What am I missing?
Cheers,
def initialize() {
log.info "Initializing"
// - Subscribe to dashboard remote control buttons
subscribe(location.TurnHeatPumpON, "pushed", dashboardHeatPumpON_Handler)
subscribe(location.TurnHeatPumpOFF, "pushed", dashboardHeatPumpOFF_Handler)
}
// ------------------ Handler for incomming dashboard heat pump ON events --------------------------------------------------------------
//
def dashboardHeatPumpON_Handler(evt) {
log.info "Dashboard event handler: New event received: ${evt.value} from ${evt.device}"
currentPowerStatusV = evt.value
state.currentPowerStatusV = currentPowerStatusV
log.debug "Dashboard event handler: Button pressed, new Power status value: ${state.currentPowerStatusV}"
}
// ------------------ Handler for incomming dashboard heat pump OFF events --------------------------------------------------------------
//
def dashboardHeatPumpOFF_Handler(evt) {
log.info "Dashboard event handler: New event received: ${evt.value} from ${evt.device}"
currentPowerStatusV = evt.value
state.currentPowerStatusV = currentPowerStatusV
log.debug "Dashboard event handler: Button pressed, new Power status value: ${state.currentPowerStatusV}"
}
Log file example from the virtual device representing the turn on the heat pump command: