Hi,
I got the the ems-esp implementation, and the thermostat works fine.
hem> l Woonkamer_Thermostaat
Internals:
DEVICETOPIC Woonkamer_Thermostaat
FUUID 5eab0d68-f33f-d772-98a6-b3131bbc9855ff51
IODev mqtt2
LASTInputDev mqtt2
MSGCNT 3301
NAME Woonkamer_Thermostaat
NR 103
STATE auto
20 °C
/ 20.1 °C
TYPE MQTT2_DEVICE
mqtt2_MSGCNT 3301
mqtt2_TIME 2021-10-15 18:48:13
JSONMAP:
hc1_currtemp currtemp
hc1_daytemp daytemp
hc1_holidayttemp holidaytemp
hc1_mode mode
hc1_nighttemp nighttemp
hc1_seltemp desired-temp
READINGS:
2021-07-31 15:28:35 0
2021-10-15 09:36:22 IODev mqtt2
2021-02-18 20:31:16 attrTemplateVersion 20201110
2021-10-15 18:48:13 building medium
2021-10-15 18:48:13 currtemp 20.1
2021-10-15 18:48:13 dampedoutdoortemp -10
2021-03-29 21:04:43 dampedtemp -10
2021-10-15 18:48:13 dateTime 18:46:29 15/10/2021
2021-10-15 18:48:13 desired-temp 20
2021-10-15 18:48:13 errorcode (0)
2021-10-15 18:48:13 floordry off
2021-10-15 18:48:13 hc1_comforttemp 21
2021-10-15 18:48:13 hc1_controlmode room
2021-10-15 18:48:13 hc1_designtemp 75
2021-10-15 18:48:13 hc1_ecotemp 15
2021-10-15 18:48:13 hc1_hatemp 20.1
2021-10-15 18:48:13 hc1_heatingtype radiator
2021-10-15 18:48:13 hc1_manualtemp 17
2021-10-15 18:48:13 hc1_maxflowtemp 75
2021-10-15 18:48:13 hc1_minflowtemp 25
2021-10-15 18:48:13 hc1_modetype comfort
2021-10-15 18:48:13 hc1_nofrosttemp 5
2021-10-15 18:48:13 hc1_offsettemp 0
2021-10-15 18:48:13 hc1_program 1
2021-10-15 18:48:13 hc1_roominfluence 3
2021-10-15 18:48:13 hc1_summermode auto
2021-10-15 18:48:13 hc1_summertemp 17
2021-10-15 18:48:13 hc1_targetflowtemp 0
2021-10-15 18:48:13 minexttemp -10
2021-10-15 18:48:13 mode auto
2021-03-29 21:04:43 time 21:03:51 29/03/2021
2021-10-15 18:48:13 wwcircmode own_prog
2021-10-15 18:48:13 wwextra1 0
2021-10-15 18:48:13 wwmode own_prog
2021-10-15 18:48:13 wwsettemp 60
2021-10-15 18:48:13 wwsettemplow 45
2021-03-29 21:04:43 wwtemp 60
2021-03-29 21:04:43 wwtemplow 45
Attributes:
IODev mqtt2
devStateIcon set.auto:edit_settings:mode+manual set.manual:edit_settings:mode+auto auto:time_automatic:mode+manual manual:time_manual_mode:mode+auto set.*°C:edit_settings
group Klimaat
icon temp_control
jsonMap hc1_mode:mode hc1_seltemp:desired-temp hc1_daytemp:daytemp hc1_nighttemp:nighttemp hc1_holidayttemp:holidaytemp hc1_currtemp:currtemp
model ems-esp_thermostat_simple
readingList ems-esp/thermostat_data:.* { json2nameValue($EVENT, '', $JSONMAP) }
room Woonkamer
setList mode:uzsuSelectRadio,auto,manual thermostat_data/thermostat_cmd_mode1 $EVTPART1
desired-temp:slider,15.0,0.5,30.0,1 thermostat_data/thermostat_cmd_temp1 $EVTPART1
setStateList on off
stateFormat mode
desired-temp °C
/ currtemp °C
webCmd mode:desired-temp
Only the boiler gives an error, and doesn't get any data
fhem> l Woonkamer_Boiler
Internals:
CID ems-esp
DEF ems-esp
DEVICETOPIC Woonkamer_Boiler
FUUID 5eab1dc0-f33f-d772-98fc-6cc0645a33fea8f2
IODev mqtt2
NAME Woonkamer_Boiler
NR 105
STATE heating
TYPE MQTT2_DEVICE
READINGS:
2021-10-15 19:04:33 BoilerStatus Error evaluating Woonkamer_Boiler userReading BoilerStatus: Undefined subroutine &main::BoilerStatus called at (eval 1712) line 1.
2021-10-15 18:51:22 IODev mqtt2
2021-10-15 19:04:33 attrTemplateVersion 20201110
Attributes:
IODev mqtt2
devStateIcon idle:sani_heating heating:sani_heating@red tapwater:sani_water_hot@red
eventMap hot:Hot intelligent:Eco
group Klimaat
icon sani_boiler_temp
model ems-esp_boiler
readingList ems-esp/boiler_data { json2nameValue($EVENT,'',$JSONMAP) }
room Woonkamer
setList wWComfort:select,hot,intelligent ems-esp/boiler_cmd { "cmd":"comfort", "data": "$EVTPART1" }
stateFormat { my $h=ReadingsNum($name,"heating_active",1); my $t=ReadingsNum($name,"tapwater_active",0); !$h && !$t ? "idle" : ($h && !$t ? "heating" : "tapwater")}
userReadings BoilerStatus {BoilerStatus("serviceCode","serviceCodeNumber")}
webCmd wWComfort
in the console on the fhem server i get values
mosquitto_sub -h 192.168.180.5 -t ems-esp/boiler_data
{"heatingActive":"off","tapwaterActive":"off","selFlowTemp":5,"selBurnPow":0,"curBurnPow":0,"heatingPumpMod":0,"curFlowTemp":60.4,"retTemp":57.8,"sysPress":1.9,"boilTemp":63.4,"burnGas":"off","flameCurr":0,"heatingPump":"off","fanWork":"off","ignWork":"off","heatingActivated":"on","heatingTemp":75,"pumpModMax":70,"pumpModMin":30,"pumpDelay":1,"burnMinPeriod":10,"burnMinPower":0,"burnMaxPower":75,"boilHystOn":-6,"boilHystOff":6,"burnStarts":85885,"burnWorkMin":429333,"heatWorkMin":331881,"UBAuptime":3957817,"serviceCode":"0H","serviceCodeNumber":203,"lastCode":"6L(229) 29.09.2021 21:52","maintenanceMessage":"-","maintenance":"off"}
Found 1 issue
ems-esp/boiler_data { json2nameValue($EVENT,'',$JSONMAP) }
should be
ems-esp/boiler_data:.* { json2nameValue($EVENT,'',$JSONMAP) }
Only what is not working yet is stateformat/ I get the heating icon, and shouw expect "idle"
l Woonkamer_Boiler
Internals:
CID ems-esp
DEF ems-esp
DEVICETOPIC Woonkamer_Boiler
FUUID 5eab1dc0-f33f-d772-98fc-6cc0645a33fea8f2
IODev mqtt2
LASTInputDev mqtt2
MSGCNT 63
NAME Woonkamer_Boiler
NR 105
STATE heating
TYPE MQTT2_DEVICE
mqtt2_MSGCNT 63
mqtt2_TIME 2021-10-15 20:22:53
READINGS:
2021-10-15 20:22:53 BoilerStatus Error evaluating Woonkamer_Boiler userReading BoilerStatus: Undefined subroutine &main::BoilerStatus called at (eval 9701) line 1.
2021-10-15 18:51:22 IODev mqtt2
2021-10-15 20:22:53 UBAuptime 3957877
2021-10-15 19:04:33 attrTemplateVersion 20201110
2021-10-15 20:22:53 boilHystOff 6
2021-10-15 20:22:53 boilHystOn -6
2021-10-15 20:22:53 boilTemp 55.2
2021-10-15 20:22:53 burnGas off
2021-10-15 20:22:53 burnMaxPower 75
2021-10-15 20:22:53 burnMinPeriod 10
2021-10-15 20:22:53 burnMinPower 0
2021-10-15 20:22:53 burnStarts 85885
2021-10-15 20:22:53 burnWorkMin 429333
2021-10-15 20:22:53 curBurnPow 0
2021-10-15 20:22:53 curFlowTemp 51.4
2021-10-15 20:22:53 fanWork off
2021-10-15 20:22:53 flameCurr 0
2021-10-15 20:22:53 heatWorkMin 331881
2021-10-15 20:22:53 heatingActivated on
2021-10-15 20:22:53 heatingActive off
2021-10-15 20:22:53 heatingPump off
2021-10-15 20:22:53 heatingPumpMod 0
2021-10-15 20:22:53 heatingTemp 75
2021-10-15 20:22:53 ignWork off
2021-10-15 20:22:53 lastCode 6L(229) 29.09.2021 21:52
2021-10-15 20:22:53 maintenance off
2021-10-15 20:22:53 maintenanceMessage -
2021-10-15 20:22:53 pumpDelay 1
2021-10-15 20:22:53 pumpModMax 70
2021-10-15 20:22:53 pumpModMin 30
2021-10-15 20:22:53 retTemp 44.3
2021-10-15 20:22:53 selBurnPow 0
2021-10-15 20:22:53 selFlowTemp 5
2021-10-15 20:22:53 serviceCode 0H
2021-10-15 20:22:53 serviceCodeNumber 203
2021-10-15 20:22:53 sysPress 1.9
2021-10-15 20:22:53 tapwaterActive off
Attributes:
IODev mqtt2
devStateIcon idle:sani_heating heating:sani_heating@red tapwater:sani_water_hot@red
eventMap hot:Hot intelligent:Eco
group Klimaat
icon sani_boiler_temp
model ems-esp_boiler
readingList ems-esp/boiler_data:.* { json2nameValue($EVENT,'',$JSONMAP) }
room Woonkamer
setList wWComfort:select,hot,intelligent ems-esp/boiler_cmd { "cmd":"comfort", "data": "$EVTPART1" }
stateFormat { my $h=ReadingsNum($name,"heatingActive",1); my $t=ReadingsNum($name,"tapwaterActive",0); !$h && !$t ? "idle" : ($h && !$t ? "heating" : "tapwater")}
userReadings BoilerStatus {BoilerStatus("serviceCode","serviceCodeNumber")}
webCmd wWComfort
I think , I now the error but don't know how to fix
the values are now off and on for heating an tapwater. The stateformat template said 0 en 1 I think
anyone idea how to fix this?
stateFormat { my $h=ReadingsNum($name,"heatingActive",1); my $t=ReadingsNum($name,"tapwaterActive",0); !$h && !$t ? "idle" : ($h && !$t ? "heating" : "tapwater")}
Thanks for the hint with missing :.*, will update svn these days.
Wrt. to state format, you may try:
stateFormat { my $h=ReadingsNum($name,"heatingActive",1) eq 'on'; my $t=ReadingsNum($name,"tapwaterActive",0) eq 'on'; !$h && !$t ? "idle" : ($h && !$t ? "heating" : "tapwater")}
No the state format is not working. When heating is active on I shoould expect an red icon. (dedvstateicon), I get only the normal icon
Woonkamer_Boiler
Internals:
CID ems-esp
DEF ems-esp
DEVICETOPIC Woonkamer_Boiler
FUUID 5eab1dc0-f33f-d772-98fc-6cc0645a33fea8f2
IODev mqtt2
LASTInputDev mqtt2
MSGCNT 3956
NAME Woonkamer_Boiler
NR 105
STATE idle
TYPE MQTT2_DEVICE
mqtt2_MSGCNT 3956
mqtt2_TIME 2021-10-16 09:55:53
READINGS:
2021-10-16 09:55:53 BoilerStatus Error evaluating Woonkamer_Boiler userReading BoilerStatus: Undefined subroutine &main::BoilerStatus called at (eval 78025) line 1.
2021-10-15 22:56:40 IODev mqtt2
2021-10-16 09:55:53 UBAuptime 3958693
2021-10-15 19:04:33 attrTemplateVersion 20201110
2021-10-16 09:55:53 boilHystOff 6
2021-10-16 09:55:53 boilHystOn -6
2021-10-16 09:55:53 boilTemp 35.5
2021-10-16 09:55:53 burnGas on
2021-10-16 09:55:53 burnMaxPower 75
2021-10-16 09:55:53 burnMinPeriod 10
2021-10-16 09:55:53 burnMinPower 0
2021-10-16 09:55:53 burnStarts 85898
2021-10-16 09:55:53 burnWorkMin 429370
2021-10-16 09:55:53 curBurnPow 29
2021-10-16 09:55:53 curFlowTemp 34.8
2021-10-16 09:55:53 fanWork on
2021-10-16 09:55:53 flameCurr 27.4
2021-10-16 09:55:53 heatWorkMin 331911
2021-10-16 09:55:53 heatingActivated on
2021-10-16 09:55:53 heatingActive on
2021-10-16 09:55:53 heatingPump on
2021-10-16 09:55:53 heatingPumpMod 31
2021-10-16 09:55:53 heatingTemp 75
2021-10-16 09:55:53 ignWork off
2021-10-16 09:55:53 lastCode 6L(229) 29.09.2021 21:52
2021-10-16 09:55:53 maintenance off
2021-10-16 09:55:53 maintenanceMessage -
2021-10-16 09:55:53 pumpDelay 1
2021-10-16 09:55:53 pumpModMax 70
2021-10-16 09:55:53 pumpModMin 30
2021-10-16 09:55:53 retTemp 27.1
2021-10-16 09:55:53 selBurnPow 29
2021-10-16 09:55:53 selFlowTemp 75
2021-10-16 09:55:53 serviceCode -H
2021-10-16 09:55:53 serviceCodeNumber 200
2021-10-16 09:55:53 sysPress 2.1
2021-10-16 09:55:53 tapwaterActive off
Attributes:
IODev mqtt2
devStateIcon idle:sani_heating heating:sani_heating@red tapwater:sani_water_hot@red
eventMap hot:Hot intelligent:Eco
group Klimaat
icon sani_boiler_temp
model ems-esp_boiler
readingList ems-esp/boiler_data:.* { json2nameValue($EVENT,'',$JSONMAP) }
room Woonkamer
setList wWComfort:select,hot,intelligent ems-esp/boiler_cmd { "cmd":"comfort", "data": "$EVTPART1" }
stateFormat { my $h=ReadingsNum($name,"heatingActive",1) eq 'on'; my $t=ReadingsNum($name,"tapwaterActive",0) eq 'on'; !$h && !$t ? "idle" : ($h && !$t ? "heating" : "tapwater")}
userReadings BoilerStatus {BoilerStatus("serviceCode","serviceCodeNumber")}
Try ReadingsVal() instead of ...Num()
Hi,
That works, thnx!
Wrt to:
Zitat2021-10-16 09:55:53 BoilerStatus Error evaluating Woonkamer_Boiler userReading BoilerStatus: Undefined subroutine &main::BoilerStatus called at (eval 78025) line 1.
Tried to fix it in https://forum.fhem.de/index.php/topic,104968.msg1180136.html#msg1180136
Unfortunately all the service codes provided in the original file had been in german, but you may find it usefull nevertheless....