HTTP Binding Tasmota 4-CH Device

Hi There,

I am trying to connect my Sonoff 4-CH Switch (running Tasmota Firmware) to my openHAB 4 Server.

If I do use these URL, I can user the Switch:

Status: http://10.1.1.147/cm?cmnd=Power2
ON: http://10.1.1.147/cm?cmnd=Power2%20ON
OFF: http://10.1.1.147/cm?cmnd=Power2%20OFF

My Things Config with Channel looks like:

UID: http:url:f26926a118
label: Terasse Licht
thingTypeUID: http:url
configuration:
  ignoreSSLErrors: false
  baseURL: http://10.1.1.147/cm?cmnd=Power2
  delay: 0
  stateMethod: GET
  refresh: 30
  commandMethod: GET
  timeout: 3000
  bufferSize: 2048
channels:
  - id: Power2
    channelTypeUID: http:switch
    label: Terasse Licht
    description: ""
    configuration:
      onValue: "%20ON"
      offValue: "%20OFF"
      escapedUrl: true 

I am adding an Item (type:switch), but I can not activate/deactivate the switch - nothing happens.
I’m sure I miss sth. but after 2h I really prefer to get in touch with the community :slight_smile:

appreciating your help

Hi, why are you using the http binding ? The “usual” way would have been either to use mqtt (which implies a mosquitto broker), flash the sonoff with esphome (and use the new esphome binding), or even use the sonoff firmware (there’s also a binding for that).

I had several problems with the http binding whenever I used “special” characters such as %, so I’m using the SmartHome J/HTTP Binding instead.

Right now there is the Tasmota Plug binding but it currently supports only one channel. I think it could extended to 4 channels.

Thanks, I was not aware of this binding. But I prefer to have the web interface disabled which rules out http commands. And when I enable web interface it is protected by userid:password

Just a suggestion, you may add pulsetime support to your binding.

The marketplace binding was updated to support channels 2,3 & 4.

Wow guys - you are amazing.

Actually I was not successfull with mqtt (mosquitto was working with device - tested with mqtt explorer).
But I was not able to find the correct config within openhab.

I will check the plugin in marketplace by next week And will Come back with a Resultat.

@mlobstein: Great job!

as there is no kudos without a question mark: :wink:

Maybe you are also able to expand that binding to read also other (mostly) values from Tasmota like temperature, pressure a.s.o. ???
I run a LOT of Tasmota-Stuff here, which not only have switches, but also provide other information and I would love to have them integrated without MQTT.

The issue might be, that it be not easy, as one do not really know, what kind of data is provided. I even do not know (as I´m not a coder), whether it is possible to get the data via the api (and how). Nevertheless, as said, I run a lot of them and can help with testing and proves.

Good idea. The only issue I see is that there are many different types of data provided depending on the device. On mine it provides energy usage information:

I will look into it to see what is possible.
@moody_blue I have added username/password support to the marketplace binding.

the plugin from marketplace works like a charm - many thanks for this!