home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.61k stars 30.77k forks source link

The device storage is full when trying to learn new codes on broadlink.remote component #35875

Closed mikepruett3 closed 4 years ago

mikepruett3 commented 4 years ago

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.

service: remote.learn_command
entity_id: remote.living_room
device: television
command: test

Environment

Problem-relevant configuration.yaml

platform: broadlink
name: "Living Room"
host: 10.10.10.xx
mac: 'XX:XX:XX:XX:XX:XX'
type: rm_mini

Traceback/Error logs

Log Details (ERROR)
Logger: homeassistant.components.broadlink.remote
Source: components/broadlink/remote.py:305
Integration: broadlink (documentation, issues)
First occurred: 2:04:46 PM (1 occurrences)
Last logged: 2:04:46 PM

Failed to learn 'test/television': The device storage is full

Additional information

anamika784 commented 4 years ago

Everything works fine. Thank you.

felipediel commented 4 years ago

@anamika784 @marco76mk Thanks for the feedback.

@orson1282 That's ok, the file will be created when you capture a toggle command. But thanks for the feedback anyway.

@Critical2104 Could you try without SmartIR?

marco76mk commented 4 years ago

I updated to version 0.110.2 With this change it works "broadlink.learn" "remote.learn_command" doesn't work

here is the error: 2020-05-24 19:58:04 ERROR (MainThread) [homeassistant.components.broadlink.remote] Failed to learn 'Turn off/television': The device storage is full

felipediel commented 4 years ago

@marco76mk This error seems quite impossible to happen with this update. Or maybe there is something I don't know. Could you please check if you have this file in /usr/src/homeassistant/homeassistant/components/broadlink/remote.py?

ericksonian commented 4 years ago

I'm having this same "Storage is Full" running 0.110 in Docker on Ubuntu. I'm not sure where the homeassistant/components folder is so I can test this fix you have. Is there a way to make this happen? Of will the fix be in the next full release? I'm working with a RM Mini 3, the red one, and I have been able to get HA to see the device and connect, but have had no luck sending or learning any codes using the remote or switch components.For reference, I have a RM Pro in another room and I have successfully use broadlink.send everyday for months. I got the remote.learn to work for that one as well, but have not implemented it yet.

felipediel commented 4 years ago

@ericksonian It's merged. You just need to update Home Assistant.

ericksonian commented 4 years ago

Okay thank you! I'm on 0.110.1 in docker, and it says its updated. So I'll try again later today or tomorrow and see how it goes

felipediel commented 4 years ago

@ericksonian You need 0.110.2.

marco76mk commented 4 years ago

@marco76mk This error seems quite impossible to happen with this update. Or maybe there is something I don't know. Could you please check if you have this file in /usr/src/homeassistant/homeassistant/components/broadlink/remote.py?

I confirm that the file on HASSIO is exactly that.

felipediel commented 4 years ago

@marco76mk Do you have anything in the custom_components/broadlink folder?

marco76mk commented 4 years ago

@marco76mk Do you have anything in the custom_components/broadlink folder?

no, I don't have any "custom_components/" folders in my config folder

felipediel commented 4 years ago

Strange. Look. This error shouldn't be raised. Perhaps it is being generated here, but until then I thought it was impossible.

I need to debug you. Please run this file using python3 debug.py. If the LED blinks, try to learn a code. Then send me debug.txt.

marco76mk commented 4 years ago

@marco76mk Do you have anything in the custom_components/broadlink folder?

no, I don't have any "custom_components/" folders in my config folder

bash-5.0# cd /usr/src/homeassistant/homeassistant/components/broadlink bash-5.0# ls -lah total 88K
drwxr-xr-x 1 root root 4.0K May 24 16:05 . drwxr-xr-x 1 root root 28.0K May 24 16:05 .. -rw-r--r-- 1 root root 3.9K May 24 15:01 init.py drwxr-xr-x 2 root root 4.0K May 24 16:05 pycache -rw-r--r-- 1 root root 711 May 24 15:01 const.py -rw-r--r-- 1 root root 1.8K May 24 15:01 device.py -rw-r--r-- 1 root root 219 May 24 15:01 manifest.json -rw-r--r-- 1 root root 10.5K May 24 15:01 remote.py -rw-r--r-- 1 root root 5.1K May 24 15:01 sensor.py -rw-r--r-- 1 root root 465 May 24 15:01 services.yaml -rw-r--r-- 1 root root 10.5K May 24 15:01 switch.py

this is what I find in the component folder

felipediel commented 4 years ago

Try this: rm -r __pycache__

marco76mk commented 4 years ago

Sorry for my bad English. If I use the command "broadlink.learn" it works !!! and returns the button code. If I use the "remote.learn_command" command it doesn't work and returns the error "The device storage is full" I tried clearing the folder cache. It does not solve.

reboot not solve

I tried to run the debug but it returns me this. I don't know if I did the right thing.

