Autor Thema: tasmota MQTT EQ3BT devices  (Gelesen 3014 mal)

Offline kroonen

  • Full Member
  • ***
  • Beiträge: 195
    • http://www.kroonen.eu/mobile
tasmota MQTT EQ3BT devices
« am: 14 Oktober 2021, 22:07:50 »
Hoi,

I have an ESP32 flashed with tasmota to connect to EQ3 bluetooth devices. I can connect to the devices, now I want to intgrate it also with fhem

I got this:

define Zolderkamer_thermostaat dummy
setuuid Zolderkamer_thermostaat 6168848e-f33f-7999-a5ef-5ea28c7144db4ef8
attr Zolderkamer_thermostaat group Klimaat
attr Zolderkamer_thermostaat mqttSubscribe state:stopic={"stat/EQ3/EQ3Zolderkamer"}
attr Zolderkamer_thermostaat readingList tele/EQ3/EQ3Zolderkamer/LWT:.* LWT\
    stat/EQ3/EQ3Zolderkamer:.* { json2nameValue($EVENT) }
attr Zolderkamer_thermostaat room Zolder
attr Zolderkamer_thermostaat setList state:14.0,14.5,15.0,15.5,16.0,16.5,17.0,17.5,18.0,18.5,19.0,19.5,20.0,20.5,21.0,21.5,22.0,22.5,23.0
attr Zolderkamer_thermostaat webCmd state

I only get this as state, so not yet ready good, I don't get de json reformatted as single values

{"cmd":"poll","result":"ok","MAC":"001A220B5533","tas":"Rolluikzolder","RSSI":-63,"stattime":1634241933,"temp":17.0,"posn":0,"mode":"manual","hassmode":"idle","boost":"inactive","dst":"set","window":"closed","state":"unlocked","battery":"GOOD"}


Offline Beta-User

  • Developer
  • Hero Member
  • ****
  • Beiträge: 19327
Antw:tasmota MQTT EQ3BT devices
« Antwort #1 am: 14 Oktober 2021, 22:29:08 »
 :o dummy + readingList in MQTT environment = strange brew, especially in combination with an MQTT_GENERIC_BRIDGE that seems to be working in the background ;D .

I'd recommend to go for the "pure MQTT2-way" (at least to sort things out first) and let send the tasmota Client-ESP32 to a MQTT2_SERVER. This will generate a MQTT2_DEVICE-TYPE device with already decoded data (that might not be to easy to interpret as well, but that's next step)...

Other (more complex) option would be to do some "expression" statements in MQTT_GENERIC_BRIDGE attributes.
Server: HP-T620@Debian 11, 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

Offline kroonen

  • Full Member
  • ***
  • Beiträge: 195
    • http://www.kroonen.eu/mobile
Antw:tasmota MQTT EQ3BT devices
« Antwort #2 am: 14 Oktober 2021, 22:56:21 »
I created with MQTT2, and looks better now.

fhem> l Zolderkamer_thermostaat
Internals:
   CID        rolluikzolder
   DEF        rolluikzolder
   DEVICETOPIC Zolderkamer_thermostaat
   FUUID      6168848e-f33f-7999-a5ef-5ea28c7144db4ef8
   IODev      mqtt2
   LASTInputDev mqtt2
   MSGCNT     2
   NAME       Zolderkamer_thermostaat
   NR         87
   STATE      unlocked
   TYPE       MQTT2_DEVICE
   mqtt2_MSGCNT 2
   mqtt2_TIME 2021-10-14 22:45:33
   READINGS:
     2021-10-14 22:37:08   IODev           mqtt2
     2021-10-14 22:45:33   MAC             001A220B5533
     2021-10-14 22:45:33   RSSI            -63
     2021-10-14 22:45:33   battery         GOOD
     2021-10-14 22:45:33   boost           inactive
     2021-10-14 22:45:33   cmd             poll
     2021-10-14 22:45:33   dst             set
     2021-10-14 22:45:33   hassmode        idle
     2021-10-14 22:45:33   mode            manual
     2021-10-14 22:45:33   posn            0
     2021-10-14 22:45:33   result          ok
     2021-10-14 22:45:33   state           unlocked
     2021-10-14 22:45:33   stattime        1634244333
     2021-10-14 22:45:33   tas             Rolluikzolder
     2021-10-14 22:45:33   temp            17.0
     2021-10-14 22:45:33   window          closed
