thomasf / yeelight

yeelight wifi light bulb api and mqtt bridge
MIT License
11 stars 2 forks source link

can you please write some simple document about hot to start using your mqtt-bridge ? #1

Open user216 opened 2 years ago

user216 commented 2 years ago

I run MQTT via :

go run cmd/yeelight-mqtt/yeelight-mqtt.go -if wlp3s0 -mqtt mqtt://guest:guest@127.0.0.1 -metricsAddr :8080 -client_id yeelight-mqtt

but it allocate port that yeelight.go want to use

Also, I try to run:

go run cmd/yeelight/yeelight.go   -logtomemory ls

but get this output only:

E1210 19:08:22.647513 2417197 discover.go:46] read udp 0.0.0.0:1982: raw-read udp4 0.0.0.0:1982: use of closed network connection

So how I can use this two components in proper way ?

thomasf commented 2 years ago

running go run cmd/yeelight/yeelight.go ls shoyuld just print a list of connected bulbs and their associated connect addresses:

$ go run . ls
E1211 15:59:50.472556   14253 discover.go:46] read udp 0.0.0.0:1982: raw-read udp4 0.0.0.0:1982: use of closed network connection
0x0000000002dfe94b [tv-ceil] 192.168.4.12:55443
...

I don't remember the exact details but you might try running with sudo because broadcast networking requires elevated privileges to work, it is probably not the case for this program but it wont hurt to try.

You need to have the hub and/or bulbs (don't remember) set into a specific mode to allow them to be controlled locally, by default they will only allow being controlled by the cloud services. The setting is somewhere in the phone app under a bunch of menus, I just set this up many years ago and I don't have the app anymore or remember how to do it.

thomasf commented 2 years ago

Oh the cmd/yeelight/yeelight.go seems to have the interface name hard coded and it's only a draft.

the yeelight-mqtt's -if flag should work though.