Page 1 of 1

Filter by Manufacturer Name

PostPosted: Mon Aug 15, 2022 2:54 pm
by Bildhauer
Hello

this script fails:

Code: Select all
for dev in indigo.devices.iter("props.SupportsEnergyMeter") :
   if dev.enabled and dev.supportsStatusRequest and dev.zwManufactureName == "Greenwave":
      indigo.device.statusRequest(dev)



Main goal is to do an status update only to devices manufactured by "Greenwave".

Who can help? This are the device details:

Code: Select all
batteryLevel : None
buttonConfiguredCount : 0
buttonGroupCount : 0
configured : True
description :
deviceTypeId : zwRelayType
displayStateId : onOffState
displayStateImageSel : PowerOn
displayStateValRaw : True
displayStateValUi : on
enabled : True
energyAccumBaseTime : 2000-01-01 00:00:00
energyAccumTimeDelta : 0
energyAccumTotal : 0.0018
energyCurLevel : 0.2
errorState :
folderId : 85000692
globalProps : MetaProps : (dict)
     com.perceptiveautomation.indigoplugin.zwave : (dict)
          SupportsEnergyMeter : true (bool)
          SupportsEnergyMeterCurPower : true (bool)
          SupportsEnergyMeterReset : true (bool)
          SupportsGasMeterReset : true (bool)
          SupportsPowerMeter : true (bool)
          SupportsWaterMeterReset : true (bool)
          address : 38 (integer)
          indigoObjVersion : 10 (integer)
          userEnergyPollingEnabled : false (bool)
          version : 4.21 (string)
          zwClassCmdBase : 37 (integer)
          zwDevEndPoint : 2 (integer)
          zwDevSubIndex : 1 (integer)
          zwManufactureId : 153 (integer)
          zwManufactureName : GreenWave (string)
          zwMeterSubTypeFlags : 5 (integer)
          zwMeterSupportsReset : true (bool)
          zwMeterType : 1 (integer)
          zwModelId : 196612 (integer)
          zwModelName : Relay Power Switch (string)
          zwShowDumpDevToLog : false (bool)
          zwShowEnergyPollingUI : true (bool)
          zwShowMainUI : false (bool)
          zwShowManualModifyConfigParmUI : false (bool)
          zwShowPollingUI : false (bool)
          zwShowSubmitModelInfoUI : false (bool)
          zwShowWakeIntervalUI : false (bool)
id : 1156974714
lastChanged : 2022-08-15 23:30:00
lastSuccessfulComm : 2022-08-15 23:30:00
ledStates : []
model : Relay Power Switch
name : Zwischenstecker Büro Bluetooth-Receiver (Steckdosenleiste 1 Dose 2)
onState : True
ownerProps : com.perceptiveautomation.indigoplugin.zwave : (dict)
     SupportsEnergyMeter : true (bool)
     SupportsEnergyMeterCurPower : true (bool)
     SupportsEnergyMeterReset : true (bool)
     SupportsGasMeterReset : true (bool)
     SupportsPowerMeter : true (bool)
     SupportsWaterMeterReset : true (bool)
     address : 38 (integer)
     indigoObjVersion : 10 (integer)
     userEnergyPollingEnabled : false (bool)
     version : 4.21 (string)
     zwClassCmdBase : 37 (integer)
     zwDevEndPoint : 2 (integer)
     zwDevSubIndex : 1 (integer)
     zwManufactureId : 153 (integer)
     zwManufactureName : GreenWave (string)
     zwMeterSubTypeFlags : 5 (integer)
     zwMeterSupportsReset : true (bool)
     zwMeterType : 1 (integer)
     zwModelId : 196612 (integer)
     zwModelName : Relay Power Switch (string)
     zwShowDumpDevToLog : false (bool)
     zwShowEnergyPollingUI : true (bool)
     zwShowMainUI : false (bool)
     zwShowManualModifyConfigParmUI : false (bool)
     zwShowPollingUI : false (bool)
     zwShowSubmitModelInfoUI : false (bool)
     zwShowWakeIntervalUI : false (bool)
pluginId : com.perceptiveautomation.indigoplugin.zwave
pluginProps : emptyDict : (dict)
protocol : ZWave
remoteDisplay : True
sharedProps : com.indigodomo.indigoserver : (dict)
states : States : (dict)
     accumEnergyTimeDelta : 0 (integer)
     accumEnergyTimeDelta.ui : 0 seconds (string)
     accumEnergyTotal : 0.0018 (real)
     accumEnergyTotal.ui : 0.0018 kWh (string)
     curEnergyLevel : 0.2 (real)
     curEnergyLevel.ui : 0.2 W (string)
     onOffState : on (on/off bool)
