Closed edautz closed 1 year ago
Thanks for your feedback, yes, still a lot of open ends on this integration. I think HACS automatically downloads the repository on installation? Not sure because obviously this is a step I don't do very often.
I'm quite sure your receive pin is not on pin 0 but on interrupt 0 which is pin 2. Yes I did switch to using the interrupt number to the actual pin number on the board.
The integration should not hang, I'm not sure what's going on there. Any messages in the log file?
I'm developing on the latest HA version and haven't done any backwards compatibility tests
Right,
Tested again with a HA container 2023.3.5.
Same problem.
Logfile entry: Logger: homeduino.homeduino Source: runner.py:179 First occurred: 7:06:06 PM (1 occurrences) Last logged: 7:06:06 PM
Error during decode of data, invalid data: fxx�f���
In the past I lowerred the serial baudrate from 115200 to 57600. Thats is burned in the nano firmware. I wonder that could be the case.
I tried to set the baud with stty -F /dev/ttyUSB0 57600 in the container and the host, but the problem and the logenty persists.
Logger: homeduino.homeduino Source: runner.py:179 First occurred: 7:26:50 PM (1 occurrences) Last logged: 7:26:50 PM
Error during decode of data, invalid data: fxx�f���
I don't have any Phyton knowledge. Looked in your code but cannot see where to change it.
Could the baudrate be the problem? And if so it possible to make the serial baudrate configurable? And modify the error handling to avoid hangups?
Yes, baud rate is definitely the case. Fastest way for you to fix this is to flash the Arduino with the original baudrate as I don't have the time to work on the code in the upcoming days/week
Ok. I reflashed the homeduino device with the new baudrate of 115200 and now I am able to add it to my HA integrations menu.
But how to add some RF devices?
Do I somehow have to install https://github.com/rrooggiieerr/rfcontrolpy ?
Help appreciated.
I've updated the readme with instructions on how to add RF actors
I can add a device, but only type1 devices:
I have also switch2, switch5 and switch6 type devices.
If I look to your repository https://github.com/rrooggiieerr/rfcontrolpy/tree/main/rfcontrol/protocols, they seems also been supported.
How to configure those device types?
Additional question:
What does the checkboxes:
Ignore all Extrapolate device units
mean?
Can you help me out?
Hi @edautz, this is a very beta version of the integration and one of the many HA integrations I'm working on. You're actually the only user besides me. Also I don't use a lot of 433MHz devices anymore, only a hand full of devices I haven't replaced with Zigbee ones yet. What I'm trying to say, don't expect this to be functioning and use it at your own riks.
Having said that, I just released some updates that should increase the stability and enables all protocols implemented by RFControl.
I have only tested the switch1 and dimmer1 protocols myself, because that's what I have. All the other protocols are untested.
@rrooggiieerr, I understand and appreciate your efforts on this repostitory. I will test it on my test HA instance and report back the results.
The reason why I am so interrested is: I have some outdoor RF switches to control my pond pumps and UV lamp. I cannot find an outdoor proof zwave or wifi switch replacement, so I am stuck on there RF switches. As we speak I keep an Pimatic docker container alive to control this devices, but I want to abandon Pimatic completely. This integration has the potention to close the last remeaning gap in my Homeassistant setup for the RF functionality.
I saw I could add more device types and a baudrade when installing homeduino. No errors in the logs.
Very good.
I add 2 switches:
A switch2 type device, it takes House code as device ID and unit code as Device unit. I am able to use it and it works, but produces an error every time I switch it on or off.
[547448369216] 'NoneType' object has no attribute 'loop' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 199, in handle_call_service await hass.services.async_call( File "/usr/src/homeassistant/homeassistant/core.py", line 1808, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1845, in _execute_service await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)( File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service await service.entity_service_call( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 686, in entity_service_call future.result() # pop exception if have File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 961, in async_request_call await coro File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 726, in _handle_entity_call await result File "/config/custom_components/homeduino/switch.py", line 184, in async_turn_on if await self.coordinator.rf_send( File "/config/custom_components/homeduino/init.py", line 141, in rf_send self.async_set_updated_data({"protocol": protocol, "values": values}) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 358, in async_set_updated_data self._schedule_refresh() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 173, in _schedule_refresh self._unsub_refresh = event.async_track_point_in_utc_time( File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 1329, in async_track_point_in_utc_time cancel_callback = hass.loop.call_later(delta, run_action, job) AttributeError: 'NoneType' object has no attribute 'loop'
I tried also a switch6 type device: When I try systemcode code 22 as device ID and programcode 16 as device unit, the entity is unavailable. And produces in the log the follwing error:
Error adding entities for domain switch with platform homeduino Error while setting up homeduino platform for switch Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 442, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 717, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 806, in add_to_platform_finish await self.async_added_to_hass() File "/config/custom_components/homeduino/switch.py", line 127, in async_added_to_hass await super().async_added_to_hass() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 382, in async_added_to_hass self.coordinator.async_add_listener( File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 127, in async_add_listener self._schedule_refresh() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 173, in _schedule_refresh self._unsub_refresh = event.async_track_point_in_utc_time( File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 1329, in async_track_point_in_utc_time cancel_callback = hass.loop.call_later(delta, run_action, job) AttributeError: 'NoneType' object has no attribute 'loop'
When I turn it around, systemcode code 22 as deviceunit and programcode 16 as deviceID, the switch is available but doesn't work. It also produces the 'NoneType' object has no attribute 'loop' error.
I've been doing a lot of updates to the code yesterday and today, please try the latest version
I tested this afternoon, maybe I missed the last three commits. Will retest.
How's it working for you now? I made some changes last evening that make it more stable for me. Feel free to check that out
Thanks for the update.
Tested a switch2 and a switch6 device. They are both working now.
The only probleem remains, when I turn on or off the homeduino switches, an error message pops up:
Failed to call service switch/turn_on. 'NoneType' object has no attribute 'loop'
or
Failed to call service switch/turn_off. 'NoneType' object has no attribute 'loop'
and the system logging is updated with a entry:
Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 199, in handle_call_service await hass.services.async_call( File "/usr/src/homeassistant/homeassistant/core.py", line 1808, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1845, in _execute_service await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)( File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service await service.entity_service_call( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 686, in entity_service_call future.result() # pop exception if have File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 961, in async_request_call await coro File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 726, in _handle_entity_call await result File "/config/custom_components/homeduino/switch.py", line 184, in async_turn_on if await self.coordinator.rf_send( File "/config/custom_components/homeduino/init.py", line 144, in rf_send self.async_set_updated_data({"protocol": protocol, "values": values}) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 358, in async_set_updated_data self._schedule_refresh() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 173, in _schedule_refresh self._unsub_refresh = event.async_track_point_in_utc_time( File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 1329, in async_track_point_in_utc_time cancel_callback = hass.loop.call_later(delta, run_action, job) AttributeError: 'NoneType' object has no attribute 'loop'
I have no idea why you get that message, for me when creating a switch2 or switch6 and using them gives no problems.
Which HA Core version are you using
I am testing with core 2023.3.5 in a container.
I have downgraded my test system to 2023.3.5 and still don't get the error you get.
Wich client do you use? I tested your integration not with the companion app, but with the chrome browser with a seperate HA testinstance. Can you also test with a chrome browser?
I use bot browser and app. The error happens deeper in the HA system, not related to UI. I think it has to do with the order the Homeduino device and Homeduino RF actors are loaded. I made some changes to the code which will hopefully resolve the matter. Give it a try
Thanks for the update and swift respons.
I tried the changed code, but run in trouble doing a fresh install:
Tried it 3 times with a fresh install, also reset the homeduino hardware, but problem persists.
Could you try again with the latest code?
Yes that did it!!!!
I can install a new homeduino and the switches are working without the "Failed to call service switch/turn_off. 'NoneType' object has no attribute 'loop'" error.
Thanks for that.
A request and a question:
Request:
Is it possible to get more meaningfull Entity ID's, when adding RF actors? Now I get: switch.switch6_22_switch_16 switch.switch2_25_switch_16
More readable would be nice, e.g. pound pump and lamp switch etc.
Question:
What is the meaning of checkboxes:
When adding an RF actor?
That's good to hear! Are the switch2 and switch6 protocols working with the same Device ID (House Code/System Code) and Unit (Unit Code/Program Code) you were using in Pimatic?
You can rename the entity id's using HA, just go to the settings of your entity and you can change the Name, Icon and Entity ID. This works for every entity in HA, not only the ones by the Homeduino integration.
The other options are not yet documented and might actually get deleted in a future release. Just ignore them for now. Also it's still not a finished integration but work in progress.
That's good to hear! Are the switch2 and switch6 protocols working with the same Device ID (House Code/System Code) and Unit (Unit Code/Program Code) you were using in Pimatic?
Yes they are.
You can rename the entity id's using HA, just go to the settings of your entity and you can change the Name, Icon and Entity ID. This works for every entity in HA, not only the ones by the Homeduino integration.
Ok. I'll try that.
The other options are not yet documented and might actually get deleted in a future release. Just ignore them for now. Also it's still not a finished integration but work in progress.
Ok. Very clear.
Thank you for your fine integration and swift support. This closes for me the last step to abandon Pimatic and I will it integrate it in my production systems in the near future.
Hello,
I tried to install your plugin on a fresh HA 2022.11.1 container, with a mapping to a homeduino device on a USB port:
devices:
Here are my findings:
After the installation steps, I got the settings screen in the homeduino integration:
My homeduino device has the recieve pin on pin 0! But that option is not available. The lowest pin nummer is 2.
See my pimatic config:
When I try the config with recieve pin 2 and send pin 4, the plugin hangs. Also without the recieve pin.