[SOLVED] State changes but no action when using MQTT

Begonnen von frank.j@me.com, 26 Januar 2022, 20:10:39

Vorheriges Thema - Nächstes Thema

frank.j@me.com

Hallo,

I have FHEM running and setup with MQTT_CLIENT and MQTT_GENERIC_BRIDGE

I have an EnOcean light in FHEM, added attributes MQTTDefaults, MQTTPublish and MQTTSubscribe:

define FSR14_1_2 EnOcean FF95270E
setuuid FSR14_1_2 5e2d7ee7-f33f-8300-12f3-8b29df4a7cf33adc
attr FSR14_1_2 userattr lightSceneParamsToSave lightSceneRestoreOnlyIfChanged:1,0
attr FSR14_1_2 IODev TCM310_0
attr FSR14_1_2 alias Vogels
attr FSR14_1_2 devStateIcon on:light_light_dim_100@orange dim:light_light_dim_50@green off:light_light@blue
attr FSR14_1_2 eep A5-38-08
attr FSR14_1_2 fp_bg 490,383,0,FSR14_1_2,
attr FSR14_1_2 group 2 Eetkamer
attr FSR14_1_2 gwCmd switching
attr FSR14_1_2 manufID 00D
attr FSR14_1_2 mqttDefaults base={"/enocean/FSR14_1_2"}
attr FSR14_1_2 mqttPublish state:topic={"enocean/FSR14_1_2/state"}
attr FSR14_1_2 mqttSubscribe state:topic={"enocean/FSR14_1_2/set"}
attr FSR14_1_2 room BGG,Homekit
attr FSR14_1_2 subDef FFB87A06
attr FSR14_1_2 subType gateway


I have Home Assistant running, and installed the mosquito MQTT server. Via this I can publish packets and listen for packets. Both work fine, if I switch the light on or off the Home Assistant receives the state. And vice versa, when I publish a packet with subject enocean/FSR14_1_2/set with value on or off it is received in FHEM, and the state in FHEM for the light also indicates correctly on or off, but there is no action, so the physical light does not follow the state.

What am I doing wrong?

Beta-User

First: Welcome to the FHEM forum!

Most likely, there's just a simple "s" missing in mqttSubscribe.
https://fhem.de/commandref_modular.html#MQTT_GENERIC_BRIDGE
ZitatTopics can be defined for setting readings ('topic' or 'readings-topic') and calls to the 'set' command on the device ('stopic' or 'set-topic').
Also attributes can be set ('atopic' or 'attr-topic').
Zitatattr FSR14_1_2 mqttSubscribe state:stopic={"enocean/FSR14_1_2/set"}
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

frank.j@me.com

That was the solution, many thanks! I didn't pick this up from the documentation.

Im using FHEM for 6 years now, love it!

Beta-User

Thanks a lot for your feedback!

Would you mind setting this thread to [solved]? (just edit the title in the first message in this thread).
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