Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Blueline PowerCost Monitor #1248

Closed
gcormier opened this issue Jan 2, 2020 · 21 comments
Closed

Add Blueline PowerCost Monitor #1248

gcormier opened this issue Jan 2, 2020 · 21 comments
Labels
device support Request for a new/improved device decoder

Comments

@gcormier
Copy link
Contributor

gcormier commented Jan 2, 2020

Documentation : https://static.hydroottawa.com/documents/residential/conservation/pdf/peaksaver_user_guides/8-Energy-Display-Installation-Guide-EN.pdf

I'm a bit confused as there is reference to rtl_433 ( https://github.com/CapnBry/Powermon433/blob/master/arduino/Powermon433/Powermon433.ino ) but it's not a supported device. Perhaps the author meant he used rtl_433 to do the decoding.

I'm willing to capture the samples and submit to test repo. Based on the code above, I am using this

-X "name=blueline,modulation=OOK_MC_ZEROBIT,short=500,long=1000,r=58000"

Does that seem accurate?

@gcormier
Copy link
Contributor Author

gcormier commented Jan 2, 2020

FCC : Data obtained by an IR-reader/sensor is transmitted in form of short bursts every 28.5 to 31.5 seconds on 433.92 MHz (single frequency). The carrier is On/Off pulse modulated (logic ‘1’: 0.5ms TX-on followed by 2ms TX-off, logic ‘0’: 0.5ms TX- on followed by 4ms TX-off).

@merbanan
Copy link
Owner

merbanan commented Jan 3, 2020

https://github.com/radredgreen/rtl_433/commits/master

@merbanan
Copy link
Owner

merbanan commented Jan 3, 2020

http://scruss.com/blog/2013/12/03/blueline-black-decker-power-monitor-rf-packets/

So you can just clean up the old code from the above branch.

@gcormier gcormier changed the title Add Blineline PowerCost Monitor Add Blueline PowerCost Monitor Jan 3, 2020
@gcormier
Copy link
Contributor Author

gcormier commented Jan 3, 2020

I think I have a valid packet captured. The ON period is 2ms, not 0.5ms as described in the FCC filing, but it has matching OFF periods of 2ms or 4ms.

Can I ask why these produce the same results? Swapping short and long values in the decoder string?

greg@biglenny:~/rtl_433_tests/tests/blueline/lime-outside$ rtl_433 -r g010_433.92M_1000k.cs16 -X "name=blueline,modulation=OOK_PPM,short=2000,long=4000,gap=7000,reset=350000"
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
time      : @0.134372s
model     : blueline     count     : 2             num_rows  : 2             rows      : 
len       : 32           data      : 010c99a8, 
len       : 0            data      : 
codes     : {32}010c99a8, {0}
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
time      : @0.549692s
model     : blueline     count     : 2             num_rows  : 2             rows      : 
len       : 32           data      : 01f2bcd5, 
len       : 0            data      : 
codes     : {32}01f2bcd5, {0}
greg@biglenny:~/rtl_433_tests/tests/blueline/lime-outside$ rtl_433 -r g010_433.92M_1000k.cs16 -X "name=blueline,modulation=OOK_PPM,short=2000,long=4000,gap=7000,reset=350000"
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
time      : @0.134372s
model     : blueline     count     : 2             num_rows  : 2             rows      : 
len       : 32           data      : 010c99a8, 
len       : 0            data      : 
codes     : {32}010c99a8, {0}
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
time      : @0.549692s
model     : blueline     count     : 2             num_rows  : 2             rows      : 
len       : 32           data      : 01f2bcd5, 
len       : 0            data      : 
codes     : {32}01f2bcd5, {0}

@zuckschwerdt
Copy link
Collaborator

That example might get the wrong results, you do need -s 1M. Both examples look the same? Copy/paste error?

@gcormier
Copy link
Contributor Author

gcormier commented Jan 3, 2020

Sorry, I made a copy/paste error.

One was short=2000,long=4000, the other was short=4000,long=2000, but the output is the same. But it should be interpreting the bits differently (inversely), no?

@zuckschwerdt
Copy link
Collaborator

For PPM short and long will only result in a threshold (6000 here) if no tolerance value is used.

@Mindavi Mindavi added the device support Request for a new/improved device decoder label Aug 10, 2020
@jbrzozoski
Copy link
Contributor

jbrzozoski commented Dec 24, 2020

Blueline PowerCost monitor added by #1580
This issue can probably be closed

@gcormier
Copy link
Contributor Author

I'm unable to enable this filter for rtl_433:

~/rtl_433/build/src/rtl_433 -R 176

Then the output interestingly:

Registered 1 out of 176 device decoding protocols [ ]

Adding a second random protocol with -R 1:

Registered 2 out of 176 device decoding protocols [ 1 ]

@merbanan
Copy link
Owner

rtl_433 -R 176:auto should give you the key. And then rtl_433 -R 176:"key" should work.

@gcormier
Copy link
Contributor Author

gcormier commented Jan 18, 2021

I've read the PR to try and get a better understanding of what's happening.

I've run it with -R 176:auto, it picked up the first few - then I ran outside and pressed the button on the device. None of these seem to be the key?

