FHEM Forum

FHEM - Hausautomations-Systeme => MQTT => Thema gestartet von: moustic999 am 01 November 2019, 23:23:52

Titel: ems-esp MQTT
Beitrag von: moustic999 am 01 November 2019, 23:23:52
hello,
I'm trying to use ems-esp (https://github.com/proddy/EMS-ESP (https://github.com/proddy/EMS-ESP)) with my fhem. I don't have big knowledge of fhem and certainly not using mqtt.

Could you help me to build something usable ?

here are message published by ems-esp :
  Topic:status Payload:online
  Topic:start Payload:start
  Topic:shower_data Payload:{"timer":"0","alert":"0"}
  Topic:boiler_data Payload:{"wWComfort":"Hot","wWSelTemp":60,"wWDesiredTemp":70,"selFlowTemp":51,"selBurnPow":100,"curBurnPow":0,"pumpMod":51,"wWCircPump":0,"outdoorTemp":10.1,"wWCurTmp":54.5,"wWCurFlow":0,"curFlowTemp":45.9,"retTemp":41.1,"switchTemp":0,"sysPress":1.1,"boilTemp":42.4,"wWActivated":"on","wWOnetime":"off","burnGas":"off","flameCurr":0,"heatPmp":"on","fanWork":"off","ignWork":"off","wWCirc":"off","heating_temp":90,"pump_mod_max":100,"pump_mod_min":30,"wWHeat":"off","wWStarts":2647,"wWWorkM":47311,"UBAuptime":2042484,"burnStarts":70463,"burnWorkMin":424195,"heatWorkMin":376884,"ServiceCode":"0Y","ServiceCodeNumber":204}
  Topic:tapwater_active Payload:0
  Topic:heating_active Payload:0
  Topic:thermostat_data Payload:{"hc1":{"seltemp":21,"daytemp":0,"nighttemp":2,"mode":"auto"}}


and the Subscribed ones
MQTT subscriptions:
  Topic:home/ems-esp/restart
  Topic:home/ems-esp/start
  Topic:home/ems-esp/thermostat_cmd_temp1
  Topic:home/ems-esp/thermostat_cmd_mode1
  Topic:home/ems-esp/thermostat_cmd_temp2
  Topic:home/ems-esp/thermostat_cmd_mode2
  Topic:home/ems-esp/thermostat_cmd_temp3
  Topic:home/ems-esp/thermostat_cmd_mode3
  Topic:home/ems-esp/thermostat_cmd_temp4
  Topic:home/ems-esp/thermostat_cmd_mode4
  Topic:home/ems-esp/thermostat_cmd
  Topic:home/ems-esp/boiler_cmd
  Topic:home/ems-esp/boiler_cmd_wwactivated
  Topic:home/ems-esp/boiler_cmd_wwonetime
  Topic:home/ems-esp/boiler_cmd_wwtemp
  Topic:home/ems-esp/generic_cmd
  Topic:home/ems-esp/shower_data



I already connected to my mosquitto server using MQTT2_CLIENT and a MQTT2_DEVICE has been autocreated.
define ems_esp MQTT2_DEVICE mqttBroker
setuuid ems_esp 5db9b940-f33f-c58d-4499-a29c0fe0d7f1fa7b
attr ems_esp IODev mqttBroker
attr ems_esp readingList mqttBroker:home/ems-esp/boiler_data:.* { json2nameValue($EVENT) }\
mqttBroker:home/ems-esp/heating_active:.* heating_active\
mqttBroker:home/ems-esp/thermostat_data:.* { json2nameValue($EVENT) }\

attr ems_esp room MQTT2_DEVICE
attr ems_esp setList temperature home/ems-esp/thermostat_cmd_temp1 $EVTPART1\
auto home/ems-esp/thermostat_cmd_mode1 auto\
manual home/ems-esp/thermostat_cmd_mode1 manual


as a test I created a small readingsgroup :
define Buderus_Heater readingsGroup ems_esp:<%sani_domestic_waterworks>,<Pression>,sysPress ems_esp:<%sani_supply_temp>,<Temp.depart>,curFlowTemp ems_esp:<%sani_return_temp>,<Temp.retour>,retTemp\

and I successfully created another MQTT2_DEVICE to set the mode :
define buderus.thermostat MQTT2_DEVICE
setuuid buderus.thermostat 5dbc5776-f33f-c58d-6657-0d77e45cd1e175d6
attr buderus.thermostat IODev mqttBroker
attr buderus.thermostat devStateIcon auto:time_automatic:heat manual:time_manual_mode:auto
attr buderus.thermostat eventMap /auto:auto/heat:manual
attr buderus.thermostat readingList mqttBroker:home/ems-esp/thermostat_data:.* { json2nameValue($EVENT) }
attr buderus.thermostat room Chauffage
attr buderus.thermostat setList auto home/ems-esp/thermostat_cmd_mode1 auto\
heat home/ems-esp/thermostat_cmd_mode1 manual\
temp home/ems-esp/thermostat_cmd_temp1 $EVTPART1
attr buderus.thermostat stateFormat hc1_mode


I can now change the mode, but it takes few seconds to have the state updated. Is there an way to improve that ?

second point, I would like to have a number field where I can set the temperature to send to the heater via the home/ems-esp/thermostat_cmd_temp1.

I made lot of trial, but with no luck.

Finally, I think this could be integrated into few templates for ems-esp depending thermostat type ( mine is a RC300)

Titel: Antw:ems-esp MQTT
Beitrag von: TomLee am 01 November 2019, 23:45:10
Zitatsecond point, I would like to have a number field where I can set the temperature to send to the heater via the home/ems-esp/thermostat_cmd_temp1.

I hope I'm not completely wrong

attr buderus.thermostat setList temp2:19,20,21,22,23 home/ems-esp/thermostat_cmd_temp1/set $EVTPART1
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 03 November 2019, 08:35:24
Thx for sharing your first experience with ems-esp.

Would be fine to add some templates to attrTemplate and support you in finding reasonable settings :) . As a first step, I added ems-esp to the general CLIENT template, hope this works as expected (see below).

For testing purpose, it's easier to excange data as "RAW" definitions (see pictures here (https://wiki.fhem.de/wiki/Raw_definition)), so I can build "identical" devices in my test environment (without communication though) and you can keep a working copy with states while testing.

Sounds like this is your first mqtt2-device? As autocreate will use "CID" to determine which of all existing mqtt2-device-devices will "get" any new subscription, your "ems_esp"-Device will also get everything else from your future further MQTT-speaking devices.

So first step should be to assign a differen CID to it:
defmod ems_esp MQTT2_DEVICE ems-espAfter tomorrow's update, you might define an additional MQTT2_DEVICE (with CID "mqttBroker" - for all others: use the name of the IO) and assign the template "MQTT2_CLIENT_general_bridge"
This should help to distinguish between different sources and directly build additional devices when needed.
Then we should decide on how many MQTT2-DEVICEs are needed and if additional readingsGroup devices make sense. To get an impression on the possibilities how to visualize a lot of data, see TomLee's thread here: https://forum.fhem.de/index.php/topic,104858.0.html. So until now, I tend to stick with just one device for all (see also webCmdLabel), as also the setting options seem to be quite standardized and not very specific to the hardware used. But I might be wrong in this.

Wrt. to the time difference between set and reaction I'd assume, that's ok (or even a good sign). Afaik it takes some time to write on the bus and also to read reaction, so that way we seem to have a real feedback and not only a "I received it and will _try_ to process the command"...
Titel: Antw:ems-esp MQTT
Beitrag von: moustic999 am 03 November 2019, 15:33:32
Thanks for the anwser. I chenged the CID as per your recommendation.

regardig the amount of device,  I imagine at least 2 parts, 1 for controlling the Thermostat ( set the mode /get current mode, set the temp, get current target temp) and 1 for reading all values from the heater such as pressure, flow temp, return temp, outdoor temp etc...
not sure we can do that in 1 device.

I read the wiki for RAW, I was not aware of this feature, very interesting.

I removed all readings waited to have them back, so here are them :
defmod ems_esp MQTT2_DEVICE ems-esp
attr ems_esp IODev mqttBroker
attr ems_esp readingList mqttBroker:home/ems-esp/boiler_data:.* { json2nameValue($EVENT) }\
mqttBroker:home/ems-esp/tapwater_active:.* tapwater_active\
mqttBroker:home/ems-esp/heating_active:.* heating_active\
mqttBroker:home/ems-esp/shower_data:.* { json2nameValue($EVENT) }\
mqttBroker:home/ems-esp/status:.* status\
mqttBroker:home/ems-esp/start:.* start
attr ems_esp room MQTT2_DEVICE
attr ems_esp setList mode1 home/ems-esp/thermostat_cmd_mode1 $EVTPART1\
temp1 home/ems-esp/thermostat_cmd_temp1 $EVTPART1

setstate ems_esp 2019-11-03 15:31:34 ServiceCode 0Y
setstate ems_esp 2019-11-03 15:31:34 ServiceCodeNumber 204
setstate ems_esp 2019-11-03 15:31:34 UBAuptime 2045583
setstate ems_esp 2019-11-03 15:27:39 alert 0
setstate ems_esp 2019-11-03 15:31:34 boilTemp 33.9
setstate ems_esp 2019-11-03 15:31:34 burnGas off
setstate ems_esp 2019-11-03 15:31:34 burnStarts 70704
setstate ems_esp 2019-11-03 15:31:34 burnWorkMin 424488
setstate ems_esp 2019-11-03 15:31:34 curBurnPow 0
setstate ems_esp 2019-11-03 15:31:34 curFlowTemp 34.2
setstate ems_esp 2019-11-03 15:31:34 fanWork off
setstate ems_esp 2019-11-03 15:31:34 flameCurr 0
setstate ems_esp 2019-11-03 15:31:34 heatPmp on
setstate ems_esp 2019-11-03 15:31:34 heatWorkMin 377088
setstate ems_esp 2019-11-03 15:31:34 heating_active 0
setstate ems_esp 2019-11-03 15:31:34 heating_temp 90
setstate ems_esp 2019-11-03 15:31:34 ignWork off
setstate ems_esp 2019-11-03 15:31:34 outdoorTemp 13.7
setstate ems_esp 2019-11-03 15:31:34 pumpMod 45
setstate ems_esp 2019-11-03 15:31:34 pump_mod_max 100
setstate ems_esp 2019-11-03 15:31:34 pump_mod_min 30
setstate ems_esp 2019-11-03 15:31:34 retTemp 33.4
setstate ems_esp 2019-11-03 15:31:34 selBurnPow 100
setstate ems_esp 2019-11-03 15:31:34 selFlowTemp 40
setstate ems_esp 2019-11-03 15:27:39 start start
setstate ems_esp 2019-11-03 15:27:39 status online
setstate ems_esp 2019-11-03 15:31:34 switchTemp 0
setstate ems_esp 2019-11-03 15:31:34 sysPress 1
setstate ems_esp 2019-11-03 15:31:34 tapwater_active 0
setstate ems_esp 2019-11-03 15:27:39 timer 0
setstate ems_esp 2019-11-03 15:31:34 wWActivated on
setstate ems_esp 2019-11-03 15:31:34 wWCirc off
setstate ems_esp 2019-11-03 15:31:34 wWCircPump 0
setstate ems_esp 2019-11-03 15:31:34 wWComfort Hot
setstate ems_esp 2019-11-03 15:31:34 wWCurFlow 0
setstate ems_esp 2019-11-03 15:31:34 wWCurTmp 57.5
setstate ems_esp 2019-11-03 15:31:34 wWDesiredTemp 70
setstate ems_esp 2019-11-03 15:31:34 wWHeat off
setstate ems_esp 2019-11-03 15:31:34 wWOnetime off
setstate ems_esp 2019-11-03 15:31:34 wWSelTemp 60
setstate ems_esp 2019-11-03 15:31:34 wWStarts 2652
setstate ems_esp 2019-11-03 15:31:34 wWWorkM 47400



maybe it is better to share them via a file ?
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 04 November 2019, 11:02:32
OK, sounds reasonable to split things up, especially as the two devices seem to have different functions in the entire system.

So first version for a central heating device (?). It's more intended to make you familiar with variables, widgets and devStateIcon options, it pretty sure contains some suggestions not very reasonable; feel free to replace them as needed and desired:

name:ems-esp_heater_device
filter:TYPE=MQTT2_DEVICE
desc:EMS-ESP is a open-source system to communicate with EMS (Energy Management System) based boilers, thermostats and other modules from manufacturers like Bosch, Buderus, Nefit, Junkers and Sieger, see <a href="https://github.com/proddy/EMS-ESP">project page</a>. First version, to contribute see <a href="https://forum.fhem.de/index.php/topic,104968.0.html">Forum Thread</a>.
order:E_02a
par:DEVTYPE;Internal TYPE of the device; { InternalVal("DEVICE","TYPE",undef)}
par:BASE_ID;base topic set, default is "home";{ AttrVal("DEVICE","readingList","") =~ m,[^:]+:?[/]?([^/])+[/][^/]+[/].*:, ? $1 : undef }
par:DEV_ID;ID topic set, default is "ems-esp";{ AttrVal("DEVICE","readingList","") =~ m,[^:]+:?[/]?BASE_ID[/]([^/]+)[/].*:, ? $1 : undef }
par:ICON;ICON as set, defaults to sani_boiler_temp;{ AttrVal("DEVICE","icon","sani_boiler_temp") }
attr DEVICE icon ICON
attr DEVICE  readingList BASE_ID/DEV_ID/boiler_data:.* { json2nameValue($EVENT) }\
  BASE_ID/DEV_ID/tapwater_active:.* tapwater_active\
  BASE_ID/DEV_ID/heating_active:.* heating_active\
  BASE_ID/DEV_ID/shower_data:.* { json2nameValue($EVENT) }\
  BASE_ID/DEV_ID/status:.* status\
  BASE_ID/DEV_ID/start:.* start
attr DEVICE  setList mode1:auto,manual BASE_ID/DEV_ID/thermostat_cmd_mode1 $EVTPART1\
  temp1:selectnumbers,45,0.5,65,1,lin BASE_ID/DEV_ID/thermostat_cmd_temp1 $EVTPART1
attr DEVICE stateFormat Interface: \
status \
Tapwater: \
1:tapwater_active\
Heating: \
2:heating_active\
<br>Uptime: formatedUptime
attr DEVICE devStateIcon online:it_net offline:it_net@red  2.1:lan_rs485 2.0:lan_rs485@red
attr DEVICE autocreate 1
attr DEVICE model ems-esp_heater_device

For testing, you may copy the code to a new file located in the attrTemplate directory (typically: opt/fhem/FHEM/lib/AttrTemplate/), then issue "{ AttrTemplate_Initialize() }" (also after every change to one of the templates), then it should be available in the selection list of every MQTT2_DEVICE.

For the template "language" see this (https://forum.fhem.de/index.php/topic,104804.msg988100.html#msg988100) posting (unfortunately in german), for widgets this wiki article (https://wiki.fhem.de/wiki/FHEMWEB/Widgets) should be more or less self-explaining.

In general, sharing the code in code-tags is ok for me.

Looking forward to your feedback :) .
Titel: Antw:ems-esp MQTT
Beitrag von: moustic999 am 28 November 2019, 11:38:50
hello,

I made little progress on implmenting stuff.

I'm now blocked for this simple device. Maybe you can help

Getting values and settings values are not done via the same, so my slider is not updated with current value as well as my radio is not aligne with current choice.

here is the raw :
defmod buderus.heater.thermostat.hc1 MQTT2_DEVICE
attr buderus.heater.thermostat.hc1 IODev mqttBroker
attr buderus.heater.thermostat.hc1 devStateIcon auto:time_automatic:heat manual:time_manual_mode:auto set_auto:time_automatic@yellow set_heat:time_manual_mode@yellow
attr buderus.heater.thermostat.hc1 readingList mqttBroker:home/ems-esp/thermostat_data:.* { json2nameValue($EVENT) }
attr buderus.heater.thermostat.hc1 room Chauffage
attr buderus.heater.thermostat.hc1 setList mode:uzsuSelectRadio,auto,manual home/ems-esp/thermostat_cmd_mode1 $EVTPART1\
temp:slider,15.0,0.5,30.0,1 home/ems-esp/thermostat_cmd_temp1 $EVTPART1
attr buderus.heater.thermostat.hc1 setStateList mode hc1_mode
attr buderus.heater.thermostat.hc1 stateFormat hc1_mode\
hc1_seltemp °C
attr buderus.heater.thermostat.hc1 webCmd mode:temp

setstate buderus.heater.thermostat.hc1 auto\
26 °C
setstate buderus.heater.thermostat.hc1 2019-11-28 11:35:31 hc1_daytemp 0
setstate buderus.heater.thermostat.hc1 2019-11-28 11:35:31 hc1_mode auto
setstate buderus.heater.thermostat.hc1 2019-11-28 11:35:31 hc1_nighttemp 0
setstate buderus.heater.thermostat.hc1 2019-11-28 11:35:31 hc1_seltemp 26
setstate buderus.heater.thermostat.hc1 2019-11-15 16:17:07 mode set manual
setstate buderus.heater.thermostat.hc1 2019-11-15 16:19:04 state set_mode
setstate buderus.heater.thermostat.hc1 2019-11-28 11:35:27 temp set 26.0


also when changing mode /temp,  there is a delay until we receive values from heater, during that time mode icon is yellow, I would like to have same for the temp, but I don't know how to change text color.

Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 28 November 2019, 12:23:33
To get "the circle closed" you have tu use the same reading names in sending and receiving direction.
Atm this e.g. seems to be "mode" when sending from FHEM, but "hc1_mode" when receiving.

There are two ways to solve that kind of trouble:
- "easy way" is to name the setters the same as the return values are named in the JSON. This would lead to:
attr buderus.heater.thermostat.hc1 setList hc1_mode:uzsuSelectRadio,auto,manual home/ems-esp/thermostat_cmd_mode1 $EVTPART1\
temp1:slider,15.0,0.5,30.0,1 home/ems-esp/thermostat_cmd_temp1 $EVTPART1

- second option is to do the renaming when receiving:attr buderus.heater.thermostat.hc1 readingList mqttBroker:home/ems-esp/thermostat_data:.* { json2nameValue($EVENT,'',$JSONMAP) }
attr buderus.heater.thermostat.hc1 jsonMap hc1_mode:mode temp1:temp
Imo, the second option should be prefered in this case, as I assume, there _could_ exist more than one thermostat on the bus, as renaming of the other readings is more open to the user and confusion could be more easy avoided. You may even use a combination of both methods (e.g. setter and jsonMap entry for "desiredTemperature"). This would lead to the following "side-effect": The device would be automatically recognized by WeekdayTimer (maybe others also) as a heating device. I'm currently working with @Risiko to get WeekdayTimer to accept temperature profiles from (Module) "weekprofile" side. So most likely in some few day, it's finally a piece of cake to synchronize e.g. temparature profiles all over the place without hassling about what TYPE they are, including HomeMatic (-IP), MAX or ZWave thermostats...

Wrt. colouring of "not yet confirmed" set actions, this would be possible when using the Perl variant of devStateIcon. Would showing a different icon (instead of text) when things are to be processed would also be an option? Then I'd suggest to show the "edit_settings"-icon, when "^set.*°C$".
Titel: Antw:ems-esp MQTT
Beitrag von: moustic999 am 28 November 2019, 17:30:38
I tried the second option with Jsonmap but it does not work. I think it is due to the json data itself :

here is the raw content for thermostat_data topic :
{"hc1":{"seltemp":24,"daytemp":0,"nighttemp":0,"mode":"auto"}}

there is no direct hc1_mode neither hc1_seltemp, this is genereated by json2nameValue I guess.

Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 28 November 2019, 17:47:40
OK, the reading to be mapped is called "hc1_seltemp".
Pls. try to use jsonMap with that instead of temp1 (first started with the mode thing, didn't thoroughly check the latter).
Titel: Antw:ems-esp MQTT
Beitrag von: moustic999 am 29 November 2019, 08:56:15
I used the right reading, but jsonmap is not applied whatever I  try

here is the raw : defmod buderus.heater.thermostat.hc1 MQTT2_DEVICE
attr buderus.heater.thermostat.hc1 IODev mqttBroker
attr buderus.heater.thermostat.hc1 devStateIcon auto:time_automatic:heat manual:time_manual_mode:auto set_auto:time_automatic@yellow set_heat:time_manual_mode@yellow
attr buderus.heater.thermostat.hc1 jsonMap hc1_seltemp temp
attr buderus.heater.thermostat.hc1 readingList mqttBroker:home/ems-esp/thermostat_data:.* { json2nameValue($EVENT, '', $JSONMAP) }
attr buderus.heater.thermostat.hc1 room Chauffage
attr buderus.heater.thermostat.hc1 setList mode:uzsuSelectRadio,auto,manual home/ems-esp/thermostat_cmd_mode1 $EVTPART1\
temp:slider,15.0,0.5,30.0,1 home/ems-esp/thermostat_cmd_temp1 $EVTPART1
attr buderus.heater.thermostat.hc1 setStateList mode hc1_mode
attr buderus.heater.thermostat.hc1 stateFormat hc1_mode\
hc1_seltemp °C
attr buderus.heater.thermostat.hc1 webCmd mode:temp

setstate buderus.heater.thermostat.hc1 auto\
24 °C
setstate buderus.heater.thermostat.hc1 2019-11-29 08:50:01 hc1_daytemp 0
setstate buderus.heater.thermostat.hc1 2019-11-29 08:50:01 hc1_mode auto
setstate buderus.heater.thermostat.hc1 2019-11-29 08:50:01 hc1_nighttemp 0
setstate buderus.heater.thermostat.hc1 2019-11-29 08:50:01 hc1_seltemp 24
setstate buderus.heater.thermostat.hc1 2019-11-15 16:17:07 mode set manual
setstate buderus.heater.thermostat.hc1 2019-11-15 16:19:04 state set_mode
setstate buderus.heater.thermostat.hc1 2019-11-28 11:35:27 temp set 26.0



and the topic data which is in topic  home/ems-esp/thermostat_data

{"hc1":{"seltemp":24,"daytemp":0,"nighttemp":0,"mode":"auto"}}


If I understand you work on WeekdayTimer, having the reading named "desiredTemperature" would be enough to support it ? Will it be working for KNX as well ? that would be wonderful !
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 29 November 2019, 09:18:50
wrt. to jsonMap, your syntax should be: "oldreadingname1:newreadingname1 oldreadingname2:newreadingname2".

So pls. try again with:
attr buderus.heater.thermostat.hc1 jsonMap hc1_mode:mode hc1_seltemp:temp


Wrt. to WeekdayTimer, there are several keywords indicating a device to be a "heater/thremostat type". "desiredTemp" is just one of them. In general it shouldn't be a big issue. If there's a risk to mess up with other devices (meaning: setter-reading isn't named in a way to avoid confusion with "normal" temperature readings), you could use an attribute "switchInThePast" to get a similar behaviour.
You could post a list/RAW definition of you device, but discussion on that thing shouldn't take too much room in this thread.

Titel: Antw:ems-esp MQTT
Beitrag von: moustic999 am 29 November 2019, 10:11:29
I already fixed the jsomap syntax but not helped

I let the broker to create again a new device via autocreate "complex" and at that time it works

here is the raw
defmod MQTT2_mqttBroker MQTT2_DEVICE ems-esp
attr MQTT2_mqttBroker IODev mqttBroker
attr MQTT2_mqttBroker devStateIcon auto:time_automatic:heat manual:time_manual_mode:auto
attr MQTT2_mqttBroker jsonMap hc1_mode:mode1 hc1_seltemp:temp1
attr MQTT2_mqttBroker readingList mqttBroker:home/ems-esp/thermostat_data:.* { json2nameValue($EVENT, '', $JSONMAP) }\

attr MQTT2_mqttBroker room MQTT2_DEVICE
attr MQTT2_mqttBroker setList mode1:uzsuSelectRadio,auto,manual home/ems-esp/thermostat_cmd_mode1 $EVTPART1\
temp1:slider,15.0,0.5,30.0,1 home/ems-esp/thermostat_cmd_temp1 $EVTPART1
attr MQTT2_mqttBroker stateFormat mode1\
temp1 °C
attr MQTT2_mqttBroker webCmd mode1:temp1

setstate MQTT2_mqttBroker manual\
24 °C
setstate MQTT2_mqttBroker 2019-11-29 10:05:57 hc1_daytemp 0
setstate MQTT2_mqttBroker 2019-11-29 10:05:57 hc1_nighttemp 0
setstate MQTT2_mqttBroker 2019-11-29 10:05:57 mode1 manual
setstate MQTT2_mqttBroker 2019-11-29 10:05:57 temp1 24


What I have found is that if I try to rename it to whatever, jsonmap does not work anymore. I don't understand why.

I tried :
rename MQTT2_mqttBroker buderus.thermostat

reverting to original name make it work again.



Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 29 November 2019, 10:21:54
Thx for the feedback, I already was a little worrying if I had some misunderstanding of the jsonMap feature...

Wrt. the renaming: I assume this either has to do with the name (points are special in a Perl environment), or there's a problem when updating the info at runtime.

Can you please make a short test and
1. rename the device, but avoid points in the naming; (if that leads to problems: still existent after save+FHEM-restart?)
2. rename e.g. temp1 to desiredTemp (esp. in jsonMap attribute).

I'd assume the first will again to cause the problem, even after restart (we'll have to inform Rudi then), but the latter to work without trouble.
Titel: Antw:ems-esp MQTT
Beitrag von: moustic999 am 29 November 2019, 10:39:20
you were right. the dot in the name give the issue.

I renamed to 'thermostat' and it is fine. I also updated to desiredTemp with no issue.

except for "pending changes" not shown properly in the state ( yellow ... ) I'm pretty satisfied with current stuff. I will try to put this in the template.
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 29 November 2019, 10:57:57
 :)

Now you could make a test, if WDT correctly identifies your device as heating: Just use a profile with a switchtime for today that already has passed, e.g.:
defmod Buderus_Timer WeekdayTimer thermostat !$we|06:45|22.5 $we|08:00|22.5 $we|10:30|22.0 56|23:00|18.0 56|23:30|18.0 0-4|22:00|18.5
For direct use with weekplan, see this thread https://forum.fhem.de/index.php/topic,105521.0.html for the test variants of the modules (you may ask for help in English in case you need some translation; feedback about the commandref would be fine also...).
Titel: Antw:ems-esp MQTT
Beitrag von: moustic999 am 29 November 2019, 11:06:31
today I'm already using WeekdayTimer for my knx devices, but With changing mode instead of temperature, is it foreseen also to work out-of-the box with a generic reading name ?

Titel: Antw:ems-esp MQTT
Beitrag von: moustic999 am 29 November 2019, 11:24:32
I guess "desiredTemp" should be called  "desired" as per the default definition below


defmod Buderus_Timer WeekdayTimer thermostat !$we|06:45|22 $we|08:00|22.5 $we|10:30|22.0 56|11:15|18.0 56|23:30|18.0 0-4|22:00|18.5
attr Buderus_Timer commandTemplate set $NAME desired $EVENT

setstate Buderus_Timer 18.0
setstate Buderus_Timer 2019-11-29 11:15:00 currValue 18.0
setstate Buderus_Timer 2019-11-29 11:15:00 nextUpdate 2019-11-29 23:30:00
setstate Buderus_Timer 2019-11-29 11:15:00 nextValue 18.0
setstate Buderus_Timer 2019-11-29 11:15:00 state 18.0

Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 29 November 2019, 11:40:04
Sorry, my fault.

Looking in the WDT code, it's one of: "desired-temp", "desiredTemperature", "desired", "thermostatSetpointSet"...
I'd tend to "desiredTemperature" as reading name.




For the KNX thing&ootb: It depends... It should be recognised as heating (and therefore switch in the past by default), if there exits one of the mentionned set options. But as you are using a different reading to be set, in any case you have to change commandTemplate accordingly, I assume.
If it's not automatically treated as heating, set the "swip"-Attribute to 1. This has the same effect...
Titel: Antw:ems-esp MQTT
Beitrag von: moustic999 am 29 November 2019, 12:08:28
I changed to "desired" in my thermostat.It works fine, at schedule time, the proper "set thermostat desired 18.0" is sent.

but in my thermostat, the reading is updated correctly, the proper publish is sent, but the state does not change until it receive the thermostat_data.

I would expect that the set command update the status as well, but maybe I'm wrong ?

Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 29 November 2019, 12:20:01
In your newer RAW, there's no more setStateList.
Therefore all set commands will be reflected in "state" reading. Imo, the "desired" reading isn't updated (and you missinterpreted what you've seen) and tend to use that attribute to some dummy values like "on off".

Then you should find "set " followed by the value in the reading as long as there's no confirmation from the receiving side.
Titel: Antw:ems-esp MQTT
Beitrag von: moustic999 am 29 November 2019, 12:34:39
yup exact I was a bit confused ;-)
here is the latest RAW which work
defmod thermostat MQTT2_DEVICE ems-esp
attr thermostat IODev mqttBroker
attr thermostat devStateIcon auto:time_automatic manual:time_manual_mode
attr thermostat icon temp_control
attr thermostat jsonMap hc1_mode:mode hc1_seltemp:desired
attr thermostat readingList mqttBroker:home/ems-esp/thermostat_data:.* { json2nameValue($EVENT, '', $JSONMAP) }
attr thermostat room MQTT2_DEVICE
attr thermostat setList mode:uzsuSelectRadio,auto,manual home/ems-esp/thermostat_cmd_mode1 $EVTPART1\
desired:slider,15.0,0.5,30.0,1 home/ems-esp/thermostat_cmd_temp1 $EVTPART1
attr thermostat stateFormat mode\
desired °C
attr thermostat webCmd mode:desired

setstate thermostat manual\
22 °C
setstate thermostat 2019-11-29 12:28:40 desired 22
setstate thermostat 2019-11-29 12:28:40 hc1_daytemp 0
setstate thermostat 2019-11-29 12:28:40 hc1_nighttemp 0
setstate thermostat 2019-11-29 12:28:40 mode manual
setstate thermostat 2019-11-29 12:28:29 state mode


also the associated WeekdayTimer , attrs are default  :
defmod Buderus_Timer WeekdayTimer thermostat fr !$we|06:45|22.5 $we|08:00|22.5 $we|10:30|22.0 56|12:18|18.0 56|23:30|18.0 0-4|22:00|18.5
attr Buderus_Timer commandTemplate set $NAME desired $EVENT

setstate Buderus_Timer 18.0
setstate Buderus_Timer 2019-11-29 12:18:00 currValue 18.0
setstate Buderus_Timer 2019-11-29 12:18:00 nextUpdate 2019-11-29 23:30:00
setstate Buderus_Timer 2019-11-29 12:18:00 nextValue 18.0
setstate Buderus_Timer 2019-11-29 12:18:00 state 18.0
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 29 November 2019, 12:47:56
OK, so here's the suggestion to

- use setStateList and
- use desired-temp as reading (imo "desired" is somehow open for interpretation, and you seem to dislike desiredTemperature for whatever reason ;D ...)

