Author Topic: wattage not seen in Vc  (Read 6557 times)

0 Members and 1 Guest are viewing this topic.

achel

  • Jr. Member
  • **
  • Posts: 39
  • Karma: 4
    • View Profile
wattage not seen in Vc
« on: January 03, 2015, 01:55:07 PM »
Hello
I'm using a aeon Labs Heavy Duty Switch       

http://mobile.vesternet.com/item/31323830

I use a work around to get it to work on my veralite http://www.vesternet.com/resources/application-notes/apnt-89
I'm using the easy way on that link.

I see the   the watts on vera ui but when I ask vc for status I get all the info but not the watts.

I would like to use the watts info to trigger events.

I hope you guys have some ideas how I can do this

Thanks.
« Last Edit: January 03, 2015, 05:15:58 PM by achel »

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: wattage not seen in payload
« Reply #1 on: January 03, 2015, 02:26:08 PM »
I'm not sure what you mean by payload here. Are you issuing a Vera.GetStatus command? It would help if you posted your command or a log or something.

I don't know if this will work (probably not), but you could try this query, which I found on the MIOS wiki. You need to replace "[YOURDEVICEID]" with your switch's device ID where indicated.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.3.3-->
<command id="432" name="Get Heavy Duty switch wattage" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>vera.raw</cmdType>
    <params>
      <param>data_request?id=variableget&amp;DeviceNum=YOURDEVICEID&amp;serviceId=urn:micasaverde-com:serviceId:EnergyMetering1&amp;Variable=Watts</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <params>
      <param>{LastResult}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Get wattage</phrase>
</command>

« Last Edit: February 26, 2015, 08:53:09 AM by nime5ter »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

achel

  • Jr. Member
  • **
  • Posts: 39
  • Karma: 4
    • View Profile
Re: wattage not seen in payload
« Reply #2 on: January 03, 2015, 05:05:35 PM »
Sadly that didn't work.
What I am hoping for is the way that vera reports to Vc about other senses like light or humidity when it changes, I was hoping to get the same from the watts being used by that particular switch.

I shouldn't have used the word payload, I should have called the post watts not being reported to Vc.
« Last Edit: January 03, 2015, 05:15:06 PM by achel »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: wattage not seen in payload
« Reply #3 on: January 03, 2015, 05:33:16 PM »
Sadly that didn't work.
What do you mean by "didn't work"?

What I am hoping for is the way that vera reports to Vc about other senses like light or humidity when it changes, I was hoping to get the same from the watts being used by that particular switch.
If this is an energy meter then the watts consumed would be changing constantly, so the events would be firing constantly.  It is not like a light switch which fires an event when it turns on or off (this only happens at certain times).

So, I don't think you really want an event.   What you probably want is a way to check the current consumption, which is what nime5ter tried to provide you with. 

You have not really explained what you are trying to accomplish here so maybe I am still misunderstanding.
« Last Edit: January 03, 2015, 05:37:01 PM by jitterjames »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: wattage not seen in Vc
« Reply #4 on: January 03, 2015, 05:35:24 PM »
If you really want to have constantly generated events, it might be possible but it is hard for us to know.  For us to know if it is possible to get any event info from this device, you will need to enable logging in VC, and enable verbose logging in the Vera plugin settings, and then let it run for a while, and then send us a log.

achel

  • Jr. Member
  • **
  • Posts: 39
  • Karma: 4
    • View Profile
Re: wattage not seen in Vc
« Reply #5 on: January 03, 2015, 06:00:26 PM »
Quote
What do you mean by "didn't work"?
When I replaced [YOURDEVICEID] with [18] it just came up with 22, which is the same as my temperature sensor. I don't know what is going on there, I think I have done it right with just putting 18 as that's the ID of the node when i press map editor it has 18 next to the switch name.

Quote
You have not really explained what you are trying to accomplish here so maybe I am still misunderstanding.

The switch tells you the amount of watts being used when the watts drop to 0 I will know the water is hot I would like it to trigger an event to turn the switch off and tell me bath water is ready. I was going to buy more of them if this can be done for my fridge and freezer. So if it reached 0 watts I would be informed before anything defrosted.

Quote
If you really want to have constantly generated events, it might be possible but it is hard for us to know.  For us to know if it is possible to get any event info from this device, you will need to enable logging in VC, and enable verbose logging in the Vera plugin settings, and then let it run for a while, and then send us a log.

Yes I do think I want this, I will switch these options on, is 24 hours enough time for logging?


« Last Edit: January 03, 2015, 06:10:13 PM by achel »

achel

  • Jr. Member
  • **
  • Posts: 39
  • Karma: 4
    • View Profile