Attributes:
   group      Klimaat
   mqttSubscribe state:stopic={"stat/EQ3/EQ3Zolderkamer"}
   readingList tele/EQ3/EQ3Zolderkamer/LWT:.* LWT
    stat/EQ3/EQ3Zolderkamer:.* { json2nameValue($EVENT) }
   room       Zolder
   webCmd     state

So the values are good. Now the quuestion is How can I set the temp with mqtt in fhem with slider or something?

the mqtt command is

cmnd/eq3devices/EQ3/EQ3Zolderkamer/settemp 20.0


Offline Beta-User

  • Developer
  • Hero Member
  • ****
  • Beiträge: 19327
Antw:tasmota MQTT EQ3BT devices
« Antwort #3 am: 14 Oktober 2021, 23:02:05 »
Try with
attr Zolderkamer_thermostaat setList desired-temp:slider,5.0,0.5,30.0,1 cmnd/eq3devices/EQ3/EQ3Zolderkamer/settemp $EVTPART1
What's the mqttSubscribe attribute for? You may delete that ;) .

There's some more things that may be of interest, but step by step...
Server: HP-T620@Debian 11, 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

Offline kroonen

  • Full Member
  • ***
  • Beiträge: 195
    • http://www.kroonen.eu/mobile
Antw:tasmota MQTT EQ3BT devices
« Antwort #4 am: 14 Oktober 2021, 23:22:07 »
remove the mqtt subscribe

I added the line, tried to change the valu, but nothing happens. Also checked with mqtt explorer

l Zolderkamer_thermostaat
Internals:
   CID        rolluikzolder
   DEF        rolluikzolder
   DEVICETOPIC Zolderkamer_thermostaat
   FUUID      6168848e-f33f-7999-a5ef-5ea28c7144db4ef8
   IODev      mqtt2
   LASTInputDev mqtt2
   MSGCNT     1
   NAME       Zolderkamer_thermostaat
   NR         87
   STATE      Desired:16.5 manual valve:0
   TYPE       MQTT2_DEVICE
   mqtt2_MSGCNT 1
   mqtt2_TIME 2021-10-14 23:18:26
   READINGS:
     2021-10-14 23:16:40   IODev           mqtt2
     2021-10-14 23:18:26   MAC             001A220B5533
     2021-10-14 23:18:26   RSSI            -65
     2021-10-14 23:18:26   battery         GOOD
     2021-10-14 23:18:26   boost           inactive
     2021-10-14 23:18:26   cmd             poll
     2021-10-14 23:18:26   dst             set
     2021-10-14 23:18:26   hassmode        idle
     2021-10-14 23:18:26   mode            manual
     2021-10-14 23:18:26   posn            0
     2021-10-14 23:18:26   result          ok
     2021-10-14 23:18:26   state           unlocked
     2021-10-14 23:18:26   stattime        1634246306
     2021-10-14 23:18:26   tas             Rolluikzolder
     2021-10-14 23:18:26   temp            16.5
     2021-10-14 23:18:26   window          closed
Attributes:
   group      Klimaat
   readingList tele/EQ3/EQ3Zolderkamer/LWT:.* LWT
    stat/EQ3/EQ3Zolderkamer:.* { json2nameValue($EVENT) }
   room       Zolder
   setList    desired-temp:slider,5.0,0.5,30.0,1 cmnd/eq3devices/EQ3/EQ3Zolderkamer/settemp $EVTPART1
   stateFormat Desired:temp mode valve:posn



Checkin in home assisant and than in console from tasmota:

22:31:16.780 EQ3 mqtt: cmnd/eq3devices/EQ3/EQ3Zolderkamer/settemp:15.5

Bunt not from fhem
« Letzte Änderung: 14 Oktober 2021, 23:35:15 von kroonen »

Offline Beta-User

  • Developer
  • Hero Member
  • ****
  • Beiträge: 19327
