Control FHEM with Demopad HTTP request

Forum to ask for any help
Post Reply
flinke flasche
Posts: 56
Joined: Tue Apr 02, 2013 2:21 pm

Control FHEM with Demopad HTTP request

Post by flinke flasche » Fri Jan 20, 2017 12:45 am

hi,
i use a raspi with FHEM to control my heating in my home cinema.
Now i want to control it with demopad and get feedbacks, too.

Over a Browser like Google Chrome i can send a HTTP request like:

Code: Select all

http://username:password@192.168.0.26:8084/fhem?cmd=set%20kammer1_Heizung%20desiredTemperature%2015.5&XHR=1&fw_id=129
and my thermostat changes the value to 15.5°C

In Demopad the code will not work. Neither i use a password nor without one (Password disable in FHEM).
Bildschirmfoto 2017-01-20 um 00.37.26.jpg
Bildschirmfoto 2017-01-20 um 00.30.18.jpg
Can someone tell me what i'm doing wrong.
Can Demopad send Usernam and Passwort over HTTP Request?
You do not have the required permissions to view the files attached to this post.

User avatar
DemoPad
Site Admin
Posts: 735
Joined: Thu Jun 14, 2012 10:46 am
Contact:

Re: Control FHEM with Demopad HTTP request

Post by DemoPad » Fri Jan 20, 2017 10:45 am