Re: wattage not seen in Vc
« Reply #6 on: January 03, 2015, 06:22:14 PM »
I have attached the log, in the log at around 22:11 you will see the switch and it states the watts 2843.Then I switch it off at 22:27 you will see the watts at 0.
Is  "kwh": "26.7290" how much I have used in total?
Let me know if it needs to run longer, as the boiler needs to be switched on I guess for it to log what is happening.
Thanks  for all your time.
« Last Edit: January 03, 2015, 06:31:33 PM by achel »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: wattage not seen in Vc
« Reply #7 on: January 03, 2015, 06:24:27 PM »
When I replaced [YOURDEVICEID] with [18] it just came up with 22
You were not supposed to include the square brackets.  You should replace [YOURDEVICEID] with 18, not [18]

I was going to buy more of them if this can be done for my fridge and freezer. So if it reached 0 watts I would be informed before anything defrosted.
In this case it could also mean than your fridge has reached the required temperature and has switched off, not that it is broken.  You would probably be better off installing a temperature sensor.

Yes I do think I want this, I will switch these options on, is 24 hours enough time for logging?
I think that 30 minutes would be more than enough, just make sure there is some activity on the switch and that the watts have changed.

I do not think that Vera will report a change in power consumption though so you will probably need to use the command from nime5ter on some kind of loop.

achel

  • Jr. Member
  • **
  • Posts: 39
  • Karma: 4
    • View Profile
Re: wattage not seen in Vc
« Reply #8 on: January 03, 2015, 06:37:07 PM »
Quote
You were not supposed to include the square brackets.  You should replace [YOURDEVICEID] with 18, not [18]
  ::duh

I edited my post while you were posting and attached a different log, im going to have a go at Nime5ter code but doing it properly this time.

achel

  • Jr. Member
  • **
  • Posts: 39
  • Karma: 4
    • View Profile
Re: wattage not seen in Vc
« Reply #9 on: January 03, 2015, 06:44:54 PM »
nime5ter that works, thanks. I just didn't use it properly, it now tells me the wattage being used.
After I have cluttered up all your forum.
So I would have to trigger this code for it to report , would the best way to go about it.
If switch is on check wattage every 30 minutes, if off do nothing. How would I do that would I use timed event? that triggers itself every 30 minutes until the switch is turned off

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: wattage not seen in Vc
« Reply #10 on: January 03, 2015, 07:27:22 PM »
Yes that is doable.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: wattage not seen in Vc
« Reply #11 on: January 03, 2015, 08:08:15 PM »
See if this works for you.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.3.3-->
<command id="429" name="start /stop checking switch wattage" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Vera.Get.Status</cmdType>
    <params>
      <param>18</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)==(B)</ifType>
    <ifParams>{LastResult}&amp;&amp;0</ifParams>
    <then>
      <action>
        <cmdType>VC.StopMacro</cmdType>
        <params />
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else>
      <action>
        <cmdType>Vera.Raw</cmdType>
        <params>
          <param>data_request?id=variableget&amp;DeviceNum=18&amp;serviceId=urn:micasaverde-com:serviceId:EnergyMetering1&amp;Variable=Watts</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)==(B)</ifType>
    <ifParams>{LastResult}&amp;&amp;0</ifParams>
    <then>
      <action>
        <cmdType>OSD.ShowText</cmdType>
        <params>
          <param>Wattage: 0. Your bath water is ready!</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>TTS.Speak</cmdType>
        <params>
          <param>Wattage: 0. Your bath water is ready!</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else>
      <action>
        <cmdType>OSD.ShowText</cmdType>
        <params>
          <param>Wattage is: {LastResult}. I'll check again in 15 minutes.</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>TTS.Speak</cmdType>
        <params>
          <param>Wattage is: {LastResult}. I'll check again in 15 minutes.</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>VC.SetEventTimer</cmdType>
        <params>
          <param>15m</param>
          <param>checkWatts</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <event>checkWatts</event>
  <event>vera.Device.18.*</event>
</command>

It's dinner time so I won't take the time to explain the command here. Maybe analyse it for yourself, and if you have specific questions let us know.

... I have it set to check the wattage every 15 minutes as long as the switch is on, rather than every 30 minutes. That should not overtax either Vera or VC.
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

achel

  • Jr. Member
  • **
  • Posts: 39
  • Karma: 4
    • View Profile
Re: wattage not seen in Vc
« Reply #12 on: January 04, 2015, 02:12:33 AM »
Thanks  it's works a dream
I will  have to put a small  pause at the start as when the switch is first switched
it reports 0.

I am going to work but on my return I will try some things out.

nime5ter thanks for taking the time in doing this for me.


nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: wattage not seen in Vc
« Reply #13 on: January 04, 2015, 08:49:47 PM »
Great, thanks for letting us know. If you find that your solution to the switch status problem isn't working out as you'd like, there are other some other ways to  implement the same thing that might work out better for you. You might find it more effective to use two commands, for example: the first one can be triggered when the switch first turns on, and it in turn can trigger the other check wattage command after a short delay.
« Last Edit: January 04, 2015, 08:52:30 PM by nime5ter »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)