HTTP Switch channel simple 1 and 0 values

I’m stucked to setup a channel in an http bindings.
I have a query to an ESP8266 "http://ip/ledpower/get to update the status
It returns only 1 or 0 nothing more.

If I configure the channel in String, I get 1 or 0 as expected
I’ve succeded to setup a channel with a number too.

If I configure the channel witch Switch and the item Switch, I only get UNDEF, I’ve of course setup OnValue to 1 and OffValue to 0

In the log “Item ‘ESP_SalonArmoire_ESP_SalonArmoire_LED’ updated to UNDEF”

I can’t find where is the problem, any idea ?
Thanks

have a look at MAP Transformation and see if that is what you are trying to do.

It is located in the add-on store under other and transformation Add-ons can be configured either from UI or using a .map text file. You probably want to use the “usage as a profile” approach.

Take a look at this too: How to switch tasmota light bulb with HTTP - #6 by DaGeRe

It supports getting the ON/OFF state as well as sending ON/OFF commands.

Thanks,
adding a map display now ON or OFF and not UNDEF anymore.
I’m not sure to understand why, as I thought the transformation of the value was managed with “on Value” and “off Value”.

Anyway, the switch status is still not updated, while the String channel is updated.

What is strange maybe is that in the log, I can see the line for the string channel, but there’s no line for the switch channel

[openhab.event.ItemStateUpdatedEvent ] - Item ‘ESP_SalonArmoire_ESP_SalonArmoire_teststring’ updated to 1

Note that if I click on the switch in OpenHab (the item), the value goes in the ESP, the value displayed in OpenHab is correct (ON or OFF)
So the problem is only to get the status when the channel is a switch.

map:

key=value
1=ON
0=OFF
=default

David