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

Added ELEC5 paket type #48

Merged
merged 14 commits into from Feb 11, 2017

Conversation

Projects
None yet
2 participants
@diplix

diplix commented Feb 9, 2017

regarding: #47

unfortunatly the addidion doesn’t work, though i think it should. can’t find the error, but i get this in the home assistant logs:

Exception in thread Thread-3:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/threading.py", line 914, in _bootstrap_inner
    self.run()
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/threading.py", line 862, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/ix/.homeassistant/deps/RFXtrx/__init__.py", line 690, in _connect
    event = self.transport.receive_blocking()
  File "/Users/ix/.homeassistant/deps/RFXtrx/__init__.py", line 603, in receive_blocking
    return self.parse(pkt)
  File "/Users/ix/.homeassistant/deps/RFXtrx/__init__.py", line 547, in parse
    obj = SensorEvent(pkt)
  File "/Users/ix/.homeassistant/deps/RFXtrx/__init__.py", line 415, in __init__
    self.values['Battery numeric'] = pkt.battery
  File "/Users/ix/.homeassistant/deps/RFXtrx/lowlevel.py", line 134, in __getattr__
    raise AttributeError(name)
AttributeError: battery

also added this in __init__.py' row 410:

        if isinstance(pkt, lowlevel.Energy5):
            self.values['Energy usage'] = pkt.currentwatt
            self.values['Total usage'] = pkt.totalwatthours

diplix added some commits Feb 9, 2017

added ELEC5 paket type
regarding: #47

unfortunatly the addidion doesn’t work, though i think it should. can’t find the error, but i get this in the home assistant logs:

``` 
  File "/Users/ix/.homeassistant/deps/RFXtrx/__init__.py", line 693, in _connect
  File "/Users/ix/.homeassistant/deps/RFXtrx/__init__.py", line 606, in receive_blocking
  File "/Users/ix/.homeassistant/deps/RFXtrx/__init__.py", line 550, in parse
  File "/Users/ix/.homeassistant/deps/RFXtrx/__init__.py", line 418, in __init__
  File "/Users/ix/.homeassistant/deps/RFXtrx/lowlevel.py", line 134, in __getattr__
 ```
also added this in __init__.py row 410:
```
        if isinstance(pkt, lowlevel.Energy5):
            self.values['Energy usage'] = pkt.currentwatt
            self.values['Total usage'] = pkt.totalwatthours
```
added battery
with that he battery attribute i got rid of the errors and it basically works now.
@diplix

This comment has been minimized.

Show comment
Hide comment
@diplix

diplix Feb 9, 2017

ok. that seems to work now. total usage in in watt meters, energy usage in watt, current in ampere.

bildschirmfoto 2017-02-09 um 21 54 56

diplix commented Feb 9, 2017

ok. that seems to work now. total usage in in watt meters, energy usage in watt, current in ampere.

bildschirmfoto 2017-02-09 um 21 54 56

@diplix

This comment has been minimized.

Show comment
Hide comment
@diplix

diplix Feb 10, 2017

i guess i need some help with the tests. otherwise ELEC5 is working fine.

diplix commented Feb 10, 2017

i guess i need some help with the tests. otherwise ELEC5 is working fine.

@Danielhiversen

This comment has been minimized.

Show comment
Hide comment
@Danielhiversen

Danielhiversen Feb 10, 2017

Owner

Thanks.
Great work.

For the test, the code is calculating the voltage to be 189, but you have specified that it should be 185.
https://travis-ci.org/Danielhiversen/pyRFXtrx/jobs/200255825#L247
So you have either specified a wrong value in the test or there is something wrong in the calculations.
Is it possible to capture a packet and read the correct values from an external display?

Owner

Danielhiversen commented Feb 10, 2017

Thanks.
Great work.

For the test, the code is calculating the voltage to be 189, but you have specified that it should be 185.
https://travis-ci.org/Danielhiversen/pyRFXtrx/jobs/200255825#L247
So you have either specified a wrong value in the test or there is something wrong in the calculations.
Is it possible to capture a packet and read the correct values from an external display?

@diplix

This comment has been minimized.

Show comment
Hide comment
@diplix

diplix Feb 10, 2017

i think i’m going to change the value. actual readings are a little difficult, because the device is busily sending data every 3-5 seconds. i saw that the rfxtrx-pyRFXtrx-HA-chain is always laging a little behind the actual packets, so matching the raw output and the displayed values is just as much guesswork.

diplix commented Feb 10, 2017

i think i’m going to change the value. actual readings are a little difficult, because the device is busily sending data every 3-5 seconds. i saw that the rfxtrx-pyRFXtrx-HA-chain is always laging a little behind the actual packets, so matching the raw output and the displayed values is just as much guesswork.

@diplix diplix changed the title from [WIP] added ELEC5 paket type to Added ELEC5 paket type Feb 10, 2017

@diplix

This comment has been minimized.

Show comment
Hide comment
@diplix

diplix Feb 10, 2017

:(
test failed again. i’ll try matching packets and readings later.

diplix commented Feb 10, 2017

:(
test failed again. i’ll try matching packets and readings later.

diplix added some commits Feb 10, 2017

@diplix

This comment has been minimized.

Show comment
Hide comment
@diplix

diplix Feb 10, 2017

ok. tests are passing now, what i still need to do: check if all data actually gets converted to the right values and possibly get a real packet to use for testing.

diplix commented Feb 10, 2017

ok. tests are passing now, what i still need to do: check if all data actually gets converted to the right values and possibly get a real packet to use for testing.

@diplix

This comment has been minimized.

Show comment
Hide comment
@diplix

diplix Feb 11, 2017

@Danielhiversen i’m done.
the values add up, for a while i thought the current value in ampere was too high, but energy5 returns exactly the same values as the RFXmngr app.
can’t figure out what to do about the failed coverall test.

diplix commented Feb 11, 2017

@Danielhiversen i’m done.
the values add up, for a while i thought the current value in ampere was too high, but energy5 returns exactly the same values as the RFXmngr app.
can’t figure out what to do about the failed coverall test.

@Danielhiversen

This comment has been minimized.

Show comment
Hide comment
@Danielhiversen

Danielhiversen Feb 11, 2017

Owner

Great. Good job.
I will update Home Assistant, so your code will soon be part of the official release.

Owner

Danielhiversen commented Feb 11, 2017

Great. Good job.
I will update Home Assistant, so your code will soon be part of the official release.

@Danielhiversen Danielhiversen merged commit e25ed00 into Danielhiversen:master Feb 11, 2017

1 of 2 checks passed

coverage/coveralls Coverage decreased (-0.2%) to 92.521%
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@diplix diplix deleted the diplix:patch-1 branch Feb 11, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment