ems-esp MQTT

Begonnen von moustic999, 01 November 2019, 23:23:52

Vorheriges Thema - Nächstes Thema

Beta-User

 ;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).
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

moustic999

all mqtt commands are described on the wiki :

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...

Beta-User

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?
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

moustic999

#33
yeah seems a good idea, do you have a link where I can fin ebus template source ?

found it ;-)


Beta-User

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
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

moustic999

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


Beta-User

 :)
order and model are more for internal use. order is used for sorting in "set <anymqtt2-device> attrTemplatte ?", model is for statistics 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.
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

Beta-User

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).
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

grappa24

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)
FHEM 6.1, 2 x RasPi 3B+, Debian Buster; KNX, FS20, HM, HUE, Tradfri, Shellies, KLF200
Rollo-/Lichtsteuerung/-szenarien, T-Sensoren, Fensterkontakte, Heizungssteuerung, HEOS, Sprachsteuerung mit Alexa-FHEM, Netatmo, Nuki, ...

Beta-User

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.*
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

grappa24

#40
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 ....
FHEM 6.1, 2 x RasPi 3B+, Debian Buster; KNX, FS20, HM, HUE, Tradfri, Shellies, KLF200
Rollo-/Lichtsteuerung/-szenarien, T-Sensoren, Fensterkontakte, Heizungssteuerung, HEOS, Sprachsteuerung mit Alexa-FHEM, Netatmo, Nuki, ...

Beta-User

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.
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

grappa24

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
FHEM 6.1, 2 x RasPi 3B+, Debian Buster; KNX, FS20, HM, HUE, Tradfri, Shellies, KLF200
Rollo-/Lichtsteuerung/-szenarien, T-Sensoren, Fensterkontakte, Heizungssteuerung, HEOS, Sprachsteuerung mit Alexa-FHEM, Netatmo, Nuki, ...

Beta-User

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...
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

grappa24

#44
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?
FHEM 6.1, 2 x RasPi 3B+, Debian Buster; KNX, FS20, HM, HUE, Tradfri, Shellies, KLF200
Rollo-/Lichtsteuerung/-szenarien, T-Sensoren, Fensterkontakte, Heizungssteuerung, HEOS, Sprachsteuerung mit Alexa-FHEM, Netatmo, Nuki, ...