defmod thermostat MQTT2_DEVICE ems-esp
attr thermostat IODev mqttBroker
attr thermostat devStateIcon auto:time_automatic manual:time_manual_mode
attr thermostat icon temp_control
attr thermostat jsonMap hc1_mode:mode hc1_seltemp:desired-temp
attr thermostat readingList mqttBroker:home/ems-esp/thermostat_data:.* { json2nameValue($EVENT, '', $JSONMAP) }
attr thermostat room MQTT2_DEVICE
attr thermostat setList mode:uzsuSelectRadio,auto,manual home/ems-esp/thermostat_cmd_mode1 $EVTPART1\
desired-temp:slider,15.0,0.5,30.0,1 home/ems-esp/thermostat_cmd_temp1 $EVTPART1
attr thermostat setStateList on off
attr thermostat stateFormat mode\
desired-temp °C
attr thermostat webCmd mode:desired-temp


Then change wdt also accordingly
attr Buderus_Timer commandTemplate set $NAME desired-temp $EVENT
Titel: Antw:ems-esp MQTT
Beitrag von: moustic999 am 29 November 2019, 13:06:13
I change the desired to desired-temp ;-)

for the setStateList, I don' t understand pretty well it's use, but with the
attr thermostat setStateList on off

I have mode and desired-temp updated when the set command is issued, but in the state, I have also the 'set' keyword. How do we fix that ?

defmod thermostat MQTT2_DEVICE ems-esp
attr thermostat IODev mqttBroker
attr thermostat devStateIcon auto:time_automatic manual:time_manual_mode
attr thermostat icon temp_control
attr thermostat jsonMap hc1_mode:mode hc1_seltemp:desired-temp
attr thermostat readingList mqttBroker:home/ems-esp/thermostat_data:.* { json2nameValue($EVENT, '', $JSONMAP) }
attr thermostat room MQTT2_DEVICE
attr thermostat setList mode:uzsuSelectRadio,auto,manual home/ems-esp/thermostat_cmd_mode1 $EVTPART1\
desired-temp:slider,15.0,0.5,30.0,1 home/ems-esp/thermostat_cmd_temp1 $EVTPART1
attr thermostat setStateList on off
attr thermostat stateFormat mode\
desired-temp °C
attr thermostat webCmd mode:desired-temp

setstate thermostat auto\
22 °C
setstate thermostat 2019-11-29 13:04:28 desired-temp 22
setstate thermostat 2019-11-29 13:04:28 hc1_daytemp 0
setstate thermostat 2019-11-29 13:04:28 hc1_nighttemp 0
setstate thermostat 2019-11-29 13:04:28 mode auto


Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 29 November 2019, 13:18:22
Don't see any "set " in "state" (but you might see that in Internal STATE  ;) ).

This is why I asked here:
Zitat von: Beta-User am 28 November 2019, 12:23:33
Would showing a different icon (instead of text) when things are to be processed would also be an option? Then I'd suggest to show the "edit_settings"-icon, when "^set.*°C$".
So you might give a try to
attr thermostat devStateIcon set_(auto|manual):edit_settings auto:time_automatic:manual manual:time_manual_mode:auto  set.*°C:edit_settings

EDIT:
- added some commands
- Wrt. to the "useless" on/off in setStateList: this is just for forcing the module to write (other) changes to the readings not to state (lowercase=reading).
Titel: Antw:ems-esp MQTT
Beitrag von: moustic999 am 29 November 2019, 13:35:33
Ok I better understand all magic of fhem ;-)

I adapted the devStateIcon, but it does not work as expected,
when I change the temp, it is OK, I have the editSetting icon apprearing
but not when changing the mode.

because in the reading 'mode', there is no '_' so 'set thermostat mode auto' will do mode 'set auto' and not 'set_auto' as expected in devStateIcon.

Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 29 November 2019, 13:55:54
 ;D There's no magic, but wrt. to the UI some kind of layers influenceing each other in not always an obvious way ;D . But I agree, seems you are getting deeper in all these things.

However, there's at least one thing I missed.. Try:
attr thermostat devStateIcon set.(auto|manual):edit_settings auto:time_automatic:mode+manual manual:time_manual_mode:mode+auto  set.*°C:edit_settings

or (adding the option to toggle also the last mode not yet processed, don't know whether this makes sense or colouring would be helpful):attr thermostat 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(Could be, the "_" would work again, but using the dot is also ok...).
Titel: Antw:ems-esp MQTT
Beitrag von: moustic999 am 29 November 2019, 13:58:20
just for my knowledge, the '.' means any char in perl regexp ? is that right ?
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 29 November 2019, 14:08:31
You got it  ;) .

This is why I personally try to avoid the dot in any naming I use within FHEM. The dot is always in danger to get misinterpreted... (Btw.: Rudi long time ago stated to not share my point of view on that, so I'm quite surprised to find my doubts verified with the renaming thing in one of his most recent modules and features (json2nameValue using JSONMAP@MQTT2_DEVICE)...)

For more info about most of the attributes we discussed, you might also review the commandref:
https://fhem.de/commandref_modular.html#FHEMWEB
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 03 Dezember 2019, 11:23:58
Hi,

so here's the attempt to bring this to a level for publication:
name:ems-esp_thermostat
filter:TYPE=MQTT2_DEVICE
desc:To configure a thermostat for use with an <a href="https://github.com/proddy/EMS-ESP">EMS-ESP</a><br><a href="https://forum.fhem.de/index.php/topic,104968.0.html">Forum Thread</a><br>
order:E_02c
par:DEV_ID;base topic set in the ESP including "ems-esp";{ AttrVal("DEVICE","readingList","") =~ m,([^:]*ems-esp)/thermostat_data:, ? "$1" : undef }
par:ICON;ICON as set, defaults to temp_control;{ AttrVal("DEVICE","icon","temp_control") }
attr DEVICE icon ICON
attr DEVICE 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
attr DEVICE jsonMap hc1_mode:mode hc1_seltemp:desired-temp hc1_daytemp:daytemp hc1_nighttemp:nighttemp
attr DEVICE readingList DEV_ID/thermostat_data:.* { json2nameValue($EVENT, '', $JSONMAP) }
attr DEVICE setList mode:uzsuSelectRadio,auto,manual DEV_ID/thermostat_cmd_mode1 $EVTPART1\
  desired-temp:slider,15.0,0.5,30.0,1 DEV_ID/thermostat_cmd_temp1 $EVTPART1\
  daytemp:slider,15.0,0.5,30.0,1 DEV_ID/thermostat_cmd_daytemp1 $EVTPART1\
  nighttemp:slider,15.0,0.5,30.0,1 DEV_ID/thermostat_cmd_nighttemp1 $EVTPART1
attr DEVICE setStateList on off
attr DEVICE stateFormat mode\
desired-temp °C
attr DEVICE webCmd mode:desired-temp
attr DEVICE model ems-esp_thermostat

Hope, I guessed right with the day- and night-temp-setter?
Titel: Antw:ems-esp MQTT
Beitrag von: moustic999 am 03 Dezember 2019, 15:27:04
in EMS there are many kind of thermostat, and for a same thermostat many modes of using it ;-)

RC300 use mode as auto/manual and can set the target temp (seltemp).
if it is installed in a room, it will also report current temp (currtemp)
mine is installed inside the heater, so I don't have current temp.
on a RC300 night and day temp are not used.

RC35 use mode auto/day/night and can set many temp : seltemp , daytemp and nighttemp
it report also the current temp (currtemep )

most of others thermostat in compatible brands works as one f these  flavors.

I think it is quite complex to create template for this, knowing also that all sensors will have to be supported too, probably in a separate device.
I can provide a exhaustive list of all subscrptions , so we can decide how to setup these into fhem.

Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 03 Dezember 2019, 16:05:17
 ;D not really surprising...

Imo, this is quite similar to ebus; there also exist quite a few templates for that, most of them in a seperate attrTemplate-file to be installed from user side.

My suggestion would be to start with a "special device" pretty similar to "eBus_daemon_splitter".
This one has two functions:
- it represents the microcontroller (ESP8266) state (online/offline) and additionally some basic info on the bus state;
- it tries to identify "logical" entities and split these up to seperate MQTT2_DEVICEs. This is what the bridgeRegexp is for.
Should not be to hard to create, if the topic structure is as provided in https://github.com/proddy/EMS-ESP/blob/master/src/my_config.h.
Looking at that file: Is there any info about the ESP at all? (e.g. last will, RSSI, uptime?) (if not: shouldn't that be provided also?)

The termostat imo is one of these logical entities.
Wrt. to "simple readings" (just info coming from the device), we seem to be lucky, this just might be identified via the topic structure (could be we come into trouble as soon as there are more than one entities sending via thermostat_data, than we most likely should first check which of several thermostats is sending or do they make part all in the same josn-blob?). So basically everything coming over one (or more) topic-paths belongs to the same logical entity. Providing "too much" jsonMap-entries will not cause any trouble.

If we have different setList-entrys, we could use one as a "basic" template to be applied first and then modify just the info that is different (see e.g. tasmota_1ch+motion+SI7021 sample). With this method it's quite simple to create some "flavours" to choose from.
So e.g. "RC35-flavour" would be "RC-300-flavour"+"only-RC35-setters" (day/night/holidaytemp)

So if there are any, first provide info, what should make part of the "microcontroller"-Device (otherwise, try to generate a first version of the bridgeRegexp).
Titel: Antw:ems-esp MQTT
Beitrag von: moustic999 am 04 Dezember 2019, 07:57:33
all mqtt commands are described on the wiki :

https://github.com/proddy/EMS-ESP/wiki/MQTT (https://github.com/proddy/EMS-ESP/wiki/MQTT)

I will post some example I can capture on my heater. I will also request to few others people to send some example I miss...
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 04 Dezember 2019, 08:25:12
So I'd suggest to start with the ESP-template and use all info send under sensors, start and heartbeat as (mightbe-) readings. As commands, I'd see restart and generic_cmd (is there a list of what's available?).
For the others, most likely using the same grouping than in the wiki (publish data) could make sense, perhaps we should combine thermostat and mixing_data in one device?

Would you mind to do a first try on the ESP thing (use the ebus template as a base; this here should be easier as there by far are less variants of the possible topic paths)?

I'll provide an example for the RC300 as base to RC35 as extended version templates?
Titel: Antw:ems-esp MQTT
Beitrag von: moustic999 am 04 Dezember 2019, 08:37:49
yeah seems a good idea, do you have a link where I can fin ebus template source ?

found it ;-)

Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 04 Dezember 2019, 09:43:40
So here's the untested "from - to" pair of templates for thermostat:

name:ems-esp_thermostat_simple
filter:TYPE=MQTT2_DEVICE
desc:To configure a simple thermostat (e.g. RC300) for use with an <a href="https://github.com/proddy/EMS-ESP">EMS-ESP</a>.<br><a href="https://forum.fhem.de/index.php/topic,104968.0.html">Forum Thread</a><br>
order:E_02c
par:BASEPATH;base topic set in the ESP including "ems-esp";{ AttrVal("DEVICE","readingList","") =~ m,([^:]*ems-esp)/thermostat_data:, ? "$1" : undef }
par:ICON;ICON as set, defaults to temp_control;{ AttrVal("DEVICE","icon","temp_control") }
attr DEVICE icon ICON
attr DEVICE 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
attr DEVICE jsonMap hc1_mode:mode hc1_seltemp:desired-temp hc1_daytemp:daytemp hc1_nighttemp:nighttemp hc1_holidayttemp:holidaytemp
attr DEVICE readingList BASEPATH/thermostat_data:.* { json2nameValue($EVENT, '', $JSONMAP) }
attr DEVICE setList mode:uzsuSelectRadio,auto,manual BASEPATH/thermostat_cmd_mode1 $EVTPART1\
  desired-temp:slider,15.0,0.5,30.0,1 BASEPATH/thermostat_cmd_temp1 $EVTPART1
attr DEVICE setStateList on off
attr DEVICE stateFormat mode\
desired-temp °C
attr DEVICE webCmd mode:desired-temp
attr DEVICE model ems-esp_thermostat_simple

name:ems-esp_thermostat_RC35_type
filter:TYPE=MQTT2_DEVICE
desc:To configure a thermostat comparable to RC35 for use with an <a href="https://github.com/proddy/EMS-ESP">EMS-ESP</a><br>.<a href="https://forum.fhem.de/index.php/topic,104968.0.html">Forum Thread</a>
order:E_02c1
par:BASEPATH;base topic set in the ESP including "ems-esp";{ AttrVal("DEVICE","readingList","") =~ m,([^:]*ems-esp)/thermostat_data:, ? "$1" : undef }
set DEVICE attrTemplate ems-esp_thermostat_simple
attr DEVICE setList mode:uzsuSelectRadio,auto,manual BASEPATH/thermostat_cmd_mode1 $EVTPART1\
  desired-temp:slider,15.0,0.5,30.0,1 BASEPATH/thermostat_cmd_temp1 $EVTPART1\
  daytemp:slider,15.0,0.5,30.0,1 BASEPATH/thermostat_cmd_daytemp1 $EVTPART1\
  nighttemp:slider,15.0,0.5,30.0,1 BASEPATH/thermostat_cmd_nighttemp1 $EVTPART1\
  holidaytemp:slider,15.0,0.5,30.0,1 BASEPATH/thermostat_cmd_holidayttemp1 $EVTPART1
attr DEVICE model ems-esp_thermostat_RC35_type
Titel: Antw:ems-esp MQTT
Beitrag von: moustic999 am 04 Dezember 2019, 14:24:11
Good.
here the template for the ems-esp itself :
###########################################
# ems-esp
# The ems-esp device
name:ems-esp_heater_device
filter:TYPE=MQTT2_DEVICE
desc:EMS-ESP is a open-source system to communicate with EMS (Energy Management System) based boilers, thermostats and other modules from manufacturers like Bosch, Buderus, Nefit, Junkers and Sieger, see <a href="https://github.com/proddy/EMS-ESP">project page</a>. First version, to contribute see <a href="https://forum.fhem.de/index.php/topic,104968.0.html">Forum Thread</a>.
order:E_02a
par:DEVTYPE;Internal TYPE of the device; { InternalVal("DEVICE","TYPE",undef)}
par:BASE_ID;base topic set, default is "home";{ AttrVal("DEVICE","readingList","") =~ m,[^:]+:?[/]?([^/])+[/][^/]+[/].*:, ? $1 : "home" }
par:DEV_ID;ID topic set, default is "ems-esp";{ AttrVal("DEVICE","readingList","") =~ m,[^:]+:?[/]?BASE_ID[/]([^/]+)[/].*:, ? $1 : "ems-esp" }
par:ICON;ICON as set, defaults to sani_boiler_temp;{ AttrVal("DEVICE","icon","sani_boiler_temp") }
attr DEVICE icon ICON
modify DEVICE DEV_ID
attr DEVICE userReadings formatedUptime:uptime.* {my $m = ReadingsVal($name,"uptime",0)/60;; return sprintf "0 000 00:%02d", $m if $m < 60;; my $h = $m / 60;; $m %= 60;; return sprintf "0 000 %02d:%02d", $h, $m if $h < 24;; my $d = $h / 24;; $h %= 24;; return sprintf "0 %03d %02d:%02d", $d, $h, $m if $d <365;; my $y = $d / 365;; $d %= 365;; return sprintf "%d %03d %02d:%02d", $y, $d, $h, $m}
attr DEVICE  readingList BASE_ID/DEV_ID/start:.* start\
BASE_ID/DEV_ID/heartbeat:.* { json2nameValue($EVENT) }
attr DEVICE stateFormat Interface: \
start\
Signal: \
rssid %\
<br>Uptime: formatedUptime\
<br>IPAddress : <a href="http://IP" target="_blank">IP</a>
attr DEVICE setList restart:noArg BASE_ID/DEV_ID/restart
attr DEVICE devStateIcon online:it_net offline:it_net@red  2.1:lan_rs485 2.0:lan_rs485@red
attr DEVICE autocreate 1
attr DEVICE webCmd restart
attr DEVICE model ems-esp_heater_device


That's a first shot, but it is working.
However I'm not sure what "order" and "model" are used for ?
Also how do we enable bridegeregexp ?

I did not put tapwater and heating in this as I think it is more appropriate in boiler section.
Sensors are also not included because it is additional oneWire sensor which can be connected on the ems-esp but could be in another room. So probably it is best to have them as separate temperature sensors

for thermostat, I have some minor modif to do to your template, I'm busy with

Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 04 Dezember 2019, 14:55:18
 :)
order and model are more for internal use. order is used for sorting in "set <anymqtt2-device> attrTemplatte ?", model is for statistics (https://fhem.de/stats/statistics.html) and to lead helpers here (e.g. me) to the right direction in case so gets into trouble with one of the templates.

bridgeRegexp is an attribute, it's just activated when filled with content... What you are looking for is closer to OpenMQTTGateway_MCU than to ebus, btw..

Wrt. to the sensors, it's possible to split them to a seperate device, but as it's not that easy to do the same with each of the sensors. Looking at the docu, it seems they have to be distinguished by the JSON content (and additional: that seems not to be as clear as e.g. in a Tasmota device)... Perhaps you have a look at template "tasmota_use_DS18x20_id" to get an idea what I'm trying to tell you when writing this.
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 06 Dezember 2019, 12:21:34
So here's my suggestion, especially wrt. to the bridgeRegexp:
###########################################
# ems-esp
# The ems-esp device
name:ems-esp_heater_device
filter:TYPE=MQTT2_DEVICE
desc:EMS-ESP is a open-source system to communicate with EMS (Energy Management System) based boilers, thermostats and other modules from manufacturers like Bosch, Buderus, Nefit, Junkers and Sieger, see <a href="https://github.com/proddy/EMS-ESP">project page</a>. First version, to contribute see <a href="https://forum.fhem.de/index.php/topic,104968.0.html">Forum Thread</a>.
order:E_02a
par:BASE_ID;base topic set, default is "home";{ AttrVal("DEVICE","readingList","") =~ m,[^:]+:?[/]?([^/])+[/][^/]+[/].*:, ? $1 : "home" }
par:DEV_ID;ID topic set, default is "ems-esp";{ AttrVal("DEVICE","readingList","") =~ m,[^:]+:?[/]?BASE_ID[/]([^/]+)[/].*:, ? $1 : "ems-esp" }
par:ICON;ICON as set, defaults to sani_boiler_temp;{ AttrVal("DEVICE","icon","sani_boiler_temp") }
attr DEVICE icon ICON
modify DEVICE DEV_ID
attr DEVICE bridgeRegexp \
  BASE_ID/DEV_ID/(sensors|sm_data|hp_data|thermostat_data).*:.* "ems_esp_$1"\
  BASE_ID/DEV_ID/(boiler_data|tapwater_active|heating_active|mixing_data|shower_data).*:.* "ems_esp_boiler"
attr DEVICE userReadings formatedUptime:uptime.* {my $m = ReadingsVal($name,"uptime",0)/60;; return sprintf "0 000 00:%02d", $m if $m < 60;; my $h = $m / 60;; $m %= 60;; return sprintf "0 000 %02d:%02d", $h, $m if $h < 24;; my $d = $h / 24;; $h %= 24;; return sprintf "0 %03d %02d:%02d", $d, $h, $m if $d <365;; my $y = $d / 365;; $d %= 365;; return sprintf "%d %03d %02d:%02d", $y, $d, $h, $m}
attr DEVICE  readingList BASE_ID/DEV_ID/start:.* LWT\
  BASE_ID/DEV_ID/heartbeat:.* { json2nameValue($EVENT) }
attr DEVICE stateFormat Interface: \
LWT\
Signal: \
rssid %\
<br>Uptime: formatedUptime\
<br>IPAddress : <a href="http://IP" target="_blank">IP</a>
attr DEVICE setList restart:noArg BASE_ID/DEV_ID/restart
attr DEVICE devStateIcon online:it_net offline:it_net@red  2.1:lan_rs485 2.0:lan_rs485@red
attr DEVICE autocreate 1
attr DEVICE webCmd restart
attr DEVICE model ems-esp_heater_device

Also the "start" reading is renamed to "LWT" (this is more common for that kind of info).
Titel: Antw:ems-esp MQTT
Beitrag von: grappa24 am 19 Januar 2020, 13:08:20
Hi,

I'm following all about "ems-esp MQTT" with great interest, still have some questions after reading many threads, wikis, etc and I'm not sure, but perhaps I can help finishing the ems-esp template?

My hardware:
- boiler:  Buderus GBx72/Nefit Trendline/Junkers Cerapur/Worcester Greenstar Si
- thermostat: Bosch EasyControl CT200
- ems-esp gateway by Kees

What have I done so far:
- integration of EMS-gateway in my network
- MQTT2 server defined in FHEM
- MQTT on EMS-gateway enabled
- definition of an MQTT2-device via autocreate - very comfortable ;)
- automatic generation of suitable readings via readingList - very comfortable ;)
- now looking for how to use templates and esp. how to use setlist
- not sure my CT200 can set parameters anyway, thinking about testing a CW400

first a listing of my MQTT2 device without template: Internals:
   CID        ems_esp
   DEF        ems_esp
   DEVICETOPIC MQTT2_ems_esp
   FUUID      5df517f0-f33f-b5ae-cafa-1106443800f7120a
   IODev      myBroker
   LASTInputDev myBroker
   MSGCNT     8
   NAME       MQTT2_ems_esp
   NR         556
   STATE      restart
   TYPE       MQTT2_DEVICE
   myBroker_MSGCNT 8
   myBroker_TIME 2020-01-19 12:56:45
   READINGS:
     2020-01-19 12:55:20   ServiceCode     
     2020-01-19 12:55:20   ServiceCodeNumber 204
     2020-01-19 12:55:20   UBAuptime       349039
     2020-01-19 12:56:45   alert           0
     2020-01-19 12:55:20   burnGas         off
     2020-01-19 12:55:20   burnStarts      12300
     2020-01-19 12:55:20   burnWorkMin     36572
     2020-01-19 12:55:20   curBurnPow      0
     2020-01-19 12:55:20   curFlowTemp     74.6
     2020-01-19 12:55:20   fanWork         on
     2020-01-19 12:55:20   flameCurr       0
     2020-01-19 12:54:19   hc1_currtemp    0
     2020-01-19 12:54:19   hc1_mode        auto
     2020-01-19 12:54:19   hc1_seltemp     0
     2020-01-19 12:55:20   heatPmp         on
     2020-01-19 12:55:20   heatWorkMin     25825
     2020-01-19 12:54:19   heating_active  0
     2020-01-19 12:55:20   heating_temp    82
     2020-01-19 12:55:20   ignWork         off
     2020-01-19 12:55:20   outdoorTemp     6.4
     2020-01-19 12:55:20   pumpMod         41
     2020-01-19 12:55:20   pump_mod_max    100
     2020-01-19 12:55:20   pump_mod_min    10
     2020-01-19 12:55:20   selBurnPow      100
     2020-01-19 12:55:20   selFlowTemp     61
     2020-01-19 12:56:45   start           start
     2020-01-19 11:41:37   state           restart
     2020-01-19 12:56:45   status          online
     2020-01-19 12:54:19   tapwater_active 0
     2020-01-19 12:56:45   timer           0
     2020-01-19 12:55:20   wWActivated     on
     2020-01-19 12:55:20   wWCirc          on
     2020-01-19 12:55:20   wWCircPump      1
     2020-01-19 12:55:20   wWComfort       Hot
     2020-01-19 12:55:20   wWCurFlow       0
     2020-01-19 12:55:20   wWCurTmp        57.4
     2020-01-19 12:55:20   wWDesiredTemp   70
     2020-01-19 12:55:20   wWHeat          off
     2020-01-19 12:55:20   wWSelTemp       55
     2020-01-19 12:55:20   wWStarts        685
     2020-01-19 12:55:20   wWWorkM         10747
Attributes:
   IODev      myBroker
   readingList ems_esp:ems-esp/status:.* status
ems_esp:ems-esp/start:.* start
ems_esp:ems-esp/shower_data:.* { json2nameValue($EVENT) }
ems_esp:ems-esp/boiler_data:.* { json2nameValue($EVENT) }
ems_esp:ems-esp/tapwater_active:.* tapwater_active
ems_esp:ems-esp/heating_active:.* heating_active
ems_esp:ems-esp/thermostat_data:.* { json2nameValue($EVENT) }
   room       Heizung,MQTT


and now a listing after using the template Internals:
   CID        ems-esp
   DEF        ems-esp
   DEVICETOPIC MQTT2_ems_esp
   FUUID      5df517f0-f33f-b5ae-cafa-1106443800f7120a
   IODev      myBroker
   LASTInputDev myBroker
   MSGCNT     2556
   NAME       MQTT2_ems_esp
   NR         556
   STATE      Interface:
LWT
Signal:
rssid %
<br>Uptime: formatedUptime
<br>IPAddress : <a href="http://IP" target="_blank">IP</a>
   TYPE       MQTT2_DEVICE
   myBroker_MSGCNT 2556
   myBroker_TIME 2020-01-19 12:10:20
   OLDREADINGS:
   READINGS:
     2020-01-19 12:10:20   ServiceCode     
     2020-01-19 12:10:20   ServiceCodeNumber 201
     2020-01-19 12:10:20   UBAuptime       348994
     2020-01-19 12:10:20   burnGas         on
     2020-01-19 12:10:20   burnStarts      12295
     2020-01-19 12:10:20   burnWorkMin     36567
     2020-01-19 12:10:20   curBurnPow      43
     2020-01-19 12:10:20   curFlowTemp     84.1
     2020-01-19 12:10:20   fanWork         on
     2020-01-19 12:10:20   flameCurr       23
     2020-01-19 12:10:18   hc1_currtemp    0
     2020-01-19 12:10:18   hc1_mode        auto
     2020-01-19 12:10:18   hc1_seltemp     0
     2020-01-19 12:10:20   heatPmp         on
     2020-01-19 12:10:20   heatWorkMin     25821
     2020-01-19 12:10:18   heating_active  1
     2020-01-19 12:10:20   heating_temp    82
     2020-01-19 12:10:20   ignWork         off
     2020-01-19 12:10:20   outdoorTemp     6.2
     2020-01-19 12:10:20   pumpMod         100
     2020-01-19 12:10:20   pump_mod_max    100
     2020-01-19 12:10:20   pump_mod_min    10
     2020-01-19 12:10:20   selBurnPow      100
     2020-01-19 12:10:20   selFlowTemp     85
     2020-01-19 11:41:37   state           restart
     2020-01-19 12:10:18   tapwater_active 0
     2020-01-19 12:10:20   wWActivated     on
     2020-01-19 12:10:20   wWCirc          on
     2020-01-19 12:10:20   wWCircPump      1
     2020-01-19 12:10:20   wWComfort       Hot
     2020-01-19 12:10:20   wWCurFlow       0
     2020-01-19 12:10:20   wWCurTmp        53.4
     2020-01-19 12:10:20   wWDesiredTemp   70
     2020-01-19 12:10:20   wWHeat          on
     2020-01-19 12:10:20   wWSelTemp       55
     2020-01-19 12:10:20   wWStarts        685
     2020-01-19 12:10:20   wWWorkM         10746
Attributes:
   IODev      myBroker
   autocreate 1
   bridgeRegexp p/ems-esp/(sensors|sm_data|hp_data|thermostat_data).*:.* "ems_esp_$1"
  p/ems-esp/(boiler_data|tapwater_active|heating_active|mixing_data|shower_data).*:.* "ems_esp_boiler"
   devStateIcon online:it_net offline:it_net@red  2.1:lan_rs485 2.0:lan_rs485@red
   icon       sani_boiler_temp
   model      ems-esp_heater_device
   readingList p/ems-esp/start:.* LWT
  p/ems-esp/heartbeat:.* { json2nameValue($EVENT) }
   room       Heizung,MQTT
   setList    restart:noArg p/ems-esp/restart
   stateFormat Interface:
LWT
Signal:
rssid %
<br>Uptime: formatedUptime
<br>IPAddress : <a href="http://IP" target="_blank">IP</a>
   userReadings formatedUptime:uptime.* {my $m = ReadingsVal($name,"uptime",0)/60;; return sprintf "0 000 00:%02d", $m if $m < 60;; my $h = $m / 60;; $m %= 60;; return sprintf "0 000 %02d:%02d", $h, $m if $h < 24;; my $d = $h / 24;; $h %= 24;; return sprintf "0 %03d %02d:%02d", $d, $h, $m if $d <365;; my $y = $d / 365;; $d %= 365;; return sprintf "%d %03d %02d:%02d", $y, $d, $h, $m}
   webCmd     restart


Either I did something wrong or there is a problem with the template?

Would be glad, if I could help finishing the template, but first I have to understand the mechanism of bridgeRegexp 100%, I use FHEM several years but I don't really like perl  ;)

Any hints how to proceed?

Regards, grappa24 (Dieter)
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 19 Januar 2020, 14:11:23
So welcome on board!

Some questions: Did you restart the ESP8266 in between? Then LWT and update etc. should be sent.

