[SOLVED] Broadlink Mqtt binding config

@Noam_Shaharabani are you useing openhab 2.4 and and the any “Bridge” in things file

That’s ok @H102 you got any other ider’s as I checked and checked can’t find. unless I missed something or you know if some one els to look at it?

Maybe try removing your local.json file and use only the default as they seem to be identical.:thinking:

@H102 good ider but didn’t work

Only other idea I can think of is to clean the cache and reboot.

I have not clean the cache before

to reboot I just do

 sudo reboot

You will need to stop OH service first. Here are the commands to use:

sudo systemctl stop openhab2.service

sudo opanhab-cli clean-cache

Give it a few seconds then

sudo reboot

@H102

[03:06:42] openhabian@openHABianPi:~$ sudo systemctl stop openhab2.service
[03:07:07] openhabian@openHABianPi:~$ sudo opanhab-cli clean-cache
sudo: opanhab-cli: command not found
[03:07:32] openhabian@openHABianPi:~$

Try sudo openhab2-cli clean-cache

EDIT: sudo openhab-cli should work, just checked.

[03:08:58] openhabian@openHABianPi:~$ sudo systemctl stop openhab2.service      [03:10:07] openhabian@openHABianPi:~$ sudo openhab2-cli clean-cache
sudo: openhab2-cli: command not found
[03:10:12] openhabian@openHABianPi:~$

With OH stopped you can so it the long way with these commands:

sudo rm -rf /var/lib/openhab2/cache/* && sudo rm -rf /var/lib/openhab2/tmp/* && sudo reboot

You can copy and paste all on the same line.

Sorry about that, I usually do it the long way but I’m guessing that sudo systemctl stop openhab2.service is what prevented sudo openhab-cli from being found.

In the future try using this instead:

sudo openhab-cli stop
sudo openhab-cli clean-cache
sudo openhab-cli start

try this, open 2 terminals, in one

cd broadlink-mqtt-bridge
node index.js

on the other send this

mosquitto_pub -d  -t "broadlink" -m "/tv/peerless/turnon"

just to see if the broadlink bridge see thie message

Looking back over the thread, I noticed the default json file address is 127.0.0.1 and the mqtt.cfg address is 192.168.0.4

Change the mqtt.cfg address to 127.0.0.1 and see if that works.

openhab just crashed.

While cleaning the cache and tmp folders you didn’t delete the actual folders did you? If using the above line it should have only deleted the contents of the folders. Check that they still exist.

What’s showing in the logs?

i dont think this is the problem, in my mqtt.cfg the ip address is 192.168.1.101, and in the broadlink bridge i did not change it from 127.0.0.1 and its working

did you try sendind message from terminal to terminal ?

I don’t think that matters anymore. If the folders are not there OH will recreate them on the next restart.

@vzorglub good info to know, thanks.

If rebooting in the past without stopping OH first, what issues could this cause?

@H102 @vzorglub @Noam_Shaharabani

Is the host should change

{
  "mqtt": {
    "host": "127.0.0.1",
    "port": 1883,
    "protocol": "mqtt",
    "subscribeBasePath": "broadlink"
  },
  "recording": {
    "timeout": {
      "ir": 30,
      "rf": 30
    },
    "path": null
  },
  "gui": {
    "port": 3000
  }
}