Ecoforest pellet stove

I have OpenHAB 2.5 installed in a QNAP NAS (from here). It’s a brand new installation, I am new to OH2, and also new to domotic. My house has several devices that can be managed by OH2 through existing bindings.

I would like to manage my Ecoforest pellet stove as well. The problem is that I did not find any binding to do it, so I’m evaluating the possibility to develop something. I can login to the QNAP using putty and give curl -k -X commands to either check the stove status, or start/stop/change parameters, but I don’t know how to do it in OH.

For example, to change the desired room temperature:

curl -k -X POST -d "idOperacion=1019&temperatura=20.0" "https://userid:pw@10.100.10.200:8000/recepcion_datos_4.cgi"

To check status:

curl -k -X POST -d "idOperacion=1002" "https://userid:pw@10.100.10.200:8000/recepcion_datos_4.cgi"

returns several parameters that need to be parsed:

error_MODO_on_off=0
on_off=0
modo_operacion=1
modo_func=1
estado=0
consigna_potencia=1
consigna_temperatura=20.0
temperatura=17.4
temperatura_ext=---.-

Note the -k parameter. I have to use it to disable trusted certificate checking.

Is it possible to integrate this stove in OH2 ? How ? I would like to have a working sample for a device that operates in a similar way so that I can change it for my case.

Thanks in advance.

Have you considered creating a rule and some proxy items for your stove, as you seem to have the commands needed?

Maybe the http binding: https://www.openhab.org/v2.5/addons/bindings/http1/

Thank you very much for your answer,

Do you mean something like this ?

Before starting this thread I’ve tried the HTTP binding. Unfortunately some examples are obsolete (http://weather.yahooapis.com no longer exists), there are no examples to parse the status info collected with the POST method and last, but not the least, when I’ve tried this binding to issue a change temperature command it failed because the certificate could not be trusted (and I don’t know how to bypass this check). So I felt completly lost.

Furthermore I don’t know if this binding is the correct one to use for this purpose.

You could use the exec binding, to submit the curl commands.

1 Like

As @Maurits28 mentioned you can use the exec binding for curl. Thanks Maurits as I could not, for some reason, remember the correct binding for curl.:upside_down_face:

1 Like

Thank you both.

No worries, enjoy tinkering!

Here is a simple setup to manage an Ecoforest pellet stove. Requires exec and RegEx add-on’s. Can be easily expanded to support more functions and other Ecoforest models.

Tested in OH2 and OH3 with the Cordoba model.

Replace <userid>:<password>@<ip> with your own data.

ecoforest.things

//
// Stove
//

// "%2$s" will be replace by the input channel command, this makes it possible to use one command line with different arguments.
Thing exec:command:MyEcoComm "Stove command" [command="curl -s -k -X POST -d \"%2$s\" https://<userid>:<password>@<ip>:8000/recepcion_datos_4.cgi", interval=0, autorun=true]
Thing exec:command:MyEcoStat "Stove state" [command="curl -s -k -X POST -d \"idOperacion=1002\" https://<userid>:<password>@<ip>:8000/recepcion_datos_4.cgi", interval=60, transform="REGEX(.*estado=(.*?).consi.*)"]
Thing exec:command:MyEcoTemp "Stove ambient temperature" [command="curl -s -k -X POST -d \"idOperacion=1002\" https://<userid>:<password>@<ip>:8000/recepcion_datos_4.cgi", interval=60, transform="REGEX(.*temperatura=(.*?).temper.*)"]

exec.whitelist

# For security reasons all commands that are used by the exec binding or transformation need to be whitelisted.
# Every command needs to be listed on a separate line below.
curl -s -k -X POST -d "%2$s" https://<userid>:<password>@<ip>:8000/recepcion_datos_4.cgi
curl -s -k -X POST -d "idOperacion=1002" https://<userid>:<password>@<ip>:8000/recepcion_datos_4.cgi

ecoforest.items

//
// Stove
//

Switch GF_LivingDining_Stove "Lareira" <fire> (GF_LivingDining)
String GF_LivingDining_Stove_Stat "Estado" <heating> {channel="exec:command:MyEcoStat:output"}
Number GF_LivingDining_Stove_Temperature "Temperatura [%.1f ºC]" <temperature> {channel="exec:command:MyEcoTemp:output"}

Switch GF_LivingDining_Stove_Run {channel="exec:command:MyEcoComm:run", autoupdate="false"}
String GF_LivingDining_Stove_Args "Comando" {channel="exec:command:MyEcoComm:input"}

ecoforest.rules

rule "Stove switch on"
when
   Item GF_LivingDining_Stove changed to ON
then
	if (GF_LivingDining_Stove_Stat.state == "0"){
		GF_LivingDining_Stove_Args.sendCommand("idOperacion=1013&on_off=1")
	}
end

rule "Stove switch off"
when
   Item GF_LivingDining_Stove changed from ON to OFF
then
	if (GF_LivingDining_Stove_Stat.state == "7"){
		GF_LivingDining_Stove_Args.sendCommand("idOperacion=1013&on_off=0")
	}
end

rule "Update stove status"
when
	Item GF_LivingDining_Stove_Stat changed
then
	// Stove can also be managed by other tools, let's update OpenHAB accordingly
	if (GF_LivingDining_Stove_Stat.state == "0" && GF_LivingDining_Stove.state != OFF){
		// Stove has been switched off
		GF_LivingDining_Stove.sendCommand(OFF)
	} else if (GF_LivingDining_Stove_Stat.state == "7" && GF_LivingDining_Stove.state != ON){
		// Stove has been switched on
		GF_LivingDining_Stove.sendCommand(ON)
	}
end

A much better solution, now that HTTP binding for OH3 supports POST commands to read status, is:

Thing

UID: http:url:e5a14ec3b0
label: Lareira
thingTypeUID: http:url
configuration:
  authMode: BASIC
  ignoreSSLErrors: true
  password: ******
  baseURL: https://192.168.129.10:8000/recepcion_datos_4.cgi
  delay: 0
  stateMethod: POST
  refresh: 30
  commandMethod: POST
  contentType: text/plain
  timeout: 3000
  username: ******
  bufferSize: 2048
channels:
  - id: switch
    channelTypeUID: http:switch
    label: Switch
    description: ""
    configuration:
      onValue: "1"
      mode: READWRITE
      stateContent: idOperacion=1002
      commandTransformation: JS:cmdEcoforestSwitch.js
      offValue: "0"
      stateTransformation: JS:getEcoforestSwitch.js
  - id: temp
    channelTypeUID: http:string
    label: Temperature
    description: null
    configuration:
      mode: READONLY
      stateTransformation: JS:getEcoforestTemp.js
      stateContent: idOperacion=1002
  - id: stat
    channelTypeUID: http:string
    label: Status
    description: null
    configuration:
      mode: READONLY
      stateTransformation: JS:getEcoforestStat.js
      stateContent: idOperacion=1002
  - id: temp_obj
    channelTypeUID: http:string
    label: Set Temperature
    description: null
    configuration:
      mode: READWRITE
      stateContent: idOperacion=1002
      commandTransformation: JS:cmdEcoforestTempObj.js
      stateTransformation: JS:getEcoforestTempObj.js
  - id: alarm
    channelTypeUID: http:string
    label: Alarm
    description: null
    configuration:
      mode: READONLY
      stateTransformation: JS:getEcoforestAlarm.js
      stateContent: idOperacion=1079

Rename the following file to .zip and unzip to the conf/transform folder
EcoForest.txt (1.6 KB)

And then create the items using the UI, one for each channel.