The esp-ems-Device configured by the template just represents the bus, not any hardware attached to the bus, and especially not the thermostat. That should be a different device, and if everything works as should, autocreate should have created at least one more device. For the additional devices (especially the thermostat), there are no attrTemplates provided via svn yet, so you may have a look at what's provided here (might just be kind of an idea until now).
(In general, that should work pretty similar to the ebus thing, so you might have a look at that thread also, that's in german).

Additional devices should make part of that list:
list TYPE=MQTT2_DEVICE:FILTER=CID~ems.*
Titel: Antw:ems-esp MQTT
Beitrag von: grappa24 am 19 Januar 2020, 16:21:31
ah o.k. I just removed my thermostat and the bus delivered the same readings as before  ;D. No need to test the CW400.

But neither LWT etc. were sent after a restart of my ESP8266 nor is there another device. Or do I have to delete the readings of my autocreated MQTT2-device befor using the template?

list TYPE=MQTT2_DEVICE:FILTER=CID~ems.* provides only one MQTT2-Device as shown in my listing above. I suppose that something goes wrong here .... Shouldn't for example "IP" be the IP-Adress of my ESP-Gateway? The "variable" has no value ....
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 20 Januar 2020, 10:16:52
Hmm,

there's indeed a problem with the template, (or at least: with the template assuming there is a "BASE_ID" set). You configured it to not send anything, default is "home", so this is where the "p/"-beginnings in the bridgeRegexp come from. I'd suggest to use a BASE_ID, at least as long as this is suggested by the project...

In general, as long as there are no changes in the reading naming, it should not be necessary to delete any readings prior to applying the templates. If there could be some changes in this field, deletion should make part of the template.

Atm, I'd additionally recommend to double-check if you configured the ESP firmware to send heartbeat? Seems to be optional, so this might be the reason for missing IP and uptime values.
Titel: Antw:ems-esp MQTT
Beitrag von: grappa24 am 20 Januar 2020, 13:17:58
seems you work at somewhat like the "genius bar"  :D  The missing heartbeat solved the problem with the missing IP, uptime and rssi   ;D

now the listing looks like this (some new readings appeared):Internals:
   CID        ems-esp
   DEF        ems-esp
   DEVICETOPIC MQTT2_ems_esp
   FUUID      5df517f0-f33f-b5ae-cafa-1106443800f7120a
   IODev      myBroker
   LASTInputDev myBroker
   MSGCNT     3025
   NAME       MQTT2_ems_esp
   NR         556
   STATE      Interface:
LWT
Signal:
46 %
<br>Uptime: 0 000 00:02
<br>IPAddress : <a href="http://192.168.178.79" target="_blank">192.168.178.79</a>
   TYPE       MQTT2_DEVICE
   myBroker_MSGCNT 3025
   myBroker_TIME 2020-01-20 13:08:22
   OLDREADINGS:
   READINGS:
     2020-01-20 13:08:22   IP              192.168.178.79
     2020-01-20 13:08:22   MQTTdisconnects 0
     2020-01-20 13:08:18   ServiceCode     
     2020-01-20 13:08:18   ServiceCodeNumber 204
     2020-01-20 13:08:18   UBAuptime       350492
     2020-01-20 13:08:18   burnGas         off
     2020-01-20 13:08:18   burnStarts      12405
     2020-01-20 13:08:18   burnWorkMin     36874
     2020-01-20 13:08:18   curBurnPow      0
     2020-01-20 13:08:18   curFlowTemp     57.4
     2020-01-20 13:08:18   fanWork         on
     2020-01-20 13:08:18   flameCurr       0
     2020-01-20 13:08:22   formatedUptime  0 000 00:02
     2020-01-20 13:08:22   freemem         62
     2020-01-20 13:08:19   hc1_currtemp    0
     2020-01-20 13:08:19   hc1_mode        auto
     2020-01-20 13:08:19   hc1_seltemp     0
     2020-01-20 13:08:18   heatPmp         on
     2020-01-20 13:08:18   heatWorkMin     26068
     2020-01-20 13:08:19   heating_active  0
     2020-01-20 13:08:18   heating_temp    82
     2020-01-20 13:08:18   ignWork         off
     2020-01-20 13:08:22   load            0
     2020-01-20 13:08:18   outdoorTemp     5.3
     2020-01-20 13:08:18   pumpMod         37
     2020-01-20 13:08:18   pump_mod_max    100
     2020-01-20 13:08:18   pump_mod_min    10
     2020-01-20 13:08:22   rssid           46
     2020-01-20 13:08:18   selBurnPow      100
     2020-01-20 13:08:18   selFlowTemp     41
     2020-01-20 13:07:57   state           restart
     2020-01-20 13:08:19   tapwater_active 0
     2020-01-20 13:08:22   uptime          124
     2020-01-20 13:08:22   version         1.9.3
     2020-01-20 13:08:18   wWActivated     on
     2020-01-20 13:08:18   wWCirc          on
     2020-01-20 13:08:18   wWCircPump      1
     2020-01-20 13:08:18   wWComfort       Hot
     2020-01-20 13:08:18   wWCurFlow       0
     2020-01-20 13:08:18   wWCurTmp        54.8
     2020-01-20 13:08:18   wWDesiredTemp   70
     2020-01-20 13:08:18   wWHeat          off
     2020-01-20 13:08:18   wWSelTemp       55
     2020-01-20 13:08:18   wWStarts        689
     2020-01-20 13:08:18   wWWorkM         10806
Attributes:
   IODev      myBroker
   autocreate 1
   bridgeRegexp p/ems-esp/(sensors|sm_data|hp_data|thermostat_data).*:.* "ems_esp_$1"
  p/ems-esp/(boiler_data|tapwater_active|heating_active|mixing_data|shower_data).*:.* "ems_esp_boiler"
   devStateIcon online:it_net offline:it_net@red  2.1:lan_rs485 2.0:lan_rs485@red
   icon       sani_boiler_temp
   model      ems-esp_heater_device
   readingList p/ems-esp/start:.* LWT
  p/ems-esp/heartbeat:.* { json2nameValue($EVENT) }
   room       Heizung,MQTT
   setList    restart:noArg p/ems-esp/restart
   stateFormat Interface:
LWT
Signal:
rssid %
<br>Uptime: formatedUptime
<br>IPAddress : <a href="http://IP" target="_blank">IP</a>
   userReadings formatedUptime:uptime.* {my $m = ReadingsVal($name,"uptime",0)/60;; return sprintf "0 000 00:%02d", $m if $m < 60;; my $h = $m / 60;; $m %= 60;; return sprintf "0 000 %02d:%02d", $h, $m if $h < 24;; my $d = $h / 24;; $h %= 24;; return sprintf "0 %03d %02d:%02d", $d, $h, $m if $d <365;; my $y = $d / 365;; $d %= 365;; return sprintf "%d %03d %02d:%02d", $y, $d, $h, $m}
   webCmd     restart


But could You please help me with the use of a "BASE_ID" - kannst gerne auch kurz auf deutsch schreiben

Und die "Gretchenfrage": Wie kann ich denn jetzt bestimmte Parameter setzen, da fehlt mir noch irgendwas zum Verstädnis ...

Dank Dir
Dieter
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 20 Januar 2020, 13:43:56
Wrt "BASE_ID": Du hast das default-"home" beim Compile rausgeworfen, daher macht das template was anderes als bei moustic99.
Mein Wunsch wäre, mit "default-settings" zu arbeiten, also bitte das "home" (oder was anderes) da wieder festzulegen, sonst müssen wir alles "zu Fuß" machen, was bedeutet, dass wir auch weitere attrTemplate-Vorschläge nicht sinnvoll testen können...

Für den Fußweg:
attr MQTT2_ems_esp bridgeRegexp ems-esp/(sensors|sm_data|hp_data|thermostat_data).*:.* "ems_esp_$1"\
  ems-esp/(boiler_data|tapwater_active|heating_active|mixing_data|shower_data).*:.* "ems_esp_boiler"

Ein Device, mit dem du dann das "thermostat"-Gerät auch steuern kannst, kann erst dann sinnvoll angelegt werden, wenn (wenigstens) die bridgeRegexp tut, was sie soll. Aber auch da wirst du ohne BASE_ID wieder das Problem haben, dass die Parameter für den hier gemachten template-Vorschlag nicht aufgelöst werden können bzw. falsch, und daher das Ergebnis nachgearbeitet werden muß.



Short English summary for moustic99: Strongly renewed the recommendation to set a base topic (BASE_ID) or to use the firmware authors default (home), but not to delete it...
Titel: Antw:ems-esp MQTT
Beitrag von: grappa24 am 20 Januar 2020, 14:04:45
Ich glaube, so langsam verstehe ich den Zusammenhang:

[Zitat]Wrt "BASE_ID": Du hast das default-"home" beim Compile rausgeworfen, daher macht das template was anderes als bei moustic99.[EndeZitat]

BASE_ID etc. wird im template gesetzt, ich hab aber nix rausgeworfen, sondern verwende das template so wie es in der aktuellen FHEM Version enthalten ist. Heißt das, dass der Code für das template verändert werden muss?

mein gateway benutzt übrigens "home" als Base, das sollte doch korrekt sein?
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 20 Januar 2020, 14:14:08
Yes, that's configured on the ESP8266 side. But "home" in the screenshot seems to be greyed out... I'd translate that to "not set"...
For testing purpose, I'd prefer something different, e.g. "heating_system" ;) .
Titel: Antw:ems-esp MQTT
Beitrag von: grappa24 am 20 Januar 2020, 14:46:29
wenn ich jetzt wüsste, was "mühsam ernährt sich das Eichhörnchen" auf englisch heißt ... ;D

Danke für Deine Geduld.

Ich hab jetzt im ESP8266 "Base" auf "heating_system" gesetzt, mein Listing sieht dann so aus:Internals:
   CID        ems-esp
   DEF        ems-esp
   DEVICETOPIC MQTT2_ems_esp
   FUUID      5df517f0-f33f-b5ae-cafa-1106443800f7120a
   IODev      myBroker
   LASTInputDev myBroker
   MSGCNT     3313
   NAME       MQTT2_ems_esp
   NR         556
   STATE      Interface:
LWT
Signal:
48 %
<br>Uptime: 0 000 00:06
<br>IPAddress : <a href="http://192.168.178.79" target="_blank">192.168.178.79</a>
   TYPE       MQTT2_DEVICE
   myBroker_MSGCNT 3313
   myBroker_TIME 2020-01-20 14:43:29
   OLDREADINGS:
   READINGS:
     2020-01-20 14:43:29   IP              192.168.178.79
     2020-01-20 14:43:29   MQTTdisconnects 0
     2020-01-20 14:43:17   ServiceCode     
     2020-01-20 14:43:17   ServiceCodeNumber 202
     2020-01-20 14:43:17   UBAuptime       350587
     2020-01-20 14:43:17   burnGas         off
     2020-01-20 14:43:17   burnStarts      12414
     2020-01-20 14:43:17   burnWorkMin     36878
     2020-01-20 14:43:17   curBurnPow      0
     2020-01-20 14:43:17   curFlowTemp     28.9
     2020-01-20 14:43:17   fanWork         off
     2020-01-20 14:43:17   flameCurr       0
     2020-01-20 14:43:29   formatedUptime  0 000 00:06
     2020-01-20 14:43:29   freemem         56
     2020-01-20 14:43:17   hc1_currtemp    0
     2020-01-20 14:43:17   hc1_mode        auto
     2020-01-20 14:43:17   hc1_seltemp     0
     2020-01-20 14:43:17   heatPmp         on
     2020-01-20 14:43:17   heatWorkMin     26072
     2020-01-20 14:43:17   heating_active  0
     2020-01-20 14:43:17   heating_temp    82
     2020-01-20 14:43:17   ignWork         off
     2020-01-20 14:43:29   load            2
     2020-01-20 14:43:17   outdoorTemp     5.3
     2020-01-20 14:43:17   pumpMod         37
     2020-01-20 14:43:17   pump_mod_max    100
     2020-01-20 14:43:17   pump_mod_min    10
     2020-01-20 14:43:29   rssid           48
     2020-01-20 14:43:17   selBurnPow      100
     2020-01-20 14:43:17   selFlowTemp     41
     2020-01-20 14:40:11   state           restart
     2020-01-20 14:43:17   tapwater_active 0
     2020-01-20 14:43:29   uptime          372
     2020-01-20 14:43:29   version         1.9.3
     2020-01-20 14:43:17   wWActivated     on
     2020-01-20 14:43:17   wWCirc          on
     2020-01-20 14:43:17   wWCircPump      1
     2020-01-20 14:43:17   wWComfort       Hot
     2020-01-20 14:43:17   wWCurFlow       0
     2020-01-20 14:43:17   wWCurTmp        53.1
     2020-01-20 14:43:17   wWDesiredTemp   70
     2020-01-20 14:43:17   wWHeat          off
     2020-01-20 14:43:17   wWSelTemp       55
     2020-01-20 14:43:17   wWStarts        689
     2020-01-20 14:43:17   wWWorkM         10806
Attributes:
   IODev      myBroker
   autocreate 1
   bridgeRegexp home/ems-esp/(sensors|sm_data|hp_data|thermostat_data).*:.* "ems_esp_$1"
  home/ems-esp/(boiler_data|tapwater_active|heating_active|mixing_data|shower_data).*:.* "ems_esp_boiler"
   devStateIcon online:it_net offline:it_net@red  2.1:lan_rs485 2.0:lan_rs485@red
   icon       sani_boiler_temp
   model      ems-esp_heater_device
   readingList home/ems-esp/start:.* LWT
  home/ems-esp/heartbeat:.* { json2nameValue($EVENT) }
ems_esp:heating_system/ems-esp/boiler_data:.* { json2nameValue($EVENT) }
ems_esp:heating_system/ems-esp/tapwater_active:.* tapwater_active
ems_esp:heating_system/ems-esp/heating_active:.* heating_active
ems_esp:heating_system/ems-esp/thermostat_data:.* { json2nameValue($EVENT) }
ems_esp:heating_system/ems-esp/heartbeat:.* { json2nameValue($EVENT) }
   room       Heizung,MQTT
   setList    restart:noArg home/ems-esp/restart
   stateFormat Interface:
LWT
Signal:
rssid %
<br>Uptime: formatedUptime
<br>IPAddress : <a href="http://IP" target="_blank">IP</a>
   userReadings formatedUptime:uptime.* {my $m = ReadingsVal($name,"uptime",0)/60;; return sprintf "0 000 00:%02d", $m if $m < 60;; my $h = $m / 60;; $m %= 60;; return sprintf "0 000 %02d:%02d", $h, $m if $h < 24;; my $d = $h / 24;; $h %= 24;; return sprintf "0 %03d %02d:%02d", $d, $h, $m if $d <365;; my $y = $d / 365;; $d %= 365;; return sprintf "%d %03d %02d:%02d", $y, $d, $h, $m}
   webCmd     restart


Kommen wir der Sache näher?
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 20 Januar 2020, 15:14:33
Zitat von: grappa24 am 20 Januar 2020, 14:46:29
Kommen wir der Sache näher?
Jein ::) ...

Jetzt bin ich am Rätseln, wo das "home" in der bridgeRegexp bzw. der readingList herkommt... (aber das war ja der Sinn des Test, ob es klappt ;D ).

Vermutlich hattest du zwischendurch "home" gesetzt?

Egal... Jetzt würde ich vorschlagen, dass du einfach alles an MQTT2_DEVICE löschst, was mit ems-bus zu tun hat, damit wir einmal von vorne checken können, ob alles paßt ::) .

Also: autocreate arbeiten lassen, dann das Basistemplate "ems-esp_heater_device" auf das hoffentlich von autocreate neu erstellte Device anwenden und etwas warten (nebenbei readingList und bridgeRegexp checken, da sollte dann alles mit "heating_system/" anfangen...). Dann solltest du mit dem list-Befehl dann irgendwann drei MQTT2_DEVICE-Devices "sehen".
Titel: Antw:ems-esp MQTT
Beitrag von: grappa24 am 20 Januar 2020, 16:19:31
ich hol mir jetzt erst mal eine neue SD-Karte für meinen RasPi, ich vermute, die Karte ist defekt, was mal wieder dazu führt, dass bei restarts von FHEM zuletzt getätigten Änderungen weg sind .... melde mich wieder
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 20 Januar 2020, 16:39:10
Sorry to hear that!

So "softly softly catchee monkey (https://dict.leo.org/forum/viewGeneraldiscussion.php?idThread=4218&idForum=4&lp=ende&lang=de#followup=16)" also on that front...
Titel: Antw:ems-esp MQTT
Beitrag von: grappa24 am 20 Januar 2020, 19:53:11
sofly softly catchee monkey - sehr nett  ;D

An der SD Karte lag es wohl doch nicht; was wohl wichtig ist, das ESP8266 Gateway zwischendurch immer mal wieder von der Heizung zu trennen und neu zu verbinden.

Ich hab nochmal ganz vorne angefangen, den Broker neu definiert: Internals:
   CFGFN     
   CONNECTS   1
   DEF        1883 global
   FD         40
   FUUID      5e25ece7-f33f-b5ae-0219-07d7f6d1689b0b27
   NAME       myBroker
   NR         603
   PORT       1883
   STATE      Initialized
   TYPE       MQTT2_SERVER
   READINGS:
     2020-01-20 19:09:54   RETAIN          {"heating_system/ems-esp/status":"online"}
     2020-01-20 19:09:54   nrclients       1
     2020-01-20 19:09:43   state           Initialized
   clients:
     myBroker_192.168.178.79_60312 1
   retain:
     heating_system/ems-esp/status:
       ts         1579543794.79581
       val        online
Attributes:
   room       MQTT


Reicht das "autocreate" auf default (=simple) zu lassen? Hab ich erst mal.

Dann wurde automatisch das folgende MQTT2-Device angelegt: Internals:
   CFGFN     
   CID        ems_esp
   DEF        ems_esp
   DEVICETOPIC MQTT2_ems_esp
   FUUID      5e25ecf2-f33f-b5ae-f38d-55cf4c0306d59f1d
   IODev      myBroker
   LASTInputDev myBroker
   MSGCNT     15
   NAME       MQTT2_ems_esp
   NR         606
   STATE      ???
   TYPE       MQTT2_DEVICE
   myBroker_MSGCNT 15
   myBroker_TIME 2020-01-20 19:16:51
   READINGS:
     2020-01-20 19:15:54   IP              192.168.178.79
     2020-01-20 19:15:54   MQTTdisconnects 6
     2020-01-20 19:16:50   ServiceCode     
     2020-01-20 19:16:50   ServiceCodeNumber 202
     2020-01-20 19:16:50   UBAuptime       350860
     2020-01-20 19:09:55   alert           0
     2020-01-20 19:16:50   burnGas         off
     2020-01-20 19:16:50   burnStarts      12438
     2020-01-20 19:16:50   burnWorkMin     36966
     2020-01-20 19:16:50   curBurnPow      0
     2020-01-20 19:16:50   curFlowTemp     32.3
     2020-01-20 19:16:50   fanWork         off
     2020-01-20 19:16:50   flameCurr       0
     2020-01-20 19:15:54   freemem         61
     2020-01-20 19:16:51   hc1_currtemp    0
     2020-01-20 19:16:51   hc1_mode        auto
     2020-01-20 19:16:51   hc1_seltemp     0
     2020-01-20 19:16:50   heatPmp         on
     2020-01-20 19:16:50   heatWorkMin     26148
     2020-01-20 19:16:51   heating_active  0
     2020-01-20 19:16:50   heating_temp    82
     2020-01-20 19:16:50   ignWork         off
     2020-01-20 19:15:54   load            1
     2020-01-20 19:16:50   outdoorTemp     1.7
     2020-01-20 19:16:50   pumpMod         41
     2020-01-20 19:16:50   pump_mod_max    100
     2020-01-20 19:16:50   pump_mod_min    10
     2020-01-20 19:15:54   rssid           52
     2020-01-20 19:16:50   selBurnPow      100
     2020-01-20 19:16:50   selFlowTemp     70
     2020-01-20 19:09:55   start           start
     2020-01-20 19:09:55   status          online
     2020-01-20 19:16:51   tapwater_active 0
     2020-01-20 19:09:55   timer           0
     2020-01-20 19:15:54   uptime          784
     2020-01-20 19:15:54   version         1.9.3
     2020-01-20 19:16:50   wWActivated     on
     2020-01-20 19:16:50   wWCirc          on
     2020-01-20 19:16:50   wWCircPump      1
     2020-01-20 19:16:50   wWComfort       Hot
     2020-01-20 19:16:50   wWCurFlow       0
     2020-01-20 19:16:50   wWCurTmp        55.9
     2020-01-20 19:16:50   wWDesiredTemp   70
     2020-01-20 19:16:50   wWHeat          off
     2020-01-20 19:16:50   wWSelTemp       55
     2020-01-20 19:16:50   wWStarts        690
     2020-01-20 19:16:50   wWWorkM         10818
Attributes:
   IODev      myBroker
   readingList ems_esp:heating_system/ems-esp/status:.* status
ems_esp:heating_system/ems-esp/start:.* start
ems_esp:heating_system/ems-esp/heartbeat:.* { json2nameValue($EVENT) }
ems_esp:heating_system/ems-esp/shower_data:.* { json2nameValue($EVENT) }
ems_esp:heating_system/ems-esp/boiler_data:.* { json2nameValue($EVENT) }
ems_esp:heating_system/ems-esp/tapwater_active:.* tapwater_active
ems_esp:heating_system/ems-esp/heating_active:.* heating_active
ems_esp:heating_system/ems-esp/thermostat_data:.* { json2nameValue($EVENT) }
   room       MQTT


Dann auf dieses Device das Basistemplate angewandt:Internals:
   CFGFN     
   CID        ems-esp
   DEF        ems-esp
   DEVICETOPIC MQTT2_ems_esp
   FUUID      5e25ecf2-f33f-b5ae-f38d-55cf4c0306d59f1d
   IODev      myBroker
   LASTInputDev myBroker
   MSGCNT     26
   NAME       MQTT2_ems_esp
   NR         606
   STATE      Interface:
LWT
Signal:
52 %
<br>Uptime: 0 000 00:17
<br>IPAddress : <a href="http://192.168.178.79" target="_blank">192.168.178.79</a>
   TYPE       MQTT2_DEVICE
   myBroker_MSGCNT 26
   myBroker_TIME 2020-01-20 19:20:51
   OLDREADINGS:
   READINGS:
     2020-01-20 19:19:54   IP              192.168.178.79
     2020-01-20 19:19:54   MQTTdisconnects 6
     2020-01-20 19:20:50   ServiceCode     
     2020-01-20 19:20:50   ServiceCodeNumber 202
     2020-01-20 19:20:50   UBAuptime       350864
     2020-01-20 19:20:50   burnGas         off
     2020-01-20 19:20:50   burnStarts      12439
     2020-01-20 19:20:50   burnWorkMin     36966
     2020-01-20 19:20:50   curBurnPow      0
     2020-01-20 19:20:50   curFlowTemp     49.8
     2020-01-20 19:20:50   fanWork         off
     2020-01-20 19:20:50   flameCurr       0
     2020-01-20 19:19:54   formatedUptime  0 000 00:17
     2020-01-20 19:19:54   freemem         61
     2020-01-20 19:20:51   hc1_currtemp    0
     2020-01-20 19:20:51   hc1_mode        auto
     2020-01-20 19:20:51   hc1_seltemp     0
     2020-01-20 19:20:50   heatPmp         on
     2020-01-20 19:20:50   heatWorkMin     26148
     2020-01-20 19:20:51   heating_active  0
     2020-01-20 19:20:50   heating_temp    82
     2020-01-20 19:20:50   ignWork         off
     2020-01-20 19:19:54   load            1
     2020-01-20 19:20:50   outdoorTemp     1.7
     2020-01-20 19:20:50   pumpMod         10
     2020-01-20 19:20:50   pump_mod_max    100
     2020-01-20 19:20:50   pump_mod_min    10
     2020-01-20 19:19:54   rssid           52
     2020-01-20 19:20:50   selBurnPow      100
     2020-01-20 19:20:50   selFlowTemp     70
     2020-01-20 19:20:51   tapwater_active 0
     2020-01-20 19:19:54   uptime          1024
     2020-01-20 19:19:54   version         1.9.3
     2020-01-20 19:20:50   wWActivated     on
     2020-01-20 19:20:50   wWCirc          on
     2020-01-20 19:20:50   wWCircPump      1
     2020-01-20 19:20:50   wWComfort       Hot
     2020-01-20 19:20:50   wWCurFlow       0
     2020-01-20 19:20:50   wWCurTmp        55.8
     2020-01-20 19:20:50   wWDesiredTemp   70
     2020-01-20 19:20:50   wWHeat          off
     2020-01-20 19:20:50   wWSelTemp       55
     2020-01-20 19:20:50   wWStarts        690
     2020-01-20 19:20:50   wWWorkM         10818
Attributes:
   IODev      myBroker
   autocreate 1
   bridgeRegexp m/ems-esp/(sensors|sm_data|hp_data|thermostat_data).*:.* "ems_esp_$1"
  m/ems-esp/(boiler_data|tapwater_active|heating_active|mixing_data|shower_data).*:.* "ems_esp_boiler"
   devStateIcon online:it_net offline:it_net@red  2.1:lan_rs485 2.0:lan_rs485@red
   icon       sani_boiler_temp
   model      ems-esp_heater_device
   readingList m/ems-esp/start:.* LWT
  m/ems-esp/heartbeat:.* { json2nameValue($EVENT) }
   room       MQTT
   setList    restart:noArg m/ems-esp/restart
   stateFormat Interface:
LWT
Signal:
rssid %
<br>Uptime: formatedUptime
<br>IPAddress : <a href="http://IP" target="_blank">IP</a>
   userReadings formatedUptime:uptime.* {my $m = ReadingsVal($name,"uptime",0)/60;; return sprintf "0 000 00:%02d", $m if $m < 60;; my $h = $m / 60;; $m %= 60;; return sprintf "0 000 %02d:%02d", $h, $m if $h < 24;; my $d = $h / 24;; $h %= 24;; return sprintf "0 %03d %02d:%02d", $d, $h, $m if $d <365;; my $y = $d / 365;; $d %= 365;; return sprintf "%d %03d %02d:%02d", $y, $d, $h, $m}
   webCmd     restart


Was auffällt, dass bei bridgeRegexp, readingList und setList das "ems_esp:heating_system" stumpf durch "m" ersetzt wurde, was läuft denn da falsch?

Ich hab dann das "m" händisch wieder durch "ems_esp":heating_system" ersetzt, dann tauchen plötzlich die folgenden Devices auf Internals:
   CFGFN     
   CID        ems_esp_thermostat_data
   DEF        ems_esp_thermostat_data
   DEVICETOPIC MQTT2_ems_esp_thermostat_data
   FUUID      5e25f162-f33f-b5ae-49cb-3df582f757ceba7d
   IODev      myBroker
   LASTInputDev myBroker
   MSGCNT     2
   NAME       MQTT2_ems_esp_thermostat_data
   NR         611
   STATE      ???
   TYPE       MQTT2_DEVICE
   myBroker_MSGCNT 2
   myBroker_TIME 2020-01-20 19:32:50
   READINGS:
     2020-01-20 19:28:51   associatedWith  MQTT2_ems_esp
     2020-01-20 19:32:50   hc1_currtemp    0
     2020-01-20 19:32:50   hc1_mode        auto
     2020-01-20 19:32:50   hc1_seltemp     0
Attributes:
   IODev      myBroker
   readingList heating_system/ems-esp/thermostat_data:.* { json2nameValue($EVENT) }
   room       MQTT2_DEVICE
und Internals:
   CFGFN     
   CID        ems_esp_boiler
   DEF        ems_esp_boiler
   DEVICETOPIC MQTT2_ems_esp_boiler
   FUUID      5e25f139-f33f-b5ae-00c9-a05f48a7a3a74576
   IODev      myBroker
   LASTInputDev myBroker
   MSGCNT     6
   NAME       MQTT2_ems_esp_boiler
   NR         576
   STATE      ???
   TYPE       MQTT2_DEVICE
   myBroker_MSGCNT 6
   myBroker_TIME 2020-01-20 19:32:50
   READINGS:
     2020-01-20 19:32:50   ServiceCode     
     2020-01-20 19:32:50   ServiceCodeNumber 202
     2020-01-20 19:32:50   UBAuptime       350876
     2020-01-20 19:28:10   alert           0
     2020-01-20 19:28:51   associatedWith  MQTT2_ems_esp
     2020-01-20 19:32:50   burnGas         off
     2020-01-20 19:32:50   burnStarts      12440
     2020-01-20 19:32:50   burnWorkMin     36967
     2020-01-20 19:32:50   curBurnPow      0
     2020-01-20 19:32:50   curFlowTemp     31.9
     2020-01-20 19:32:50   fanWork         off
     2020-01-20 19:32:50   flameCurr       0
     2020-01-20 19:32:50   heatPmp         on
     2020-01-20 19:32:50   heatWorkMin     26149
     2020-01-20 19:32:50   heating_active  0
     2020-01-20 19:32:50   heating_temp    82
     2020-01-20 19:32:50   ignWork         off
     2020-01-20 19:32:50   outdoorTemp     1.7
     2020-01-20 19:32:50   pumpMod         37
     2020-01-20 19:32:50   pump_mod_max    100
     2020-01-20 19:32:50   pump_mod_min    10
     2020-01-20 19:32:50   selBurnPow      100
     2020-01-20 19:32:50   selFlowTemp     71
     2020-01-20 19:32:50   tapwater_active 0
     2020-01-20 19:28:10   timer           0
     2020-01-20 19:32:50   wWActivated     on
     2020-01-20 19:32:50   wWCirc          on
     2020-01-20 19:32:50   wWCircPump      1
     2020-01-20 19:32:50   wWComfort       Hot
     2020-01-20 19:32:50   wWCurFlow       0
     2020-01-20 19:32:50   wWCurTmp        55.8
     2020-01-20 19:32:50   wWDesiredTemp   70
     2020-01-20 19:32:50   wWHeat          off
     2020-01-20 19:32:50   wWSelTemp       55
     2020-01-20 19:32:50   wWStarts        690
     2020-01-20 19:32:50   wWWorkM         10818
Attributes:
   IODev      myBroker
   readingList heating_system/ems-esp/shower_data:.* { json2nameValue($EVENT) }
heating_system/ems-esp/boiler_data:.* { json2nameValue($EVENT) }
heating_system/ems-esp/tapwater_active:.* tapwater_active
heating_system/ems-esp/heating_active:.* heating_active
   room       MQTT2_DEVICE
und das ursprüngliche Device MQTT2_ems_esp ist weg, taucht aber nach Entfernen und Neuanstecken des ESP8266 Gateways wieder auf: Internals:
   CID        ems-esp
   DEF        ems-esp
   DEVICETOPIC MQTT2_ems_esp
   FUUID      5e25ecf2-f33f-b5ae-f38d-55cf4c0306d59f1d
   IODev      myBroker
   NAME       MQTT2_ems_esp
   NR         565
   STATE      Interface:
LWT
Signal:
rssid %
<br>Uptime: formatedUptime
<br>IPAddress : <a href="http://IP" target="_blank">IP</a>
   TYPE       MQTT2_DEVICE
   READINGS:
     2020-01-20 19:26:50   ServiceCode     
     2020-01-20 19:26:50   ServiceCodeNumber 202
     2020-01-20 19:26:50   UBAuptime       350870
     2020-01-20 19:26:50   burnGas         off
     2020-01-20 19:26:50   burnStarts      12439
     2020-01-20 19:26:50   burnWorkMin     36966
     2020-01-20 19:26:50   curBurnPow      0
     2020-01-20 19:26:50   curFlowTemp     31
     2020-01-20 19:26:50   fanWork         off
     2020-01-20 19:26:50   flameCurr       0
     2020-01-20 19:26:51   hc1_currtemp    0
     2020-01-20 19:26:51   hc1_mode        auto
     2020-01-20 19:26:51   hc1_seltemp     0
     2020-01-20 19:26:50   heatPmp         on
     2020-01-20 19:26:50   heatWorkMin     26148
     2020-01-20 19:26:51   heating_active  0
     2020-01-20 19:26:50   heating_temp    82
     2020-01-20 19:26:50   ignWork         off
     2020-01-20 19:26:50   outdoorTemp     1.7
     2020-01-20 19:26:50   pumpMod         41
     2020-01-20 19:26:50   pump_mod_max    100
     2020-01-20 19:26:50   pump_mod_min    10
     2020-01-20 19:26:50   selBurnPow      100
     2020-01-20 19:26:50   selFlowTemp     70
     2020-01-20 19:37:31   state           restart
     2020-01-20 19:28:56   subscriptions   heating_system/ems-esp/boiler_cmd heating_system/ems-esp/boiler_cmd_wwactivated heating_system/ems-esp/boiler_cmd_wwtemp heating_system/ems-esp/generic_cmd heating_system/ems-esp/mode1 heating_system/ems-esp/mode2 heating_system/ems-esp/mode3 heating_system/ems-esp/mode4 heating_system/ems-esp/restart heating_system/ems-esp/shower_data heating_system/ems-esp/start heating_system/ems-esp/temp1 heating_system/ems-esp/temp2 heating_system/ems-esp/temp3 heating_system/ems-esp/temp4 heating_system/ems-esp/thermostat_cmd
     2020-01-20 19:26:51   tapwater_active 0
     2020-01-20 19:26:50   wWActivated     on
     2020-01-20 19:26:50   wWCirc          on
     2020-01-20 19:26:50   wWCircPump      1
     2020-01-20 19:26:50   wWComfort       Hot
     2020-01-20 19:26:50   wWCurFlow       0
     2020-01-20 19:26:50   wWCurTmp        55.8
     2020-01-20 19:26:50   wWDesiredTemp   70
     2020-01-20 19:26:50   wWHeat          off
     2020-01-20 19:26:50   wWSelTemp       55
     2020-01-20 19:26:50   wWStarts        690
     2020-01-20 19:26:50   wWWorkM         10818
Attributes:
   IODev      myBroker
   autocreate 1
   bridgeRegexp heating_system/ems-esp/(sensors|sm_data|hp_data|thermostat_data).*:.* "ems_esp_$1"
  heating_system/ems-esp/(boiler_data|tapwater_active|heating_active|mixing_data|shower_data).*:.* "ems_esp_boiler"
   devStateIcon online:it_net offline:it_net@red  2.1:lan_rs485 2.0:lan_rs485@red
   icon       sani_boiler_temp
   model      ems-esp_heater_device
   room       MQTT
   setList    restart:noArg heating_system/ems-esp/restart
   stateFormat Interface:
LWT
Signal:
rssid %
<br>Uptime: formatedUptime
<br>IPAddress : <a href="http://IP" target="_blank">IP</a>
   userReadings formatedUptime:uptime.* {my $m = ReadingsVal($name,"uptime",0)/60;; return sprintf "0 000 00:%02d", $m if $m < 60;; my $h = $m / 60;; $m %= 60;; return sprintf "0 000 %02d:%02d", $h, $m if $h < 24;; my $d = $h / 24;; $h %= 24;; return sprintf "0 %03d %02d:%02d", $d, $h, $m if $d <365;; my $y = $d / 365;; $d %= 365;; return sprintf "%d %03d %02d:%02d", $y, $d, $h, $m}
   webCmd     restart
allerdings ohne die Daten aus dem heartbeat? - ach ja und aktualisiert werden dessen readings auch nicht ...

Bleiben unterm Strich die Fragen:
Warum wird durch das Anwenden des templates der "Pfad verbogen" und
wo bleiden die Daten aus dem heartbeat im ursprünglichen Device?
warum wird das ursprünglihe Device nicht mehr aktualisiert?
Titel: Antw:ems-esp MQTT
Beitrag von: rudolfkoenig am 20 Januar 2020, 21:00:34
ZitatWarum wird durch das Anwenden des templates der "Pfad verbogen"
In der par:BASE_ID Zeile fehlt ein +:
Zitatpar:BASE_ID;base topic set, default is "home";{ AttrVal("DEVICE","readingList","") =~ m,[^:]+:?[/]?([^/]+)+[/][^/]+[/].*:, ? $1 : "home" }

Oder man verkuerzt den Regexp:
par:BASE_ID;base topic set, default is "home";{ AttrVal("DEVICE","readingList","") =~ m,([^/:]+)/, ? $1 : "home" }

Achtung: soweit ich sehe, wird in perl_code der par Zeile nur DEVICE ersetzt, BASE_ID vmtl. nicht.
Bei mir funktioniert folgende Zeile:par:DEV_ID;ID topic set, default is "ems-esp";{ AttrVal("DEVICE","readingList","") =~ m,[^/:]+/([^/]+), ? $1 : "ems-esp" }
Titel: Antw:ems-esp MQTT
Beitrag von: grappa24 am 20 Januar 2020, 23:21:37
super, vielen Dank, mit Rudis Änderungen funktioniert es!

Folgende drei MQTT2 Devices hab ich jetzt:
Internals:
   CFGFN     
   CID        ems-esp
   DEF        ems-esp
   DEVICETOPIC MQTT2_ems_esp
   FUUID      5e2620c0-f33f-b5ae-293a-a1b9289fc1dd6c81
   IODev      myBroker
   LASTInputDev myBroker
   MSGCNT     9
   NAME       MQTT2_ems_esp
   NR         638
   STATE      Interface:
LWT
Signal:
46 %
<br>Uptime: 0 000 00:16
<br>IPAddress : <a href="http://192.168.178.79" target="_blank">192.168.178.79</a>
   TYPE       MQTT2_DEVICE
   myBroker_MSGCNT 9
   myBroker_TIME 2020-01-20 23:07:12
   OLDREADINGS:
   READINGS:
     2020-01-20 23:07:12   IP              192.168.178.79
     2020-01-20 23:07:12   MQTTdisconnects 0
     2020-01-20 23:07:12   formatedUptime  0 000 00:16
     2020-01-20 23:07:12   freemem         55
     2020-01-20 23:07:12   load            1
     2020-01-20 23:07:12   rssid           46
     2020-01-20 22:55:18   state           restart
     2020-01-20 23:07:12   uptime          965
     2020-01-20 23:07:12   version         1.9.3
Attributes:
   IODev      myBroker
   autocreate 1
   bridgeRegexp heating_system/ems-esp/(sensors|sm_data|hp_data|thermostat_data).*:.* "ems_esp_$1"
  heating_system/ems-esp/(boiler_data|tapwater_active|heating_active|mixing_data|shower_data).*:.* "ems_esp_boiler"
   devStateIcon online:it_net offline:it_net@red  2.1:lan_rs485 2.0:lan_rs485@red
   icon       sani_boiler_temp
   model      ems-esp_heater_device
   readingList heating_system/ems-esp/start:.* LWT
  heating_system/ems-esp/heartbeat:.* { json2nameValue($EVENT) }
   room       MQTT
   setList    restart:noArg heating_system/ems-esp/restart
   stateFormat Interface:
LWT
Signal:
rssid %
<br>Uptime: formatedUptime
<br>IPAddress : <a href="http://IP" target="_blank">IP</a>
   userReadings formatedUptime:uptime.* {my $m = ReadingsVal($name,"uptime",0)/60;; return sprintf "0 000 00:%02d", $m if $m < 60;; my $h = $m / 60;; $m %= 60;; return sprintf "0 000 %02d:%02d", $h, $m if $h < 24;; my $d = $h / 24;; $h %= 24;; return sprintf "0 %03d %02d:%02d", $d, $h, $m if $d <365;; my $y = $d / 365;; $d %= 365;; return sprintf "%d %03d %02d:%02d", $y, $d, $h, $m}
   webCmd     restart

Internals:
   CFGFN     
   CID        ems_esp_boiler
   DEF        ems_esp_boiler
   DEVICETOPIC MQTT2_ems_esp_boiler
   FUUID      5e26209a-f33f-b5ae-8c32-3af08e0158a115a6
   IODev      myBroker
   LASTInputDev myBroker
   MSGCNT     54
   NAME       MQTT2_ems_esp_boiler
   NR         636
   STATE      ???
   TYPE       MQTT2_DEVICE
   myBroker_MSGCNT 54
   myBroker_TIME 2020-01-20 23:11:06
   READINGS:
     2020-01-20 23:11:06   ServiceCode     
     2020-01-20 23:11:06   ServiceCodeNumber 204
     2020-01-20 23:11:06   UBAuptime       351094
     2020-01-20 22:51:12   alert           0
     2020-01-20 22:51:12   associatedWith  MQTT2_ems_esp
     2020-01-20 23:11:06   burnGas         off
     2020-01-20 23:11:06   burnStarts      12450
     2020-01-20 23:11:06   burnWorkMin     37093
     2020-01-20 23:11:06   curBurnPow      0
     2020-01-20 23:11:06   curFlowTemp     48.7
     2020-01-20 23:11:06   fanWork         off
     2020-01-20 23:11:06   flameCurr       0
     2020-01-20 23:11:06   heatPmp         on
     2020-01-20 23:11:06   heatWorkMin     26275
     2020-01-20 23:11:06   heating_active  0
     2020-01-20 23:11:06   heating_temp    82
     2020-01-20 23:11:06   ignWork         off
     2020-01-20 23:11:06   outdoorTemp     -1.5
     2020-01-20 23:11:06   pumpMod         41
     2020-01-20 23:11:06   pump_mod_max    100
     2020-01-20 23:11:06   pump_mod_min    10
     2020-01-20 23:11:06   selBurnPow      100
     2020-01-20 23:11:06   selFlowTemp     20
     2020-01-20 23:11:06   tapwater_active 0
     2020-01-20 22:51:12   timer           0
     2020-01-20 23:11:06   wWActivated     on
     2020-01-20 23:11:06   wWCirc          on
     2020-01-20 23:11:06   wWCircPump      1
     2020-01-20 23:11:06   wWComfort       Hot
     2020-01-20 23:11:06   wWCurFlow       0
     2020-01-20 23:11:06   wWCurTmp        52.3
     2020-01-20 23:11:06   wWDesiredTemp   70
     2020-01-20 23:11:06   wWHeat          off
     2020-01-20 23:11:06   wWSelTemp       55
     2020-01-20 23:11:06   wWStarts        690
     2020-01-20 23:11:06   wWWorkM         10818
Attributes:
   IODev      myBroker
   readingList heating_system/ems-esp/boiler_data:.* { json2nameValue($EVENT) }
heating_system/ems-esp/tapwater_active:.* tapwater_active
heating_system/ems-esp/heating_active:.* heating_active
heating_system/ems-esp/shower_data:.* { json2nameValue($EVENT) }
   room       MQTT

Internals:
   CFGFN     
   CID        ems_esp_thermostat_data
   DEF        ems_esp_thermostat_data
   DEVICETOPIC MQTT2_ems_esp_thermostat_data
   FUUID      5e26209a-f33f-b5ae-61b3-98d8542ed2d006b5
   IODev      myBroker
   LASTInputDev myBroker
   MSGCNT     11
   NAME       MQTT2_ems_esp_thermostat_data
   NR         637
   STATE      ???
   TYPE       MQTT2_DEVICE
   myBroker_MSGCNT 11
   myBroker_TIME 2020-01-20 23:11:06
   READINGS:
     2020-01-20 22:50:19   associatedWith  MQTT2_ems_esp
     2020-01-20 23:11:06   hc1_currtemp    0
     2020-01-20 23:11:06   hc1_mode        auto
     2020-01-20 23:11:06   hc1_seltemp     0
Attributes:
   IODev      myBroker
   readingList heating_system/ems-esp/thermostat_data:.* { json2nameValue($EVENT) }
   room       MQTT


Ich hab die geänderte mqtt2.template mit Rudis Änderungen beigefügt, if you like ...


@moustic999: With the two lines changed (according rudolfkoenig)
par:BASE_ID;base topic set, default is "home";{ AttrVal("DEVICE","readingList","") =~ m,([^/:]+)/, ? $1 : "home" }
par:DEV_ID;ID topic set, default is "ems-esp";{ AttrVal("DEVICE","readingList","") =~ m,[^/:]+/([^/]+), ? $1 : "ems-esp" }


the template works well and separates the basic device into MQTT2_ems_esp
MQTT2_ems_esp_boiler
MQTT2_ems_esp_thermostat_data


good night everybody  8) - to be continued ...
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 21 Januar 2020, 10:53:13
 :) Thanks to Rudi for fixing the issue.

As there where several other things in the pipeline to be changed in the attrTemplate file, I just pushed the fix and some further code wrt. to ems-esp to svn. Either use tomorrow's update, download from svn or (with recent 99_Utils method) use
{ Svn_GetFile("FHEM/lib/AttrTemplate/mqtt2.template", "FHEM/lib/AttrTemplate/mqtt2.template", sub(){ AttrTemplate_Initialize() }) }
to get the these changes :) .

So from my side, there are several issues to address until "the job is done":
- is the grouping of the sent data meaningful, or should there be some changes? (=bridgeRegexp of the base template builds "reasonable" devices?!? Or do we need more or less?)
- are the reading names "good"? (I added $JSONMAP to the json2nameValue() function, so we can easily rename the names used by the ESP firmware; perhaps we also need a "prefix", if there's sent identically named data for different parts of the bus...?)
- setList for boiler device?
- Optics for boiler device (stateFormat, icons and so on...)
- hide the additional templates to users not using ems-esp (use prereq: or move them to seperate template file in contrib/AttrTemplate, see changes here (https://svn.fhem.de/trac/changeset/21028/), esp. to ebus and milight).

sofly softly catchee monkey...
Titel: Antw:ems-esp MQTT
Beitrag von: grappa24 am 21 Januar 2020, 19:36:42
gladly I will try to help solving the issues, will take some time. My next step is to test another thermostat (Bosch CW400), because my CT200 is not really communicative  ;)
2020-01-21 19:19:39   hc1_currtemp    0
2020-01-21 19:19:39   hc1_mode        auto
2020-01-21 19:19:39   hc1_seltemp     0
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 22 Januar 2020, 05:52:50
Nevertheless,

I'd be interested, if "ems-esp_thermostat_simple" would allow some basic control of the CT200...?
(When working on the ebus-thing, there sometimes had been some restrictions in getting values; they to a big extend only have been sent when explicitly beeing requested or commands beeing executed. Might be similar here..?)
Titel: Antw:ems-esp MQTT
Beitrag von: moustic999 am 22 Januar 2020, 09:59:21
Sorry, to answer so late. I was travelling for my job and then had not so much time to check.
There was many improvements done on the EMS-ESP side, especially on mqtt.

I did not use the template yet, I just set up the value I needed to have a working setup.
So fart I can control the target temp and the desired mode of my heater/thermostat ( Buderus RC300 , auto/manual mode + target temp)
I also retrieve a bunch of sensors (outdoor temp, return temp, flow temp) to monitor the heater working to optimize it later on.

all these could be quite easily combined into 1 or more template.
I will do some cleanup in the code and will share what is working for me.




Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 22 Januar 2020, 10:09:50
@moustic999
Thanks for feedback, glad to hear, things are working to your satisfaction and you are about to optimize things.

Looking forward to your sharing what you have and your ideas to group all the information and commands :) .
Titel: Antw:ems-esp MQTT
Beitrag von: grappa24 am 22 Januar 2020, 14:31:30
Zitat von: Beta-User am 22 Januar 2020, 05:52:50
I'd be interested, if "ems-esp_thermostat_simple" would allow some basic control of the CT200...?
what does "ems-esp_thermostat_simple" mean?  The autocreate attr of the broker?

I used MQTT-Explorer today to see what CT200 publishes: {"hc1":{"seltemp":0,"currtemp":0,"mode":"auto"}}

On the other hand the CT200 ist marked as "read only" at the "Supported EMS Device List" at emsespgithub  :(

My "plumber" will give me a CW400 for testing this afternoon, we'll see ...
Titel: Antw:ems-esp MQTT
Beitrag von: grappa24 am 22 Januar 2020, 14:39:07
Zitat von: moustic999 am 22 Januar 2020, 09:59:21
So fart I can control the target temp and the desired mode of my heater/thermostat ( Buderus RC300 , auto/manual mode + target temp)
hi moustic999, which parameters of the "boiler_data" (name of the reading?) do you control in practice?
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 22 Januar 2020, 14:43:36
Zitat von: grappa24 am 22 Januar 2020, 14:31:30
what means "ems-esp_thermostat_simple"? 
That's one of the additional ems-esp-attrTemplates I pushed to svn yesterday for testing ;) .

But if the CT200 ist marked as "read only", there seems nothing reasonable to be tested... Hiding meaningless values might be possible, but imo it's not worth doing the effort  :( .



Zitat von: grappa24 am 22 Januar 2020, 14:39:07
hi moustic999, which parameters of the "boiler_data" (name of the reading?) do you control in practice?
To both of you: Pls pay attention to the original reading names. They may differ, when jsonMap is used!
Titel: Antw:ems-esp MQTT
Beitrag von: grappa24 am 22 Januar 2020, 18:22:37
Here is the result of using  "ems-esp_thermostat_simple" on my CT200, represented by MQTT2_ems_esp_thermostat_data: Internals:
   CFGFN     
   CID        ems_esp_thermostat_data
   DEF        ems_esp_thermostat_data
   DEVICETOPIC MQTT2_ems_esp_thermostat_data
   FUUID      5e287c55-f33f-b5ae-ddb6-3efae8688d1e780f
   IODev      myBroker
   LASTInputDev myBroker
   MSGCNT     13
   NAME       MQTT2_ems_esp_thermostat_data
   NR         655
   STATE      auto
0 °C
   TYPE       MQTT2_DEVICE
   myBroker_MSGCNT 13
   myBroker_TIME 2020-01-22 18:12:13
   JSONMAP:
     hc1_daytemp daytemp
     hc1_holidayttemp holidaytemp
     hc1_mode   mode
     hc1_nighttemp nighttemp
     hc1_seltemp desired-temp
   READINGS:
     2020-01-22 17:46:13   associatedWith  MQTT2_ems_esp
     2020-01-22 18:12:13   desired-temp    0
     2020-01-22 18:12:13   hc1_currtemp    0
     2020-01-22 17:48:12   hc1_mode        auto
     2020-01-22 17:48:12   hc1_seltemp     0
     2020-01-22 18:12:13   mode            auto
Attributes:
   IODev      myBroker
   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
   icon       temp_control
   jsonMap    hc1_mode:mode hc1_seltemp:desired-temp hc1_daytemp:daytemp hc1_nighttemp:nighttemp hc1_holidayttemp:holidaytemp
   model      ems-esp_thermostat_RC35_type
   readingList heating_system/ems-esp/thermostat_data:.* { json2nameValue($EVENT, '', $JSONMAP) }
   room       MQTT
   setList    mode:uzsuSelectRadio,auto,manual heating_system/ems-esp/thermostat_cmd_mode1 $EVTPART1
  desired-temp:slider,15.0,0.5,30.0,1 heating_system/ems-esp/thermostat_cmd_temp1 $EVTPART1
  daytemp:slider,15.0,0.5,30.0,1 heating_system/ems-esp/thermostat_cmd_daytemp1 $EVTPART1
  nighttemp:slider,15.0,0.5,30.0,1 heating_system/ems-esp/thermostat_cmd_nighttemp1 $EVTPART1
  holidaytemp:slider,15.0,0.5,30.0,1 heating_system/ems-esp/thermostat_cmd_holidayttemp1 $EVTPART1
   setStateList on off
   stateFormat mode
desired-temp °C
   webCmd     mode:desired-temp


Looks nice but the set-commands (slider to 25 e.g.) do have no effect on my CT200. The second screenshot shows the original dashboard of my Gateway.

However my MQTT-Explorer shows a new line thermostat_cmd_temp1 = 25.0

tomorrow I will install the CW400, I'm exited what happens ...

Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 23 Januar 2020, 12:07:52
 ;D Funny...

I just added a new template for "read-only thermostats" (available via update tomorrow). That way, at least local changes to auto/manual and desired-temp (they are possible, I assume?) will show up within FHEM in a reasonable manner  ;D .
Titel: Antw:ems-esp MQTT
Beitrag von: grappa24 am 23 Januar 2020, 12:32:59
The CW400 seems to be type RC300 an publishes

- seltemp, mapped to desired-temp in FHEM
- currtemp, mapped to hc1_currtemp
- daytemp
- nighttemp
- mode, mapped to mode (auto, manual, heat)

- hc1_seltemp delivers some strange values (in my case 0.24) ?
- hc1_mode delivers"off" in my case, no idea ...

But unfortunately the set commands have no effect, neither desired-temp nor mode

Let me know if I can do further test, I can keep the CW400 until monday.

P.S. If CW400 really is Type RC300 (?) there seems to be a contradiction between the github docu https://emsesp.github.io/docs/#/Thermostat-Modes-RC35-vs-RC300 und my experience: According to docu RC300 has two modes auto (eco, comfort) and manual, but my CW400 has the modes auto, manual and heat while auto has the additional Parameters daytemp/nighttemp



Titel: Antw:ems-esp MQTT
Beitrag von: grappa24 am 23 Januar 2020, 12:41:56
Zitat von: Beta-User am 23 Januar 2020, 12:07:52
That way, at least local changes to auto/manual and desired-temp (they are possible, I assume?) will show up within FHEM in a reasonable manner  ;D .
Since the CT200 neither publishes anything nor allows to set values this thermostat has to go to BLACKLIST  :D
But thanks for your work, if there are thermostats which publish but dont allow to set its valuable ...
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 23 Januar 2020, 12:57:49
The hc1_.*-Readings are outdated, in the template the following is still missing:
deletereading -q DEVICE (?!associatedWith).*

Imo we should not concentrate on that...

So most important thing atm. is the sending path. I just build the topic trees according to https://emsesp.github.io/docs/#/MQTT?id=receiving-topics (or at least I tried to do so). So please double-check if the setList entries are build according to https://emsesp.github.io/docs/#/MQTT?id=monitoring-mqtt.

One remark:
Screenshots from within FHEM are not best practice for discussions on MQTT2_DEVICE. If ever possible, just use RAW code (https://wiki.fhem.de/wiki/Import_von_Code_Snippets), that's much easier to check and send back for testing.





Wrt. to the CT200: as most likely we can't identify it the MQTT way, blacklisting isn't possible ::) ;D >:( :P
Titel: Antw:ems-esp MQTT
Beitrag von: grappa24 am 23 Januar 2020, 14:21:56
Zitat von: Beta-User am 23 Januar 2020, 12:57:49
So most important thing atm. is the sending path. I just build the topic trees according to https://emsesp.github.io/docs/#/MQTT?id=receiving-topics (or at least I tried to do so). So please double-check if the setList entries are build according to https://emsesp.github.io/docs/#/MQTT?id=monitoring-mqtt.
Kannst Du mir mal skizzieren, wie man so einen set Befehl zu Fuß absetzt, damit ich das mal auf dieser elementaren Ebene testen und die topic trees verifizieren kann?

Ich hab da eine Vermutung: Bei thermostat_cmd_mode<n> steht im git, es sei spezifisch für die Home Assistant climate component, eine Alternative wäre das thermonstat_cmd topic eine Zeile darunter, das teste ich mal, müsste halt nur mal die Syntax für "zu Fuß" sehen ...

Ich glaube, ich bin jetzt da angekommen, wo man normalerweise anfängt, um etwas zu verstehen  ;D
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 23 Januar 2020, 14:32:25
Wenn du es von FHEM aus machen willst, am einfachsten das publish des IO nutzen:

Was im Moment (indirekt über die setList) abgebildet zu sein scheint, ist das hier:
set myBroker publish heating_system/ems-esp/thermostat_cmd_temp1 20.8
Ich habe den Verdacht, dass die Doku veraltet ist und eigentlich "Topic:home/ems-esp/thermostat_cmd + JSON-Blob" erwartet wird... Dann ggf. mal an den Codes in mqtt2.template orientieren, ein verschachteltes Beispiel wäre "zigbee2mqtt_bridge"?
Titel: Antw:ems-esp MQTT
Beitrag von: grappa24 am 23 Januar 2020, 16:45:41
Ah, mit set myBroker publish kann ich was anfangen. Das hat mir gefehlt, jetzt kann ich testen.
Titel: Antw:ems-esp MQTT
Beitrag von: grappa24 am 23 Januar 2020, 17:48:40
Das receiving topic war tatsächlich "falsch", mit "thermostat_cmd_xyz<n>" geht es nicht: This is specific for the Home Assistant climate component

Mit folgenden Befehlen z.B. war ich erfolgreich:

set myBroker publish heating_system/ems-esp/thermostat_cmd { "cmd":"mode1", "data": "auto" }
set myBroker publish heating_system/ems-esp/thermostat_cmd { "cmd":"temp1", "data": 20 }

Meintest du das mit JSON-Blob?

Ich werd morgen noch weitere receiving topics ausprobieren und dokumentieren. Läuft doch ... ;D

Jetzt wartet erst mal die Enkelin ... ;)
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 23 Januar 2020, 17:56:59
Zitat von: grappa24 am 23 Januar 2020, 17:48:40
Meintest du das mit JSON-Blob?
Yep!

Auf die Schnelle als Beispiel für einen setList -Eintrag:
mode:uzsuSelectRadio,auto,manual heating_system/ems-esp/thermostat_cmd { "cmd":"mode1", "data": "$EVTPART1" }
Viel Spaß mit dem Enkelchen!
Titel: Antw:ems-esp MQTT
Beitrag von: grappa24 am 24 Januar 2020, 09:03:25
just have to go OT  :(

when i connected my ems gateway to my boiler, the boiler powers down immediately but powers on again as soon as i disconnect the gateway - any idea? I also contaced BBQKees for help ...

Edit:
So I have to pause testing this weekend, Kees will send me a new gateway on warranty
It's a pitty, because I just wrote the setList for thermostat and boiler ...  :'(

Edit2:
Online again, my gateway did revover by itself ...  :-X
Titel: Antw:ems-esp MQTT
Beitrag von: grappa24 am 24 Januar 2020, 14:15:11
gestern Abend noch der große Durchbruch, jetzt häng ich wieder beim Anwenden der templates.

Neuestes Update gezogen, klar.

Autocreate legt MQTT2_ems_esp das Basisdevice an.

Dann darauf das ems-esp_heater_device Template angewandt, geht soweit. Zunächst erscheinen auch nur die gemäß ReadingList Definierten readings start und heartbeat, dann kommen aber wieder alle readings des Basisdevices und _boiler und _thermostat erscheinen nicht. Hier das Listing nach "template":
Save config ?
Floorplans
Alexa
Bad
CUL_HM
CUL_HOERMANN
Diele
Dieter
FBDECT
FS20
Fenster
Floorplans
FritzBox
HEOS
HMS
HUEDevice
HWR
Heike
Heizung
InterTechno
KNX
Keller
Klaenge
Kueche
LGTV
MQTT
MQTT2_DEVICE
Makros
Plots
Presence
Raumklima
Rollos
Schlafzimmer
TVs
Tradfri
Treppenhaus
Unsorted
Velux
Watchdogs
Webcams
Wetter
Wohnzimmmer
XiaomiBTLESens
Zeit
netatmo
icoEverything Everything
Logfile
Commandref
Remote doc
Edit files
Select style
Event monitor
Update
UpdateCheck
Restart

Internals:
   CFGFN     
   CID        ems-esp
   DEF        ems-esp
   DEVICETOPIC MQTT2_ems_esp
   FUUID      5e2ae9dd-f33f-b5ae-bccf-af9525ecf67b8286
   IODev      myBroker
   LASTInputDev myBroker
   MSGCNT     44
   NAME       MQTT2_ems_esp
   NR         573
   STATE      Interface:
start
Signal:
40 %
<br>Uptime: 0 000 00:06
<br>IPAddress : <a href="http://192.168.178.79" target="_blank">192.168.178.79</a>
   TYPE       MQTT2_DEVICE
   myBroker_MSGCNT 44
   myBroker_TIME 2020-01-24 14:11:59
   OLDREADINGS:
   READINGS:
     2020-01-24 14:11:00   IP              192.168.178.79
     2020-01-24 14:05:00   LWT             start
     2020-01-24 14:11:00   MQTTdisconnects 0
     2020-01-24 14:11:59   ServiceCode     
     2020-01-24 14:11:59   ServiceCodeNumber 200
     2020-01-24 14:11:59   UBAuptime       356102
     2020-01-24 14:05:00   alert           0
     2020-01-24 14:11:59   burnGas         on
     2020-01-24 14:11:59   burnStarts      12764
     2020-01-24 14:11:59   burnWorkMin     38933
     2020-01-24 14:11:59   curBurnPow      58
     2020-01-24 14:11:59   curFlowTemp     29
     2020-01-24 14:11:59   fanWork         on
     2020-01-24 14:11:59   flameCurr       22.6
     2020-01-24 14:11:00   formatedUptime  0 000 00:06
     2020-01-24 14:11:00   freemem         61
     2020-01-24 14:10:57   hc1_currtemp    0
     2020-01-24 14:10:57   hc1_mode        auto
     2020-01-24 14:10:57   hc1_seltemp     0
     2020-01-24 14:11:59   heatPmp         on
     2020-01-24 14:11:59   heatWorkMin     27980
     2020-01-24 14:11:59   heating_active  1
     2020-01-24 14:11:59   heating_temp    82
     2020-01-24 14:11:59   ignWork         off
     2020-01-24 14:11:00   load            1
     2020-01-24 14:11:59   outdoorTemp     2.6
     2020-01-24 14:11:59   pumpMod         41
     2020-01-24 14:11:59   pump_mod_max    100
     2020-01-24 14:11:59   pump_mod_min    10
     2020-01-24 14:11:00   rssid           40
     2020-01-24 14:11:59   selBurnPow      100
     2020-01-24 14:11:59   selFlowTemp     52
     2020-01-24 14:05:00   start           start
     2020-01-24 14:04:27   state           restart
     2020-01-24 14:05:00   status          online
     2020-01-24 14:11:59   tapwater_active 0
     2020-01-24 14:05:00   timer           0
     2020-01-24 14:11:00   uptime          364
     2020-01-24 14:11:00   version         1.9.3
     2020-01-24 14:11:59   wWActivated     on
     2020-01-24 14:11:59   wWCirc          on
     2020-01-24 14:11:59   wWCircPump      1
     2020-01-24 14:11:59   wWComfort       Hot
     2020-01-24 14:11:59   wWCurFlow       0
     2020-01-24 14:11:59   wWCurTmp        56.8
     2020-01-24 14:11:59   wWDesiredTemp   70
     2020-01-24 14:11:59   wWHeat          off
     2020-01-24 14:11:59   wWSelTemp       55
     2020-01-24 14:11:59   wWStarts        705
     2020-01-24 14:11:59   wWWorkM         10953
Attributes:
   IODev      myBroker
   autocreate 1
   bridgeRegexp heating_system/ems-esp/(sensors|sm_data|hp_data|thermostat_data).*:.* "ems_esp_$1"
  heating_system/ems-esp/(boiler_data|tapwater_active|heating_active|mixing_data|shower_data).*:.* "ems_esp_boiler"
   devStateIcon online:it_net offline:it_net@red  2.1:lan_rs485 2.0:lan_rs485@red
   icon       sani_boiler_temp
   model      ems-esp_heater_device
   readingList heating_system/ems-esp/start:.* LWT
  heating_system/ems-esp/heartbeat:.* { json2nameValue($EVENT,'',$JSONMAP) }
   room       MQTT2_DEVICE
   setList    restart:noArg heating_system/ems-esp/restart
   stateFormat Interface:
LWT
Signal:
rssid %
<br>Uptime: formatedUptime
<br>IPAddress : <a href="http://IP" target="_blank">IP</a>
   userReadings formatedUptime:uptime.* {my $m = ReadingsVal($name,"uptime",0)/60;; return sprintf "0 000 00:%02d", $m if $m < 60;; my $h = $m / 60;; $m %= 60;; return sprintf "0 000 %02d:%02d", $h, $m if $h < 24;; my $d = $h / 24;; $h %= 24;; return sprintf "0 %03d %02d:%02d", $d, $h, $m if $d <365;; my $y = $d / 365;; $d %= 365;; return sprintf "%d %03d %02d:%02d", $y, $d, $h, $m}
   webCmd     restart


Alles noch mal gelöscht, dann kommen die topics _boiler und _thermostat, aber dann nicht mehr das Basisdevice. Weiß grad nicht, wo ich ansetzen soll - viel lieber wollte ich die SetList für _boiler schreiben/testen .... :-[

Edit: Jetzt sind wieder alle drei da ...
MQTT2_ems_esp
MQTT2_ems_esp_boiler
MQTT2_ems_esp_thermostat_data
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 24 Januar 2020, 14:33:35
Hmm, woher die "Geisterreadings" kommen, kann ich grade auch nicht feststellen, evtl. solltest du parallel mal den MQTT-Verkehr mitschneiden (RAW-Events am IO mit heating_system.* aktivieren?), eventuell auch mal den ESP aus lassen, die beiden weiteren Devices löschen (aber das bridge-Gerät so lassen, wie das attrTemplate es erstellt hat, und dort nur die Readings löschen), save+shutdown restart, dann den ESP wieder starten?
(Zum Hintergrund: Manche Dinge, werden in zentralen Hashs gehalten, insbes. die gesammelten bridgeRegexp-Ausdrücke, und jedenfalls früher waren da manchmal auch nach dem Ändern/Löschen noch Reste vorhanden, die dann seltsame Effekte hatten. Eigentlich sollte das gefixt sein, aber wir wollten ja templates bauen und nicht vorrangig sowas näher untersuchen).

Jendenfalls sieht das list soweit ok aus (auch wenn ich nach wie vor die RAW-Variante bei MQTT2_DEVICE deutlich angenehmer fände).
Titel: Antw:ems-esp MQTT
Beitrag von: grappa24 am 24 Januar 2020, 14:56:34
puh, alles wieder im grünen Bereich, ich fang jetzt mal mit dem SetList für _boiler an.

by the way:

Can we change the reading names of thermostat_data
from: desired-temp to seltemp
from: hc1_currtemp to currtemp

Internals:
   CFGFN     
   CID        ems_esp_thermostat_data
   DEF        ems_esp_thermostat_data
   DEVICETOPIC MQTT2_ems_esp_thermostat_data
   FUUID      5e2af0ee-f33f-b5ae-4a11-34f6bfe924451767
   IODev      myBroker
   LASTInputDev myBroker
   MSGCNT     14
   NAME       MQTT2_ems_esp_thermostat_data
   NR         615
   STATE      heat
22 °C
   TYPE       MQTT2_DEVICE
   myBroker_MSGCNT 14
   myBroker_TIME 2020-01-24 14:40:48
   JSONMAP:
     hc1_daytemp daytemp
     hc1_holidayttemp holidaytemp
     hc1_mode   mode
     hc1_nighttemp nighttemp
     hc1_seltemp desired-temp
   READINGS:
     2020-01-24 14:28:14   associatedWith  MQTT2_ems_esp
     2020-01-24 14:40:48   desired-temp    22
     2020-01-24 14:40:48   hc1_currtemp    23
     2020-01-24 14:34:14   hc1_mode        off
     2020-01-24 14:34:14   hc1_seltemp     0
     2020-01-24 14:40:48   mode            heat
Attributes:
   IODev      myBroker
   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
   icon       temp_control
   jsonMap    hc1_mode:mode hc1_seltemp:desired-temp hc1_daytemp:daytemp hc1_nighttemp:nighttemp hc1_holidayttemp:holidaytemp
   model      ems-esp_thermostat_simple
   readingList heating_system/ems-esp/thermostat_data:.* { json2nameValue($EVENT, '', $JSONMAP) }
   room       MQTT2_DEVICE
   setList    mode:uzsuSelectRadio,auto,manual heating_system/ems-esp/thermostat_cmd { "cmd":"mode1", "data": "$EVTPART1" }
  desired-temp:slider,15.0,0.5,30.0,1 heating_system/ems-esp/thermostat_cmd { "cmd":"temp1", "data": "$EVTPART1" }
   setStateList on off
   stateFormat mode
desired-temp °C
   webCmd     mode:desired-temp


Ich hab auch mal die RAW-Events am Broker aktiviert, wo kann man die dann sehen? ... sorry
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 24 Januar 2020, 15:09:37
We could do so, but please keep in mind the reason we did it the way it is now: Imo we should use same reading names for the same functionality that are already established in other modules for heating control purposes...

So I'd rather suggest to map "hc_1_currtemp" to "measured-temp" (assuming it has the same meaning/function) according to teminology in CUL_HM (or use any other's Module-Type  wording that is already well-known and especially used in (weekprofile and) WeekdayTimer) ;) .

But if the meaning is different, feel free to make good suggestions. It's just some small changes to jsonMap and setList to rename things to whatever is reasonable...

To see the RAW-Events, use menu entry "Event monitor".
Titel: Antw:ems-esp MQTT
Beitrag von: grappa24 am 24 Januar 2020, 19:43:01
Zitat von: Beta-User am 24 Januar 2020, 15:09:37
So I'd rather suggest to map "hc_1_currtemp" to "measured-temp" (assuming it has the same meaning/function) according to teminology in CUL_HM (or use any other's Module-Type  wording that is already well-known and especially used in (weekprofile and) WeekdayTimer
o.k. I understand your motivation and I agree. My suggestions referred to the original names of the EMS-ESP, but "desired-temp" and "measured-temp" is fine  ;D
Titel: Antw:ems-esp MQTT
Beitrag von: grappa24 am 25 Januar 2020, 09:28:29
Zitat von: moustic999 am 22 Januar 2020, 09:59:21
So fart I can control the target temp and the desired mode of my heater/thermostat ( Buderus RC300 , auto/manual mode + target temp)
I also retrieve a bunch of sensors (outdoor temp, return temp, flow temp) to monitor the heater working to optimize it later on.
all these could be quite easily combined into 1 or more template.
I will do some cleanup in the code and will share what is working for me.
@moustic999: Could you please give me the receiving topics (.../boiler_cmd) which work for you? I just can control "comfort" (hot,comfort,intelligent), "flowtemp" does not work with my boiler.
Titel: Antw:ems-esp MQTT
Beitrag von: moustic999 am 25 Januar 2020, 18:02:43
here is the full "mqttlog" from EMS-ESP
you can get this anytime by "telnet" youer ems-esp and use command : mqttlog

MQTT publish log:
  Timestamp:03:02:04 Topic:status Payload:online
  Timestamp:03:02:04 Topic:start Payload:start
  Timestamp:03:02:04 Topic:shower_data Payload:{"timer":"0","alert":"0"}
  Timestamp:20:28:00 Topic:boiler_data Payload:{"wWComfort":"Hot","wWSelTemp":60,"wWDesinfectionTemp":70,"selFlowTemp":54,"selBurnPow":100,"curBurnPow":23,"pumpMod":78,"wWCircPump":0,"outdoorTemp":3.9,"wWCurTmp":61.6,"wWCurFlow":0,"curFlowTemp":54,"retTemp":47.5,"switchTemp":0,"sysPress":1.5,"boilTemp":51.4,"wWActivated":"on","wWOnetime":"off","burnGas":"on","flameCurr":12,"heatPmp":"on","fanWork":"on","ignWork":"off","wWCirc":"off","heating_temp":90,"pump_mod_max":100,"pump_mod_min":30,"wWHeat":"off","wWStarts":2760,"wWWorkM":50799,"UBAuptime":2165246,"burnStarts":76190,"burnWorkMin":486553,"heatWorkMin":435754,"ServiceCode":"-H","ServiceCodeNumber":200}
  Timestamp:19:11:00 Topic:tapwater_active Payload:0
  Timestamp:19:11:00 Topic:heating_active Payload:1
  Timestamp:20:27:30 Topic:thermostat_data Payload:{"hc1":{"seltemp":21,"mode":"auto"}}
  Timestamp:20:26:14 Topic:heartbeat Payload:{"version":"1.9.5b8","IP":"192.168.1.71","rssid":60,"load":1,"uptime":1455974,"freemem":50,"MQTTdisconnects":18}

MQTT subscriptions:
  Topic:home/ems-esp/restart
  Topic:home/ems-esp/start
  Topic:home/ems-esp/thermostat_cmd_temp1
  Topic:home/ems-esp/thermostat_cmd_mode1
  Topic:home/ems-esp/thermostat_cmd_temp2
  Topic:home/ems-esp/thermostat_cmd_mode2
  Topic:home/ems-esp/thermostat_cmd_temp3
  Topic:home/ems-esp/thermostat_cmd_mode3
  Topic:home/ems-esp/thermostat_cmd_temp4
  Topic:home/ems-esp/thermostat_cmd_mode4
  Topic:home/ems-esp/thermostat_cmd
  Topic:home/ems-esp/boiler_cmd
  Topic:home/ems-esp/boiler_cmd_wwactivated
  Topic:home/ems-esp/boiler_cmd_wwonetime
  Topic:home/ems-esp/boiler_cmd_wwtemp
  Topic:home/ems-esp/generic_cmd
  Topic:home/ems-esp/shower_data



note that I would like to create an issue for EMS-ESp to have boiler_data split into 2 or 3 topics, because this is huge and it make fhem to slow down.
also that would map better the reality of EMS bus messages.
Titel: Antw:ems-esp MQTT
Beitrag von: moustic999 am 25 Januar 2020, 18:11:04
note that I don't have "currTemp" for thermostat, tha's normal because my thermostat is set up inside the heater and then, does not report the room temp.
Titel: Antw:ems-esp MQTT
Beitrag von: grappa24 am 26 Januar 2020, 06:59:38
in my case the receiving topics Topic:home/ems-esp/thermostat_cmd_temp1
  Topic:home/ems-esp/thermostat_cmd_mode1
  Topic:home/ems-esp/thermostat_cmd_temp2
  Topic:home/ems-esp/thermostat_cmd_mode2
  Topic:home/ems-esp/thermostat_cmd_temp3
  Topic:home/ems-esp/thermostat_cmd_mode3
  Topic:home/ems-esp/thermostat_cmd_temp4
  Topic:home/ems-esp/thermostat_cmd_mode4
don't work, but Topic:home/ems-esp/thermostat_cmddoes the job.

My problem with Topic:home/ems-esp/boiler_cmd is, that command comfort works well but command flowtemp not. So I would be glad if you moustic999 could tell me, which concrete boiler command works for you?

Here is the original documentation from github:boiler_cmd for sending generic command to control the Boiler JSON {"cmd":<command>,"data":<value> with command being comfort and data = [hot,comfort,intelligent] or flowtemp with data being the desired temperature or boiler_cmd_wwonetime {"cmd":"flowtemp",data:55}


Zitat von: moustic999 am 25 Januar 2020, 18:02:43
note that I would like to create an issue for EMS-ESp to have boiler_data split into 2 or 3 topics, because this is huge and it make fhem to slow down.
also that would map better the reality of EMS bus messages.
feel free to do so, I have no problem with fhem performance till now

Zitat von: moustic999 am 25 Januar 2020, 18:11:04
note that I don't have "currTemp" for thermostat, tha's normal because my thermostat is set up inside the heater and then, does not report the room temp.
same with my setup, but my boiler reports the currTemp, but its useless because its the temperature of my "heating room" and not relevant for setting "selTemp". By the way I startet to build al glossar to get an overview of the different names and meanings of the terms used by the different "players" (EMS protocoll, FHEM, ...). See the draft version as enclosure. By the way, I'm meanwhile using 1.9.5 Beta firmware for Kees EMS-Gateway  ;D
Titel: Antw:ems-esp MQTT
Beitrag von: grappa24 am 26 Januar 2020, 07:37:33
while I'm using FLOORPLAN for visualising have a look at my implementation of our EMS-ESP project to my floorplan ...  8)
Titel: Antw:ems-esp MQTT
Beitrag von: grappa24 am 28 Januar 2020, 09:42:39
Zitat von: grappa24 am 26 Januar 2020, 06:59:38
in my case the receiving topics Topic:home/ems-esp/thermostat_cmd_temp1
  Topic:home/ems-esp/thermostat_cmd_mode1
  Topic:home/ems-esp/thermostat_cmd_temp2
  Topic:home/ems-esp/thermostat_cmd_mode2
  Topic:home/ems-esp/thermostat_cmd_temp3
  Topic:home/ems-esp/thermostat_cmd_mode3
  Topic:home/ems-esp/thermostat_cmd_temp4
  Topic:home/ems-esp/thermostat_cmd_mode4
don't work,
After Updating EMS gateway to firmware 1.9.4 (?) these topics work well  ;D. As well as "Topic:home/ems-esp/thermostat_cmd + JSON-Blob"
Titel: Antw:ems-esp MQTT
Beitrag von: grappa24 am 28 Januar 2020, 09:55:25
Zitat von: grappa24 am 26 Januar 2020, 06:59:38
My problem with Topic:home/ems-esp/boiler_cmd is, that command comfort works well but command flowtemp not.
As Proddy told me, the following boiler-topics should work:
- boiler_cmd with command being "comfort" and "flowtemp"
- boiler_cmd_wwtemp (setting the warm water boiler temp)
- boiler_cmd_wwonetime (send a single charge to boiler to heat up the warm water (DHW) )

(Only) in case of my boiler Junkers Cerapur ZSB 24-5 C 23 "flowtemp" and "wwtemp" don't work - seams to be boiler-specific
Titel: Antw:ems-esp MQTT
Beitrag von: grappa24 am 28 Januar 2020, 09:59:53
For now I'm "through" and "made my peace with" EMS;D So please @Beta-User tell me, what is your issue no. 1 and I will concentrate on that to support finishing the AttrTemplates concerning ems-esp.
Titel: Antw:ems-esp MQTT
Beitrag von: grappa24 am 28 Januar 2020, 10:00:53
For now I'm "through" and "made my peace with" EMS ;D So please @Beta-User tell me, what is your issue no. 1 and I will concentrate on that to support finishing the AttrTemplates concerning ems-esp.
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 28 Januar 2020, 10:07:54
 :) Thx for updating about making progress.

Wrt. to the firmware issue, I'm a little surprised the later firmware (0.9.5 beta) beeing more restricted than 0.9.4. If there's limitations in 0.9.5 that can be overruled by the use of the "right" way to set setters, I'd suggest to concentrate on the newer ones.

My "concern nr. 1"? Hmmm, (beside the above mentionned) not that easy...

I'd like to offer a reasonable set of attrTemplates (part of them beeing "conditioned" by the existence of the mcu device). "Reasonable" for now means: They are working, whoever wants to use them can easily find out to what hardware they have been configured for... stuff like that ;) . Sufficient as a guideline?
Titel: Antw:ems-esp MQTT
Beitrag von: grappa24 am 28 Januar 2020, 10:40:03
Zitat
- is the grouping of the sent data meaningful, or should there be some changes? (=bridgeRegexp of the base template builds "reasonable" devices?!? Or do we need more or less?)
- are the reading names "good"? (I added $JSONMAP to the json2nameValue() function, so we can easily rename the names used by the ESP firmware; perhaps we also need a "prefix", if there's sent identically named data for different parts of the bus...?)
- setList for boiler device?
- Optics for boiler device (stateFormat, icons and so on...)
- hide the additional templates to users not using ems-esp (use prereq: or move them to seperate template file in contrib/AttrTemplate, see changes here, esp. to ebus and milight).
So I will concentrate on the red issues cause "grouping" and "optics" are not my favourite  :-[

OT: But first I have to go to the DIY-store to get some stuff for wiring my new Bosch MB LAN2 beside my EMS-gateway 8). FHEM/EMS ist nice, but additionally I want to access my boiler via Bosch HomeCom
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 28 Januar 2020, 10:44:36
Zitat von: grappa24 am 28 Januar 2020, 10:40:03
So I will concentrate on the red issues cause "grouping" and "optics" are not my favourite  :-[
That's ok. Hope the "mechanics" behind the bridgeRegexp is clear now or do you need additional help on that? (then I'd need additional info what should "end" where..)

ZitatOT: But first I have to go to the DIY-store to get some stuff for wiring my new Bosch MB LAN2 beside my EMS-gateway 8) . FHEM/EMS ist nice, but additionally I want to access my boiler via Bosch HomeCom
Enjoy ;D !
Titel: Antw:ems-esp MQTT
Beitrag von: grappa24 am 28 Januar 2020, 10:55:40
Zitat von: Beta-User am 28 Januar 2020, 10:44:36
Hope the "mechanics" behind the bridgeRegexp is clear now or do you need additional help on that? (then I'd need additional info what should "end" where..)
I'll have a look at the mechanics behind bridgeRegexp but if you have some basic info for me your welcome.

As I said Regular Expressions / Perl are not my favourites. As a former it-trainer C/C++ were my topics (beside FORTRAN in the beginning - guess how old I am :P )
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 28 Januar 2020, 11:13:42
OK, so basically: What's the meaning of
bridgeRegexp heating_system/ems-esp/(sensors|sm_data|hp_data|thermostat_data).*:.* "ems_esp_$1"
  heating_system/ems-esp/(boiler_data|tapwater_active|heating_active|mixing_data|shower_data).*:.* "ems_esp_boiler"

The first line maps any of "sensors"... Topic tree endings to a seperate device, $1 in the end just stands for the matched alternative. Could be written also in seperate lines like
heating_system/ems-esp/sensors.*:.* "ems_esp_sensors"ems_esp_sensors (or ems_esp_$1, which first has t be evaluated) just stands for the CID of the MQTT2_DEVICE.

Information prosessing is as follwos: First step for MQTT2_DEVICE  is to check wheather there's any device existent matching the topic-tree. (Only!) if not, autocreate@MQTT2_DEVICE (if it's turned on @IO level!) in general will first look if there's already any device with that CID, and if not, it will autocreate it (TYPE=autocreate must also be active for that to work). If the target devicce exists already, the readingList argument will be extended, unless the device's autocreate attribute is set to 0 (then the info will be ignored).

Second line maps the enumerated topic tree endings to the device with CID "ems_esp_boiler". So basic summary:
To seperate these also, just move the item from line 2 to line 1 and clear readingList attribute in the first taget device accordingly ;) .
Titel: Antw:ems-esp MQTT
Beitrag von: grappa24 am 29 Januar 2020, 09:16:10
new draft version of ems-esp glossary ...
Titel: Antw:ems-esp MQTT
Beitrag von: moustic999 am 29 Januar 2020, 10:36:49
I think the template is quite good for basic use ( control of heating, sensors logging )
however I think it would be really great to create proper thermostats where there are multiple (hc1, hc2,.... )
if I'm right, template only work with 1 thermostat currently.
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 29 Januar 2020, 11:22:00
Zitat von: moustic999 am 29 Januar 2020, 10:36:49
if I'm right, template only work with 1 thermostat currently.
That's true.
We could build more complex expressions, e.g. (untested)
BASE_ID/DEV_ID/thermostat_data.*:.*(hc[\d]).* "ems_esp_thermostat_$1"\
But then, we also have to adopt readingList attribute of each of the thermostat devices to only react on "it's" part of the JSON info and so on.

Imo, it would be much easier to just use a copy of the first (hc1) thermostat device and then do some small changes, especially use jsonMap to filter out all of the unneeded info. So in the second thermostat, we would just use a different jsonMap (for the first it should be extended to filter out hc2 info):
attr DEVICE jsonMap hc2_mode:mode hc2_seltemp:desired-temp hc2_daytemp:daytemp hc2_nighttemp:nighttemp hc3_holidayttemp:holidaytemp hc1_mode:0 hc1_seltemp:0 hc1_daytemp:0 hc1_nighttemp:0 hc1_holidayttemp:0

and adopt topic paths in setList accordingly?
Titel: Antw:ems-esp MQTT
Beitrag von: grappa24 am 29 Januar 2020, 22:12:42
OT: with the help of mqtt analytics meanwhile I could improve my settings (Meine Heizkurve war viel zu hoch und zu steil, heating curve was to high and steep), the boiler produced too much heat and could not deliver it.

should change my name to "Heizungsversteher"  8)

Titel: Antw:ems-esp MQTT
Beitrag von: kroonen am 30 April 2020, 21:18:14
Hi,

I have for the ems-esp boiler a question. I would like to create a devStateicon , because the template doesn't have it.

Is it possible to look at heating_active and tapwater_active  values both?

For example

heating_active 0
tapwave_active 0

then icon: sani_heating

heating_active 1
tapwater_active 0

then icon: sani_heating@red

heating_active 0
tapwater_active 1

then icon: sani_water_hot@red
Titel: Antw:ems-esp MQTT
Beitrag von: rudolfkoenig am 30 April 2020, 22:16:25
Yes, but IMHO it is more straitforward to set stateFormat to:
{
  my $h=ReadingsNum($name,"heating_active",0);
  my $t=ReadingsNum($name,"tapwater_active",0);
  !$h && !$t ? "sani_heating" : ($h && !$t ? "sani_heating\@red" : "sani_water_hot\@red")
}

Titel: Antw:ems-esp MQTT
Beitrag von: kroonen am 30 April 2020, 22:54:57
Thnx, works as wanted.

Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 01 Mai 2020, 06:30:15
For the template, I slightly changed that to get a more readable STATE.

attr DEVICE stateFormat { my $h=ReadingsNum($name,"heating_active",0); my $t=ReadingsNum($name,"tapwater_active",0); !$h && !$t ? "idle" : ($h && !$t ? "heating" : "tapwater")}
attr DEVICE devStateIcon idle:sani_heating heating:sani_heating@red tapwater:sani_water_hot@red

Should work, but testing is appreciated :) .
Titel: Antw:ems-esp MQTT
Beitrag von: kroonen am 06 Mai 2020, 16:15:15
agree, is more human readable, I go check it and give the feedback
Titel: Antw:ems-esp MQTT
Beitrag von: kroonen am 06 Mai 2020, 19:31:16
@Beta-User Tested, and works as expected.




Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 06 Mai 2020, 21:23:49
Thx. for your feedback!
Titel: Antw:ems-esp MQTT
Beitrag von: grappa24 am 26 Mai 2020, 09:09:29
Zunächst mal sorry, dass ich mich nicht mehr gemeldet habe  :-[

Ich hätte eine Frage zum Boiler-Device:

Dort gibt es ja das reading "wWComfort"; ich hab mir eine Select-Box definiert, um das reading mit "hot" bzw. "intelligent" zu füllen. Dann dafür noch das attr webCmd definiert.

Das Setzen des readings funktioniert auch soweit, nur wird die Select-Box danach nicht mehr mit dem aktuellen Wert des readings gefüllt - oder mach ich da einen Denkfehler?

defmod MQTT2_ems_esp_boiler MQTT2_DEVICE ems_esp_boiler
attr MQTT2_ems_esp_boiler IODev myBroker
attr MQTT2_ems_esp_boiler alias Brenner
attr MQTT2_ems_esp_boiler devStateIcon 1
attr MQTT2_ems_esp_boiler readingList heating_system/ems-esp/boiler_data:.* { json2nameValue($EVENT) }\
heating_system/ems-esp/tapwater_active:.* tapwater_active\
heating_system/ems-esp/heating_active:.* heating_active\
heating_system/ems-esp/shower_data:.* { json2nameValue($EVENT) }
attr MQTT2_ems_esp_boiler setList wWComfort:select,hot,intelligent heating_system/ems-esp/boiler_cmd { "cmd":"comfort", "data": "$EVTPART1" }
attr MQTT2_ems_esp_boiler stateFormat Warmwasser: wWComfort
attr MQTT2_ems_esp_boiler webCmd wWComfort

setstate MQTT2_ems_esp_boiler Warmwasser: Hot
setstate MQTT2_ems_esp_boiler 2020-05-26 08:56:15 ServiceCode
setstate MQTT2_ems_esp_boiler 2020-05-26 08:56:15 ServiceCodeNumber 203
setstate MQTT2_ems_esp_boiler 2020-05-26 08:56:15 UBAuptime 532405
setstate MQTT2_ems_esp_boiler 2020-05-24 18:00:13 alert 0
setstate MQTT2_ems_esp_boiler 2020-02-06 08:28:54 associatedWith MQTT2_ems_esp
setstate MQTT2_ems_esp_boiler 2020-02-24 20:57:39 boilTemp 57.7
setstate MQTT2_ems_esp_boiler 2020-05-26 08:56:15 burnGas off
setstate MQTT2_ems_esp_boiler 2020-05-26 08:56:15 burnStarts 25608
setstate MQTT2_ems_esp_boiler 2020-05-26 08:56:15 burnWorkMin 70648
setstate MQTT2_ems_esp_boiler 2020-05-26 08:56:15 curBurnPow 0
setstate MQTT2_ems_esp_boiler 2020-05-26 08:56:15 curFlowTemp 44.3
setstate MQTT2_ems_esp_boiler 2020-05-26 08:56:15 fanWork off
setstate MQTT2_ems_esp_boiler 2020-05-26 08:56:15 flameCurr 0
setstate MQTT2_ems_esp_boiler 2020-05-26 08:56:15 heatPmp off
setstate MQTT2_ems_esp_boiler 2020-05-26 08:56:15 heatWorkMin 52730
setstate MQTT2_ems_esp_boiler 2020-05-26 06:08:15 heating_active 0
setstate MQTT2_ems_esp_boiler 2020-05-26 08:56:15 heating_temp 30
setstate MQTT2_ems_esp_boiler 2020-05-26 08:56:15 ignWork off
setstate MQTT2_ems_esp_boiler 2020-05-26 08:56:15 outdoorTemp 21.4
setstate MQTT2_ems_esp_boiler 2020-05-26 08:56:15 pumpMod 0
setstate MQTT2_ems_esp_boiler 2020-05-26 08:56:15 pump_mod_max 100
setstate MQTT2_ems_esp_boiler 2020-05-26 08:56:15 pump_mod_min 10
setstate MQTT2_ems_esp_boiler 2020-05-26 08:56:15 selBurnPow 0
setstate MQTT2_ems_esp_boiler 2020-05-26 08:56:15 selFlowTemp 5
setstate MQTT2_ems_esp_boiler 2020-05-25 20:41:22 state wWComfort
setstate MQTT2_ems_esp_boiler 2020-02-19 09:43:02 switchTemp 0
setstate MQTT2_ems_esp_boiler 2020-05-26 06:08:15 tapwater_active 0
setstate MQTT2_ems_esp_boiler 2020-05-24 18:00:13 timer 0
setstate MQTT2_ems_esp_boiler 2020-05-26 08:56:15 wWActivated on
setstate MQTT2_ems_esp_boiler 2020-05-26 08:56:15 wWCiPuMode 7
setstate MQTT2_ems_esp_boiler 2020-05-26 08:56:15 wWCiPuType 255
setstate MQTT2_ems_esp_boiler 2020-05-26 08:56:15 wWCirc on
setstate MQTT2_ems_esp_boiler 2020-05-26 08:56:15 wWCircPump 255
setstate MQTT2_ems_esp_boiler 2020-05-26 08:56:15 wWComfort Hot
setstate MQTT2_ems_esp_boiler 2020-05-26 08:56:15 wWCurFlow 0
setstate MQTT2_ems_esp_boiler 2020-05-26 08:56:15 wWCurTmp 54.3
setstate MQTT2_ems_esp_boiler 2020-05-26 08:56:15 wWDesinfecting off
setstate MQTT2_ems_esp_boiler 2020-05-26 08:56:15 wWDesinfectionTemp 70
setstate MQTT2_ems_esp_boiler 2020-02-19 09:43:02 wWDesiredTemp 70
setstate MQTT2_ems_esp_boiler 2020-05-26 08:56:15 wWHeat off
setstate MQTT2_ems_esp_boiler 2020-05-26 08:56:15 wWOnetime off
setstate MQTT2_ems_esp_boiler 2020-05-26 08:56:15 wWReady off
setstate MQTT2_ems_esp_boiler 2020-05-26 08:56:15 wWRecharge off
setstate MQTT2_ems_esp_boiler 2020-05-26 08:56:15 wWSelTemp 55
setstate MQTT2_ems_esp_boiler 2020-05-26 08:56:15 wWStarts 1208
setstate MQTT2_ems_esp_boiler 2020-05-26 08:56:15 wWTempOK on
setstate MQTT2_ems_esp_boiler 2020-05-26 08:56:15 wWWorkM 17918
setstate MQTT2_ems_esp_boiler 2020-05-26 08:56:15 wwStorageTemp2 54.3



By the way:
Bei meinem Boiler Buderus GBx72/Nefit Trendline/Junkers Cerapur/Worcester Greenstar Si/27i (DeviceID: 0x08, ProductID: 123, Version: 06.03) funktioniert das Setzen von wWComfort wie folgt:

hot -> Hot
intelligent -> Eco
eco -> keine Auswirkung

Was für mich o.k. ist, da sich mein Brenner sowieso nur zwischen hot und eco umschalten lässt, aber muss man das verstehen? Ich hab deshalb das setList attr entsprechend geändert, nicht dass sich jemand wundert  ;)
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 26 Mai 2020, 09:29:05
Dann mal: welcome back!

Du sendest "hot", zurück scheint aber "Hot" zu kommen...

Es wäre mMn. kein Problem, weitere Thermostat-Typen als gesonderte attrTemplate zu bauen, es sollte dann aber irgendwie "fertig" sein (und möglichst auch für mehrere Fälle passen). Irgendwie ist der Prozess hier - warum auch immer - allerdings etwas ins Stocken geraten.

@our english-speaking users here:
Are you interested in further development of attrTemplates? There had been no more posts on that topic, so feel free to give some feedback; otherwise, we may discuss individual questions in whatever language is used by the one asking...
(Or open up seperate Threads?)
Titel: Antw:ems-esp MQTT
Beitrag von: grappa24 am 26 Mai 2020, 09:42:21
ich hab jetzt mal "Hot" gesendet, keine Reaktion. Nur wenn ich "hot" sende, kommt "Hot" zurück. Das erklärt dann wohl auch, warum sich die Select-Box nicht füllt, weil die zugelassenen Werte nicht stimmen  ;D
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 26 Mai 2020, 11:58:57
So war es gemeint gewesen ;) .
...das solltest du dem Entwickler melden, ist m.E. nicht korrekt/ein Typo...

Workaround für den Moment: eventMap (ungetestet: Hot:hot sollte funktionieren).
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 27 Mai 2020, 10:45:02
Hallo,

mal auf Basis dessen, was sich hier aus dem Kaffeesatz ergibt ein weiterentwickeltes attrTemplate für "boiler":

name:ems-esp_boiler
filter:TYPE=MQTT2_DEVICE
desc:To configure a boiler device for use with an <a href="https://github.com/proddy/EMS-ESP">EMS-ESP</a><br>.<a href="https://forum.fhem.de/index.php/topic,104968.0.html">Forum Thread</a>
order:E_02b
par:BASEPATH;base topic set in the ESP including "ems-esp";{ AttrVal("DEVICE","readingList","") =~ m,([^:]*ems-esp)/boiler_data:, ? "$1" : undef }
attr DEVICE readingList BASEPATH/boiler_data { json2nameValue($EVENT,'',$JSONMAP) }\
  BASEPATH/shower_data:.* { json2nameValue($EVENT,'',$JSONMAP) }\
  BASEPATH/mixing_data:.* { json2nameValue($EVENT,'',$JSONMAP) }\
  BASEPATH/tapwater_active:.* tapwater_active\
  BASEPATH/heating_active:.* heating_active
attr DEVICE stateFormat { my $h=ReadingsNum($name,"heating_active",0); my $t=ReadingsNum($name,"tapwater_active",0); !$h && !$t ? "idle" : ($h && !$t ? "heating" : "tapwater")}
attr DEVICE devStateIcon idle:sani_heating heating:sani_heating@red tapwater:sani_water_hot@red
attr DEVICE setList wWComfort:select,hot,intelligent BASEPATH/boiler_cmd { "cmd":"comfort", "data": "$EVTPART1" }
attr DEVICE webCmd wWComfort
attr DEVICE eventMap Hot:hot Eco:intelligent
attr DEVICE model ems-esp_boiler
setreading DEVICE attrTemplateVersion 20200527

Neben der offenbar erfolgreichen eventMap ist die setList dazugekommen; da in webCmd auch der Status des Readings erkennbar sein sollte (?), müßte es so eigentlich alles relevante hübsch anzeigen?

Rückmeldung wäre nett, dann checke ich das so ein. (Oder gibt es mehrere Boiler-Varianten, die man irgendwie berücksichtigen muß?).
Titel: Antw:ems-esp MQTT
Beitrag von: grappa24 am 05 Juni 2020, 19:44:51
setList kann ich so bestätigen, läuft so bei mir.
eventMap funktioniert bei mir so: hot:Hot intelligent:Eco
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 06 Juni 2020, 13:08:34
Danke, hab's eben korrigiert eingecheckt!
Titel: Antw:ems-esp MQTT
Beitrag von: thomasg am 17 September 2020, 10:06:58
Hi Zusammen,