bash-5.0# cd /usr/src/homeassistant/homeassistant/components/broadlink bash-5.0# ls -lah total 112K
drwxr-xr-x 1 root root 4.0K May 24 22:03 . drwxr-xr-x 1 root root 4.0K May 24 16:05 .. -rw-r--r-- 1 root root 3.9K May 24 15:01 init.py -rw-r--r-- 1 root root 711 May 24 15:01 const.py -rw-r--r-- 1 root root 38.1K May 24 22:00 debug.py -rw-r--r-- 1 root root 381 May 24 22:00 debug.txt -rw-r--r-- 1 root root 1.8K May 24 15:01 device.py -rw-r--r-- 1 root root 219 May 24 15:01 manifest.json -rw-r--r-- 1 root root 10.5K May 24 15:01 remote.py -rw-r--r-- 1 root root 5.1K May 24 15:01 sensor.py -rw-r--r-- 1 root root 465 May 24 15:01 services.yaml -rw-r--r-- 1 root root 10.5K May 24 15:01 switch.py bash-5.0# python3 debug.py bash-5.0# cat debug.txt 22:09:51,731 root INFO Broadlink API Debug 22:09:51,733 main DEBUG Starting discovery...

22:09:51,749 main DEBUG [Request] bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\xe4\x07\t\x16\x14\x07\x18\x05\x00\x00\x00\x00\xac\x1e \x01\xc7\x93\x00\x00\x00\x00\x00\x00\x00\x00\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00')

22:09:56,755 main DEBUG No device discovered.

marco76mk commented 4 years ago

debug.txt This is the txt file when starting debugging from my PC. the led flashes and has captured the code

felipediel commented 4 years ago

The debug is ok, no errors.

head -328 remote.py | tail -1

What is the output?

marco76mk commented 4 years ago

ha > login docker exec -it homeassistant /bin/bash bash-5.0# cd /usr/src/homeassistant/homeassistant/components/broadlink bash-5.0# head -328 remote.py | tail -1 except (ReadError, StorageError): bash-5.0#

anamika784 commented 4 years ago

The "remote.learn_command" doesn't work for me either. I deleted the pycache file. Here is the error: 2020-05-24 22:45:30 ERROR (MainThread) [homeassistant.components.broadlink.remote] Failed to learn 'Turn on/television': The device storage is full

felipediel commented 4 years ago

I'm working on an update that will help us understand what is going on.

felipediel commented 4 years ago

Could anyone get this update, call remote.learn_command and send me the error message?

felipediel commented 4 years ago

@marco76mk @anamika784 :point_up:

marco76mk commented 4 years ago

does not work. I have deleted the pycache folder I restarted "ha" the error message has changed:

2020-05-25 08:30:32 ERROR (MainThread) [homeassistant.components.broadlink.remote] Failed to enter learning mode: The device storage is full 2020-05-25 08:30:32 ERROR (MainThread) [homeassistant.components.broadlink.remote] Failed to learn 'Turn on': The device storage is full

maorbenamer commented 4 years ago

I still have the same problem: Failed to learn 'mute / television': The device storage is full Device: RM4_PRO Home Assistant: 0.110.2 I also tried with Switch And also with Remote

mikicof commented 4 years ago

Hi!

I'm having the same problem with the storage is full, but trying to call the service broadlink.learn gives a Service not found error.

Mine is a Manual installation on a RPi

Thank you

gitawayu commented 4 years ago

In case it helps anyone, I had the "storage full" a few days ago, when using the remote.learn_command service on Broadlink "RM4c mini" after updating from 0.109.6 to 0.110.1 but, today, after updating to 0.110.2, it started working again (and remote.send_command was able to send the learned command/code)

felipediel commented 4 years ago

@marco76mk @anamika784 @maorbenamer @Critical2104 I understand the problem now. You specified the wrong type in the remote platform config. Remove type: whatever and it will work fine.

@mikicof Your problem is different. You need to set up a switch to register broadlink.learn service.

felipediel commented 4 years ago

The 'type' attribute is clearly causing confusion. This will be no longer necessary soon. For now, the rule is not to specify the type if you are not experiencing problems.

sira87 commented 4 years ago

The 'type' attribute is clearly causing confusion. This will be no longer necessary soon. For now, the rule is not to specify the type if you are not experiencing problems.

I try to give my 2 cents, but I'm a beginner so I may have done something wrong, expecially while applying the update you suggested.

I'm having the same problem of the users above while trying to learn a command via service remote.learn_command and via broadlink.learn.

I'm running a supervised install (if it can help) and I have not specified any type in my remote platform config.

These are the errors I get via remote.learn_command:

Logger: homeassistant.components.broadlink.remote
Source: components/broadlink/remote.py:302
Integration: broadlink (documentation, issues)
First occurred: 18:24:07 (1 occurrences)
Last logged: 18:24:07

Failed to enter learning mode: The device storage is full
Logger: homeassistant.components.broadlink.remote
Source: components/broadlink/remote.py:288
Integration: broadlink (documentation, issues)
First occurred: 18:24:09 (1 occurrences)
Last logged: 18:24:09

Failed to learn 'Turn on': The device storage is full

I followed the update instructions minus the SSH part because I have access to my RPi with VNC, so I did it with his terminal. If this is a bad practice or if it was useless I can try with SSH.

