letscontrolit / ESPEasy

Easy MultiSensor device based on ESP8266/ESP32
http://www.espeasy.com
Other
3.25k stars 2.2k forks source link

[C014 & P086] Can't set Generic Homie Receiver parameter #4459

Open fedemox opened 1 year ago

fedemox commented 1 year ago

Checklist

I have...

Steps already tried...

If you self compile, please state this and PLEASE try to ONLY REPORT ISSUES WITH OFFICIAL BUILDS!

Summarize of the problem/feature request

I'd like to control a brushless fan driven by a ESC, providing PWM signal at 50Hz on pin 13. Successfully tested command PWM,13,value,0,50 with integer values from 11 to 30 (3D printed fan is super scary at high speed!!). Successfully tested with controller C005 - Home Assistant (openHAB) MQTT & P033 - Generic - Dummy Device. Successfully tested CMD and GPIO set of controller C014 (Homie). Failed test with C014 - Controller - Homie MQTT convention & P086 - Generic - Homie receiver.

Expected behavior

Controller algorithm should not discard properly formatted MQTT command.

Actual behavior

MQTT messages on topic homie/ESPeasySerever/fan/speed/set are always flagged as INVALID MSG and ignored.

Steps to reproduce

  1. Use MQTT Explorer or OpenHAB to post on topic homie/ESPeasySerever/fan/speed/set the value 11
  2. Observe the logged record C014 : MQTT received: /set: N: fan V: speed INVALID MSG
  3. Gnash your teeth.

System configuration

Hardware: NodeMCU Amica V2 ESP8266 ESP-12F (amazon.it)

ESP Easy version: released binaries with names

ESP Easy settings/screenshots:

Rules or log data

Rules:

On fan#speed do
LogEntry,"%eventvalue1|ND%, %eventvalue2|ND%"
PWM,13,%eventvalue1%,0,50
homieValueSet,1,1,%eventvalue1%
endon

Log record:

341382: WIFI : DHCP IP: 192.168.1.147 (ESPeasyServer) GW: 192.168.1.1 SN: 255.255.255.0 duration: 25 ms
341392: WIFI : Connected! AP: mox-casa (00:14:BF:E1:C2:34) Ch: 6 Duration: 1056 ms
341396: EVENT: WiFi#Connected
341453: MQTT : Intentional reconnect
341472: MQTT : Connected to broker with client ID: ESPeasyServer
341478: Subscribed to: homie/ESPeasyServer/#
341536: C014 : autodiscover information of 3 Devices and 2 Nodes sent with no errors! (25 messages)
341541: EVENT: WiFi#ChangedAccesspoint
341553: EVENT: WiFi#ChangedWiFichannel
341561: EVENT: MQTT#Connected
346572: WD : Uptime 6 ConnectFailures 0 FreeMem 18216 WiFiStatus 3 ESPeasy internal wifi status: Conn. IP Init
361843: C014 : MQTT received: /set: N: fan V: speed INVALID MSG
362843: C014 : MQTT received: /set: N: fan V: speed INVALID MSG
363343: C014 : MQTT received: /set: N: fan V: speed INVALID MSG
364093: C014 : MQTT received: /set: N: fan V: speed INVALID MSG
364843: C014 : MQTT received: /set: N: fan V: speed INVALID MSG
366343: C014 : MQTT received: /set: N: fan V: speed INVALID MSG
367343: C014 : MQTT received: /set: N: fan V: speed INVALID MSG
375017: P086 : Value 4: 0.00
375027: EVENT: fan#speed=0
375035: ACT : PWM,13,0,0,50
375041: PWM : GPIO: 13 duty: 0 f: 50 Hz
375045: ACT : homieValueSet,1,1,0
375050: P086 : deviceNr:1 valueNr:1 valueType:0 integer/float set to 0.00
375055: C014 : homie acknowledge: fan taskIndex:1 valueNr:1 valueName:speed valueType:0 topic:homie/ESPeasyServer/fan/speed valueInt:0
375060: EVENT: fan#=0.00
375069: EVENT: fan#=0.00
375076: EVENT: fan#=0.00
376572: WD : Uptime 6 ConnectFailures 0 FreeMem 17712 WiFiStatus 3 ESPeasy internal wifi status: Conn. IP Init

sysinfo.pdf

devices mqtt explorer

tonhuisman commented 1 year ago

Can you upgrade to the 20221224 release, as just before that release a bug in the area of finding a task by name was fixed, that may be the cause of this issue.

TD-er commented 1 year ago

ESP_Easy_mega_20221224_collection_A_ESP8266_4M1M is listed in the description as tested.

fedemox commented 1 year ago

Failed also with C014 - Controller - Homie MQTT convention & P033 - Generic - Dummy Device. Same behaviour:

374010: C014 : MQTT received: /set: N: dummyfan V: dummyspeed INVALID MSG
tonhuisman commented 12 months ago

@fedemox Have you been able to configure your Homie receiver task so it will receive your values?

fedemox commented 11 months ago

No. Same behaviour on firmware ESP_Easy_mega_20230822_collection_A_ESP8266_4M1M.bin

tonhuisman commented 11 months ago

@fedemox I've done some work on MQTT controllers and the Homie receiver (with the intent to add Homie receiver support to all MQTT controllers), can you test the last successful GH Actions run for that PR?

fedemox commented 11 months ago

Half success! Now the controller acknowledges the received command, but its value isn't passed to the device. Every minute the rule (see above) is triggered, but parameters are 0/empty.

212628 : Info   : WD   : Uptime 4 ConnectFailures 0 FreeMem 20120 WiFiStatus 3 ESPeasy internal wifi status: Conn. IP Init
217639 : Info   : C014 : MQTT received: /set: N: fan V: speed cmd:  OK
241072 : Info   : EVENT: Clock#Time=Mon,18:18
241278 : Info   : P086 : Value 1:
241279 : Info   : P086 : Value 2:
241280 : Info   : P086 : Value 3:
241281 : Info   : P086 : Value 4:
241286 : Info   : EVENT: fan#speed
241290 : Info   : ACT  : LogEntry,"ND, ND"
241292 : Info   : ND, ND
241294 : Info   : ACT  : PWM,13,0,0,50
241296 : Info   : PWM  : GPIO: 13 duty: 0 f: 50 Hz
241299 : Info   : ACT  : homieValueSet,1,1,0
241302 : Info   : P086 : deviceNr: 1 valueNr: 1 valueType: 0 integer/float set to 0.00
241305 : Info   : C014 : homie acknowledge: fan taskIndex:1 valueNr:1 valueName:speed valueType:0 topic:homie/Collection_A/fan/speed valueInt:0 valueStr:0 success!
241313 : Info   : EVENT: fan#
241316 : Info   : EVENT: fan#
241318 : Info   : EVENT: fan#
242628 : Info   : WD   : Uptime 4 ConnectFailures 0 FreeMem 20120 WiFiStatus 3 ESPeasy internal wifi status: Conn. IP Init