Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New install - one Tasmota device: iFan - JSON error #14

Open
roger-richards opened this issue May 15, 2024 · 0 comments
Open

New install - one Tasmota device: iFan - JSON error #14

roger-richards opened this issue May 15, 2024 · 0 comments

Comments

@roger-richards
Copy link

roger-richards commented May 15, 2024

Describe the bug
New install and setup one device iFan with plugin HB-UI.

To Reproduce
my plugin JSON:

{
    "name": "Ceiling Fan",
    "type": "fan",
    "url": "mqtt://localhost:1884",
    "topic": "tasmota_%06X",
    "fullTopic": "cmnd/tasmota_B7CCEB/",
    "debug": true,
    "_bridge": {
        "username": "0E:3A:D6:BB:A5:49",
        "port": 51250
    },
    "accessory": "mqtt-tasmota"
}

homebridge log error:

[16/05/2024, 10:04:02] [Ceiling Fan] Loaded homebridge-mqtt-tasmota v0.12.0 child bridge successfully
[16/05/2024, 10:04:02] [Ceiling Fan] New mqtt-tasmota accessory mqtt-tasmota
[16/05/2024, 10:04:02] [Ceiling Fan] Connecting to MQTT broker on mqtt://192.168.8.211:1884
[16/05/2024, 10:04:02] [Ceiling Fan] Built topic = "cmnd/tasmota_fan/LWT"
[16/05/2024, 10:04:02] [Ceiling Fan] LWT Status subscribe cmnd/tasmota_fan/LWT
[16/05/2024, 10:04:02] [Ceiling Fan] Built topic = "cmnd/tasmota_fan/RESULT"
[16/05/2024, 10:04:02] [Ceiling Fan] Built topic = "cmnd/tasmota_fan/FANSPEED"
[16/05/2024, 10:04:02] [Ceiling Fan] Built topic = "cmnd/tasmota_fan/STATE"
[16/05/2024, 10:04:02] [Ceiling Fan] Built topic = "cmnd/tasmota_fan/STATE"
[16/05/2024, 10:04:03] [Ceiling Fan] MQTT client connected
[16/05/2024, 10:04:03] Homebridge v1.8.1 (HAP v0.12.0) (Ceiling Fan) is running on port 51250.
[16/05/2024, 10:04:03] [Ceiling Fan] Message received cmnd/tasmota_fan/STATE, 

/var/lib/homebridge/node_modules/homebridge-mqtt-tasmota/src/fan.js:46
        message = JSON.parse(message.toString('utf-8'))
                       ^
SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at MqttTasmotaFanAccessory.onMqttMessage (/var/lib/homebridge/node_modules/homebridge-mqtt-tasmota/src/fan.js:46:24)
    at MqttClient.emit (node:events:518:28)
    at handlePublish (/var/lib/homebridge/node_modules/homebridge-mqtt-tasmota/node_modules/mqtt/src/lib/handlers/publish.ts:172:11)
    at handle (/var/lib/homebridge/node_modules/homebridge-mqtt-tasmota/node_modules/mqtt/src/lib/handlers/index.ts:29:17)
    at work (/var/lib/homebridge/node_modules/homebridge-mqtt-tasmota/node_modules/mqtt/src/lib/client.ts:726:17)
    at processTicksAndRejections (node:internal/process/task_queues:77:11)
[15/05/2024,] [Ceiling Fan] Child bridge process ended
[15/05/2024,] [Ceiling Fan] Process Ended. Code: 1, Signal: null

Expected behavior
no JSON error on a simple and clean setup.

Desktop (please complete the following information):

  • OS: Mac + MQTT Explorer

hombridge host (please complete the following information):

  • Device: Raspberry Pi
  • OS: Linux homebridge2 6.6.28+rpt-rpi-v8 POWER1 POWER2 #1 SMP PREEMPT Debian 1:6.6.28-1+rpt1 (2024-04-22) aarch64
    Homebridge v1.8.1
    Node.js Version v20.12.2

Additional context
Mosquitto broker is setup on Raspberry pi and I can control the tasmota iFan via terminal: mosquitto_pub -p 1884 -m "toggle"
I used JSONLint to check the entire homebridge config and it is clean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant