### Start Virtual CCU Source: https://github.com/danielperna84/pyhomematic/wiki/Contributing-and-development-for-pyhomematic Execute this script to start the virtual CCU for testing pyhomematic modifications. ```bash /home/user/devccu.py ``` -------------------------------- ### Connect and Control Homematic Devices Source: https://github.com/danielperna84/pyhomematic/blob/master/README.rst This example demonstrates connecting to a Homegear server, controlling a device, querying its state, setting up event callbacks, and stopping the server. The server must be stopped to prevent Python from hanging. ```python def syscb(src, *args): print(src) for arg in args: print(arg) def cb1(address, interface_id, key, value): print("CALLBACK WITH CHANNELS: %s, %s, %s, %s" % (address, interface_id, key, value)) def cb2(address, interface_id, key, value): print("CALLBACK WITHOUT CHANNELS: %s, %s, %s, %s" % (address, interface_id, key, value)) from pyhomematic import HMConnection pyhomematic = HMConnection(local="192.168.1.12", localport=7080, remote="192.168.1.23", remoteport=2001, systemcallback=syscb) # Create server thread pyhomematic.start() # Start server thread, connect to homegear, initialize to receive events pyhomematic.devices['address_of_rollershutter_device'].move_down() # Move rollershutter down pyhomematic.devices_all['address_of_doorcontact:1'].getValue("STATE") # True or False, depending on state pyhomematic.devices['address_of_doorcontact'].setEventCallback(cb1) # Add first callback pyhomematic.devices['address_of_doorcontact'].setEventCallback(cb2, bequeath=False) # Add second callback pyhomematic.stop() # Shutdown to finish the server thread and quit ``` -------------------------------- ### Add New Device Class in Home Assistant Source: https://github.com/danielperna84/pyhomematic/wiki/Contributing-and-development-for-pyhomematic Modify the Home Assistant core integration to include a new device class. This is necessary when introducing new device types to pyhomematic. ```python homeassistant/components/homematic/const.py#L42 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.