ich würde gerne auf Basis dieses Templates eines für HeishaMon erstellen. Ein MQTT Device, welches eine Panasonic Wärmepumpe anbindet. Nähere Infos hier: https://github.com/Egyras/HeishaMon (https://github.com/Egyras/HeishaMon)
Für openhab wurde soetwas schon gemacht. Screenshot: https://user-images.githubusercontent.com/36902688/68837978-60782800-06c6-11ea-99f4-12df9687a2c8.png (https://user-images.githubusercontent.com/36902688/68837978-60782800-06c6-11ea-99f4-12df9687a2c8.png)
So ähnlich würde ich es gerne auch für fhem haben wollen. Als erstes würde ich gerne den Parameter "Compressor_Freq" anzeigen und den Flüstermodus anzeigen / setzten.

Wie gehe ich da am besten vor?



Internals:
   CFGFN     
   CID        HeishaMon
   DEF        HeishaMon
   DEVICETOPIC MQTT2_HeishaMon
   FUUID      5f621e1b-f33f-c37d-0bfc-6fd29228409d2edd
   IODev      horstmqtt
   LASTInputDev horstmqtt
   MSGCNT     37502
   NAME       MQTT2_HeishaMon
   NR         391
   STATE      temperature°C
   TYPE       MQTT2_DEVICE
   horstmqtt_MSGCNT 37502
   horstmqtt_TIME 2020-09-17 10:00:16
   READINGS:
     2020-09-17 09:56:22   Buffer_Temp     -78
     2020-09-17 09:56:22   Bypass_Outlet_Temp -31
     2020-09-17 09:56:23   Compressor_Current 0.0
     2020-09-17 09:56:21   Compressor_Freq 0
     2020-09-17 09:56:21   Cool_Delta      5
     2020-09-17 09:56:22   Cool_Energy_Consumption 0
     2020-09-17 09:56:22   Cool_Energy_Production 0
     2020-09-17 09:56:23   Cool_To_Heat_Temp 10
     2020-09-17 09:56:23   Cooling_Mode    0
     2020-09-17 09:56:22   DHW_Energy_Consumption 0
     2020-09-17 09:56:22   DHW_Energy_Production 0
     2020-09-17 09:56:21   DHW_Heat_Delta  -5
     2020-09-17 09:56:23   DHW_Heater_Operations_Hours 0
     2020-09-17 09:56:22   DHW_Heater_State 0
     2020-09-17 09:56:21   DHW_Holiday_Shift_Temp -25
     2020-09-17 09:56:21   DHW_Target_Temp 47
     2020-09-17 09:56:21   DHW_Temp        44
     2020-09-17 09:56:22   Defrost_Temp    -31
     2020-09-17 09:56:22   Defrosting_State 0
     2020-09-17 09:56:22   Discharge_Temp  13
     2020-09-17 09:56:22   Error           No error
     2020-09-17 09:56:22   Eva_Outlet_Temp 14
     2020-09-17 09:56:23   External_Heater_State 0
     2020-09-17 09:56:23   Fan1_Motor_Speed 0
     2020-09-17 09:56:23   Fan2_Motor_Speed 0
     2020-09-17 09:56:21   Force_DHW_State 0
     2020-09-17 09:56:23   Force_Heater_State 0
     2020-09-17 09:56:21   Heat_Delta      3
     2020-09-17 09:56:21   Heat_Energy_Consumption 0
     2020-09-17 09:56:21   Heat_Energy_Production 0
     2020-09-17 09:56:23   Heat_Pump_Model 0
     2020-09-17 09:56:23   Heat_To_Cool_Temp 15
     2020-09-17 09:56:23   Heater_On_Outdoor_Temp 0
     2020-09-17 09:56:23   Heating_Mode    0
     2020-09-17 09:56:23   Heating_Off_Outdoor_Temp 17
     2020-09-17 09:56:21   Heatpump_State  1
     2020-09-17 09:56:23   High_Pressure   11.4
     2020-09-17 09:56:21   Holiday_Mode_State 0
     2020-09-17 09:58:01   Inside_Pipe_Temp 17
     2020-09-17 09:56:23   Internal_Heater_State 0
     2020-09-17 09:56:22   Ipm_Temp        16
     2020-09-17 10:00:15   LWT             Online
     2020-09-17 09:56:23   Low_Pressure    0
     2020-09-17 09:56:22   Main_Hex_Outlet_Temp 20
     2020-09-17 09:56:21   Main_Inlet_Temp 21
     2020-09-17 09:56:21   Main_Outlet_Temp 22
     2020-09-17 09:56:21   Main_Schedule_State 1
     2020-09-17 09:56:21   Main_Target_Temp 20
     2020-09-17 09:56:21   Operating_Mode_State 0
     2020-09-17 09:56:21   Operations_Counter 1989
     2020-09-17 09:56:21   Operations_Hours 7831
     2020-09-17 09:56:21   Outside_Pipe_Temp 13
     2020-09-17 09:56:21   Outside_Temp    14
     2020-09-17 09:56:22   Pool_Temp       -78
     2020-09-17 09:56:21   Powerful_Mode_Time 0
     2020-09-17 10:00:16   Pump_Flow       10.16
     2020-09-17 09:58:51   Pump_Speed      3100
     2020-09-17 09:56:21   Quiet_Mode_Level 0
     2020-09-17 09:56:21   Quiet_Mode_Schedule 0
     2020-09-17 09:56:23   Room_Heater_Operations_Hours 203
     2020-09-17 09:56:22   Room_Heater_State 0
     2020-09-17 09:56:22   Room_Holiday_Shift_Temp -2
     2020-09-17 09:56:22   Room_Thermostat_Temp 24
     2020-09-17 09:56:22   Solar_Temp      -78
     2020-09-17 09:56:23   Sterilization_Max_Time 10
     2020-09-17 09:56:23   Sterilization_State 0
     2020-09-17 09:56:23   Sterilization_Temp 65
     2020-09-17 09:56:21   ThreeWay_Valve_State 0
     2020-09-17 09:56:23   Z1_Cool_Curve_Outside_High_Temp 20
     2020-09-17 09:56:23   Z1_Cool_Curve_Outside_Low_Temp 30
     2020-09-17 09:56:23   Z1_Cool_Curve_Target_High_Temp 15
     2020-09-17 09:56:23   Z1_Cool_Curve_Target_Low_Temp 10
     2020-09-17 09:56:22   Z1_Cool_Request_Temp 0
     2020-09-17 09:56:22   Z1_Heat_Curve_Outside_High_Temp 15
     2020-09-17 09:56:22   Z1_Heat_Curve_Outside_Low_Temp -15
     2020-09-17 09:56:22   Z1_Heat_Curve_Target_High_Temp 32
     2020-09-17 09:56:22   Z1_Heat_Curve_Target_Low_Temp 23
     2020-09-17 09:56:22   Z1_Heat_Request_Temp -5
     2020-09-17 09:56:22   Z1_Temp         22
     2020-09-17 09:56:22   Z1_Water_Target_Temp 20
     2020-09-17 09:56:22   Z1_Water_Temp   -78
     2020-09-17 09:56:23   Z2_Cool_Curve_Outside_High_Temp 20
     2020-09-17 09:56:23   Z2_Cool_Curve_Outside_Low_Temp 30
     2020-09-17 09:56:23   Z2_Cool_Curve_Target_High_Temp 15
     2020-09-17 09:56:23   Z2_Cool_Curve_Target_Low_Temp 10
     2020-09-17 09:56:22   Z2_Cool_Request_Temp 0
     2020-09-17 09:56:23   Z2_Heat_Curve_Outside_High_Temp -5
     2020-09-17 09:56:23   Z2_Heat_Curve_Outside_Low_Temp 15
     2020-09-17 09:56:23   Z2_Heat_Curve_Target_High_Temp 55
     2020-09-17 09:56:23   Z2_Heat_Curve_Target_Low_Temp 35
     2020-09-17 09:56:22   Z2_Heat_Request_Temp 0
     2020-09-17 09:56:22   Z2_Temp         -128
     2020-09-17 09:56:22   Z2_Water_Target_Temp 36
     2020-09-17 09:56:22   Z2_Water_Temp   -78
     2020-09-16 16:58:38   subscriptions   panasonic_heat_pump/SendRawValue panasonic_heat_pump/SetDHWTemp panasonic_heat_pump/SetForceDHW panasonic_heat_pump/SetForceDefrost panasonic_heat_pump/SetForceSterilization panasonic_heat_pump/SetHeatpump panasonic_heat_pump/SetHolidayMode panasonic_heat_pump/SetOperationMode panasonic_heat_pump/SetPowerfulMode panasonic_heat_pump/SetQuietMode panasonic_heat_pump/SetZ1CoolRequestTemperature panasonic_heat_pump/SetZ1HeatRequestTemperature panasonic_heat_pump/SetZ2CoolRequestTemperature panasonic_heat_pump/SetZ2HeatRequestTemperature
Attributes:
   IODev      horstmqtt
   readingList HeishaMon:panasonic_heat_pump/LWT:.* LWT
HeishaMon:panasonic_heat_pump/sdc/High_Pressure:.* High_Pressure
HeishaMon:panasonic_heat_pump/sdc/Inside_Pipe_Temp:.* Inside_Pipe_Temp
HeishaMon:panasonic_heat_pump/sdc/Main_Inlet_Temp:.* Main_Inlet_Temp
HeishaMon:panasonic_heat_pump/sdc/Main_Outlet_Temp:.* Main_Outlet_Temp
HeishaMon:panasonic_heat_pump/sdc/Z1_Temp:.* Z1_Temp
HeishaMon:panasonic_heat_pump/sdc/Eva_Outlet_Temp:.* Eva_Outlet_Temp
HeishaMon:panasonic_heat_pump/sdc/Heatpump_State:.* Heatpump_State
HeishaMon:panasonic_heat_pump/sdc/Pump_Flow:.* Pump_Flow
HeishaMon:panasonic_heat_pump/sdc/Force_DHW_State:.* Force_DHW_State
HeishaMon:panasonic_heat_pump/sdc/Quiet_Mode_Schedule:.* Quiet_Mode_Schedule
HeishaMon:panasonic_heat_pump/sdc/Operating_Mode_State:.* Operating_Mode_State
HeishaMon:panasonic_heat_pump/sdc/Main_Target_Temp:.* Main_Target_Temp
HeishaMon:panasonic_heat_pump/sdc/Compressor_Freq:.* Compressor_Freq
HeishaMon:panasonic_heat_pump/sdc/DHW_Target_Temp:.* DHW_Target_Temp
HeishaMon:panasonic_heat_pump/sdc/DHW_Temp:.* DHW_Temp
HeishaMon:panasonic_heat_pump/sdc/Operations_Hours:.* Operations_Hours
HeishaMon:panasonic_heat_pump/sdc/Operations_Counter:.* Operations_Counter
HeishaMon:panasonic_heat_pump/sdc/Main_Schedule_State:.* Main_Schedule_State
HeishaMon:panasonic_heat_pump/sdc/Outside_Temp:.* Outside_Temp
HeishaMon:panasonic_heat_pump/sdc/Heat_Energy_Production:.* Heat_Energy_Production
HeishaMon:panasonic_heat_pump/sdc/Heat_Energy_Consumption:.* Heat_Energy_Consumption
HeishaMon:panasonic_heat_pump/sdc/Powerful_Mode_Time:.* Powerful_Mode_Time
HeishaMon:panasonic_heat_pump/sdc/Quiet_Mode_Level:.* Quiet_Mode_Level
HeishaMon:panasonic_heat_pump/sdc/Holiday_Mode_State:.* Holiday_Mode_State
HeishaMon:panasonic_heat_pump/sdc/ThreeWay_Valve_State:.* ThreeWay_Valve_State
HeishaMon:panasonic_heat_pump/sdc/Outside_Pipe_Temp:.* Outside_Pipe_Temp
HeishaMon:panasonic_heat_pump/sdc/DHW_Heat_Delta:.* DHW_Heat_Delta
HeishaMon:panasonic_heat_pump/sdc/Heat_Delta:.* Heat_Delta
HeishaMon:panasonic_heat_pump/sdc/Cool_Delta:.* Cool_Delta
HeishaMon:panasonic_heat_pump/sdc/DHW_Holiday_Shift_Temp:.* DHW_Holiday_Shift_Temp
HeishaMon:panasonic_heat_pump/sdc/Defrosting_State:.* Defrosting_State
HeishaMon:panasonic_heat_pump/sdc/Z1_Heat_Request_Temp:.* Z1_Heat_Request_Temp
HeishaMon:panasonic_heat_pump/sdc/Z1_Cool_Request_Temp:.* Z1_Cool_Request_Temp
HeishaMon:panasonic_heat_pump/sdc/Z1_Heat_Curve_Target_High_Temp:.* Z1_Heat_Curve_Target_High_Temp
HeishaMon:panasonic_heat_pump/sdc/Z1_Heat_Curve_Target_Low_Temp:.* Z1_Heat_Curve_Target_Low_Temp
HeishaMon:panasonic_heat_pump/sdc/Z1_Heat_Curve_Outside_High_Temp:.* Z1_Heat_Curve_Outside_High_Temp
HeishaMon:panasonic_heat_pump/sdc/Z1_Heat_Curve_Outside_Low_Temp:.* Z1_Heat_Curve_Outside_Low_Temp
HeishaMon:panasonic_heat_pump/sdc/Room_Thermostat_Temp:.* Room_Thermostat_Temp
HeishaMon:panasonic_heat_pump/sdc/Z2_Heat_Request_Temp:.* Z2_Heat_Request_Temp
HeishaMon:panasonic_heat_pump/sdc/Z2_Cool_Request_Temp:.* Z2_Cool_Request_Temp
HeishaMon:panasonic_heat_pump/sdc/Z1_Water_Temp:.* Z1_Water_Temp
HeishaMon:panasonic_heat_pump/sdc/Z2_Water_Temp:.* Z2_Water_Temp
HeishaMon:panasonic_heat_pump/sdc/Cool_Energy_Production:.* Cool_Energy_Production
HeishaMon:panasonic_heat_pump/sdc/Cool_Energy_Consumption:.* Cool_Energy_Consumption
HeishaMon:panasonic_heat_pump/sdc/DHW_Energy_Production:.* DHW_Energy_Production
HeishaMon:panasonic_heat_pump/sdc/DHW_Energy_Consumption:.* DHW_Energy_Consumption
HeishaMon:panasonic_heat_pump/sdc/Z1_Water_Target_Temp:.* Z1_Water_Target_Temp
HeishaMon:panasonic_heat_pump/sdc/Z2_Water_Target_Temp:.* Z2_Water_Target_Temp
HeishaMon:panasonic_heat_pump/sdc/Error:.* Error
HeishaMon:panasonic_heat_pump/sdc/Room_Holiday_Shift_Temp:.* Room_Holiday_Shift_Temp
HeishaMon:panasonic_heat_pump/sdc/Buffer_Temp:.* Buffer_Temp
HeishaMon:panasonic_heat_pump/sdc/Solar_Temp:.* Solar_Temp
HeishaMon:panasonic_heat_pump/sdc/Pool_Temp:.* Pool_Temp
HeishaMon:panasonic_heat_pump/sdc/Main_Hex_Outlet_Temp:.* Main_Hex_Outlet_Temp
HeishaMon:panasonic_heat_pump/sdc/Discharge_Temp:.* Discharge_Temp
HeishaMon:panasonic_heat_pump/sdc/Defrost_Temp:.* Defrost_Temp
HeishaMon:panasonic_heat_pump/sdc/Bypass_Outlet_Temp:.* Bypass_Outlet_Temp
HeishaMon:panasonic_heat_pump/sdc/Ipm_Temp:.* Ipm_Temp
HeishaMon:panasonic_heat_pump/sdc/Z2_Temp:.* Z2_Temp
HeishaMon:panasonic_heat_pump/sdc/DHW_Heater_State:.* DHW_Heater_State
HeishaMon:panasonic_heat_pump/sdc/Room_Heater_State:.* Room_Heater_State
HeishaMon:panasonic_heat_pump/sdc/Internal_Heater_State:.* Internal_Heater_State
HeishaMon:panasonic_heat_pump/sdc/External_Heater_State:.* External_Heater_State
HeishaMon:panasonic_heat_pump/sdc/Fan1_Motor_Speed:.* Fan1_Motor_Speed
HeishaMon:panasonic_heat_pump/sdc/Fan2_Motor_Speed:.* Fan2_Motor_Speed
HeishaMon:panasonic_heat_pump/sdc/Pump_Speed:.* Pump_Speed
HeishaMon:panasonic_heat_pump/sdc/Low_Pressure:.* Low_Pressure
HeishaMon:panasonic_heat_pump/sdc/Compressor_Current:.* Compressor_Current
HeishaMon:panasonic_heat_pump/sdc/Force_Heater_State:.* Force_Heater_State
HeishaMon:panasonic_heat_pump/sdc/Sterilization_State:.* Sterilization_State
HeishaMon:panasonic_heat_pump/sdc/Sterilization_Temp:.* Sterilization_Temp
HeishaMon:panasonic_heat_pump/sdc/Sterilization_Max_Time:.* Sterilization_Max_Time
HeishaMon:panasonic_heat_pump/sdc/Z1_Cool_Curve_Target_High_Temp:.* Z1_Cool_Curve_Target_High_Temp
HeishaMon:panasonic_heat_pump/sdc/Z1_Cool_Curve_Target_Low_Temp:.* Z1_Cool_Curve_Target_Low_Temp
HeishaMon:panasonic_heat_pump/sdc/Z1_Cool_Curve_Outside_High_Temp:.* Z1_Cool_Curve_Outside_High_Temp
HeishaMon:panasonic_heat_pump/sdc/Z1_Cool_Curve_Outside_Low_Temp:.* Z1_Cool_Curve_Outside_Low_Temp
HeishaMon:panasonic_heat_pump/sdc/Heating_Mode:.* Heating_Mode
HeishaMon:panasonic_heat_pump/sdc/Heating_Off_Outdoor_Temp:.* Heating_Off_Outdoor_Temp
HeishaMon:panasonic_heat_pump/sdc/Heater_On_Outdoor_Temp:.* Heater_On_Outdoor_Temp
HeishaMon:panasonic_heat_pump/sdc/Heat_To_Cool_Temp:.* Heat_To_Cool_Temp
HeishaMon:panasonic_heat_pump/sdc/Cool_To_Heat_Temp:.* Cool_To_Heat_Temp
HeishaMon:panasonic_heat_pump/sdc/Cooling_Mode:.* Cooling_Mode
HeishaMon:panasonic_heat_pump/sdc/Z2_Heat_Curve_Target_High_Temp:.* Z2_Heat_Curve_Target_High_Temp
HeishaMon:panasonic_heat_pump/sdc/Z2_Heat_Curve_Target_Low_Temp:.* Z2_Heat_Curve_Target_Low_Temp
HeishaMon:panasonic_heat_pump/sdc/Z2_Heat_Curve_Outside_High_Temp:.* Z2_Heat_Curve_Outside_High_Temp
HeishaMon:panasonic_heat_pump/sdc/Z2_Heat_Curve_Outside_Low_Temp:.* Z2_Heat_Curve_Outside_Low_Temp
HeishaMon:panasonic_heat_pump/sdc/Z2_Cool_Curve_Target_High_Temp:.* Z2_Cool_Curve_Target_High_Temp
HeishaMon:panasonic_heat_pump/sdc/Z2_Cool_Curve_Target_Low_Temp:.* Z2_Cool_Curve_Target_Low_Temp
HeishaMon:panasonic_heat_pump/sdc/Z2_Cool_Curve_Outside_High_Temp:.* Z2_Cool_Curve_Outside_High_Temp
HeishaMon:panasonic_heat_pump/sdc/Z2_Cool_Curve_Outside_Low_Temp:.* Z2_Cool_Curve_Outside_Low_Temp
HeishaMon:panasonic_heat_pump/sdc/Room_Heater_Operations_Hours:.* Room_Heater_Operations_Hours
HeishaMon:panasonic_heat_pump/sdc/DHW_Heater_Operations_Hours:.* DHW_Heater_Operations_Hours
HeishaMon:panasonic_heat_pump/sdc/Heat_Pump_Model:.* Heat_Pump_Model
   room       MQTT2_DEVICE
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 17 September 2020, 10:31:25
Als ich vorhin geschrieben habe, du sollst dir das template und den Thread (wg. der zu beachtenden "Konventionen" usw.) anschauen, war nicht unbedingt die Rede vom "Kapern".

Würde also vorschlagen, du schaust dir den Quelltext an (aktuell ab hier: https://svn.fhem.de/trac/browser/trunk/fhem/FHEM/lib/AttrTemplate/mqtt2.template#L2934), merkst dir diesen Thread wg. der Frage, wie setter und Readings heißen sollten und wir diskutieren ggf. weiter in deinem Thread: https://forum.fhem.de/index.php/topic,114282.0/topicseen.html...
Titel: Antw:ems-esp MQTT
Beitrag von: benkler am 05 November 2020, 15:17:09
Hallo Zusammen,

hat jemand bereits auf die version 2 von EMS-ESP umgestellt ?
Leider hat sich hier ja einiges im MQTT Teil geändert und ich gehe davon aus, dass die ganzen Templates überarbeitet werden müssten

Ich habe das mal gemacht und wichtig ist erstmal, dass das gewählte Topic nicht mehr im MQTT steht es kommt jetzt nurnoch ems-esp/ und nicht topic/ems-esp/.

einige Readings beim Boiler haben nun einen Anderen Name z.B.:
heatPmp wird zu heatPump
heating_temp wird zu heatingTemp


MFG
benkler
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 06 November 2020, 12:18:35
Falls das eine Bitte um Hilfe sein soll:

Ein update der attrTemplate sollte kein Hexenwerk sein, aber wenn möglich sollte das "en block" gemacht werden; für die, die noch die "alte" Version nutzen, kann gerne das, was heute da ist als "outdated" noch eine ganze Weile weiter in der File bleiben.

Falls du also RAW-lists von deinen (vollständig überarbeiteten) Devices liefern magst...?
Titel: Antw:ems-esp MQTT
Beitrag von: benkler am 06 November 2020, 12:31:14
Nicht direkt eine Bitte um Hilfe :)

Ich werde mir am Wochenende mal alle meine Devices anschauen und überarbeiten und danach werde ich RAW-lists von meinen Devices liefern.
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 06 November 2020, 12:37:36
Gerne. Falls du das direkt in (getesteter) attrTemplate-Form liefern könntest, wäre das noch besser... ;) (Ist auch kein Hexenwerk)
Titel: Antw:ems-esp MQTT
Beitrag von: benkler am 06 November 2020, 18:43:35
Hier mal meine Templates dich ich auch getestet habe und sowei ich es beurteilen kann auch funktionieren.
Befehle ans ESP Senden habe ich nicht getestet, da ich das aktuell nicht nutze

###########################################
# ems-esp - v2.1
# The ems-esp device firmware v2.1
name:ems-esp_heater_device_v2
filter:TYPE=MQTT2_DEVICE
desc:EMS-ESP is a open-source system to communicate with EMS (Energy Management System) based boilers, thermostats and other modules from manufacturers like Bosch, Buderus, Nefit, Junkers and Sieger, see <a href="https://github.com/proddy/EMS-ESP">project page</a>. First version, to contribute see <a href="https://forum.fhem.de/index.php/topic,104968.0.html">Forum Thread</a>.
order:E_02a
par:DEV_ID;ID topic set, default is "ems-esp";{ AttrVal("DEVICE","readingList","") =~ m,[^/:]+/([^/]+), ? $1 : "ems-esp" }
par:ICON;ICON as set, defaults to sani_boiler_temp;{ AttrVal("DEVICE","icon","sani_boiler_temp") }
attr DEVICE icon ICON
modify DEVICE DEV_ID
attr DEVICE bridgeRegexp \
  DEV_ID/(sensors|sm_data|hp_data|thermostat_data).*:.* "ems_esp_$1"\
  DEV_ID/(boiler_data|tapwater_active|heating_active|mixing_data|shower_data).*:.* "ems_esp_boiler"\
  DEV_ID/(status|info|heartbeat).*:.* "Heizung"
attr DEVICE userReadings formatedUptime:uptime.* {my $m = ReadingsVal($name,"uptime_sec",0)/60;; return sprintf "0 000 00:%02d", $m if $m < 60;; my $h = $m / 60;; $m %= 60;; return sprintf "0 000 %02d:%02d", $h, $m if $h < 24;; my $d = $h / 24;; $h %= 24;; return sprintf "0 %03d %02d:%02d", $d, $h, $m if $d <365;; my $y = $d / 365;; $d %= 365;; return sprintf "%d %03d %02d:%02d", $y, $d, $h, $m}
attr DEVICE  readingList DEV_ID/status:.* LWT\
  DEV_ID/heartbeat:.* { json2nameValue($EVENT) }\
  DEV_ID/info:.* { json2nameValue($EVENT) }\
  DEV_ID/status:.* { json2nameValue($EVENT) }
attr DEVICE stateFormat Interface: LWT Signal: rssi % <br>Uptime: formatedUptime <br>IPAddress : <a href="http://ip" target="_blank">ip</a>
attr DEVICE setList restart:noArg DEV_ID/restart
attr DEVICE devStateIcon online:it_net offline:it_net@red  2.1:lan_rs485 2.0:lan_rs485@red
attr DEVICE autocreate 1
attr DEVICE webCmd restart
attr DEVICE model ems-esp_heater_device_v2
setreading DEVICE attrTemplateVersion 20200522 or prior

name:ems-esp_boiler_v2
filter:TYPE=MQTT2_DEVICE
desc:To configure a boiler device for use with an <a href="https://github.com/proddy/EMS-ESP">EMS-ESP</a> with Firmware 2.1.0.<br><a href="https://forum.fhem.de/index.php/topic,104968.0.html">Forum Thread</a>
order:E_02b
par:DEV_ID;ID topic set, default is "ems-esp";{ AttrVal("DEVICE","readingList","") =~ m,[^/:]+/([^/]+), ? $1 : "ems-esp" }
attr DEVICE readingList DEV_ID/boiler_data { json2nameValue($EVENT) }\
DEV_ID/shower_data:.* { json2nameValue($EVENT) }\
DEV_ID/mixing_data:.* { json2nameValue($EVENT) }\
DEV_ID/tapwater_active:.* tapwater_active\
DEV_ID/heating_active:.* heating_active\
DEV_ID/boiler_data_ww:.* { json2nameValue($EVENT) }\
attr DEVICE stateFormat \
Vorlauf: curFlowTemp C\
Rücklauf: retTemp C \
Vorlauf Soll: selFlowTemp C\
SystemDruck: sysPress Bar \
Wasserspeicher: wwStorageTemp2 C \
Status: BoilerStatus \
Status-Code: serviceCode serviceCodeNumber\
Temp Außen: outdoorTemp C\
attr DEVICE devStateIcon idle:sani_heating heating:sani_heating@red tapwater:sani_water_hot@red
attr DEVICE userReadings BoilerStatus {BoilerStatus("serviceCode","serviceCodeNumber")}
attr DEVICE model ems-esp_boiler_v2
setreading DEVICE attrTemplateVersion 20200529

#ems-esp thermostat device
name:ems-esp_thermostat_read-only_v2
filter:TYPE=MQTT2_DEVICE
desc:To configure a simple read-only thermostat (e.g. CT200) for use with an <a href="https://github.com/proddy/EMS-ESP">EMS-ESP</a> with Firmware 2.1.0.<br><a href="https://forum.fhem.de/index.php/topic,104968.0.html">Forum Thread</a><br>
order:E_02c
par:DEV_ID;ID topic set, default is "ems-esp";{ AttrVal("DEVICE","readingList","") =~ m,[^/:]+/([^/]+), ? $1 : "ems-esp" }
par:ICON;ICON as set, defaults to temp_control;{ AttrVal("DEVICE","icon","temp_control") }
attr DEVICE icon ICON
attr DEVICE devStateIcon auto:time_automatic manual:time_manual_mode
attr DEVICE jsonMap hc1_mode:mode hc1_seltemp:desired-temp hc1_daytemp:daytemp hc1_nighttemp:nighttemp hc1_holidayttemp:holidaytemp
attr DEVICE readingList DEV_ID/thermostat_data:.* { json2nameValue($EVENT, '', $JSONMAP) }
attr DEVICE stateFormat mode\
desired-temp °C
attr DEVICE webCmd :
attr DEVICE model ems-esp_thermostat_read-only_v2
setreading DEVICE attrTemplateVersion 20200522 or prior

name:ems-esp_thermostat_simple_v2
filter:TYPE=MQTT2_DEVICE
desc:To configure a simple thermostat (e.g. RC300) for use with an <a href="https://github.com/proddy/EMS-ESP">EMS-ESP</a> with Firmware 2.1.0.<br><a href="https://forum.fhem.de/index.php/topic,104968.0.html">Forum Thread</a><br>
order:E_02c1
par:DEV_ID;ID topic set, default is "ems-esp";{ AttrVal("DEVICE","readingList","") =~ m,[^/:]+/([^/]+), ? $1 : "ems-esp" }
par:ICON;ICON as set, defaults to temp_control;{ AttrVal("DEVICE","icon","temp_control") }
attr DEVICE icon ICON
attr DEVICE 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
attr DEVICE jsonMap hc1_mode:mode hc1_seltemp:desired-temp hc1_daytemp:daytemp hc1_nighttemp:nighttemp hc1_holidayttemp:holidaytemp
attr DEVICE readingList DEV_ID/thermostat_data:.* { json2nameValue($EVENT, '', $JSONMAP) }
attr DEVICE setList mode:uzsuSelectRadio,auto,manual DEV_ID/thermostat_cmd_mode1 $EVTPART1\
  desired-temp:slider,15.0,0.5,30.0,1 DEV_ID/thermostat_cmd_temp1 $EVTPART1
attr DEVICE setStateList on off
attr DEVICE stateFormat mode\
desired-temp °C
attr DEVICE webCmd mode:desired-temp
set DEVICE attrTemplate speechcontrol_type_thermostat
attr DEVICE model ems-esp_thermostat_simple_v2
setreading DEVICE attrTemplateVersion 20201107

name:ems-esp_thermostat_RC35_type_v2
filter:TYPE=MQTT2_DEVICE
desc:To configure a thermostat comparable to RC35 for use with an <a href="https://github.com/proddy/EMS-ESP">EMS-ESP</a> with Firmware 2.1.0<br>.<a href="https://forum.fhem.de/index.php/topic,104968.0.html">Forum Thread</a>
order:E_02c1
par:DEV_ID;ID topic set, default is "ems-esp";{ AttrVal("DEVICE","readingList","") =~ m,[^/:]+/([^/]+), ? $1 : "ems-esp" }
attr DEVICE readingList DEV_ID/thermostat_data:.* { json2nameValue($EVENT) } \
DEV_ID/thermostat_data1:.* { json2nameValue($EVENT) } \
DEV_ID/thermostat_data_hc1:.* { json2nameValue($EVENT) } \
attr DEVICE setList mode:uzsuSelectRadio,auto,manual DEV_ID/thermostat_cmd_mode1 $EVTPART1 \
  desired-temp:slider,15.0,0.5,30.0,1 DEV_ID/thermostat_cmd_temp1 $EVTPART1 \
  daytemp:slider,15.0,0.5,30.0,1 DEV_ID/thermostat_cmd_daytemp1 $EVTPART1 \
  nighttemp:slider,15.0,0.5,30.0,1 DEV_ID/thermostat_cmd_nighttemp1 $EVTPART1 \
  holidaytemp:slider,15.0,0.5,30.0,1 DEV_ID/thermostat_cmd_holidayttemp1 $EVTPART1