Antw:tasmota MQTT EQ3BT devices
« Antwort #5 am: 14 Oktober 2021, 23:33:58 »
Hmm, that's been "stolen" to some extent from attrTemplate "zigbee2mqtt_eurotronic_spirit", and imo there's nothing to see at first instance why this should not work (perhaps apart from sending "20" instead of "20.0").


Sure about the topic part "eq3devices/"?
In most cases, tasmota only is different in cmnd and tele (or stat), so this seems to be somehow unfamiliar, too.

additionally: using raw list (list -r <device>) is easier for me to copy things to a test environment if needed.
« Letzte Änderung: 14 Oktober 2021, 23:35:35 von Beta-User »
Server: HP-T620@Debian 11, 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

Offline Beta-User

  • Developer
  • Hero Member
  • ****
  • Beiträge: 19327
Antw:tasmota MQTT EQ3BT devices
« Antwort #6 am: 15 Oktober 2021, 07:48:10 »
Found https://tasmota.github.io/docs/EQ3-TRV/.

Assuming, this is what you are using (and still up to date), the MAC address has to make part of the topic.

Additional remarks:
- Didn't find any info on that, but if possible, I'd strongly recommend to get data from each TRV on a seperate topic (similar to SetOption89 for ZigBee)
- There's quite a lot parallels to the zigbee variant. So if you are able to read german, I'd recommend to have a look at https://forum.fhem.de/index.php/topic,116094.0.html (and some of the things mentionned there).
Server: HP-T620@Debian 11, 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

Offline kroonen

  • Full Member
  • ***
  • Beiträge: 195
    • http://www.kroonen.eu/mobile
Antw:tasmota MQTT EQ3BT devices
« Antwort #7 am: 15 Oktober 2021, 09:18:18 »
Yes,

But you can map it to names

BLEAlias 001A220B5533=EQ3Zolderkamer

I test it with command line from fhem server, and this works.

mosquitto_pub  -h 192.168.180.5 -t cmnd/eq3devices/EQ3/EQ3Zolderkamer/settemp -m 20


I don't think it's even send to the mqtt broker. I got verbose level on 5 en moving the slider nothing is in the log


Offline Beta-User

  • Developer
  • Hero Member
  • ****
  • Beiträge: 19327
Antw:tasmota MQTT EQ3BT devices
« Antwort #8 am: 15 Oktober 2021, 09:32:21 »
Did you press "set" as well?

Or add it to webCmd, then moving the slider should immediately lead to a publish command:
attr Zolderkamer_thermostaat webCmd desired-tempAdditionally, I'd recommend to set jsonMap. As a start:
attr Zolderkamer_thermostaat jsonMap temp:desired-temp posn:valve(or actuator instead of valve)
Server: HP-T620@Debian 11, 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

Offline kroonen

  • Full Member
  • ***
  • Beiträge: 195
    • http://www.kroonen.eu/mobile
Antw:tasmota MQTT EQ3BT devices
« Antwort #9 am: 15 Oktober 2021, 09:34:54 »
It is already wokring, if you move the slider, you also have to click op set  ::)

I go later today finetune it and I post the config

Offline Beta-User

  • Developer
  • Hero Member
  • ****
  • Beiträge: 19327
Antw:tasmota MQTT EQ3BT devices
« Antwort #10 am: 15 Oktober 2021, 09:44:15 »
OK, looking forward to that!

If possible, I'd like to add it to our set of attrTemplate as well, might be interesting for quite a few people in the future. (as a base, the output of "list -r Zolderkamer_thermostaat" would be easier to handle).

Do you have an explanation for the difference ("/eq3devices") in the structure of readingList and setList topics? This is very uncommon for Tasmota devices and might be a problem if this can be set by user.

For later use in periodicCmd:
$yyMMddhhmmsshex = sub{sprintf '%02X%02X%02X%02X%02X%02X', $_[5]-100, $_[4]+1, $_[3], $_[2], $_[1], $_[0]}->(localtime);
« Letzte Änderung: 15 Oktober 2021, 10:39:28 von Beta-User »
Server: HP-T620@Debian 11, 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