subModel : ui=Relay Switch
subType :
supportsAllLightsOnOff : False
supportsAllOff : False
supportsStatusRequest : True
version : 4.21


Best regards

Stephan O.

Re: Filter by Manufacturer Name

PostPosted: Mon Aug 15, 2022 6:55 pm
by DaveL17
I think this will do it.

Code: Select all
for dev in indigo.devices.iter("props.SupportsEnergyMeter"):
   if dev.enabled and dev.supportsStatusRequest and dev.ownerProps["zwManufactureName"] == "GreenWave":
      indigo.device.statusRequest(dev)

Re: Filter by Manufacturer Name

PostPosted: Tue Aug 16, 2022 3:14 pm
by Bildhauer
Thanks! I'll try!

Re: Filter by Manufacturer Name

PostPosted: Wed Aug 17, 2022 5:21 am
by Bildhauer
Unfiortunately it doesn't to what I want it to do: at the end the devices should do an update in regards to the current power consumption. Any idea how to make it happen?

Best regards

Bildhauer

Re: Filter by Manufacturer Name

PostPosted: Wed Aug 17, 2022 5:39 am
by DaveL17
When I tested the script, I only changed the manufacturer name and it worked:

Code: Select all
for dev in indigo.devices.iter("props.SupportsEnergyMeter"):
   if dev.enabled and dev.supportsStatusRequest and dev.ownerProps["zwManufactureName"] == "Aeon Labs":
      indigo.device.statusRequest(dev)

Can you describe what's not happening in greater detail?

Re: Filter by Manufacturer Name

PostPosted: Wed Aug 17, 2022 6:16 am
by Bildhauer
Hello,

one an hour I am writing the power consumption into a file to monitor it. The "GreenWave" power strip does not update its energy parameters automatically. That's what I'm trying with this kind of script.

Best regards

Bildhauer

Re: Filter by Manufacturer Name

PostPosted: Wed Aug 17, 2022 6:20 am
by DaveL17
Are you certain that it supports status update requests?

Re: Filter by Manufacturer Name

PostPosted: Wed Aug 17, 2022 6:46 am
by Bildhauer
Pushing the "update" button its doing it …

Another idea is to update the Virtual Energy Meter devices linked to it. But there II'm facing issues like these:

Code: Select all
   Virtual Energy Meter Error      Error in plugin execution ServerReplacedElem:

Traceback (most recent call last):
  File "plugin.py", line 328, in deviceUpdated
KeyError: key id 710455184 not found in database

   Virtual Energy Meter Error      Error in plugin execution ServerReplacedElem:

Traceback (most recent call last):
  File "plugin.py", line 328, in deviceUpdated
KeyError: key id 710455184 not found in database

   Virtual Energy Meter Error      Error in plugin execution ServerReplacedElem:

Traceback (most recent call last):
  File "plugin.py", line 328, in deviceUpdated
KeyError: key id 710455184 not found in database

   Virtual Energy Meter Error      Error in plugin execution ServerReplacedElem:

Traceback (most recent call last):
  File "plugin.py", line 328, in deviceUpdated
KeyError: key id 710455184 not found in database

   Virtual Energy Meter Error      Error in plugin execution ServerReplacedElem:

Traceback (most recent call last):
  File "plugin.py", line 328, in deviceUpdated
KeyError: key id 710455184 not found in database

   Virtual Energy Meter Error      Error in plugin execution ServerReplacedElem:

Traceback (most recent call last):
  File "plugin.py", line 328, in deviceUpdated
KeyError: key id 710455184 not found in database

   Virtual Energy Meter Error      Error in plugin execution ServerReplacedElem:

Traceback (most recent call last):
  File "plugin.py", line 328, in deviceUpdated
KeyError: key id 710455184 not found in database

   Virtual Energy Meter Error      Error in plugin execution ServerReplacedElem:

Traceback (most recent call last):
  File "plugin.py", line 328, in deviceUpdated
KeyError: key id 710455184 not found in database

Re: Filter by Manufacturer Name

PostPosted: Wed Aug 17, 2022 6:56 am
by howartp
I have a Greenwave though haven’t used it for months.

Can’t you set polling to a specific time (ie hourly) rather than the default “when traffic detected”?


Sent from my iPhone using Tapatalk Pro

Re: Filter by Manufacturer Name

PostPosted: Wed Aug 17, 2022 11:33 am
by Bildhauer
howartp wrote:
I have a Greenwave though haven’t used it for months.

Can’t you set polling to a specific time (ie hourly) rather than the default “when traffic detected”?


Sent from my iPhone using Tapatalk Pro


I’ll have a look at it!