fbacker / broadlink-mqtt-bridge

Bridge Broadlink RM Devices with MQTT and API for e.g. OpenHAB
41 stars 14 forks source link

MQTT-Bridge missing #7

Closed KickingAss2024 closed 5 years ago

KickingAss2024 commented 5 years ago

https://github.com/fbacker/broadlink-mqtt-bridge

I have don every thing I think I may of missed something can some one help

yes I have MQTT Binding (v1.x) have use mqtt fx to

broadlink/epson_projector/menu
play

and it worked.

mqtt.cfg

#
# Define your MQTT broker connections here for use in the MQTT Binding or MQTT
# Persistence bundles. Replace <broker> with an ID you choose.
#

# URL to the MQTT broker, e.g. tcp://localhost:1883 or ssl://localhost:8883
broker.url=tcp://192.168.0.4:1883

# Optional. Client id (max 23 chars) to use when connecting to the broker.
# If not provided a random default is generated.
#<broker>.clientId=<clientId>

# Optional. True or false. If set to true, allows the use of clientId values
# up to 65535 characters long. Defaults to false.
# NOTE: clientId values longer than 23 characters may not be supported by all
# MQTT servers. Check the server documentation.
#<broker>.allowLongerClientIds=false

# Optional. User id to authenticate with the broker.
#<broker>.user=<user>

# Optional. Password to authenticate with the broker.
#<broker>.pwd=<password>

# Optional. Set the quality of service level for sending messages to this broker.
# Possible values are 0 (Deliver at most once),1 (Deliver at least once) or 2
# (Deliver exactly once). Defaults to 0.
#<broker>.qos=<qos>

# Optional. True or false. Defines if the broker should retain the messages sent to
# it. Defaults to false.
#<broker>.retain=<retain>

# Optional. True or false. Defines if messages are published asynchronously or
# synchronously. Defaults to true.
#<broker>.async=<async>

# Optional. Defines the last will and testament that is sent when this client goes offline
# Format: topic:message:qos:retained <br/>
#<broker>.lwt=<last will definition>

Items

//Test
Switch Menu                      "Menu"                                                 {mqtt=">[broker:broadlink/epson_projector/menu:command:ON:play],>[broker:broadlink/epson_projector/menu:command:OFF:play}

site map

Frame label="Garage"
       {
           Switch item=DEMOSW
           Switch item=Menu

Configure

in ./config there's a couple of options in default.json. Do not change this. This is the default settings that can be overwritten. Make your own file ./config/local.json and only add and change values that you want.

NOTE: Changing the default.json will break updates.

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

Nothing in the openhab log?

In mqtt.conf you are using broker.url=tcp://192.168.0.4:1883

and broadlink conf "mqtt": { "host": "127.0.0.1",

Are they using same mqtt broker?

try to create a local.json in broadlink/config and add

{
  "mqtt": {
    "host": "192.168.0.4"
  }
}
fbacker commented 5 years ago

@adtwomey did is solve the issue?

iw62 commented 5 years ago

Fredrick hi, I installed the bridge and the webgui do not recognize the device. Should i enter the Broadlink device info somewhere (IP, MAC)? Can you please help. Using Openhab on RSP3+ and Broadlink RM3 mini (BTW, when i am using Broadling manager app , it recognize the device. Thank you

fbacker commented 5 years ago

When this program starts. It automatically scans the network for different kind of broadlink devices. So the RM3 and RSP3 needs to be on the same network.

However... The scan is only performed at program startup. So if the device wan't available at the time it couldn't find it. Pressing the 'list devices' should show that. Under the weather, but when back on my feet I might be able to add a 're-scan for devices'.

To try before I have the time to change anything.

  1. both devices on same network
  2. make sure broadlink is alive and well
  3. stop and start the 'bridge' program

if you have the web gui open you might see a log event if the device was found.

fbacker commented 5 years ago

@iw62 please try latest commit. I've added a rescan button to the GUI. If triggered it will rescan for broadlink devices.

fbacker commented 5 years ago

New fix today to help the rescan. No feedback so closing this.