Allocating 15 zero-copy buffers
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
time      : 2021-01-18 10:07:40
model     : Blueline PowerCost Monitor             id        : 12080
gap       : 5281         mic       : CRC
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
time      : 2021-01-18 10:08:12
model     : Blueline PowerCost Monitor             id        : 12080
impulses  : 531          mic       : CRC
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
time      : 2021-01-18 10:08:12
model     : Blueline PowerCost Monitor             id        : 12080
impulses  : 531          mic       : CRC
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
time      : 2021-01-18 10:08:12
model     : Blueline PowerCost Monitor             id        : 12080
gap       : 5489         mic       : CRC
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
time      : 2021-01-18 10:08:22
model     : Blueline PowerCost Monitor             id        : 12080
mic       : CRC
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
time      : 2021-01-18 10:08:23
model     : Blueline PowerCost Monitor             id        : 12080
mic       : CRC
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
time      : 2021-01-18 10:08:23
model     : Blueline PowerCost Monitor             id        : 12080
mic       : CRC
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
time      : 2021-01-18 10:08:23
model     : Blueline PowerCost Monitor             id        : 12080
mic       : CRC
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
time      : 2021-01-18 10:08:27
model     : Blueline PowerCost Monitor             id        : 12080
mic       : CRC
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
time      : 2021-01-18 10:08:27
model     : Blueline PowerCost Monitor             id        : 12080
mic       : CRC
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
time      : 2021-01-18 10:08:27
model     : Blueline PowerCost Monitor             id        : 12080
mic       : CRC
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
time      : 2021-01-18 10:08:27
model     : Blueline PowerCost Monitor             id        : 12080
mic       : CRC
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
time      : 2021-01-18 10:09:13
model     : Blueline PowerCost Monitor             id        : 12080
gap       : 5617         mic       : CRC
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
time      : 2021-01-18 10:09:14
model     : Blueline PowerCost Monitor             id        : 12080
gap       : 5617         mic       : CRC
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
time      : 2021-01-18 10:09:14
model     : Blueline PowerCost Monitor             id        : 12080
gap       : 5617         mic       : CRC

Unless id is the key? Also, I think the missing "gap" is the packets when I pushed the button (twice).

@gcormier
Copy link
Contributor Author

gcormier commented Jan 18, 2021

Aha, note to future people following the breadcrumps - read the comments in the source file for an exhaustive description of steps to follow and what is going on, as well as how to calculate kWh - https://github.com/merbanan/rtl_433/blob/master/src/devices/blueline.c

I'm good to go - wonderful work by everyone involved. Looks like a lot of work was needed to get past the traditional stateless decoding, hopefully paving the way for future peculiar devices :)

@gcormier
Copy link
Contributor Author

And, here it is pulled in to Home Assistant, using rtl_433 with the MQTT function.

  - platform: mqtt
    name: "Power Consumption"
    state_topic: "rtl_433/Blueline_PowerCost_Monitor/12080/gap"
    unit_of_measurement: 'kWh'
    value_template: "{{ '%.2f'%(3600 / (value | float)) | float }}"

image

@merbanan
Copy link
Owner

s/power/energy/

@zuckschwerdt
Copy link
Collaborator

pe

@bkenobi
Copy link

bkenobi commented Feb 22, 2021

Has anyone looked at the battery info? Mine is returning a value of 1 with new batteries. I'm trying to determine if this is a flag that returns 1 for "good" and 0 (or some other value) for "bad" or if it returns a remaining percentage. I'm trying to set up a notification and right now all I have to trigger on is when battery_ok doesn't equal 1.

@jbrzozoski
Copy link
Contributor

I never hooked my monitor up to a variable power supply to see how the flags or battery status changed as the voltage decreased. My implementation was purely trusting the prior work. The old implementations only looked at one single bit for the battery, so that's all I did in mine.

@bkenobi
Copy link

bkenobi commented Feb 22, 2021

It looks like the code simply outputs "1" in my case. I can review what the previous work found if you have a link. I've looked at lots of code for this device over the last few years but never considered the battery because I never had anything working reliably (until now).

@jbrzozoski
Copy link
Contributor

It looks like the code simply outputs "1" in my case. I can review what the previous work found if you have a link. I've looked at lots of code for this device over the last few years but never considered the battery because I never had anything working reliably (until now).

Some references used include:

@merbanan
Copy link
Owner

merbanan commented Mar 3, 2021

I am closing this issue now. If some one figures out the battery flag send a PR or reopen this issue.

@merbanan merbanan closed this as completed Mar 3, 2021
@gcormier
Copy link
Contributor Author

gcormier commented Aug 5, 2021

Home Assistant now has Energy tracking. Power monitoring devices not yet supported, but posting this here for reference as it may help other if/when power devices become supported.

  - platform: mqtt
    name: "Power Consumption"
    state_topic: "rtl_433/Blueline_PowerCost_Monitor/12080/gap"
    unit_of_measurement: 'kW'
    value_template: "{{ '%.2f'%(3600 / (value | float)) | float }}"
    device_class: power
    state_class: measurement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
device support Request for a new/improved device decoder
Projects
None yet
Development

No branches or pull requests

6 participants