Offline kroonen

  • Full Member
  • ***
  • Beiträge: 195
    • http://www.kroonen.eu/mobile
Antw:tasmota MQTT EQ3BT devices
« Antwort #11 am: 15 Oktober 2021, 11:11:57 »
/eq3devices is an grouptopic in tasmota . The benefit is I have 4 EQ3 devices and also 3 flashed sonoff dual r3 that also I use for my shutters.  The dual r3 has also bluetooth so I can use for the radiator valves.

The benefit is that the command went to 3 devices and the one gets the bluetooth connection to the radiator gives back the value

the commands /topics in home assistant are

- platform: mqtt
    name: "Radiator Zolder"
    modes: ['off',heat,auto,idle]
    min_temp: 4.5
    max_temp: 23.0
    temp_step: 0.5
    mode_command_topic: cmnd/eq3devices/EQ3/EQ3Zolderkamer/mode
    temperature_command_topic: cmnd/eq3devices/EQ3/EQ3Zolderkamer/settemp
    temperature_state_topic: stat/EQ3/EQ3Zolderkamer
    temperature_state_template: '{{ value_json.temp }}'
    mode_state_topic: stat/EQ3/EQ3Zolderkamer
    mode_state_template: '{{ value_json.hassmode }}'
    hold_command_topic: cmnd/eq3devices/EQ3/EQ3Zolderkamer
    hold_state_template: '{{ value_json.mode }}'
    hold_state_topic: stat/EQ3/EQ3Zolderkamer
    hold_modes: ["auto","manual"]
    precision: 0.5

Trying to make it in fhem similair
« Letzte Änderung: 15 Oktober 2021, 11:14:24 von kroonen »

Offline Beta-User

  • Developer
  • Hero Member
  • ****
  • Beiträge: 19327
Antw:tasmota MQTT EQ3BT devices
« Antwort #12 am: 15 Oktober 2021, 11:28:00 »
OK, so this sounds like a special setup, but using this functionality of the r3-ESP32's really sounds smart :) .

Some questions:
- will really only one of the three deliver the message or each of them?
- would each of the radiators also accept commands set to the "right" ESP32? (=short cmnd topic as proposed)
- is the "stat" topic also kind of group topic? Otherwise there should be responses from the radiator going to other topics as well?
- The homeassistant info might be some kind of interpretation. For me the respective MQTT traffic would be more helpfull (as shown e.g. by mosquitto_sub), including all the tree r3-ESP32.
Server: HP-T620@Debian 11, 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

Offline kroonen

  • Full Member
  • ***
  • Beiträge: 195
    • http://www.kroonen.eu/mobile
Antw:tasmota MQTT EQ3BT devices
« Antwort #13 am: 18 Oktober 2021, 20:49:17 »
Hi,

I only let one react, so not so well working.

Yes group topic works also with the stat topic.

I will make some more commands

I also have a question

I try to display icons instead of the value. I have this already for devstateicon

100:sani_heating_level_10 0:sani_heating_level_100 9\d.*:sani_heating_level_10 8\d.*:sani_heating_level_20 7\d.*:sani_heating_level_30 6\d.*:sani_heating_level_40 5\d.*:sani_heating_level_50 4\d.*:sani_heating_level_60 3\d.*:sani_heating_level_70 2\d.*:sani_heating_level_80 1\d.*:sani_heating_level_90 \b\d\b.*:sani_heating_level_90

How can I use it in the stateformat to use with the valve value?




Offline Beta-User

  • Developer
  • Hero Member
  • ****
  • Beiträge: 19327
Antw:tasmota MQTT EQ3BT devices
« Antwort #14 am: 18 Oktober 2021, 21:08:04 »
So I'll await your testing.

wrt. to stateFormat, make sure,
- each desired icon get's it's own line in STATE and
- each item get's an unique identifier (so not temp values may be interpreted as valve)bla\
vlv:[$name:valve]
\blub

and change devStateIcon accordingly:
vlv.100:sani_heating_level_10
Please let me kno, if this is too short intro to this topic...
Server: HP-T620@Debian 11, 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