eschava / broadlink-mqtt

MQTT client to control BroadLink devices
MIT License
224 stars 61 forks source link

Macros #18

Closed gajpchapo closed 7 years ago

gajpchapo commented 7 years ago

Hi Eugene,

Further to the issue raised last week I have tried the change you suggested to no avail;

I am trying to create a macro for a two digit channel number, channel 10.

Item File; Switch Broadlink_Samsung_10 {mqtt=">[broker:broadlink/channel_10:macro:*:replay]"}

Sitemap Switch item=Broadlink_Samsung_10 label="ITV3"

File in Macros directory; commands/tv/samsung/1 pause 250 commands/tv/samsung/0

I have tried with auto instead of replay but neither work

Thanks

eschava commented 7 years ago

Do not use "commands/" prefix in the macros file for command definition

gajpchapo commented 7 years ago

ok, thanks I will try

gajpchapo commented 7 years ago

Hi Eugene,

Made the change in Macros file to;

tv/samsung/1 pause 250 tv/samsung/0

Also tried;

/tv/samsung/1 pause 250 /tv/samsung/0

I've tried with both "auto" and "replay" and I never get an MQTT message at all.

Thanks

eschava commented 7 years ago

could you please put here the output of the broadlink-mqtt process?

gajpchapo commented 7 years ago

There is no output at all. MQTT receives no command

eschava commented 7 years ago

Broadlink MQTT show print to the log either "Replaying macro from file ..." or "Unrecognized MQTT message" So if you see no message - please check MQTT connectivity

gajpchapo commented 7 years ago

Hi Eugene,

Having reviewed your code I have seen the error of my ways. Item needs to be;

Switch Broadlink_Samsung_10 {mqtt=">[broker:broadlink/channel_10:command:*:macro]"}, not

Switch Broadlink_Samsung_10 {mqtt=">[broker:broadlink/channel_10:macro::replay]"} or Switch Broadlink_Samsung_10 {mqtt=">[broker:broadlink/channel_10:macro::auto]"} as I had it

All working wonderfully now, thanks again!

eschava commented 7 years ago

I'm glad that you've found reason of the issue Good luck!