Closed mikepruett3 closed 4 years ago
Hey there @danielhiversen, @felipediel, mind taking a look at this issue as its been labeled with a integration (broadlink
) you are listed as a codeowner for? Thanks!
(message by CodeOwnersMention)
Hi @mikepruett3. Thanks for reporting this error. I'll fix it, but since I don't have the device, I'll need help to test the solution.
1.1. Follow this tutorial.
1.1. Disable Protected Mode
.
1.2. Set up a user name and password in the config file.
ssh USERNAME@HOST
docker exec -it homeassistant /bin/bash
cd /usr/src/homeassistant/homeassistant/components/broadlink
wget -O __init__.py https://raw.githubusercontent.com/felipediel/home-assistant/fix-learning/homeassistant/components/broadlink/__init__.py
wget -O remote.py https://raw.githubusercontent.com/felipediel/home-assistant/fix-learning/homeassistant/components/broadlink/remote.py
Please let me know if it worked so I can create a pull request.
@felipediel I had the same issue and just tried your potential fix, same behavior.
I removed the "type" from my configuration.yaml and it fixed the issue.
switch:
switches: ac: friendly_name: "Chris Office AC" command_on: 'JgCSAAABIpIXNRUSFjYWNRY2FjUWEhYRFjYWEhU2FhIWERYSFhEWEhYRFhIWERYSFhEWNhY1FhIWERYSFjYVNhY2FhEWNhYRFhIWNRYSFgACjhYRFhIWEhUSFhIVEhYSFRIWEhUSFjYVEhYSFhEWNhUSFhIWERYSFhEWEhYRFhIWERYSFhEWEhYSFRIWERY2FjYVAA0FAAAAAAAA' command_off: 'JgCSAAABIZMVNxUSFTcVExQ3FRMUNxUSFRMVNhU3FRMVExQTFRIVExUSFRMVExQTFRMUExUTFBMVEhUTFTYVNxU2FRMVNxUSFRMVNxQTFQACjxUSFRMVExQTFRIVExUSFRMVEhUTFRMUExUSFRMVNhUTFRIVExUTFBQUExQUFBMUFBQTFBQUExUTFDcVEhU3FRIVAA0FAAAAAAAA' string: friendly_name: "LED String Lights" command_on: 'JgBwAAABJZISExIUEhQSFBIUEhQSFBIUEjcTNhM2FDYSNxM2EzYTNxI3ExMSNxMTExMTExM2FBITExU1EhQSNxI3FTQTExM3FQAFCQABKUkTAAxHAAEoSRQADEgAASdJFAAMRwABJ0oSAAxJAAEnSRQADQUAAAAAAAAAAA==' command_off: 'JgBwAAABI5MUExMTEhQTExMTEhQTExMTEzYUNRQ2EzYTNhM3EzYTNhQ1FDQVNhQSFBIUEhM3ExMTExMTEhQSNxM2FDYTExI3EwAFDQABKEkUAAxHAAEpSRMADEkAASdJFAAMSAABJ0oTAAxIAAEnShQADQUAAAAAAAAAAA=='
@chrisfonte Your problem was in the config file, it is different.
So I already had SSH access to the ubuntu server running my hassio_supervisor and homeassistant containers. I did docker exec into the homeassistant container, and pull the init.py file down and restart. Still having the same issue.
@mikepruett3 Please run this file using python3 debug.py
and send me debug.txt.
If the LED blinks during debugging, try to capture a code.
Here is the debug.txt file. I did look at the closest device when I ran the debug, and no LED activity at all.
Your firewall is blocking discovery. You can run debug.py using your computer if you want, just make sure you are on the same network.
So this worked before updating to 0.110.0 this morning. I have not made any other network changes, or any changes on my firewall (Ubiquity EdgeRouterX). Having said that, I did do a few tests using the broadlink python3 library (my python sucks, but I did find some discovery steps on the python-broadlink github page.
From my workstation on the same network
python3
Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:37:02) [MSC v.1924 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import broadlink
>>> devices = broadlink.discover(timeout=30)
>>> print(devices)
[<broadlink.rm object at 0x0000021898400820>, <broadlink.rm object at 0x00000218984007C0>]
yet when I try from the homeassistant container...
docker exec -it homeassistant /bin/bash
bash-5.0# python3
Python 3.7.7 (default, Apr 28 2020, 13:57:57)
[GCC 9.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import broadlink
>>> devices = broadlink.discover(timeout=30)
>>> print(devices)
[]
Could this have something to do with hassio ingress or apparmor?
On a whim, I tried the same test from the bash console of the ubuntu server hosting the homeassistant container, and discovery works there as well...
$ python3
Python 3.6.9 (default, Apr 18 2020, 01:56:04)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import broadlink
>>> devices = broadlink.discover(timeout=30)
>>> print(devices)
[<broadlink.rm object at 0x7f52dc838438>, <broadlink.rm object at 0x7f52dc8385f8>]
>>>
You need to run debug.py on your workstation.
Ok, so I ran the debug.py from the ubuntu server running the homeassistant container (not from inside the container), and this is the debug.txt file that was created...
Note, when I run the debug.py from inside the homeassitant container, I get this debug.txt output
Here is the debug.txt from my workstation...
Ok, the debug is working. Now try to learn a code when the LED blinks and send me debug.txt. Don't do it inside the container.
Here is the debug.txt, I ran it from the ubuntu server console.
Strange, there are no error codes in the response. Tomorrow I will create a custom debug script to understand what is going on. I'll keep you informed.
Hi Guys, landing here after searching.. same problem here with 0.110 on hassOS via Hyper-V and a RM4 mini. Launching services broadlink.learn and remote.learn_command report same error:
If i send a command previously learned from itself all works, i see the white led blink.
Available for testing or debug....
I have a same problem
I have a same problem too - 0.110.0 and a RM3 mini
I have a same problem too. ( Home Assistant Core release with the issue: 0.110.0 and a RM4 mini) ERROR (MainThread) [homeassistant.components.broadlink] Failed to learn: The device storage is full
Same error here And no notifications when learning. Hassio 0.110.0.
Thank you @felipediel Unfortunately i cant learn any command because the RM4 dont receive any ir code. After call the services the error appearing immediately and with any iteraction with the broadlink. The white led doesnt appear.. it works only if i manually send an ir but i dont have finished the capture work... 😄 I will put my self in queue for the fixing! 🤞 See you
@felipediel Does that mean the codes are sent, and the error is kinda irrelevant?
I deleted my previous comment because I was wrong and I don't want to create confusion. I just implemented a possible solution based on a deeper analysis of the debug files. Could anyone help me test it?
@sebastian-steinmann I was wrong. The error needs to be handled.
I'm able to test, and it's no longer throwing the error in the logs.
But this is also my first time setting up this integration, and I'm unsure how to view the learned code. Where do I see the learned code?
@JayNewstrom Are you using broadlink.learn
or remote.learn_command
?
I'm using remote.learn_command
. But I can setup something else if that's the way to go.
I see now, I just didn't finish reading the documentation, my bad.
I see the learned commands in the json file/root/config/.storage
Everything seems to be working as expected on my end.
Great! I will create a PR.
@felipediel Will the solution also work for Hassio?
I was testing in Hassio and broadlink rm mini 4
I just tested this, but still getting the error.
Even tried rebooting the entire host-system. What kinda info do you need to debug?
@sebastian-steinmann Are you sure? Storage error?
Please run this file using python3 debug.py
and send me debug.txt.
Getting no device discovered, not sure how to get the text-file out, but that seems like the gist of it. So might be something on my end.
But yeah, getting the full error: Failed to learn 'power/tv': The device storage is full
I just updated the files to wait a second before reading the data. Could you try again?
Still the same error, but I got the debug.py script working by adding my localip and discoverip in the script.
Its all seemed to work fine then. Do you want the debug.txt after my changes?
Also, best way to get the file out of the container?
You can run debug.py on your computer.
I just saw I was getting the error on the wrong type of component, set type: rm4_mini, and now it works!
it was on switch:218, and thats sp1
I'l kill you hahahaha :smile: Great! Ready to merge.
Testing the solution
1. Set up SSH add-on
1.1. Follow this tutorial. 1.1. Disable
Protected Mode
. 1.2. Set up a user name and password in the config file.2. Open a terminal and connect to your device via SSH
ssh USERNAME@HOST
3. Change user to homeassistant.
docker exec -it homeassistant /bin/bash
4. Let's update some files
cd /usr/src/homeassistant/homeassistant/components/broadlink
wget -O __init__.py https://raw.githubusercontent.com/felipediel/home-assistant/fix-learning/homeassistant/components/broadlink/__init__.py
wget -O remote.py https://raw.githubusercontent.com/felipediel/home-assistant/fix-learning/homeassistant/components/broadlink/remote.py
7. Restart Home Assistant
Please let me know if it worked so I can create a pull request.
Just tried these new files, and its working for me now! No storage error, and I was able to learn and use the code.
Thanks!
@mikepruett3 Thanks for the feedback!
@felipediel having the same issue.
Merged in your change and now I get Platform error switch.broadlink - cannot import name 'DOMAIN' from 'homeassistant.components.broadlink' (/usr/src/homeassistant/homeassistant/components/broadlink/__init__.py) Platform error switch.broadlink - cannot import name 'DOMAIN' from 'homeassistant.components.broadlink' (/usr/src/homeassistant/homeassistant/components/broadlink/__init__.py)
@Critical2104 You did something wrong. Replace all files in the folder and it will work fine. If it doesn't work, the problem is being caused by a custom component.
@Critical2104 You did something wrong. Replace all files in the folder and it will work fine. If it doesn't work, the problem is being caused by a custom component.
Flashed a new HA instance, only other custom component is SmartIR, merged in again your changes and now I always get
Failed to send packet: The device storage is full
I have two rm mini 3
, one bought almost one year ago and it is working fine, and another one bought last week that is causing me this issue. Apparently the two devices are identical.
Testing the solution
1. Set up SSH add-on
1.1. Follow this tutorial. 1.1. Disable
Protected Mode
. 1.2. Set up a user name and password in the config file.2. Open a terminal and connect to your device via SSH
ssh USERNAME@HOST
3. Change user to homeassistant.
docker exec -it homeassistant /bin/bash
4. Let's update some files
cd /usr/src/homeassistant/homeassistant/components/broadlink
wget -O __init__.py https://raw.githubusercontent.com/felipediel/home-assistant/fix-learning/homeassistant/components/broadlink/__init__.py
wget -O remote.py https://raw.githubusercontent.com/felipediel/home-assistant/fix-learning/homeassistant/components/broadlink/remote.py
7. Restart Home Assistant
Please let me know if it worked so I can create a pull request.
works on my broadlink RM mini 3 (new firmware): remote:
Thanks!!!
I also had this problem and I just upgraded to the 0.110.2 and it seems to have fixed the problem, buuuttt... :-)
I just installled a new remote, and noticed the following. All of the other remotes I have create 2 files in the .storage folder.
broadlinkremote
This time only the _codes file was created, but not the _flags file. I don't know if this means anything, but I just thought you should know @felipediel .
The problem
I was able to use the remote.learn_command service yesterday, before upgrading to 0.110.0 this morning. Now when I try to learn a code, I get an error about The device storage is full. I have plenty of disk space available for my HASS install... and I have tried this on multiple Broadlink RM Mini 3's and have the same issue.
Environment
Problem-relevant
configuration.yaml
Traceback/Error logs
Additional information