How to query tuya api

Hi,
i’ve just installed HA and linked my tuya app to HA.
i need to query my Circuit breaker for power usage if it’s more then XX and time between 02:00 to 06:00 then do someting.
how i can achive that?

THX

With an automation.

the problem is that i can’t find the power usage state for this device. Although in the tuya app wgen i enter to device i can see the power usage

That would have been useful information to include.

What do you see in Home Assistant?

Which integration did you use to add the Tuya device?

Tuya are known for their extremely bad API which limits what the Home Assistant core integration can do.

There are third party integrations (e.g. Local Tuya) that use unofficial methods to get around these limitations.

i’ve the offical tuya integration and localtuya.
in the localtuya i can’t get the localkey from the tuya api website probebly they disabled this option.
in the offical tuya app it recognize the Circuit breaker as an ON/OFF and not with power metter

Have a look through the (copious amounts of) open issues:

You might find some advice for your device.