`local MY_NUMERICAL_VARIABLES_SID = 'urn:my-numerical-variables'`

local HVACO_SID = 'urn:upnp-org:serviceId:HVAC_UserOperatingMode1'

local HVACO_DEVICE_ID = 11

luup.variable_watch( 'alphanumerical2numerical', HVACO_SID, nil, HVACO_DEVICE_ID )

function alphanumerical2numerical( lul_device, lul_service, lul_variable, lul_value_old, lul_value_new )

if ( lul_service == HVACO_SID ) and ( lul_variable == 'ModeStatus' )

then

if lul_value_new == 'HeatOn'

then

luup.variable_set( MY_NUMERICAL_VARIABLES_SID, tostring( lul_variable ) .. 'Numerical', '1', lul_device )

elseif lul_value_new == 'Off'

then

luup.variable_set( MY_NUMERICAL_VARIABLES_SID, tostring( lul_variable ) .. 'Numerical', '0', lul_device )

end

end

end