attr DEVICE model ems-esp_thermostat_RC35_type_v2
attr DEVICE stateFormat mode\
seltemp °C
setreading DEVICE attrTemplateVersion 20200522 or priorr


für den Boiler habe ich noch ein userReading welches noch unterstützung aus den myUtils benötigt. hier der Part aus den myUtils, eventuell kann das jemand brauchen

###### Boilerstatus ######
sub BoilerStatus($$) {
  my($servicecode,$servicecodenumber) = @_;
  $servicecode = ReadingsVal("MQTT2_ems_esp_boiler","serviceCode","");
  $servicecodenumber = ReadingsVal("MQTT2_ems_esp_boiler","serviceCodeNumber","");
  my $status;
if($servicecode eq "-H" and $servicecodenumber eq "200")
    {$status="Heizbetrieb";}
elsif ($servicecode eq "-A" and $servicecodenumber eq "208")
{$status="Schornsteinfegerbetrieb oder Servicebetrieb";}
elsif ($servicecode eq "=H" and $servicecodenumber eq "201")
{$status="Warmwasserbetrieb";}
elsif ($servicecode eq "0A" and $servicecodenumber eq "202")
{$status= "Wartephase kann waerme nicht an Anlage abgeben";}
elsif ($servicecode eq "0A" and $servicecodenumber eq "305")
{$status= "Wartephase des Gas Brennwertgeraetes nach Abschluss der Warmwasserbereitung";}
elsif ($servicecode eq "0C" and $servicecodenumber eq "283")
{$status="Heizgeraet wird hochgefahren";}
elsif ($servicecode eq "0E" and $servicecodenumber eq "265")
{$status="Wartephase des Gas-Brennwertgeraetes. das Geraet schaltet als Reaktion auf die Waermeanforderung regelmaessig auf Niedriglast ein";}
elsif ($servicecode eq "0H" and $servicecodenumber eq "203")
{$status="Betriebsbereitschaft keine Waermeanforderung vorhanden";}
elsif ($servicecode eq "0L" and $servicecodenumber eq "284")
{$status="Die Gasarmatur wird angesteuert";}
elsif ($servicecode eq "0U" and $servicecodenumber eq "270")
{$status="Das Heizgeraet wird hochgefahren";}
elsif ($servicecode eq "0Y" and $servicecodenumber eq "204")
{$status="Wartephase des Gas-Brennwertgeraetes. Vorlauftemperatur ist hoeher als die eingestellte Heizwassertemperatur";}
elsif ($servicecode eq "0Y" and $servicecodenumber eq "276")
{$status="Die Temperaturfuehler im Heizgeraet messen eine zu hohe Temperatur";}
elsif ($servicecode eq "0Y" and $servicecodenumber eq "285")
{$status="Die Temperaturfuehler im Heizgeraet messen eine zu hohe Temperatur";}
elsif ($servicecode eq "2E" and $servicecodenumber eq "207")
{$status="Betriebsdruck zu niedrig";}
elsif ($servicecode eq "2F" and $servicecodenumber eq "260")
{$status="Die Temperaturfuehler im Heizgeraet messen eine Abweichende Temperatur";}
elsif ($servicecode eq "2F" and $servicecodenumber eq "345")
{$status="Die Temperaturfuehler im Heizgeraet messen eine Abweichende Temperatur";}
elsif ($servicecode eq "2L" and $servicecodenumber eq "266")
{$status="Die Temperaturfuehler im Heizgeraet messen eine Abweichende Temperatur";}
elsif ($servicecode eq "2P" and $servicecodenumber eq "212")
{$status="Die Temperaturfuehler im Heizgeraet messen eine Abweichende Temperatur";}
elsif ($servicecode eq "2P" and $servicecodenumber eq "341")
{$status="Die Temperaturfuehler im Heizgeraet messen eine Abweichende Temperatur";}
elsif ($servicecode eq "2U" and $servicecodenumber eq "213")
{$status="Die Temperaturfuehler im Heizgeraet messen eine Abweichende Temperatur";}
elsif ($servicecode eq "4C" and $servicecodenumber eq "224")
{$status="Die Temperaturfuehler im Heizgeraet messen eine Abweichende Temperatur";}
elsif ($servicecode eq "6A" and $servicecodenumber eq "227")
{$status="Brenner entzuendet nicht";}
elsif ($servicecode eq "7C" and $servicecodenumber eq "231")
{$status="Waehrend einer Stoerung war eine kurze Stromunterbrechung";}
elsif ($servicecode eq "H07")
{$status="Betriebsdruck zu niedrig";}
elsif ($servicecode eq "rE")
{$status="Das Heizgeraet wird zurueckgesezt";}
else
{$status="Unbekannt $servicecode  $servicecodenumber";}

  return $status;
};


so hatte es bei mir auch fuktioniert.



für Kritik bin ich natürlich offen ;)
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 09 November 2020, 10:42:42
Hmm, hatte vorhin was eingecheckt, aber leider den EDIT nicht gesehen, muss also nochmal nacharbeiten...

Was den myUtils-Code angeht, vorab mal Danke für's posten!

(OT Kritikpunkte, eher für's lernen:
- userReadinging ohne trigger sollte man nicht definieren, zumal hier die Infos über mehrere Topics reinkommen (=> Last reduzieren);
- Die Parameter-Übergabe leuchtet mir nicht ein. Wenn, dann eher den Device-Namen übergeben, dann paßt der Code als generalisierter Code für alle...? Alles andere ist sowieso hart vercoded.)

Was mir unklar ist: Braucht es die doppelte Abfrage von servicecode und servicecodenumber? Das sieht - jedenfalls auf den ersten Blick - relativ eindreutig aus, wenn man nur das letztere nimmt, oder täuscht das?

Aus gegebenem Anlaß würde ich vorschlagen, das ganze nochmal deutlich auszubauen, weiß aber noch nicht, ob das zielführend wäre. Es gibt derzeit zwei Threads, die sich mit "ähnlichen Themen" beschäftigen, die man hier m.E. gut verwenden könnte:

Zum einen betreffend Sprachsteuerungsfragen bei Heizungsgeräten (ca. ab hier: https://forum.fhem.de/index.php/topic,97989.msg1099062.html#msg1099062), zum anderen das "Ausschlachten" des JSON in myUtils (
https://forum.fhem.de/index.php/topic,115620.msg1098964.html#msg1098964).Damit könnte man das Auspacken, Umbenennen und "Übersetzen" der Fehlercodes in eine einzige myUtils packen und z.B. gleich die Statuscodes auf Basis der Spracheinstellungen in global übersetzen...

Vorab: Ich unterstütze da gerne für den Einstige in das Thema, will mich aber ansonsten eher zurückhalten (es sei denn, es schickt mir jemand einen getesteten Adapter, den ich nur an meine Junkers anschließen muß und verrät mir, wo... Dann steige ich ggf. aus Eigeninteresse ein :P ).
Titel: Antw:ems-esp MQTT
Beitrag von: benkler am 09 November 2020, 13:51:24
Danke fürs einchecken ;)

Ja das mit dem UserReading muss ich noch optimieren, ich hatte am anfang den kompletten code im Attribute (das konnte man irgendwann nicht mehr editieren :D ).

Die Abfrage von ServiceCode uns ServiceCodeNumber macht schon an ein paar stellen sinn:
elsif ($servicecode eq "0A" and $servicecodenumber eq "202")
{$status= "Wartephase kann waerme nicht an Anlage abgeben";}
elsif ($servicecode eq "0A" and $servicecodenumber eq "305")
{$status= "Wartephase des Gas Brennwertgeraetes nach Abschluss der Warmwasserbereitung";}

elsif ($servicecode eq "0Y" and $servicecodenumber eq "204")
{$status="Wartephase des Gas-Brennwertgeraetes. Vorlauftemperatur ist hoeher als die eingestellte Heizwassertemperatur";}
elsif ($servicecode eq "0Y" and $servicecodenumber eq "276")
{$status="Die Temperaturfuehler im Heizgeraet messen eine zu hohe Temperatur";}


hier ist der Servicecode gleich aber die number unterscheidet sich und auch die Aussage des Codes ist ein anderer (auch wenn nur leicht).
ich habe mir das Handbuch meines Boilers zur hand genommen und die Codes gemeinsam mit den Nummern "übersetzt" so ist das dann auch gewachsen.

Ich schaue mir die anderen Themen mal an und optimiere ggf. meinen code noch weiter, das war halt bis jetzt immer nur für mich :)
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 09 November 2020, 14:43:39
OK, die zwei Ausnahmen hatte ich nicht gesehen.

Diese if ... else-Kaskaden widerstreben mir seit einiger Zeit, eleganter ist es, da mit Hashes zu arbeiten. Hier wäre mein Vorschlag, zwei "Übersetzungshashes" zu definieren, einen "flachen" mit servicecodenumber => Text, und einen "gestuften" mit
servicecodenumber => servicecode => Text. Braucht dann halt zwei Durchläufe beim Ersetzen, ist aber kein Drama (bzw. "internationalisiert" wäre das dann vielleicht servicecodenumber => language =>Text bzw. servicecodenumber => servicecode => language => Text).Sowas ist einfacher zu pflegen und man könnte ggf. die "Übersetzungstabelle" auch außerhalb des Codes in einer eigenen Datei pflegen, falls es zu unterschiedlich für verschiedene Typen ist?
(OT: meine "Erstlinge", die ich hier irgendwo mal gepostet hatte, würde ich zu einem großen Teil heute auch anders machen, zum Teil auch deswegen, weil ich eben auch früher manches nur "für mich" gemacht hatte und heute eher darauf achte, dass der Code - wenn möglich - einfacher in eine andere Umgebung paßt...
Das ist überigens hilfreich, weil dann die Konfiguration im wesentlichen die "personenbezogenen" Teile enthält und der eigentliche Funktionscode "anonym" ist und so problem- und schutzlos z.B. auf github gesichert werden kann).
Titel: Antw:ems-esp MQTT
Beitrag von: Wondermusic am 15 Juni 2021, 11:27:39
Zitat von: benkler am 06 November 2020, 18:43:35
...für den Boiler habe ich noch ein userReading welches noch unterstützung aus den myUtils benötigt. hier der Part aus den myUtils, eventuell kann das jemand brauchen

###### Boilerstatus ######
sub BoilerStatus($$) {
  my($servicecode,$servicecodenumber) = @_;
  $servicecode = ReadingsVal("MQTT2_ems_esp_boiler","serviceCode","");
  $servicecodenumber = ReadingsVal("MQTT2_ems_esp_boiler","serviceCodeNumber","");
  my $status;
if($servicecode eq "-H" and $servicecodenumber eq "200")
    {$status="Heizbetrieb";}
elsif ($servicecode eq "-A" and $servicecodenumber eq "208")
{$status="Schornsteinfegerbetrieb oder Servicebetrieb";}
elsif ($servicecode eq "=H" and $servicecodenumber eq "201")
{$status="Warmwasserbetrieb";}
elsif ($servicecode eq "0A" and $servicecodenumber eq "202")
{$status= "Wartephase kann waerme nicht an Anlage abgeben";}
elsif ($servicecode eq "0A" and $servicecodenumber eq "305")
{$status= "Wartephase des Gas Brennwertgeraetes nach Abschluss der Warmwasserbereitung";}
elsif ($servicecode eq "0C" and $servicecodenumber eq "283")
{$status="Heizgeraet wird hochgefahren";}
elsif ($servicecode eq "0E" and $servicecodenumber eq "265")
{$status="Wartephase des Gas-Brennwertgeraetes. das Geraet schaltet als Reaktion auf die Waermeanforderung regelmaessig auf Niedriglast ein";}
elsif ($servicecode eq "0H" and $servicecodenumber eq "203")
{$status="Betriebsbereitschaft keine Waermeanforderung vorhanden";}
elsif ($servicecode eq "0L" and $servicecodenumber eq "284")
{$status="Die Gasarmatur wird angesteuert";}
elsif ($servicecode eq "0U" and $servicecodenumber eq "270")
{$status="Das Heizgeraet wird hochgefahren";}
elsif ($servicecode eq "0Y" and $servicecodenumber eq "204")
{$status="Wartephase des Gas-Brennwertgeraetes. Vorlauftemperatur ist hoeher als die eingestellte Heizwassertemperatur";}
elsif ($servicecode eq "0Y" and $servicecodenumber eq "276")
{$status="Die Temperaturfuehler im Heizgeraet messen eine zu hohe Temperatur";}
elsif ($servicecode eq "0Y" and $servicecodenumber eq "285")
{$status="Die Temperaturfuehler im Heizgeraet messen eine zu hohe Temperatur";}
elsif ($servicecode eq "2E" and $servicecodenumber eq "207")
{$status="Betriebsdruck zu niedrig";}
elsif ($servicecode eq "2F" and $servicecodenumber eq "260")
{$status="Die Temperaturfuehler im Heizgeraet messen eine Abweichende Temperatur";}
elsif ($servicecode eq "2F" and $servicecodenumber eq "345")
{$status="Die Temperaturfuehler im Heizgeraet messen eine Abweichende Temperatur";}
elsif ($servicecode eq "2L" and $servicecodenumber eq "266")
{$status="Die Temperaturfuehler im Heizgeraet messen eine Abweichende Temperatur";}
elsif ($servicecode eq "2P" and $servicecodenumber eq "212")
{$status="Die Temperaturfuehler im Heizgeraet messen eine Abweichende Temperatur";}
elsif ($servicecode eq "2P" and $servicecodenumber eq "341")
{$status="Die Temperaturfuehler im Heizgeraet messen eine Abweichende Temperatur";}
elsif ($servicecode eq "2U" and $servicecodenumber eq "213")
{$status="Die Temperaturfuehler im Heizgeraet messen eine Abweichende Temperatur";}
elsif ($servicecode eq "4C" and $servicecodenumber eq "224")
{$status="Die Temperaturfuehler im Heizgeraet messen eine Abweichende Temperatur";}
elsif ($servicecode eq "6A" and $servicecodenumber eq "227")
{$status="Brenner entzuendet nicht";}
elsif ($servicecode eq "7C" and $servicecodenumber eq "231")
{$status="Waehrend einer Stoerung war eine kurze Stromunterbrechung";}
elsif ($servicecode eq "H07")
{$status="Betriebsdruck zu niedrig";}
elsif ($servicecode eq "rE")
{$status="Das Heizgeraet wird zurueckgesezt";}
else
{$status="Unbekannt $servicecode  $servicecodenumber";}

  return $status;
};


Ich fand die Idee Klasse und habe mir mal die Arbeit gemacht eine eigene 99_buderusUtils.pm zu basteln. Vielleicht kann sie ja jemand gebrauchen. ;-)
Da ist so ziemlich alles drin was ich an Fehlercodes finden konnte.

Gruß,
Richy
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 17 Oktober 2021, 12:48:45
Nachdem ich die Tage mal wieder mit ems-esp zu tun hatte, ist mir das etwas seltsame serReadings aus dem attrTemplate ins Auge gestochen. Da sind m.E. ein paar Dinge verbesserungsfähig...

Werde bei Gelegenheit mal das hier einchecken:
attr DEVICE userReadings BoilerStatus:serviceCode.* {BoilerStatus(ReadingsVal($name,'serviceCode',''),ReadingsVal($name,'serviceCodeNumber',''))}

Das müßte dann mit der angehängten myUtils zusammenpassen...

Die ist deutlich überarbeitet, kann also auch Fehler enthalten, keine Gewähr!
Titel: Antw:ems-esp MQTT
Beitrag von: freddeh am 05 März 2022, 09:03:10
Hallo zusammen,

ich habe einen ems-esp mit Firmware 3.3.1 (Buderus GBx72, BC25, RC35) in Betrieb, habe aber die starke Vermutung, dass sich sich seit der 2.2 ziemlich viel getan hat, bekomme anhand der Beispiele das nicht ohne weiteres zum Laufen, weil die Readings nicht mehr passen. Gibt es jemanden, der auch schon die aktuelle Firmware im Einsatz hat?

Viele Grüße
Frederik

Titel: Antw:ems-esp MQTT
Beitrag von: maddhin am 01 Oktober 2022, 20:56:32
Hi,

ich spiele mit dem Gedanken mir so eine ems-esp Box für meine Junkers-Therme anzuschaffen - hat jemand Erfahrung mit Fhem und der v3 Firmware? Ich bin nicht so firm und es wäre schade, wenn das dann nicht mit FHEM funktionieren würde...
Titel: Antw:ems-esp MQTT
Beitrag von: man361 am 03 Oktober 2022, 14:01:29
Hi maddhin,
Bin zwar auch noch FHEM Neuling mit vielen Fragezeichen...
Aber das EMS-ESP v3.4.1 ist bei mir mit MQTT eingebunden. Innerhalb EMS-ESP hab ich das Senden aktuell auf 20sec gestellt, gibt dann aber 'ne ganze Menge aus...
Falls es dir hilft, hier meine raw-Definition:

defmod MQTT2_ems_esp MQTT2_DEVICE ems_esp
attr MQTT2_ems_esp alias Gastherme
attr MQTT2_ems_esp icon sani_heating
attr MQTT2_ems_esp readingList ems_esp:ems-esp/info:.* { json2nameValue($EVENT) }\
ems_esp:ems-esp/heartbeat:.* { json2nameValue($EVENT) }\
ems_esp:ems-esp/status:.* status\
ems_esp:ems-esp/boiler_data:.* { json2nameValue($EVENT) }\
ems_esp:ems-esp/boiler_data_ww:.* { json2nameValue($EVENT) }\
ems_esp:ems-esp/thermostat_data:.* { json2nameValue($EVENT) }\
ems_esp:ems-esp/thermostat_data_hc1:.* { json2nameValue($EVENT) }\
ems_esp:ems-esp/tapwater_active:.* tapwater_active\
ems_esp:ems-esp/heating_active:.* heating_active\
ems_esp:ems-esp/boiler_data/ubauptime:.* ubauptime\
ems_esp:ems-esp/boiler_data_ww/wwcurtemp:.* wwcurtemp\
ems_esp:ems-esp/boiler_data_ww/wwcurtemp2:.* wwcurtemp2\
ems_esp:ems-esp/boiler_data/curflowtemp:.* curflowtemp\
ems_esp:ems-esp/boiler_data_ww/wwstoragetemp2:.* wwstoragetemp2
attr MQTT2_ems_esp room Heizung,MQTT2_DEVICE
attr MQTT2_ems_esp stateFormat Aussen: outdoortemp °C, Vorlauf: curflowtemp °C, Warmwasser: wwcurtemp °C
attr MQTT2_ems_esp suppressReading IPv4_.*|MAC|RSSI|api.*|building|connection|controlmode|datetime|floor.*|ntp_status|rssi|rx.*|mqtt.*|tx.*|uptime.*|wifistrength


Gruß, Achim
Titel: Antw:ems-esp MQTT
Beitrag von: Gisbert am 03 Oktober 2022, 14:51:00
Hallo maddhin,

ich hätte ein EMS BUS Gateway V1.7 (günstig) von https://bbqkees-electronics.nl. (https://bbqkees-electronics.nl.) abzugeben, da meine Buderus-Gasheizung (Baujahr 2000) zu alt ist, um vernünftig damit zu laufen. Bis auf einen Versuch war das Board nicht im Einsatz.

Viele Grüße Gisbert
Titel: Antw:ems-esp MQTT
Beitrag von: maddhin am 03 Oktober 2022, 15:28:00
Zitat von: Gisbert am 03 Oktober 2022, 14:51:00
ich hätte ein EMS BUS Gateway V1.7 (günstig) von https://bbqkees-electronics.nl. (https://bbqkees-electronics.nl.) abzugeben
dazu schicke ich gleich mal ne PN;)

Ich brauche den EMS-ESP hauptsächlich, um das im Flur installiere Raumthermostat zu umgehen bzw. zu steuern. Im Moment habe ich das Problem, dass ich z.B. das Wohnzimmer nicht auf 22 Grad bekomme, wenn ich im Flur nicht z.B. 21 Grad einstelle (im Flur sind eigentlich immer 20 Grad).

D.h. ich plane über FHEM immer die höchste Solltemperatur an die Regelung (Bosch CR-100) weiterzugeben und so die Therme "einzuschalten", wenn nötig. Die Räume würde ich über Homeatic IP Thermostate steuern.

Hat sich jemand sowas schonmal zusammengebastelt? Meine spontane Idee ist, das dann über ein DoIF und einer Funktion, die immer den höchsten Sollwert der Thermostate ermittelt, zu lösen. Ggf. kann man die höchste Solltemp auch einfach nur in einen Dummy schreiben, das bräuchte dann aber wohl jeweils ein Doif per Thermostat. Viele Wege führen nach Rom LOL

Schönen Feiertag!
Titel: Antw:ems-esp MQTT
Beitrag von: maddhin am 08 Oktober 2022, 13:25:57
Hallo zusammen,

dank @Gisbert bin ich nun glücklicher Besitzer und Betreiber eines EMS-ESP (FW 3.4.3) :)

Ich habe bei meinem MQTT2device autocreate eingeschaltet und es wurde ein device "MQTT2_Mosquitto" erstellt. Nun wollte ich für diesen device das attrtemplate "ems-esp_heater_device" vergeben, bekomme dann aber folgende Fehlermeldung:

wrong syntax for MQTT2_Mosquitto: define <name> MQTT2_DEVICE [clientid]
Unknown command Mosquitto:ems-esp, try help.
Unknown command Mosquitto:ems-esp/(sensors|sm_data|hp_data|thermostat_data).*:.*, try help.
Unknown command Mosquitto:ems-esp/(boiler_data|tapwater_active|heating_active|mixing_data|shower_data).*:.*, try help.
Unknown command Mosquitto:ems-esp/status:.*, try help.
Unknown command Mosquitto:ems-esp/heartbeat:.*, try help.
Unknown command Mosquitto:ems-esp/info:.*, try help.
Unknown command Mosquitto:ems-esp/status:.*, try help.
Unknown command Mosquitto:ems-esp/restart, try help.


Ich meine hier gelesen zu haben, dass dieses attrTemplate dann nochmal das "richtige" device für den Boiler und das Thermometer anlegt, oder?

Sorry, ich stehe hier jetzt auf der Leitung.
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 08 Oktober 2022, 13:46:08
Mahlzeit. Irgendwie paßt das nicht so richtig zu dem, was ich aus dem aktuellen attrTemplate "ems-esp_heater_device" ablesen würde.
Prinzipiell bist du richtig vorgegangen, wobei das mit der ClientID "Mosquitto" sehr komisch anmutet.

Kannst du das per autocreate erstellte Device nochmal löschen, den ESP neu starten und dann mal zeigen, wie das dann aussieht.

Und zu meinem besseren Verständnis: was ist mit "bei meinem MQTT2device autocreate eingeschaltet" gemeint? Wenn eine ClientID in der readingList auftaucht, müßte damit ein MQTT2_SERVER gemeint sein, und bei dem steht per default "autocreate" (intern) auf "simple"...
Titel: Antw:ems-esp MQTT
Beitrag von: maddhin am 08 Oktober 2022, 14:21:03
HI,
ich habe bei mir nur ein MQTT2_CLIENT device namens Mosquitto, siehe unten. Ein Server device habe ich nicht, wahrscheinlich weil der in einem anderen Docker-Container läuft? Schon so lange her, dass ich das aufgesetzt habe, weiß nicht, ob ich da vielleicht was falsch gemacht habe. Vielleicht muss man den MQTT"-server device auch noch definieren?

Internals:
   BUF       
   Clients    :MQTT2_DEVICE:MQTT_GENERIC_BRIDGE:
   ClientsKeepOrder 1
   DEF        mqtt:1883
   DeviceName mqtt:1883
   FD         20
   FUUID      60280265-f33f-92df-5b30-9c06d00ae11aeabb
   FVERSION   00_MQTT2_CLIENT.pm:0.264050/2022-09-16
   NAME       Mosquitto
   NR         29
   PARTIAL   
   STATE      opened
   TYPE       MQTT2_CLIENT
   WBCallback
   clientId   Mosquitto
   eventCount 1
   lastMsgTime 1665231153.54463
   nextOpenDelay 5
   MatchList:
     1:MQTT2_DEVICE ^.
     2:MQTT_GENERIC_BRIDGE ^.
   READINGS:
     2022-10-08 13:16:57   state           opened
Attributes:
   DbLogExclude .*
   icon       mqtt
   room       3.1_Interfaces


Dieser device hat jedenfalls erstmal kein autocreate und EMS-ESP wird auch nicht angelegt, wenn dies nicht eingeschaltet ist (Habe devices gelöscht, etc wie Du geschrieben hast).

Ich ucke jetzt mal, wie ich zu dieser MQTT Konfiguration gekommen bin...
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 08 Oktober 2022, 14:38:12
Mach' kein größeres Gewirr rein, als jetzt schon ist; das geht auch mit MQTT2_CLIENT, aber du solltest beachten, dass es dann m.E. sinnvoll ist, ein weiteres Device zwischenzuschalten, um "vorzusortieren". Details findest du im Wiki zu MQTT2_CLIENT.

Titel: Antw:ems-esp MQTT
Beitrag von: maddhin am 08 Oktober 2022, 17:20:12
Also ich habe die 3 devices jetzt manuel angelegt und das template für den EMS_Esp und die Regelung funktionieren. Beim Boiler bekomme ich ein

EMS_Boiler: bad reading name EMS_Boiler stateFormat  (contains not A-Za-z/\d_\.- or is too long)


Da müsste ich in dem Template etwas ändern, oder? Ich nutze FW 3.4.3.
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 08 Oktober 2022, 17:42:04
Da waren in der Tat zwei Fehler drin (zu viele escapte Zeilenumbrüche).
Entweder selbst Hand anlegen, oder nach dem morgigen update nochmal anwenden.
Titel: Antw:ems-esp MQTT
Beitrag von: maddhin am 08 Oktober 2022, 21:51:59
Ich habe etwas gebastelt heute und der Boiler geht, ich werde aber morgen noch das template ausprobieren und ggf. anpassen, wenn notwendig.

Bei mir funktioniert das "set desired-temp" bei der Regelung/Thermostat leider nicht. Direkt über die GUI des EMS-ESP funktioniert es aber.

Wenn ich setlist ändere, funktioniert es:
mode:uzsuSelectRadio,auto,manual ems-esp/thermostat { "cmd":"hc1_mode","data":$EVTPART1 }
  desired-temp:slider,15.0,0.5,30.0,1 ems-esp/thermostat { "cmd":"hc1_seltemp","data":$EVTPART1 }


Allerdings kann ich den mode nicht ändern, da ich es nicht hinbekomme, dass $EVTPART1 in Gänsefüßchen rausgeht, weil für auto/manual "auto" bzw "manual" gesendet werden muss.

Kann es sein, dass sich hier bei der FW3 einiges geändert hat?
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 09 Oktober 2022, 11:07:11
Hmm, ok, das Format scheint sich wirklich geändert zu haben. Habe nochmal ein update ins svn geschubst.

Das hier müßte eigentlich klappen:
mode:uzsuSelectRadio,auto,manual ems-esp/thermostat { "cmd":"hc1_mode","data":"$EVTPART1" }

Prinzipiell kommt es mir so vor, als wären diese attrTemplate's auch noch nicht komplett fertig gewesen.
Titel: Antw:ems-esp MQTT
Beitrag von: grappa24 am 30 Oktober 2022, 17:21:56
Ich hab noch das "alte" EMS-ESP Gateway Premium II von 2019 mit fw 1.9.5

Alles läuft soweit gut ("never chance a running system") ;D

Es gibt ja jetzt das neue E32/S32 Gateway von BBQKees mit fw 3.5

Weiß jemand, was diese neue Generation mehr/besser kann als die alte?



Titel: Antw:ems-esp MQTT
Beitrag von: Franz Tenbrock am 16 November 2022, 21:29:13
Hallo
da der thread aktiv ist hake ichmich mal ein
habe einige Jahre nichts mit FHEM gemacht lief ja alles was ich brauchte
bin also nicht im Thema drin
habe eine Panasonoc heisha
das heishamon Bauteil habe ich heute eingebaut und es auch im wlan gefunden und dann auch in meinem wlan Netz eingebunden,

ich hatte vor 5 Jahren mal einen ESP Abstandssensor für meine Zisterne, hat irgendwann den Geist aufgegeben
damals wurde das so definiert:

define mqttServer MQTT 127.0.0.1:1883
attr mqttServer room MQTT

define ESP1_D1 MQTT_DEVICE
attr ESP1_D1 IODev mqttServer
attr ESP1_D1 room MQTT
attr ESP1_D1 stateFormat Abstand
attr ESP1_D1 subscribeReading_Abstand /fhem/ESP1/1/Abstand
attr ESP1_D1 userReadings USensor:Abstand:.* { ReadingsVal($name,"Abstand",0)-30 }
#### -40 ist der Abstand zwischen Sensor und maximalem Wasserstand = 160

hab das nun so definiert:

define mqttServer MQTT 127.0.0.1:1883
setuuid mqttServer 637536bc-f33f-132e-a1e4-8d7cd044cac336f5
attr mqttServer room MQTT
define Heisha MQTT_DEVICE
setuuid Heisha 6375441e-f33f-132e-d74a-5ac36fc7b79aaba0
attr Heisha IODev mqttServer
attr Heisha room MQTT

ich habe natürlihc im Wiki nachgeschaut dort wird es nun heute anders definiert.
define m2s MQTT2_SERVER 1883 global

wenn ich das aber in der Art definiere, meckert FHEM und meint 1883 wäre schon besetzt
wenn ich das mqtt device über fhem lösche und dann ncoh einmal probiere, das Gleiche

MQTT" ist sicher das neuere Modul wie aber mache ich den port wieder frei
???
Titel: Antw:ems-esp MQTT
Beitrag von: Beta-User am 16 November 2022, 21:44:31
Der Thread ist vielleicht aktiv, aber er ist mAn. nicht dazu da, allgemeine Fragen zu MQTT zu diskutieren. Bitte ggf. zu Panasonic Heisha einen gesonderten Thread aufmachen, das hat doch nichts mit diesem Interface hier zu tun, oder täuscht mich das?

Ansonsten gibt es schon eine Ladung Threads zum Umstieg von MQTT "alt" auf MQTT2. Die einfachste: Definiere einen (MQTT2-) Server mit einem anderen Port und lasse das neue Gerät dahin senden.
Titel: Aw: ems-esp MQTT
Beitrag von: h3llsp4wn am 15 November 2023, 20:39:21
Hallo zusammen,

nachdem ich nun meine neue GB 172i.2 mit dem ems-esp laufen habe, stellt sich mir noch die Frage nach den Wochenprogrammen - hat hier schon jemand etwas gebaut bzw. realisiert? Ich hatte für die alte Therme und FTUI was gebastelt, so dass man die Programme ändern und schreiben konnte (klar - dann eben etliche male Befehle senden und schauen, dass alles angekommen ist).

Cheers,

h3ll
Titel: Aw: ems-esp MQTT
Beitrag von: eckhard scholz am 29 November 2023, 15:01:58
Hallo Leute ,

habe euren Thema gelesen und bin etwa auf dem selben Stand wie maddhin.
Mit dem Lesen der Daten von dem EMS-ESP (V3.6.4.) bin ich ganz zufrieden.
Was ich aber nicht hin bekomme ist das beschreiben z.B: wwseltemp.
attr MQTT2_ems_esp setList wwseltemp:46,48,50,52,54 boiler_data_ww/ems_esp/wwseltemp set $EVTPART1
Was mache ich da falsch?
Was fehlt ev. noch?

