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

Wrong current month peaks indexing #632

Closed
longer83 opened this issue Sep 10, 2023 · 2 comments
Closed

Wrong current month peaks indexing #632

longer83 opened this issue Sep 10, 2023 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@longer83
Copy link

longer83 commented Sep 10, 2023

Describe the bug:

Wrong current month peaks indexing. Current month peaks show incorrect values, peak 3 always "unknown".

Screenshots:

Screenshot_2023-08-13-14-13-08-07_c3a231c25ed346e59462e84656a70e50

Screenshot_2023-08-13-14-13-29-48_40deb401b9ffe8e1df2f1cc5ba480b12

Hardware information:

  • Country: Norway
  • Meter: Kamstrup Omnipower (DK-8660)
  • Encryption enabled: no
  • AMS reader: Pow-K+

Relevant firmware information:

  • Version: 2.2.21
  • MQTT: yes
  • MQTT payload type: HomeAssistant
  • HAN baud and parity: 2400 8N1
  • ENTSO-E API enabled: yes

Additional context:

Debug log:

name: Current month peak 3
state_topic: amsleser/realtime
unique_id: ams-xxxx_peaks3
object_id: ams-xxxx_peaks3
unit_of_measurement: kWh
value_template: '{{ value_json.peaks[3] | is_defined }}'
device:
  identifiers:
    - ams-xxxx
  name: AMS reader
  model: Pow-K+
  sw_version: v2.2.21
  manufacturer: amsleser.no
  configuration_url: http://ams-xxxx.local/
device_class: energy
platform: mqtt
Received 15:43:32
QoS: 0
Payload: max: 3
peaks:
  - 3.57
  - 2.45
  - 3.06
threshold: 5
hour:
  use: 1.38
  cost: 0
  produced: 0
  income: 0
day:
  use: 21.9
  cost: 0
  produced: 0
  income: 0
month:
  use: 63.5
  cost: 0
  produced: 0
  income: 

Looks like the indexing is incorrect and peaks should have following indexes:

value_json.peaks[0]
value_json.peaks[1]
value_json.peaks[2]

not

value_json.peaks[1]
value_json.peaks[2]
value_json.peaks[3]

Issue has been also raised up on amshan-homeassistant GitHub: #65.

@gskjold gskjold self-assigned this Sep 11, 2023
@gskjold gskjold added the bug Something isn't working label Sep 11, 2023
@gskjold gskjold added this to the v2.2.22 milestone Sep 11, 2023
@gskjold
Copy link
Member

gskjold commented Sep 11, 2023

Nice catch, thanks!

@gskjold gskjold closed this as completed Sep 21, 2023
@gskjold
Copy link
Member

gskjold commented Sep 21, 2023

Final testing of this feature in issue #641

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants