"command unknown" on publish rule?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
treii28
Normal user
Posts: 14
Joined: 03 May 2024, 18:31

"command unknown" on publish rule?

#1 Post by treii28 » 03 May 2024, 18:37

I'm new to ESP Easy and have a 1M install (for now) on an ESP-01s relay module that I'm using to turn a small pump on and off.

For some reason, now that I'm adding more MQTT publish info into the rule set, the publish line for when the pump is turned on an offi is returning Command Unknown on the status

Code: Select all

On System#Boot Do
  GPIO,0,1
  Publish,"%sysname%/status/flash/freq","%flash_freq%MHz"
  Publish,"%sysname%/status/flash/freq","%flash_size%Bytes"
  Publish,"%sysname%/status/CPU/freq","%cpu_freq%MHz"
  Publish,"%sysname%/status/FS/size","%fs_size%Bytes"
  Publish,"%sysname%/status/FS/free","%fs_free%Bytes"
  TimerSet,2,15
Endon

// report time on system waking
On System#Wake Do
  GPIO,0,1
  // NTP time is likely not yet set on first start
  if %unixtime%>0
    Publish,"%sysname%/status/Sleep","%lcltime%:Awake"
  endif
  TimerSet,2,15
Endon

On Time#Initialized Do
  Publish,"%sysname%/Time/Init","%lcltime%"
  Publish,"%sysname%/Time/Sunrise","%sunrise%AM"
  Publish,"%sysname%/Time/Sunset","%sunset%PM"
Endon

On Rules#Timer=1 Do
  GPIO,0,1
  [i]Publish,"%sysname%/Relay/Pump","%lcltime%:Off"[/i]
  Publish,"%sysname%/Power/VCC","%vcc%VDC"
  TimerSet,2,270
Endon

On Rules#Timer=2 Do
  // only turn on the pump during daylight hours
  if (%syssec_d%>%s_sunrise%) and (%syssec_d%<%s_sunset%)
    GPIO,0,0
    [i]Publish,"%sysname%/Relay/Pump","%lcltime%:On"[/i]
    TimerSet,1,30
  else
    TimerSet,2,1800
  endif
Endon

On System#Sleep Do
  Publish,"%sysname%/status/Sleep","%lcltime%:Sleeping"
  GPIO,0,1
Endon
It appears to be throwing the error on both the on and off publish commands:

Code: Select all

Command unknown: Relay,0,2024-05-03 12:24:58:Pump On
Command unknown: Relay,0,2024-05-03 12:20:28:Pump Off
Command unknown: Relay,0,2024-05-03 12:19:58:Pump On

TD-er
Core team member
Posts: 8789
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: "command unknown" on publish rule?

#2 Post by TD-er » 03 May 2024, 18:52

Which exact build are you using (filename as reported in the sysinfo page)
Publish is part of MQTT and if you don't have any MQTT controller included in your build, then the publish command isn't present in the build.

ESP01 is extremely limited due to its 1M flash.

User avatar
Ath
Normal user
Posts: 3569
Joined: 10 Jun 2018, 12:06
Location: NL

Re: "command unknown" on publish rule?

#3 Post by Ath » 03 May 2024, 19:08

Your MQTT broker is returning a 'Relay....' command to your unit, when you publish to the Relay topic.
This implies your configuration issue is in the MQTT broker, not on the ESPEasy side. ESPEasy doesn't have a 'relay' command, AFAIK.
/Ton (PayPal.me)

treii28
Normal user
Posts: 14
Joined: 03 May 2024, 18:31

Re: "command unknown" on publish rule?

#4 Post by treii28 » 16 May 2024, 18:05

Not sure what the issue was, but i retyped the lines, i swear exactly the same after making changes elsewhere, and it was working again.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest