I am using this particular device for measuring and switching power to my car's charger.
I want to be able to follow how much energy (kw) it has used in each session (live)
Your driver reports the cumulative energy value. It does not reset at the beginning of each session.
Would it be possible to add a feature to report an additional value which resets at the beginning of each session (triggered by "on" event) ?
Also, I would like to be able to set starting energy point with a custom command.
I tried adding this function:
def setEnergy( energy )
{
def energyDouble = safeToDouble( energy ).round(6)
energyEvent( energyDouble, isDigital=true )
if (settings?.logEnable) log.debug "setEnergy() : state.lastEnergyRaw = ${state.lastEnergyRaw} new energy = ${energyDouble}"
def now = FormattedDateTimeFromUnix( now() )
state.lastResetDate = now
state.lastEnergyCost = 0.0
state.lastResetEnergy = state.lastEnergyRaw
state.lastHourlyEnergy = state.lastEnergyRaw
energyEvent( energyDouble, isDigital=true )
hourlyEnergyEvent( energyDouble, isDigital=true )
if (settings?.txtEnable) log.info "${device.displayName} Energy (total:${state.lastEnergyRaw} kWh) was reset on ${state.lastResetDate}"
}
It sets the energy for less than a second but then resets to previous value.
how can I achieve this ?
I just removed one of the problematic Tuya plugs that was connected to my cable modem. It had been fine for months then went offline this morning. They usually connect once I add them again, but are as reliable as a drunk roofer.
I have 8 of these in the drawer of stuff too good to throw away. Not sure why I am keeping them.
OK. I had not noticed that previously. I just tried and it seems to work. Thanks.
What about setting energy to a specific value ?
How can I make my function work ?
Hello, will you be able to make it work or should I throw it in a drawer? Or does exist any workaround? I have for example home assistant in docker. Can I maybe get it working with home assistant reading the events from hubitat?
Sorry, but I don't think I will have the chance to get back to the multi-channel energy reporting Tuya devices soon. This driver is not suitable for that.
The best workaround would be to use HomeAssistant and then bring the power/energy readings to Hubitat using the Home Assistant Device Bridge.
This solution will apply less stress on the HE hub (as the HA-HE communication is TCPIP).
Hello kkossev,
I tried to share my device trough Maker API but my HA (docker) is not able to receive these events. Am I doing right, or you was meaning to use a real HA hub and pair this device to it?
EDIT: The device appeared after almost 3h.. I hope that HA will manage better the data's!
I meant using a real Zigbee stick with Home Assistant and Zigbee2MQTT, as I expect that Z2M handles these multi channel power monitoring devices better.
Let us know how it works the way you have set it at the moment.
Hello,
Any idea what could happen or any of you have such symptoms:
Plug "Smart ZigBee Socket NOUS A1Z" stopped showing status in Hubitat. It technically works, manually can be operated but not via dashboard or device section. It stopped showing status "off" but with consumption of power 18watt.
I updated drivers to 1.9.3. I deleted it from Hubitat and started pairing again after factory reset. No response from the Plug to the hubitat.
Can be Zegbee module crashed? Any other ideas?
Please help.
C8 Pro.
It stopped reporting. So I deleted the device, reset it to factory by holding the button. Start blinking. Pairing failed. I trided different methods. Direct pairing as well