Gruß
Eckhard

einen Thema habe ich auch schon am laufen
mein Thema hier (https://forum.fhem.de/index.php?topic=135984.msg1294950#bot)
aber das Problem was ich habe würde eigentlich auch hier rein passen.
Titel: Aw: ems-esp MQTT
Beitrag von: fz55 am 29 November 2023, 17:18:09
Hallo Eckhard,

probiere mal das hier

attr MQTT2_ems_esp setList wwseltemp:46,48,50,52,54 boiler_data_ww/ems_esp/wwseltemp $EVTPART1
Ich glaube man kann auch $EVTPART1 weglassen.

Grüße
fz55
Titel: Aw: ems-esp MQTT
Beitrag von: eckhard scholz am 29 November 2023, 17:57:11
hallo fz55,

hab ich beides mal probiert aber leider ohne Erfolg.
17:51:34.378 SENT boiler_data_ww/ems_esp/wwseltemp 48
17:51:38.836 SENT boiler_data_ww/ems_esp/wwseltemp 50
MQTT traffic bringt nur diese Meldung, ändern tut sich nichts.
Kann den da noch was fehlen, das der Wert nicht im ESM-ESP übernommen wird?
Titel: Aw: ems-esp MQTT
Beitrag von: fz55 am 29 November 2023, 18:09:00
Hallo Eckhard,

bist du sicher, dass boiler_data_ww/ems_esp/wwseltemp das richtige Topic zum Ändern des Temperaturwerts ist?
Titel: Aw: ems-esp MQTT
Beitrag von: eckhard scholz am 29 November 2023, 20:51:24
Hallo fz55,

nein bin ich nicht, bin auch nicht grad der Profie für MQTT.
Ich habe noch eine anderes Thema gefunden, da hat mir passibe geholfen.
https://forum.fhem.de/index.php?topic=135984.0
Bin da der Sache mit seiner Hilfe etwas näher gekommen aber noch nicht zum Erfolg.

Titel: Aw: ems-esp MQTT
Beitrag von: eckhard scholz am 29 November 2023, 21:40:40
Danke für die Hinweise,

mit noch etwas probieren und passible´s Erklärung funktioniert es so
attr MQTT2_ems_esp setList WwSollT:46,48,50,52,54 ems-esp/boiler {"cmd":"wwseltemp", "data":$EVTPART1}
alleine ohne eure Hinweise wäre ich nicht daruf gekommen. Zumal die ESM-ESP Hilfe bisschen verwirrend ist, wenn man nicht so der große Programmierer ist.

Gruß
Eckhard
Titel: Aw: ems-esp MQTT
Beitrag von: stratege-0815 am 02 Dezember 2023, 08:12:09
Hallo zusammen,
verwendet ihr hier ein bestimmtes MQTT Template für den Ems-esp? Es werden ja mehrere angeboten die passen könnten.

ems-esp_heater_device
ems-esp_boiler
ems-esp_thermostat_read-only
ems-esp_thermostat_RC35_type
ems-esp_thermostat_simple

Welches liefert mir alle Werte vom Ems-esp webinterface?
Titel: Aw: ems-esp MQTT
Beitrag von: grappa24 am 02 Dezember 2023, 10:15:15
Zitat von: stratege-0815 am 02 Dezember 2023, 08:12:09Hallo zusammen,
verwendet ihr hier ein bestimmtes MQTT Template für den Ems-esp? Es werden ja mehrere angeboten die passen könnten.
Hi, ich hab eine Bosch/Junkers Heizung (ZSB 24-5 C 23 / ST 160-2E / CW400) und steuere diese über EMS-ESP.
Boiler: Buderus GBx72/Nefit Trendline/Junkers Cerapur/Worcester Greenstar Si/27i:
  Dafür verwende ich ems-esp_boiler
Thermostat: RC300/RC310/Moduline 3000/Bosch CW400/W-B Sense II:
  Dafür verwende ich ems_esp_thermostat_data

Auslesen kann man den Boiler damit sehr gut, steuern kann ich ehrlich gesagt aktuell nur wWComfort

Beim meinem Regler lässt sich nur "desired_temp" und "mode" über EMS setzen.
Titel: Aw: ems-esp MQTT
Beitrag von: stratege-0815 am 02 Dezember 2023, 13:42:14
Will ich ems-esp_boiler zuweisen will erhalte ich folgenden Fehler.

Unknown command ems_esp:ems-esp/boiler_data:.*, try help.
Unknown command ems_esp:ems-esp/shower_data:.*, try help.
Unknown command ems_esp:ems-esp/mixing_data:.*, try help.
Unknown command ems_esp:ems-esp/tapwater_active:.*, try help.
Unknown command ems_esp:ems-esp/heating_active:.*, try help.
Unknown command ems_esp:ems-esp/boiler_data_ww:.*, try help.

Ich habe eine buderus gb152-24 mit einem RC35 Bedienteil.
Titel: Aw: ems-esp MQTT
Beitrag von: grappa24 am 02 Dezember 2023, 19:13:30
ich schick dir hier mal ein List meines ems-esp-boiler device:

define MQTT2_ems_esp_boiler MQTT2_DEVICE ems_esp_boiler
attr MQTT2_ems_esp_boiler IODev myBroker
attr MQTT2_ems_esp_boiler alias Brenner
attr MQTT2_ems_esp_boiler devStateIcon 1
attr MQTT2_ems_esp_boiler devStateStyle style="text-align:left"
attr MQTT2_ems_esp_boiler eventMap hot:Hot intelligent:Eco
attr MQTT2_ems_esp_boiler fp_Dachstudio 444,711,7,MQTT2_ems_esp_boiler,
attr MQTT2_ems_esp_boiler icon mqtt
attr MQTT2_ems_esp_boiler readingList heating_system/ems-esp/boiler_data:.* { json2nameValue($EVENT) }\
heating_system/ems-esp/tapwater_active:.* tapwater_active\
heating_system/ems-esp/heating_active:.* heating_active\
heating_system/ems-esp/shower_data:.* { json2nameValue($EVENT) }
attr MQTT2_ems_esp_boiler room Heizung,MQTT2_DEVICE,Raumklima
attr MQTT2_ems_esp_boiler setList wWComfort:select,Hot,Eco heating_system/ems-esp/boiler_cmd { "cmd":"comfort", "data": "$EVTPART1" }
attr MQTT2_ems_esp_boiler stateFormat Warmwasser: wWComfort
attr MQTT2_ems_esp_boiler webCmd wWComfort
#   CID        ems_esp_boiler
#   DEF        ems_esp_boiler
#   FUUID      5e2af0ed-f33f-b5ae-d2ee-99a37f886489ee6d
#   IODev      myBroker
#   LASTInputDev myBroker
#   MSGCNT     1343
#   NAME       MQTT2_ems_esp_boiler
#   NR         524
#   STATE      Warmwasser: Hot
#   TYPE       MQTT2_DEVICE
#   eventCount 1343
#   myBroker_CONN myBroker_192.168.178.79_63212
#   myBroker_MSGCNT 1343
#   myBroker_TIME 2023-12-02 19:09:49
#   READINGS:
#     2023-12-01 08:49:15   IODev           myBroker
#     2023-12-02 19:09:49   ServiceCode     
#     2023-12-02 19:09:49   ServiceCodeNumber 200
#     2023-12-02 19:09:49   UBAuptime       2382427
#     2023-12-01 09:32:24   alert           0
#     2020-02-06 08:28:54   associatedWith  MQTT2_ems_esp
#     2020-02-24 20:57:39   boilTemp        57.7
#     2023-12-02 19:09:49   burnGas         on
#     2023-12-02 19:09:49   burnStarts      107115
#     2023-12-02 19:09:49   burnWorkMin     310264
#     2023-12-02 19:09:49   curBurnPow      13
#     2023-12-02 19:09:49   curFlowTemp     64.3
#     2023-12-02 19:09:49   fanWork         on
#     2023-12-02 19:09:49   flameCurr       8.4
#     2023-12-02 19:09:49   heatPmp         on
#     2023-12-02 19:09:49   heatWorkMin     232482
#     2023-12-02 18:33:49   heating_active  1
#     2023-12-02 19:09:49   heating_temp    73
#     2023-12-02 19:09:49   ignWork         off
#     2023-11-01 03:13:00   json2nameValueErrorText error parsing (#2) 'offline'
#     2023-11-01 03:13:00   json2nameValueInput offline
#     2023-12-02 19:09:49   outdoorTemp     -3.5
#     2023-12-02 19:09:49   pumpMod         41
#     2023-12-02 19:09:49   pump_mod_max    100
#     2023-12-02 19:09:49   pump_mod_min    10
#     2023-12-02 19:09:49   selBurnPow      100
#     2023-12-02 19:09:49   selFlowTemp     64
#     2023-11-29 12:00:02   state           wWComfort
#     2020-02-19 09:43:02   switchTemp      0
#     2023-12-02 18:33:49   tapwater_active 0
#     2023-12-01 09:32:24   timer           0
#     2023-12-02 19:09:49   wWActivated     on
#     2023-12-02 19:09:49   wWCiPuMode      7
#     2023-12-02 19:09:49   wWCiPuType      255
#     2023-12-02 19:09:49   wWCirc          on
#     2023-12-02 19:09:49   wWCircPump      255
#     2023-12-02 19:09:49   wWComfort       Hot
#     2023-12-02 19:09:49   wWCurFlow       0
#     2023-12-02 19:09:49   wWCurTmp        53.1
#     2023-12-02 19:09:49   wWDesinfecting  off
#     2023-12-02 19:09:49   wWDesinfectionTemp 70
#     2020-02-19 09:43:02   wWDesiredTemp   70
#     2023-12-02 19:09:49   wWHeat          off
#     2023-12-02 19:09:49   wWOnetime       off
#     2023-12-02 19:09:49   wWReady         off
#     2023-12-02 19:09:49   wWRecharge      off
#     2023-12-02 19:09:49   wWSelTemp       56
#     2023-12-02 19:09:49   wWStarts        5000
#     2023-12-02 19:09:49   wWTempOK        on
#     2023-12-02 19:09:49   wWWorkM         77782
#     2023-12-02 19:09:49   wwStorageTemp2  53.1
#
setstate MQTT2_ems_esp_boiler Warmwasser: Hot
setstate MQTT2_ems_esp_boiler 2023-12-01 08:49:15 IODev myBroker
setstate MQTT2_ems_esp_boiler 2023-12-02 19:09:49 ServiceCode
setstate MQTT2_ems_esp_boiler 2023-12-02 19:09:49 ServiceCodeNumber 200
setstate MQTT2_ems_esp_boiler 2023-12-02 19:09:49 UBAuptime 2382427
setstate MQTT2_ems_esp_boiler 2023-12-01 09:32:24 alert 0
setstate MQTT2_ems_esp_boiler 2020-02-06 08:28:54 associatedWith MQTT2_ems_esp
setstate MQTT2_ems_esp_boiler 2020-02-24 20:57:39 boilTemp 57.7
setstate MQTT2_ems_esp_boiler 2023-12-02 19:09:49 burnGas on
setstate MQTT2_ems_esp_boiler 2023-12-02 19:09:49 burnStarts 107115
setstate MQTT2_ems_esp_boiler 2023-12-02 19:09:49 burnWorkMin 310264
setstate MQTT2_ems_esp_boiler 2023-12-02 19:09:49 curBurnPow 13
setstate MQTT2_ems_esp_boiler 2023-12-02 19:09:49 curFlowTemp 64.3
setstate MQTT2_ems_esp_boiler 2023-12-02 19:09:49 fanWork on
setstate MQTT2_ems_esp_boiler 2023-12-02 19:09:49 flameCurr 8.4
setstate MQTT2_ems_esp_boiler 2023-12-02 19:09:49 heatPmp on
setstate MQTT2_ems_esp_boiler 2023-12-02 19:09:49 heatWorkMin 232482
setstate MQTT2_ems_esp_boiler 2023-12-02 18:33:49 heating_active 1
setstate MQTT2_ems_esp_boiler 2023-12-02 19:09:49 heating_temp 73
setstate MQTT2_ems_esp_boiler 2023-12-02 19:09:49 ignWork off
setstate MQTT2_ems_esp_boiler 2023-11-01 03:13:00 json2nameValueErrorText error parsing (#2) 'offline'
setstate MQTT2_ems_esp_boiler 2023-11-01 03:13:00 json2nameValueInput offline
setstate MQTT2_ems_esp_boiler 2023-12-02 19:09:49 outdoorTemp -3.5
setstate MQTT2_ems_esp_boiler 2023-12-02 19:09:49 pumpMod 41
setstate MQTT2_ems_esp_boiler 2023-12-02 19:09:49 pump_mod_max 100
setstate MQTT2_ems_esp_boiler 2023-12-02 19:09:49 pump_mod_min 10
setstate MQTT2_ems_esp_boiler 2023-12-02 19:09:49 selBurnPow 100
setstate MQTT2_ems_esp_boiler 2023-12-02 19:09:49 selFlowTemp 64
setstate MQTT2_ems_esp_boiler 2023-11-29 12:00:02 state wWComfort
setstate MQTT2_ems_esp_boiler 2020-02-19 09:43:02 switchTemp 0
setstate MQTT2_ems_esp_boiler 2023-12-02 18:33:49 tapwater_active 0
setstate MQTT2_ems_esp_boiler 2023-12-01 09:32:24 timer 0
setstate MQTT2_ems_esp_boiler 2023-12-02 19:09:49 wWActivated on
setstate MQTT2_ems_esp_boiler 2023-12-02 19:09:49 wWCiPuMode 7
setstate MQTT2_ems_esp_boiler 2023-12-02 19:09:49 wWCiPuType 255
setstate MQTT2_ems_esp_boiler 2023-12-02 19:09:49 wWCirc on
setstate MQTT2_ems_esp_boiler 2023-12-02 19:09:49 wWCircPump 255
setstate MQTT2_ems_esp_boiler 2023-12-02 19:09:49 wWComfort Hot
setstate MQTT2_ems_esp_boiler 2023-12-02 19:09:49 wWCurFlow 0
setstate MQTT2_ems_esp_boiler 2023-12-02 19:09:49 wWCurTmp 53.1
setstate MQTT2_ems_esp_boiler 2023-12-02 19:09:49 wWDesinfecting off
setstate MQTT2_ems_esp_boiler 2023-12-02 19:09:49 wWDesinfectionTemp 70
setstate MQTT2_ems_esp_boiler 2020-02-19 09:43:02 wWDesiredTemp 70
setstate MQTT2_ems_esp_boiler 2023-12-02 19:09:49 wWHeat off
setstate MQTT2_ems_esp_boiler 2023-12-02 19:09:49 wWOnetime off
setstate MQTT2_ems_esp_boiler 2023-12-02 19:09:49 wWReady off
setstate MQTT2_ems_esp_boiler 2023-12-02 19:09:49 wWRecharge off
setstate MQTT2_ems_esp_boiler 2023-12-02 19:09:49 wWSelTemp 56
setstate MQTT2_ems_esp_boiler 2023-12-02 19:09:49 wWStarts 5000
setstate MQTT2_ems_esp_boiler 2023-12-02 19:09:49 wWTempOK on
setstate MQTT2_ems_esp_boiler 2023-12-02 19:09:49 wWWorkM 77782
setstate MQTT2_ems_esp_boiler 2023-12-02 19:09:49 wwStorageTemp2 53.1

Titel: Aw: ems-esp MQTT
Beitrag von: turo am 24 Februar 2024, 17:11:55
Hallo,

ich habe seit einer Woche ein Buderus GB182i.2 Heizgerät. Wird von ems-esp erkannt als: "Condens 5000i/Greenstar 8000/GC9800IW/GB192i.2".

Die Servicecodes haben für dieses Gerät natürlich eine andere Bedeutung. Es ist wohl auch nur noch die Servicecodenummer wichtig.

Ich habe die Tabelle aus dem Installationshandbuch in eine Routine umformatiert, um den Servicecode in Text zu übersetzen. Vielleicht kann es jemand brauchen.

my %servicecodes = (
 200 => ["Wärmeerzeuger im Heizbetrieb","O"],
 201 => ["Wärmeerzeuger im WW-Betrieb","O"],
 202 => ["Gerät im Schaltoptimierungsprogramm","O"],
 203 => ["Gerät in Betriebsbereitschaft, kein Wärmebedarf vorhanden","O"],
 204 => ["Aktuelle Heizwassertemperatur des Wärmeerzeugers höher als Sollwert","O"],
 208 => ["Wärmeanforderung wegen Abgastest","O"],
 214 => ["Gebläse wird während Sicherheitszeit abgeschaltet","V"],
 224 => ["Sicherheitstemperaturbegrenzer hat ausgelöst","V"],
 227 => ["Kein Flammensignal nach Zündung","V"],
 228 => ["Flammensignal trotz nicht vorhandener Flamme","V"],
 229 => ["Flamme während Brennerbetrieb ausgefallen","B"],
 232 => ["Wärmeerzeuger durch externen Schaltkontakt verriegelt","B"],
 233 => ["Kesselidentifikationsmodul oder Geräteelektronik Störung","V"],
 234 => ["Elektrische Störung Gasarmatur","V"],
 235 => ["Versionskonflikt Geräteelektronik/Kesselidentifikationsmodul","V"],
 237 => ["Systemstörung","V"],
 238 => ["Geräteelektronik ist defekt","V"],
 242 => ["Systemstörung Geräteelektronik / Basiscontroller","V"],
 243 => ["Systemstörung Geräteelektronik / Basiscontroller","V"],
 244 => ["Systemstörung Geräteelektronik / Basiscontroller","V"],
 245 => ["Systemstörung Geräteelektronik / Basiscontroller","V"],
 246 => ["Systemstörung Geräteelektronik / Basiscontroller","V"],
 247 => ["Systemstörung Geräteelektronik / Basiscontroller","V"],
 248 => ["Systemstörung Geräteelektronik / Basiscontroller","V"],
 249 => ["Systemstörung Geräteelektronik / Basiscontroller","V"],
 250 => ["Systemstörung Geräteelektronik / Basiscontroller","V"],
 251 => ["Systemstörung Geräteelektronik / Basiscontroller","V"],
 252 => ["Systemstörung Geräteelektronik / Basiscontroller","V"],
 253 => ["Systemstörung Geräteelektronik / Basiscontroller","V"],
 254 => ["Systemstörung Geräteelektronik / Basiscontroller","V"],
 255 => ["Systemstörung Geräteelektronik / Basiscontroller","V"],
 256 => ["Systemstörung Geräteelektronik / Basiscontroller","V"],
 257 => ["Systemstörung Geräteelektronik / Basiscontroller","V"],
 258 => ["Systemstörung Geräteelektronik / Basiscontroller","V"],
 259 => ["Systemstörung Geräteelektronik / Basiscontroller","V"],
 260 => ["Systemstörung Geräteelektronik / Basiscontroller","V"],
 261 => ["Systemstörung Geräteelektronik / Basiscontroller","V"],
 262 => ["Systemstörung Geräteelektronik / Basiscontroller","V"],
 263 => ["Systemstörung Geräteelektronik / Basiscontroller","V"],
 265 => ["Wärmebedarf geringer als gelieferte Energie","B"],
 268 => ["Relaistest wurde aktiviert","O"],
 269 => ["Flammenüberwachung","V"],
 273 => ["Betriebsunterbrechung - Brenner und Gebläse","B"],
 281 => ["Pumpendruckerhöhung zu niedrig","B"],
 306 => ["Flammensignal nach Schließen der Brennstoffversorgung","V"],
 358 => ["Blockierschutz aktiv","O"],
 360 => ["Systemstörung Geräteelektronik / Basiscontroller","V"],
 362 => ["Kesselidentifikationsmodul oder Geräteelektronik Störung","V"],
 363 => ["Systemstörung Geräteelektronik / Basiscontroller","V"],
 811 => ["Warmwasserbereitung: Thermische Desinfektion misslungen","A"],
 815 => ["Temperaturfühler hydr. Weiche defekt (Pumpeneffizienzmodul)","W"],
 1000 => ["Systemkonfiguration nicht bestätigt","B"],
 1010 => ["Keine Kommunikation über BUS-Verbindung EMS","O"],
 1013 => ["Maximaler Brennzeitpunkt ist erreicht","W"],
 1017 => ["Wasserdruck zu niedrig","W"],
 1018 => ["Wartungsintervall abgelaufen","W"],
 1019 => ["Falscher Pumpentyp erkannt","W"],
 1022 => ["Speichertemperaturfühler defekt oder Kontaktprobleme","W"],
 1023 => ["Maximale Betriebsdauer einschließlich Standby-Zeit ist erreicht","W"],
 1025 => ["Rücklauftemperaturfühler ist defekt","W"],
 1037 => ["Außentemperaturfühler defekt, Ersatzbetrieb Heizung aktiv","W"],
 1038 => ["Zeit/Datum ungültiger Wert","W"],
 1039 => ["Ungemischte Heizkreise nicht für Estrichtrocknung geeignet","W"],
 1040 => ["Estrichtrocknung mit ungemischten Heizkreisen nur mit Gesamtanlage","W"],
 1041 => ["Spannungsausfall während Estrichtrocknung","B"],
 1042 => ["Interner Fehler: Zugriff auf Uhrenbaustein blockiert","B"],
 1065 => ["Wasserdruckfühler defekt oder nicht angeschlossen","W"],
 1068 => ["Außentemperaturfühler oder Lambdasonde defekt.","W"],
 1075 => ["Kurzschluss Wärmeblock-Temperaturfühler","W"],
 1076 => ["Kein Signal vom Wärmeblock-Temperaturfühler","W"],
 2085 => ["Interner Fehler","V"],
 2908 => ["Systemstörung Geräteelektronik / Basiscontroller","V"],
 2910 => ["Fehler im Abgassystem","V"],
 2914 => ["Systemstörung Geräteelektronik","V"],
 2915 => ["Systemstörung Geräteelektronik","V"],
 2916 => ["Systemstörung Geräteelektronik","V"],
 2920 => ["Störung Flammenüberwachung","V"],
 2923 => ["Systemstörung Geräteelektronik","V"],
 2924 => ["Systemstörung Geräteelektronik","V"],
 2925 => ["Systemstörung Geräteelektronik","V"],
 2926 => ["Systemstörung Geräteelektronik","V"],
 2927 => ["Kein Flammenerkennungssignal während Zündung","B"],
 2928 => ["Interner Fehler","V"],
 2931 => ["Systemstörung Geräteelektronik / Basiscontroller","V"],
 2940 => ["Systemstörung Feuerungsautomat","V"],
 2946 => ["Falscher Kodierstecker erkannt","V"],
 2948 => ["Kein Flammensignal bei kleiner Leistung","B"],
 2950 => ["Kein Flammensignal nach dem Startvorgang","B"],
 2951 => ["Zu viele Flammenabrisse","V"],
 2952 => ["Interner Fehler beim Test des Ionisationssignales","V"],
 2955 => ["Eingest. Parameter f. die hydr. Konfig. werden vom Wärmeerz.nicht unterst.","B"],
 2956 => ["Hydraulische Konfiguration am Wärmeerzeuger ist aktviert","O"],
 2957 => ["Systemstörung Geräteelektronik","V"],
 2961 => ["Kein Gebläsesignal vorhanden","V"],
 2962 => ["Kein Gebläsesignal vorhanden","V"],
 2963 => ["Temperatur am Wärmeblock liegt außerh. des zulässigen Bereiches","B"],
 2965 => ["Zu hohe Vorlauftemperatur","B"],
 2966 => ["Zu schneller Temperaturanstieg der Vorlauftemperatur im Wärmeblock","B"],
 2968 => ["Heizungswasser wird nachgefüllt","O"],
 2969 => ["Maximale Anzahl von Nachfüllvorgängen errreicht","O"],
 2970 => ["Zu schneller Druckabfall im Heizsystem","B"],
 2971 => ["Betriebsdruck zu niedrig","B"],
 2972 => ["Netzspannung zu niedrig","B"],
 2980 => ["Das Gerät wurde aus Sicherheitsgründen gesperrt, nachdem mindestens fünf verriegelnde Störungen innerhalb von 15 Minuten aufgetreten sind.","V"],
 2981 => ["Das Gerät wurde bei bestehender Sicherheitssperre (Störungs-Code 2980) aus- und wieder eingeschaltet","V"]
);


###### Boilerstatus ######
sub BoilerStatus($) {
  my $servicecodenumber = shift;
  return defined($servicecodes{$servicecodenumber}) ? $servicecodes{$servicecodenumber}->[0] : "Unbekannt $servicecodenumber";
}
Benutzung im userReadings dann etwa mit:
attr MQTT2_ems_esp:servicecodenumber userReadings BoilerStatus {BoilerStatus(ReadingsVal($NAME,"servicecodenumber","-1"))}Der Hash enthält auch schon mal die "Störungsklasse" (z.B. "O" = normaler Betrieb). Da könnte man natürlich auch was draus machen.

Turo
Titel: Aw: ems-esp MQTT
Beitrag von: schnuddel am 20 April 2024, 14:52:22
Hallo zusammen,

ich habe auch ein kleines Problem mit dem EMS-ESP Gateway, und zwar genau genommen mit dem setlist.

Dieses setlist funktioniert:
setList off ems-esp/thermostat {"cmd" :"wwmode", "data" :"off"}Damit kann ich auf ff schalten, wenn die Warmwasserproduktion gerade in einem anderen Modus ist.

Das kommt dann im Event Monitor:
2024-04-20 14:45:22 statistics Statistiken Updated stats for: MQTT2_ems_esp
2024-04-20 14:45:22 MQTT2_DEVICE MQTT2_ems_esp off
2024-04-20 14:45:22 MQTT2_DEVICE MQTT2_ems_esp statNrgconstotal: Hour: 0 Day: 2 Month: 38 Year: 38 (since: 2024-04-11 )
2024-04-20 14:45:22 MQTT2_DEVICE MQTT2_ems_esp statNrgconstotalHour: 0
2024-04-20 14:45:22 MQTT2_DEVICE MQTT2_ems_esp statNrgconstotalDay: 2
2024-04-20 14:45:22 MQTT2_DEVICE MQTT2_ems_esp statNrgconstotalMonth: 38
2024-04-20 14:45:22 MQTT2_DEVICE MQTT2_ems_esp statNrgconstotalYear: 38
2024-04-20 14:45:22 MQTT2_DEVICE MQTT2_ems_esp statNrgtotal: Hour: 0.00 Day: 8.02 Month: 108.44 Year: 108.44 (since: 2024-04-11 )
2024-04-20 14:45:22 MQTT2_DEVICE MQTT2_ems_esp statNrgtotalHour: 0.00
2024-04-20 14:45:22 MQTT2_DEVICE MQTT2_ems_esp statNrgtotalDay: 8.02
2024-04-20 14:45:22 MQTT2_DEVICE MQTT2_ems_esp statNrgtotalMonth: 108.44
2024-04-20 14:45:22 MQTT2_DEVICE MQTT2_ems_esp statNrgtotalYear: 108.44

Ich hätte gerne eine Auswahlliste, so dass ich direkt jeden passenden Modus schalten kann.

Das hier läuft aber nicht:
wwmode:off,eco,normal,comfort,own prog,auto ems-esp/thermostat {"cmd":"wwmode", "data":$EVTPART1}
Im Event Monitor kommt dann nur das hier an:
2024-04-20 14:39:38 statistics Statistiken Updated stats for: MQTT2_ems_esp
2024-04-20 14:39:38 MQTT2_DEVICE MQTT2_ems_esp wwmode
2024-04-20 14:39:38 MQTT2_DEVICE MQTT2_ems_esp statNrgconstotal: Hour: 0 Day: 2 Month: 38 Year: 38 (since: 2024-04-11 )
2024-04-20 14:39:38 MQTT2_DEVICE MQTT2_ems_esp statNrgconstotalHour: 0
2024-04-20 14:39:38 MQTT2_DEVICE MQTT2_ems_esp statNrgconstotalDay: 2
2024-04-20 14:39:38 MQTT2_DEVICE MQTT2_ems_esp statNrgconstotalMonth: 38
2024-04-20 14:39:38 MQTT2_DEVICE MQTT2_ems_esp statNrgconstotalYear: 38
2024-04-20 14:39:38 MQTT2_DEVICE MQTT2_ems_esp statNrgtotal: Hour: 0.00 Day: 8.02 Month: 108.44 Year: 108.44 (since: 2024-04-11 )
2024-04-20 14:39:38 MQTT2_DEVICE MQTT2_ems_esp statNrgtotalHour: 0.00
2024-04-20 14:39:38 MQTT2_DEVICE MQTT2_ems_esp statNrgtotalDay: 8.02
2024-04-20 14:39:38 MQTT2_DEVICE MQTT2_ems_esp statNrgtotalMonth: 108.44
2024-04-20 14:39:38 MQTT2_DEVICE MQTT2_ems_esp statNrgtotalYear: 108.44

Kann mir jemand einen Tipp geben, was ich falsch mache?
Titel: Aw: ems-esp MQTT
Beitrag von: TomLee am 20 April 2024, 15:00:26
Hallo,

im Traffic-Monitor deines IO hättest das Problem erkannt.

Zitatwwmode:off,eco,normal,comfort,own prog,auto ems-esp/thermostat {"cmd":"wwmode", "data":"$EVTPART1"}

Das Leerzeichen darf hier nicht sein.
Wenn man ganz genau ist, gehören um $EVTPART1 Quotes.
Musst das wirklich so übergeben ?

Gruß

Thomas

edit:
Falls nicht klar ist wie man das löst, hier ein Weg:
wwmode:off,eco,normal,comfort,own_prog,auto {$EVTPART1 =~ s/_/ /g;return qq(ems-esp/thermostat {"cmd":"$EVTPART0", "data":"$EVTPART1"})}   
Titel: Aw: ems-esp MQTT
Beitrag von: schnuddel am 20 April 2024, 16:44:00
Zitat von: TomLee am 20 April 2024, 15:00:26Das Leerzeichen darf hier nicht sein.
Wenn man ganz genau ist, gehören um $EVTPART1 Quotes.
Musst das wirklich so übergeben ?

Die Quotes um $EVTPART1 haben 80% des Problems gelöst. Es funktioniert jetzt für alle Modi, außer "own prog".
Ja, so heißt der Modus meiner Buderus-Wärmepumpe, wenn ich ein eigenes Zeitprogramm festlege.
Ich habe schon alle möglichen Maskierungen (Punkt, Slash, Backslash, ...) und auch Event Maps probiert, bekomme aber die richtige Syntax noch nicht hin.

Mein setlist sieht jetzt so aus:
setList wwmode:off,eco,ownprog,normal,comfort,auto ems-esp/thermostat {"cmd" : "wwmode","data" : "$EVTPART1"}
Event Map:
eventMap own.prog:ownprog
Dann wird das hier im MQTT Traffic Monitor gesendet (@TomLee Danke für den Tipp!):
ems-esp/thermostat {"cmd" : "wwmode","data" : "own.prog"}
Wie maskiere ich hier ein Leerzeichen? Geht das überhaupt?
Titel: Aw: ems-esp MQTT
Beitrag von: TomLee am 20 April 2024, 16:46:23
Hab gerade meinen letzten Beitrag editiert. Wenn du mit Unterstrich leben kannst dann sparst Dir damit das EventMap.
Titel: Aw: ems-esp MQTT
Beitrag von: schnuddel am 21 April 2024, 12:16:34
Funktioniert wunderbar, tausend Dank!