You need to formulate it as a HTTP GET command - also have a look at Basic Authentication - using the username/password fields of the device & the [#BASICAUTHENTICATION] keyword. Example simple HTTP GET command using username admin password 12345678:

GET /fhem?cmd=set%20kammer1_Heizung%20desiredTemperature%2015.5&XHR=1&fw_id=129 HTTP /1.0\x0D\x0AAuthorization: Basic YWRtaW46MTIzNDU2Nzg=\x0D\x0A

(note YWRtaW46MTIzNDU2Nzg= is "admin:12345678" base64 encoded)

or if using the keyword, fill in the username & password fields of the device & use:

GET /fhem?cmd=set%20kammer1_Heizung%20desiredTemperature%2015.5&XHR=1&fw_id=129 HTTP /1.0\x0D\x0AAuthorization: Basic [#BASICAUTHENTICATION]\x0D\x0A

flinke flasche
Posts: 56
Joined: Tue Apr 02, 2013 2:21 pm

Re: Control FHEM with Demopad HTTP request

Post by flinke flasche » Fri Jan 20, 2017 7:29 pm

Perfect. Thank you.
This works fine for me.

flinke flasche
Posts: 56
Joined: Tue Apr 02, 2013 2:21 pm

Re: Control FHEM with Demopad HTTP request

Post by flinke flasche » Sat Jan 21, 2017 9:12 am

now i have the next Problem :(

with the following command i can read out some information via xml.
192.168.0.26:8083/fhem?cmd=xmllist&XHR=1 HTTP /1.0\x0D\x0A HTTP /1.0\x0D\x0AAuthorization: Basic c3RlZ21pbGxlcjoxNDjdfnHGVDEwODA=\x0D\x0A

the following code (not the complete code only for the thermostate) response in the browser:

This XML file does not appear to have any style information associated with it. The document tree is shown below.

Code: Select all

<FHZINFO>
<MAX_LIST>
<MAX name="kammer1_Heizung" state="18.0 °C" sets="wakeUp factoryReset groupid associate: deassociate: desiredTemperature:eco,comfort,boost,auto,off,5.0,5.5,6.0,6.5,7.0,7.5,8.0,8.5,9.0,9.5,10.0,10.5,11.0,11.5,12.0,12.5,13.0,13.5,14.0,14.5,15.0,15.5,16.0,16.5,17.0,17.5,18.0,18.5,19.0,19.5,20.0,20.5,21.0,21.5,22.0,22.5,23.0,23.5,24.0,24.5,25.0,25.5,26.0,26.5,27.0,27.5,28.0,28.5,29.0,29.5,30.0,on ecoTemperature:off,5.0,5.5,6.0,6.5,7.0,7.5,8.0,8.5,9.0,9.5,10.0,10.5,11.0,11.5,12.0,12.5,13.0,13.5,14.0,14.5,15.0,15.5,16.0,16.5,17.0,17.5,18.0,18.5,19.0,19.5,20.0,20.5,21.0,21.5,22.0,22.5,23.0,23.5,24.0,24.5,25.0,25.5,26.0,26.5,27.0,27.5,28.0,28.5,29.0,29.5,30.0,on comfortTemperature:off,5.0,5.5,6.0,6.5,7.0,7.5,8.0,8.5,9.0,9.5,10.0,10.5,11.0,11.5,12.0,12.5,13.0,13.5,14.0,14.5,15.0,15.5,16.0,16.5,17.0,17.5,18.0,18.5,19.0,19.5,20.0,20.5,21.0,21.5,22.0,22.5,23.0,23.5,24.0,24.5,25.0,25.5,26.0,26.5,27.0,27.5,28.0,28.5,29.0,29.5,30.0,on measurementOffset:-3.5,-3.0,-2.5,-2.0,-1.5,-1.0,-0.5,0.0,0.5,1.0,1.5,2.0,2.5,3.0,3.5 maximumTemperature:off,5.0,5.5,6.0,6.5,7.0,7.5,8.0,8.5,9.0,9.5,10.0,10.5,11.0,11.5,12.0,12.5,13.0,13.5,14.0,14.5,15.0,15.5,16.0,16.5,17.0,17.5,18.0,18.5,19.0,19.5,20.0,20.5,21.0,21.5,22.0,22.5,23.0,23.5,24.0,24.5,25.0,25.5,26.0,26.5,27.0,27.5,28.0,28.5,29.0,29.5,30.0,on minimumTemperature:off,5.0,5.5,6.0,6.5,7.0,7.5,8.0,8.5,9.0,9.5,10.0,10.5,11.0,11.5,12.0,12.5,13.0,13.5,14.0,14.5,15.0,15.5,16.0,16.5,17.0,17.5,18.0,18.5,19.0,19.5,20.0,20.5,21.0,21.5,22.0,22.5,23.0,23.5,24.0,24.5,25.0,25.5,26.0,26.5,27.0,27.5,28.0,28.5,29.0,29.5,30.0,on windowOpenTemperature:off,5.0,5.5,6.0,6.5,7.0,7.5,8.0,8.5,9.0,9.5,10.0,10.5,11.0,11.5,12.0,12.5,13.0,13.5,14.0,14.5,15.0,15.5,16.0,16.5,17.0,17.5,18.0,18.5,19.0,19.5,20.0,20.5,21.0,21.5,22.0,22.5,23.0,23.5,24.0,24.5,25.0,25.5,26.0,26.5,27.0,27.5,28.0,28.5,29.0,29.5,30.0,on windowOpenDuration boostDuration:60,5,10,0,25,20,15,30 boostValveposition decalcification maxValveSetting valveOffset weekProfile" attrs="alias comment:textField-long eventMap group room suppressReading userReadings:textField-long verbose:0,1,2,3,4,5 IODev do_not_notify:1,0 ignore:0,1 dummy:0,1 showtime:1,0 keepAuto:0,1 scanTemp:0,1 event-on-change-reading event-on-update-reading event-aggregator event-min-interval stateFormat:textField-long timestamp-on-change-reading cmdIcon devStateIcon devStateStyle icon sortby webCmd widgetOverride scnProcessByDesiChange:0,1 scnShutterList scnModeHandling:NOCHANGE,AUTO,MANUAL userattr">
<INT key="DEF" value="HeatingThermostat 146c90"/>
<INT key="LASTInputDev" value="MAXCube"/>
<INT key="MAXCube_MSGCNT" value="52"/>
<INT key="MAXCube_TIME" value="2017-01-21 08:57:58"/>
<INT key="MSGCNT" value="52"/>
<INT key="NAME" value="kammer1_Heizung"/>
<INT key="NR" value="26"/>
<INT key="STATE" value="18.0 °C"/>
<INT key="TYPE" value="MAX"/>
<INT key="addr" value="146c90"/>
<INT key="backend" value="MAXCube"/>
<INT key="dstsetting" value="1"/>
<INT key="mode" value="1"/>
<INT key="rferror" value="0"/>
<INT key="serial" value="MEQ1777348"/>
<INT key="type" value="HeatingThermostat"/>
<INT key="IODev" value="MAXCube"/>
<ATTR key="IODev" value="MAXCube"/>
<ATTR key="room" value="Kammer 1"/>
<ATTR key="scanTemp" value="1"/>
<ATTR key="scnProcessByDesiChange" value="0"/>
<ATTR key="userattr" value="scnProcessByDesiChange:0,1 scnShutterList scnModeHandling:NOCHANGE,AUTO,MANUAL"/>
<ATTR key="verbose" value="4"/>
<STATE key="MAXLAN_error" value="0" measured="2017-01-21 08:57:58"/>
<STATE key="MAXLAN_errorInCommand" value="" measured="2017-01-21 08:57:58"/>
<STATE key="MAXLAN_initialized" value="1" measured="2017-01-21 08:57:58"/>
<STATE key="MAXLAN_isAnswer" value="0" measured="2017-01-21 08:57:58"/>
<STATE key="MAXLAN_valid" value="1" measured="2017-01-21 08:57:58"/>
<STATE key="battery" value="ok" measured="2017-01-21 08:57:58"/>
<STATE key="boostDuration" value="5" measured="2017-01-21 08:57:57"/>
<STATE key="boostValveposition" value="80" measured="2017-01-21 08:57:57"/>
<STATE key="comfortTemperature" value="23.0" measured="2017-01-21 08:57:57"/>
<STATE key="decalcification" value="Sat 12:00" measured="2017-01-21 08:57:57"/>
<STATE key="desiredTemperature" value="18.0" measured="2017-01-21 08:57:58"/>
<STATE key="ecoTemperature" value="16.5" measured="2017-01-21 08:57:57"/>
<STATE key="firmware" value="1.1" measured="2017-01-21 08:57:57"/>
<STATE key="groupid" value="1" measured="2017-01-21 08:57:57"/>
<STATE key="maxValveSetting" value="100" measured="2017-01-21 08:57:57"/>
<STATE key="maximumTemperature" value="27.0" measured="2017-01-21 08:57:57"/>
<STATE key="measurementOffset" value="0.0" measured="2017-01-21 08:57:57"/>
<STATE key="minimumTemperature" value="off" measured="2017-01-21 08:57:57"/>
<STATE key="mode" value="manual" measured="2017-01-21 08:57:58"/>
<STATE key="state" value="18.0 °C" measured="2017-01-21 08:57:58"/>
<STATE key="temperature" value="19.8" measured="2017-01-21 08:48:41"/>
<STATE key="testresult" value="161" measured="2017-01-21 08:57:57"/>
<STATE key="valveOffset" value="0" measured="2017-01-21 08:57:57"/>
<STATE key="valveposition" value="0" measured="2017-01-21 08:57:58"/>
<STATE key="weekprofile-0-Sat-temp" value="17.0 °C / 20.0 °C / 17.0 °C" measured="2017-01-21 08:57:57"/>
<STATE key="weekprofile-0-Sat-time" value="00:00-11:00 / 11:00-23:00 / 23:00-00:00" measured="2017-01-21 08:57:57"/>
<STATE key="weekprofile-1-Sun-temp" value="17.0 °C / 20.0 °C / 17.0 °C" measured="2017-01-21 08:57:57"/>
<STATE key="weekprofile-1-Sun-time" value="00:00-11:00 / 11:00-23:00 / 23:00-00:00" measured="2017-01-21 08:57:57"/>
<STATE key="weekprofile-2-Mon-temp" value="17.0 °C / 20.0 °C / 17.0 °C" measured="2017-01-21 08:57:57"/>
<STATE key="weekprofile-2-Mon-time" value="00:00-17:30 / 17:30-23:00 / 23:00-00:00" measured="2017-01-21 08:57:57"/>
<STATE key="weekprofile-3-Tue-temp" value="17.0 °C / 20.0 °C / 17.0 °C" measured="2017-01-21 08:57:57"/>
<STATE key="weekprofile-3-Tue-time" value="00:00-17:30 / 17:30-23:00 / 23:00-00:00" measured="2017-01-21 08:57:57"/>
<STATE key="weekprofile-4-Wed-temp" value="17.0 °C / 20.0 °C / 17.0 °C" measured="2017-01-21 08:57:57"/>
<STATE key="weekprofile-4-Wed-time" value="00:00-17:30 / 17:30-23:00 / 23:00-00:00" measured="2017-01-21 08:57:57"/>
<STATE key="weekprofile-5-Thu-temp" value="17.0 °C / 20.0 °C / 17.0 °C" measured="2017-01-21 08:57:57"/>
<STATE key="weekprofile-5-Thu-time" value="00:00-17:30 / 17:30-23:00 / 23:00-00:00" measured="2017-01-21 08:57:57"/>
<STATE key="weekprofile-6-Fri-temp" value="17.0 °C / 20.0 °C / 17.0 °C" measured="2017-01-21 08:57:57"/>
<STATE key="weekprofile-6-Fri-time" value="00:00-15:00 / 15:00-23:00 / 23:00-00:00" measured="2017-01-21 08:57:57"/>
<STATE key="windowOpenDuration" value="15" measured="2017-01-21 08:57:57"/>
<STATE key="windowOpenTemperature" value="12.0" measured="2017-01-21 08:57:57"/>
</MAX>
</MAX_LIST>
</FHZINFO>
Now i want to get the value of the temperature
<STATE key="temperature" value="19.8" measured="2017-01-21 08:48:41"/>

but when i try
<STATE key="temperature" value="(.*)"/>
nothing happens

flinke flasche
Posts: 56
Joined: Tue Apr 02, 2013 2:21 pm

Re: Control FHEM with Demopad HTTP request

Post by flinke flasche » Sat Jan 21, 2017 1:49 pm

i found the solution :D
You do not have the required permissions to view the files attached to this post.

Post Reply