I'm sorry if I said or did something wrong, but I'm just beginning to learn linux and ha in this quarantine period :)

anamika784 commented 4 years ago

I have removed type: from my config. I' sorry , but it's doesn't work yet.

Logger: homeassistant.components.broadlink.remote Source: components/broadlink/remote.py:306 Integration: broadlink (documentation, issues) First occurred: 19:02:19 (1 occurrences) Last logged: 19:02:19 Failed to learn 'Turn on/television': The device storage is full

felipediel commented 4 years ago

Strange. Did you restart Home Assistant? Please show me your config.

anamika784 commented 4 years ago

Of course I restarted. My configuration.yaml: remote:

Home Assistant 0.110.2 The "broadlink.learn" works well.

marco76mk commented 4 years ago

I removed the "type" from the configuration. now if i start the command "remote.learn_command" the led turns on and in notifications it asks me to press the button on the remote control. I press and the led turns off, but in the logs I get this error:

2020-05-25 19:50:16 ERROR (MainThread) [homeassistant.components.broadlink.remote] Failed to learn 'Turn on/television': No code received

in the "config/.storage" only this file

bash-5.0# cat broadlink_remote_24dfa727d9ee_flags { "data": {}, "key": "broadlink_remote_24dfa727d9ee_flags", "version": 1

mikicof commented 4 years ago

@mikicof Your problem is different. You need to set up a switch to register broadlink.learn service.

I’ve changed the configuration and now the error is the same as remote.learn_configuration: Failed to enter learning mode: The device storage is full

felipediel commented 4 years ago

Something really obscure is going on. Those services have the same internal logic. If one works, the other should also work. I changed the file to display more error messages. Could someone update and send me the errors?

@anamika784 @maorbenamer Sorry, I was wrong about your config. I just realized that you have RM4 series devices. You should stick to type: rm4_mini and type: rm4_pro, respectively.

marco76mk commented 4 years ago

this update not work:

2020-05-25 22:55:51 ERROR (MainThread) [homeassistant.components.remote] Error while setting up broadlink platform for remote Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/broadlink/remote.py", line 134, in async_setup_platform d = next(filter(lambda d: d.host[0] == host, devices)) StopIteration

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 178, in _async_setup_platform await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT) File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for return fut.result() RuntimeError: coroutine raised StopIteration

felipediel commented 4 years ago

I updated the file to handle this exception. Please try again.

marco76mk commented 4 years ago

mmmm error:

2020-05-25 23:19:57 ERROR (MainThread) [homeassistant.components.broadlink.remote] The selected class for 10.0.0.82 is <class 'broadlink.rm'>

2020-05-25 23:21:41 ERROR (MainThread) [homeassistant.components.broadlink.remote] Learning: host=10.0.0.82, class=<class 'broadlink.rm'>, request_header=b'' 2020-05-25 23:21:49 ERROR (MainThread) [homeassistant.components.broadlink.remote] Learning: host=10.0.0.82, class=<class 'broadlink.rm'>, request_header=b''

felipediel commented 4 years ago

No other error? It seems to be working fine. Check the .storage folder.

marco76mk commented 4 years ago

2020-05-25 23:22:19 ERROR (MainThread) [homeassistant.components.broadlink.remote] Failed to learn 'Turn on': No code received

in the ".storage" folder I had removed the broadlink files, but now no file that starts with "broadlink_..." _appears

felipediel commented 4 years ago

python3 --version

Rookeh commented 4 years ago

Not sure if this helps, but I just had the exact same issue. Updated to 0.110.2 and got "The device storage is full" errors when trying to learn remote codes.

In my case, adding the type field to the configuration (in my case, rm4_mini) actually fixed the problem.

marco76mk commented 4 years ago

now it works !! I copied the "broadlink_remote_24dfa727d9ee_flags" file again and tried to run the "remote.learn_configuration" command again now the files broadlink_remote_24dfa727d9ee_codes has been created

the latest update fixes

felipediel commented 4 years ago

The last update contains only error messages. I have no idea what was going wrong. But I am happy to know that your problem is solved.

anamika784 commented 4 years ago

I typed the "type"( rm4c_mini) again, restarted. Everything is working fine now. Thank you for your help.

maorbenamer commented 4 years ago

Update to 0.110.3 and add typed the "type"( rm4_pro), Now it worked and can learned only IR. Cant learn RF Error: Failed to learn: No signal received

felipediel commented 4 years ago

@maorbenamer RF is not yet supported. I will add this feature after the refactor I'm doing.

maorbenamer commented 4 years ago

@maorbenamer RF is not yet supported. I will add this feature after the refactor I'm doing.

Thanks for the fast reply. 😀

And I thought I was wrong in one of the settings 🤦🏻‍♂️

felipediel commented 4 years ago

@sebastian-steinmann Could you help me improve support for your SP1 device? You just need to run a few debug scripts...

sebastian-steinmann commented 4 years ago

@sebastian-steinmann Could you help me improve support for your SP1 device? You just need to run a few debug scripts...

Yeah, hit me. Unsure of the classifications tho, thought I had an rm device.