5sControl / 5s-backend

Video monitoring system with AI analysis and ERP Integration (Open Source) that helps companies improve productivity, eliminate waste, and enhance workplace safety using computer vision and machine learning
https://5scontrol.com
GNU General Public License v3.0
1 stars 1 forks source link

[8 h.]automatic stop of electrical devices #401

Open mavsejko opened 2 months ago

mavsejko commented 2 months ago

Device from the manufacturer DoHome failed to connect

Image

Dimskay1988 commented 2 months ago

pip install flux_led

from flux_led import WifiLedBulb import time

def control_device(ip): try: bulb = WifiLedBulb(ip) bulb.refreshState()

    print(f"Turning on device at {ip}")
    bulb.turnOn()
    time.sleep(5)

    print(f"Turning off device at {ip}")
    bulb.turnOff()
    print(f"Successfully controlled the device at {ip}")
except Exception as e:
    print(f"Failed to control device at {ip}: {e}")

if name == "main": device_ip = '192.168.31.193' control_device(device_ip)

Dimskay1988 commented 2 months ago

для реализации проекта понадобится

Dimskay1988 commented 2 months ago

Image

Dimskay1988 commented 2 months ago

https://github.com/5sControl/5s-backend/assets/100229615/281152e0-2241-46ae-be0e-14a276f8972e