I have written a home automation script for controlling lights, music on kodi, and my TV.  I have everything working except for turning off the TV.  I have mapped my keyboard.xml file within kodi to recognize the "CECToggleState", and this works fine, but I would like to trigger this inside a python script.  
In the past, one could import the xbmc module, then use the command "xbmc.executebuiltin()" to run built in kodi functions, like "CECToggleState".  The xbmc module has been replaced by the kodi module. I have seen examples where it is suggested that "kodi.executebuiltin()" can be used,  but the kodi module does not appear to actually support "executebuiltin".  When I try running this command in python, I get an error that reads:
"AttributeError: 'module' object has no attribute 'executebuiltin'"
Can anyone confirm that this is true, or offer what has replaced this command? Or, does anyone know of a good alternative to get the same effect -- ie, send "TV off" command programatically through HDMI CEC?
You have to write xbmc.executebuitin("XBMC.CECToggleState()"), not kodi.executebuitin("XBMC.CECToggleState()"), and please upgrade your kodi from isengard to a stable version (i.e, Kyrpton).
kodi.executebuiltin() not working in Kodi: Isengard