eschava / broadlink-mqtt

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

How to send out signal /w decode error #48

Closed kennytpe168 closed 5 years ago

kennytpe168 commented 5 years ago

Hi I am new for the OpenHab, trying to setup my own system, I received the following message with decode error, any instruction will be appreciated....

**[error message] DEBUG Received MQTT message broadlink/tv/samsung/power replay [2019-10-20 21:02:49,972] DEBUG Replaying command from file C:\openHAB2\userdata\etc\scripts\broadlink-mqtt/commands/tv/samsung/power [2019-10-20 21:02:49,975] ERROR Error Traceback (most recent call last): File "mqtt.py", line 198, in on_message replay(device, file) File "mqtt.py", line 303, in replay device.send_data(ir_packet.strip().decode('hex')) LookupError: 'hex' is not a text encoding; use codecs.decode() to handle arbitrary codecs [2019-10-20 21:03:42,801] DEBUG Received MQTT message broadlink/tv/samsung/power 0

[.thing file] Bridge mqtt:broker:mybroadlinkBroker [ host="localhost", secure=false ] { Thing topic BL "BL_P" { Channels: Type string : TEP [ stateTopic="broadlink/temperature"] Type switch : PowerSwitchBL [ commandTopic="broadlink/tv/samsung/power", on="replay"] }
}

[.item file] String Switch_TEP "TEP [%s]" {channel="mqtt:broker:mybroadlinkBroker:BL:TEP"} Switch PowerSwitchBL "SwitchBL" {channel="mqtt:broker:mybroadlinkBroker:BL:PowerSwitchBL"}

eschava commented 5 years ago

Sorry, looks like Python 3 was not supported correctly Fixed, please check now

kennytpe168 commented 5 years ago

Hi , it works now message from debug mode " [2019-10-21 22:05:40,857] DEBUG Received MQTT message broadlink/tv/samsung/power replay [2019-10-21 22:05:40,861] DEBUG Replaying command from file C:\openHAB2\userdata\etc\scripts\broadlink-mqtt/commands/tv/samsung/power [2019-10-21 22:05:43,881] DEBUG Sending RM temperature 0.0 to topic broadlink/temperature "

kennytpe168 commented 5 years ago

for the recordef, it record the same value[010000000000000000000000] for different button or remote controller

[debug message] [2019-10-21 22:13:49,093] DEBUG Received MQTT message broadlink/tv/samsung/power1 recordrf [2019-10-21 22:13:49,104] DEBUG Recording RF command to file C:\openHAB2\userdata\etc\scripts\broadlink-mqtt/commands/tv/samsung/power1 [2019-10-21 22:13:49,107] DEBUG Learning RF Frequency, press and hold the button to learn... [2019-10-21 22:14:01,131] DEBUG Found RF Frequency - 1 of 2! [2019-10-21 22:14:06,132] DEBUG To complete learning, single press the button you want to learn [2019-10-21 22:14:11,144] DEBUG Done

eschava commented 5 years ago

Can you confirm that recording IR signal (not RF) works OK? If the issue is with RF only then this is related to the parent https://github.com/mjg59/python-broadlink library. Could you please try to record RF signal using broadlink_cli utility from that project?

kennytpe168 commented 5 years ago

ooops ....I input wrong command for IR/RF......after correct the command , both function works great!!...Thank you