Open yuqianma opened 2 years ago
Not a python & socket stuff expert. Here are two finds FYI:
get_ip()
may get timeout before real data. Adding retries before break
solves the bug.
After python 3.9 there's no encoding='utf-8'
. Just remove it.
But I cannot figure out how to make the device show in my HA yet...
Hi. Please try to run from the command line
cd hass_cozylife_local_pull/custom_components/hass_cozylife_local_pull
python test.py
@cozylife I did similar step and fix the first bug by adding retries as I wrote. So there are 3 bugs above. At least the last two are not related to specific network. Can you tell me how can you use this component to add a switch for example? Since it does not have a unique ID.
May open a PR this weekend. But I wonder if you have used it really.
It can be used on my hass. You can submit a hass log or PR.
Please refer to this video https://user-images.githubusercontent.com/81341241/144952264-c61a89e1-2ac9-4dc4-8f9b-ac69dd26152c.mp4
Please refer to this video https://user-images.githubusercontent.com/81341241/144952264-c61a89e1-2ac9-4dc4-8f9b-ac69dd26152c.mp4
I have my bulb on the network and when I run the test.py, I can see the ip address of the bulb! @cozylife Can you share how did you add the switch on the hass? I can't find the device entity.
Please refer to this video https://user-images.githubusercontent.com/81341241/144952264-c61a89e1-2ac9-4dc4-8f9b-ac69dd26152c.mp4
I have my bulb on the network and when I run the test.py, I can see the ip address of the bulb! @cozylife Can you share how did you add the switch on the hass? I can't find the device entity.
you only need to ensure that hass_cozylife_local_pull is running in hass, then it will automatically discover the device and display it on the screen.
Please refer to this video https://user-images.githubusercontent.com/81341241/144952264-c61a89e1-2ac9-4dc4-8f9b-ac69dd26152c.mp4
I have my bulb on the network and when I run the test.py, I can see the ip address of the bulb! @cozylife Can you share how did you add the switch on the hass? I can't find the device entity.
you only need to ensure that hass_cozylife_local_pull is running in hass, then it will automatically discover the device and display it on the screen.
So I can see the ip address of the bulb when I run the test.py - which means hass_cozylife_local_pull is running. But the device is not auto discovered. Can you share the screenshot when you click the settings icon for your lovelace card? Would love to see how the entity name appears on hass.
Please refer to this video https://user-images.githubusercontent.com/81341241/144952264-c61a89e1-2ac9-4dc4-8f9b-ac69dd26152c.mp4
I have my bulb on the network and when I run the test.py, I can see the ip address of the bulb! @cozylife Can you share how did you add the switch on the hass? I can't find the device entity.
you only need to ensure that hass_cozylife_local_pull is running in hass, then it will automatically discover the device and display it on the screen.
So I can see the ip address of the bulb when I run the test.py - which means hass_cozylife_local_pull is running. But the device is not auto discovered. Can you share the screenshot when you click the settings icon for your lovelace card? Would love to see how the entity name appears on hass. hass_cozylife_local_pull.log Please check my log.
I fixed this problem, please git pull
I fixed this problem, please git pull
Great! BTW what's your HA sys info?
OS:Ubuntu 20.04.3 LTS HASS:Home Assistant 2021.10.7
I still deem it not a usable component. Only a demo.
After I unplug and plug the device again, they cannot be manipulate in HA. The only way is to restart core to let the compoent run again. More, the entity id is not related to MAC address or other stable info. It may cause chaos after wifi restart or device remove.
(Other problem is that UDP broadcast cannot receive response from the device after a day. But unicast to the ip directly runs well. I have to restart my wifi to get them back. Not sure if it's my network's issue.)
I still deem it not a usable component. Only a demo.
After I unplug and plug the device again, they cannot be manipulate in HA. The only way is to restart core to let the compoent run again. More, the entity id is not related to MAC address or other stable info. It may cause chaos after wifi restart or device remove.
(Other problem is that UDP broadcast cannot receive response from the device after a day. But unicast to the ip directly runs well. I have to restart my wifi to get them back. Not sure if it's my network's issue.)
I will upgrade this version, currently only 0.1.0. I will continue to update.
Unfortunately I have no luck in discovering the device yet!
Unfortunately I have no luck in discovering the device yet! configuration.yaml Please retry.
ive response from the device after a day. But unicast to the ip directly runs well. I have to restart my wifi to get th
See below for a third-party custom component of the cozylife light. I believe it fixes many of the issues. https://github.com/yangqian/hass-cozylife
@yangqian Awesome!
I cannot find any device in HA.
Debugging
udp_discover.py
alone on my laptop in the same lan, the result ofget_ip()
is always[]
. I have a ESP32 switch, paired in the CozyLife app through wifi. It works well in the app. Any idea?