This page is being edited.
Сontrol music or radio
Porfyry can now turn on music or radio. You can put music of different styles in different catalogs and give the opportunity to include music in the appropriate environment. This command is suitable for playing random music from a /mnt/music/2006Relax/ :
cd /mnt/music/2006Relax/ ; \ mplayer -slave -input file=/home/pi/scripts/mplayer-control -idle -shuffle * &’
To turn on the radio, use the command:
mplayer http://streams.calmradio.com:7328/stream &
You can use these commands in your scenario or run them from the Telegram interface.
Remote Control of Household Appliances
Using this or a similar universal control panel, the smart home can control any devices that have radio infrared or radio control. These can be TVs, vacuum cleaners, split systems, gates, blinds, etc.
Connect the broadlink device to your home Wifi network according to the attached instructions. After connecting to my home Wifi network, I denied access to the Internet on the home router for broadlink devices to block the possibility of unauthorized control.

To use Broadlink devices from Python, install the libraries from GitHub.
pip install broadlink
git clone https://github.com/mjg59/python-broadlink.git
cd python-broadlink/cli
Now let’s scan the network in search of Broadlink devices
./broadlink_discovery
You will see approximately the same information as in the picture. We are interested in the type, ip address and mac address.
Now let’s create files with commands for household appliances, for example, to turn on the TV and vacuum cleaner. For this we use the following command:
./broadlink_cli –type 0x279d –host 192.168.1.36 –mac 780f77fd7532 –learnfile HOME-TV.power
At this moment the led is in red color. Point you TV Remote Control to Broadlink and press power. Led is off now and file created. Success!
Now you can use it to turn on and turn off my TV, see the command below:
./broadlink_cli –type 0x279d –host 192.168.1.36 –mac 780f77fd7532 –send @HOME-TV.power
Make similar files for all your devices with infrared or radio remote control functions so that the Smart Home can control them.
to be continued…..