Supereg / homebridge-http-switch

Powerful http switch for Homebridge: https://github.com/homebridge/homebridge
ISC License
219 stars 36 forks source link

Mqtt config #33

Closed Luftloch80 closed 5 years ago

Luftloch80 commented 5 years ago

Hi is this config right for mqtt or how does it have to Look. Got. noch reaction when topic Is sent.

mosquitto_pub -h localhost -t 'siedle/cmnd' -m ring_E_D

{ "accessory": "HTTP-SWITCH", "name": "Türgong", "switchType": "toggle", "timeout": 1000, "debug": true, "onUrl": "http://192.168.0.50:5005/clipall/fury.mp3/5", "offUrl": "http://192.168.0.50:5005/clipall/fury.mp3/5", "mqtt":{ "host": "192.168.0.50", "subscriptions": [ { "topic": "siedle/cmnd", "messagePattern": "ring_E_D", "characteristic": "On" } ]

    }}

Says ring_E_D has wrong characteristic Why Not working with stateless Switch Need it for my doorbell

Supereg commented 5 years ago

I tested your provided configuration (as it is right now) and everything works expected. Could you ensure that the configuration is as mentioned above and the plugin is actually connected to the MQTT broker. Also are you running the latest version of the plugin (please proved the version number).

Says ring_E_D has wrong characteristic

Could you copy the exact log message?

Also it could be helpful if you turn on the debug mode of the plugin and paste the additional log output.

Luftloch80 commented 5 years ago

Thx for quick reply [Türgong] MQTT updating characteristic On to true

er=admin&password=Emma1512 -t 1 -s 480x270 -f image2 - [4/1/2019, 6:25:58 PM] [Türgong] setStatus() doing http request... [4/1/2019, 6:26:01 PM] [Camera-ffmpeg] Snapshot from Eingangsbereich at 480x270 ffmpeg -i http://192.168.0.35/cgi-bin/api.cgi?cmd=Snap&channel=0&rs=wuuPhkmUCeI9WG7C&user=admin&password=Emma1512 -t 1 -s 480x270 -f image2 - [4/1/2019, 6:26:01 PM] [Türgong] Successfully set switch to ON [4/1/2019, 6:26:11 PM] [Türgong] setStatus() doing http request... [4/1/2019, 6:26:12 PM] [Camera-ffmpeg] Snapshot from Eingangsbereich at 480x270 ffmpeg -i http://192.168.0.35/cgi-bin/api.cgi?cmd=Snap&channel=0&rs=wuuPhkmUCeI9WG7C&user=admin&password=Emma1512 -t 1 -s 480x270 -f image2 - [4/1/2019, 6:26:14 PM] [Türgong] Successfully set switch to OFF [4/1/2019, 6:26:21 PM] [Türgong] MQTT updating characteristic On to true When publishing topic it sets the switch to true Also in Home App it Switches on, but it does Not Play the sound. When Pressing the Switch manually it PlayS Sound immediately Is it possible to make mqtt with stateless switch?

Luftloch80 commented 5 years ago

I read that it only Sets the State of the Switch. Is it possible to implement that it also sent http command for on State ?

Supereg commented 5 years ago

As you found out yourself the MQTT functionality is not intended to do that. And of the plugin standpoint this feature doesn't really make sense to implement.

Did you search for any external modules/software packages which try to bridge mqtt with http? A other solution could be if you create a second switch which gets notified via mqtt and then create an automation inside HomeKit that turns the actual switch on when the second switch gets turned on.