Based on what I've found so far online, I've put together a very simple implementation on my raspberry pi. Taking no credit of all the hard work others have put in and just put my code here if you want to play around
I first installed the libcoap-library as such:
apt-get install libtool
git clone --recursive https://github.com/obgm/libcoap.git
git checkout dtls
git submodule update --init --recursive
./configure --disable-documentation --disable-shared
sudo make install
I've put together a very simple Python-script that I'm planning to execute by running a shell_command:
Edit: depreceated, please look at the Github-link below instead.
You then run the code by invoking:
python ikea.py "65537" "100" "Yellow"
Or, from within Home assistant as a shell command:
ikealight_off: '/usr/bin/python3 /home/homeassistant/.homeassistant/extraconfig/python_code/ikea.py "65537" "0" "Yellow"'