MQTT to Home assistant

Begonnen von RobinC, 03 November 2026, 20:58:10

Vorheriges Thema - Nächstes Thema

RobinC

Sorry, sometimes I don't know what I don't know.
To take a step back my goal is to use Switchbot temperature sensors being read by home assistant via MQTT to Fhem. These temperatures are to be used via FakeWT to give an external temperature to MAX! valves.

I may be going the wrong way but I have created an MQTT2_DEVICE
define LR_Temp MQTT2_DEVICE
attr LR_Temp readingList homeassistant/LivingroomTemp:.* temp
#   CFGFN     
#   FUUID      6b008ce2-f33f-dadd-2dc0-d6403a30e1a35076
#   IODev      mqtt
#   LASTInputDev mqtt
#   MSGCNT     65
#   NAME       LR_Temp
#   NR         159
#   STATE      ???
#   TYPE       MQTT2_DEVICE
#   eventCount 49
#   mqtt_MSGCNT 65
#   mqtt_TIME  2026-11-20 19:14:56
#   READINGS:
#     2026-11-20 18:09:38   IODev           mqtt
#     2026-11-20 18:13:42   LRtemp          23.8
#     2026-11-20 19:14:56   temp            22.7
#
setstate LR_Temp 2026-11-20 18:09:38 IODev mqtt
setstate LR_Temp 2026-11-20 18:13:42 LRtemp 23.8
setstate LR_Temp 2026-11-20 19:14:56 temp 22.7


This is reading the correct value from home assistant, I now have a reading temp. I'm now trying to move it to the MAX! via fakeWT. Will what I have done work? Should I stop this and follow your previous instructions using the Generic bridge?

Thanks for your help.

Beta-User

#16
OK, seems you want to do something different as described here: https://wiki.fhem.de/wiki/MAX#Externer_Temperatursensor_f%C3%BCr_Heizk%C3%B6rperregelung

Using MQTT2_DEVICE is one option, my personal preference would be to use "mqttSubscribe" directly in the MAX entity and use the "funcion" option to directly call the (modified*) code in myUtils (without notify).
*means: not sure about Log3 calls, and return the fake temp as result, so you can see which fake temperature was received when. Own functions in myUtils need to be called in main-namespace, so use e.g. "::MaxFakeWallThermostat_mgb($device,$message)"

Hope that helps?
Server: HP-elitedesk@Debian 13, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: ZigBee2mqtt, MiLight@ESP-GW, BT@OpenMQTTGw | ZWave | SIGNALduino | MapleCUN | RHASSPY
svn: u.a Weekday-&RandomTimer, Twilight,  div. attrTemplate-files, MySensors

RobinC

Thanks for your help. I now have it working via MQTT2_DEVICE. I will look at mqttsubscribe it sounds a more elegant solution.

Beta-User

 ;)

Please do not forget to delete the autocreate attribute. Once you understand the mechanism, it is highly recommend to set up other MQTT2_DEVICEs manually.
Server: HP-elitedesk@Debian 13, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: ZigBee2mqtt, MiLight@ESP-GW, BT@OpenMQTTGw | ZWave | SIGNALduino | MapleCUN | RHASSPY
svn: u.a Weekday-&RandomTimer, Twilight,  div. attrTemplate-files, MySensors