This publication presents a system for integrating machine learning and artificial intelligence solutions with building automation systems. The platform is based on cloud solutions and can integrate with one of the most popular virtual building management solutions, HomeAssistant. The System uses communication based on the Message Queue Telemetry Transport (MQTT) protocol. The example machine learning function described in this publication detects anomalies in the electricity waveforms and raises the alarm. This information determines power quality and detects system faults or unusual power consumption. Recently, increasing electricity prices on global markets have meant that buildings must significantly reduce consumption. Therefore, a fundamental element of energy consumption diagnostics requires detecting unusual forms of energy consumption to optimise the use of individual devices in home and office installations.