HTTP binding error UNDEF status switch

Hi i have an error of status switch, the result is UNDEF
The thing at the request reply me 0 or 1, and in the JS a transform in ON or OFF.
I created a second Channel to only read the status and we work correctly.
where is my error?

Thing

UID: http:url:RadianteWc23p
label: Radiante Bagno Ospiti 23p
thingTypeUID: http:url
configuration:
  authMode: BASIC
  ignoreSSLErrors: false
  baseURL: http://url/ApiService/v3/
  delay: 0
  stateMethod: GET
  refresh: 5
  commandMethod: POST
  contentType: application/json
  timeout: 3000
  bufferSize: 2048
channels:
  - id: TemperaturaAmbienteWC23
    channelTypeUID: http:string
    label: Radiante WC 23p - Temperatura Ambiente
    description: null
    configuration:
      mode: READONLY
      stateExtension: getStatus?username=lli&userpass=Lli&1=BB-01-TERM3
  - id: RadianteWc23pSwitch
    channelTypeUID: http:string
    label: Radiante Bagno Ospiti 23p - Switch
    description: ""
    configuration:
      onValue: '{"setGuestFan":1}'
      mode: WRITEONLY
      offValue: '{"setGuestFan":0}'
      stateExtension: getStatus?username=lli&userpass=Lli&p1=BB-01-TERM3
      commandExtension: sendDeviceCommand?username=liguori&userpass=Liguori&device=BB-01-TERM3&commands=%2$s
  - id: test
    channelTypeUID: http:string
    label: test
    description: ""
    configuration:
      mode: READONLY
      stateExtension: getStatus?username=lli&userpass=Lli&p1=BB-01-TERM3

md-readCurrentFan.js

(function(val){
    var n = JSON.parse(val).value[0][2];
    var m = JSON.parse(n).setGuestFan;
    var reply = "";
    if (m == "1") reply = "ON";
    if (m == "0") reply = "OFF";
    return reply;
})(input);

Item switch is set
Profile: JS
Javascript filename: md-readCurrentFan.js

The JS Transformation add-on is installed?

What do you see in the logs?

None of your channels reference your JS; is there some other hidden configuration (e.g. a profile?)

Yes, the JS transformation is installed. I have other component and we function correctly.

this is the log
WARN, iles.javascriptTransformationProfile - Could not transform state ‘UNDEF’ with function ‘md-readCurrentFan.js’ and format ‘%s’

I solved, i modify the js in

(function(val){
    var n = JSON.parse(val).value[0][2];
    return JSON.parse(n).setGuestFan;
})(input);

and i set the value of a ON e OFF in 1 and 0 with a modify of commandExtension, without a MAP file.

UID: http:url:RadianteWc23p
label: Radiante Bagno Ospiti 23p
thingTypeUID: http:url
configuration:
  authMode: BASIC
  ignoreSSLErrors: false
  baseURL: http://url/ApiService/v3/
  delay: 0
  stateMethod: POST
  refresh: 5
  commandMethod: POST
  contentType: application/json
  timeout: 3000
  bufferSize: 2048
channels:
  - id: TemperaturaAmbienteWC23
    channelTypeUID: http:string
    label: Radiante WC 23p - Temperatura Ambiente
    description: null
    configuration:
      mode: READONLY
      stateExtension: getStatus?username=lli&userpass=Lli&p1=BB-01-TERM3
  - id: RadianteSwitch
    channelTypeUID: http:switch
    label: Radiante23pSwitch
    description: ""
    configuration:
      onValue: "1"
      mode: READWRITE
      offValue: "0"
      stateExtension: getStatus?username=lli&userpass=Lli&p1=BB-01-TERM3
      commandExtension: sendDeviceCommand?username=liguori&userpass=Liguori&device=BB-01-TERM3&commands={"setGuestFan":%2$s}
      stateTransformation: JS:md-readCurrentFan.js

And i modify the item