In order to control those switches, I successfully built myself a CUL (Arduino plus a 433MHz RF-device - like this) running culfw/FHEM. Is it possible to use this device with HASS at all? I guess, a connection to HASS through pilight might be possible but I would rather prefer a “native” implementation.
I also would be interested to get the CUL-USB Stick running.
I am considering to switch from FHEM to HASS, and I already have the CUL-USB Stick
and some components for that environment.
do you got any solution for your problem? I’m actually using a culfw (Arduino Nano + CC1101 433mhz module) with pimatic but I also like to switch to HASS.
If you’re running FHEM you could properly use a www request to call your devices via FHEM? Have you tested this? This might be just a work arround but maybe it works?
It didn’t work as I thought…for now I will use another 433 mhz receiver and sender connected directly to my raspberrypi via gipo…I’m still looking forward for a solution of using my Arduino Nano + cc1101 via a serial port.
I found a solution for my problem. With the pyserial libary you can send commands to the cul. Look at the cul commandref for the commands. I wrote a little script which sends the intertechno command to the cul. After that I defined some Home Assistant command line switches. Next thing to do is to receive the commands and change the state of the HA switch.
Example for the python script:
import serial
ser = serial.Serial(port=’/dev/ttyUSB0’, baudrate=38400, bytesize=8, parity=‘N’, stopbits=1)
ser.write((‘is00FFFF0FFF0F’+’\n’).encode())
ser.close()
Hi sti0,
Thank you for digging in and posting your solution. I would very much appreciate if this could be picked up and developed further. As you mentioned, for a proper implementation of those switches receiving commands is almost as necessary as sending …
I solved the receiving problem as well. I wrote a python script which uses pyserial to read the information of the cul in an endless loop. If a specific code (e.g. i512345 = on) is written, the scripts updates the switch status by using the HA api. The script runs on startup of my raspberry.
Pro:
the serial port is already open, so you can simply send messages via echo to the cul (unix e.g. echo “is00FFFF0FFF0F” > /dev/ttyUSB0). This works in no time! You don’t have to open a serial port or use a pyhton script to send a command to the stick.
Con:
very basic implementation at the moment. If I want to include new switches in HA I have to implement them on the python script as well. But it’s working well so far
Nice to see some progress here. Im also on FHEM atm but considering alternatives. A working miniCUL / nanoCUL intertechno protocol integration for wall switches is the last thing thats not supported but essential for me.
This is very interesting. I have currently a FHEM on Pi configuration with 2 CUL sticks (homemade), 1 on 433 Mhz and 1 on 868 Mhz. The 433 Mhz CUL is used for (dutch KIKU) InterTechno switches, the 868 Mhz CUL is used for communication with 5 EQ3 Max! Radiator Thermostats.
I’am trying to migrate to HASS with my home automation. Is anyone working on CUL integration for HASS?
So, it’s time to warm this topic up again.
I hope I’m not getting too much off topic here.
I’m also thinking about moving from FHEM to HA. Currently I’m playing around with a hassbian installation on a spare Raspi3.
I did get the CUL to work like sti0 discribed. After I installed pyserial it worked with:
import serial
ser = serial.Serial(port='/dev/ttyUSB0', baudrate=38400, bytesize=8)
ser.write(('isFFFF00000FFF'+'/n').encode())
ser.close()
so without the parity and stopbits parameters in the serial definition.
Altough I could switch my plugs through python3 my_pythonscript.py I found out that “import serial” doesn’t work with hassbian. So creating python scripts in /python_scripts and calling them as services in HA does not work.
I read around and found out that AppDaemon is the way to go. I installed it and started reading some tutorials.
When I was not getting anywhere (fast enough) I thought of a way of calling python3 scrips through shell command.
Now my trouble starts: The python scrips don’t work anymore. Using picocom i can still turn the plugs on and off (e.g. with “isFFFF00000FFF” for on and “isFFFF00000FF0” for off)
so there seems to be some trouble with the pyserial lib?
I uninstalled Appdaemon (pip3 uninstall appdaemon) and uninstalled and reinstalled pyserial. Still no effect. I’m out of ideas…
Any tipps and hints anyone?
I’m not using this solution anymore. It’s long ago, I can’t remember how it’s working…maybe you should consider ESPHome as alternativ which is easy to setup and is well integrated into HA.