senec 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7cc66f87a694b567a5d255e80aeca2ce5bd6bc31bbdce717f991c0f4a4bb6cae
4
- data.tar.gz: 6c2def742896e62ee42d475983b4285ecb3e7a0a0315d6fc5317f959831d4401
3
+ metadata.gz: 16c3c9c4abc76f4aefff00ebf5d5bec743f32f6a974c82ad28687067177f38b9
4
+ data.tar.gz: e1688029cc73db36e58212956fb483697036159e45fd5e76082efe85d42c444f
5
5
  SHA512:
6
- metadata.gz: c1006a948b5e0932fd9c1e675dbaec90f11e5c6a54b5899c239db0854f7e8623c03030dff72f4162acd716e60ae256526ceea2e883bf7b8f3ac8220ad93fb049
7
- data.tar.gz: 3004661d438142e41e30c758d41e9f0b7ecf3e2f74f5533387689c215aa92e11346806651f413c7b76cb686a575a8f0188f9e03829c38ae1ca36496f074f20f0
6
+ metadata.gz: c25862ac9c3ff78553ac5b651335c2ad653bbbc1746aa0164cdac8e67e65984104e0b453069cd4222f1a1bb188ffc1115cf41d7e1e21628dbd70aee7735cfb72
7
+ data.tar.gz: 9b0a3e4a5586ccdec41978614364951a3f616287dd8ed029ca66b707987656a45930d7688029cd1e705e9fd51833a4ec62bd9dea432c77bf26118e0676eecaec
@@ -14,7 +14,7 @@ jobs:
14
14
  uses: ruby/setup-ruby@v1
15
15
  with:
16
16
  bundler-cache: true
17
- ruby-version: '3.0'
17
+ ruby-version: '3.1'
18
18
 
19
19
  - name: Lint with RuboCop
20
20
  run: bundle exec rubocop
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2020 Georg Ledermann
3
+ Copyright (c) 2020,2022 Georg Ledermann
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -31,6 +31,8 @@ puts "Battery fuel charge: #{request.bat_fuel_charge} %"
31
31
  puts "Battery charge current: #{request.bat_charge_current} A"
32
32
  puts "Battery voltage: #{request.bat_voltage} V"
33
33
  puts "\n"
34
+ puts "Case temperature: #{request.case_temp} °C"
35
+ puts "\n"
34
36
  puts "Wallbox charge power: [ #{request.wallbox_charge_power.join(',')} ] W"
35
37
  puts "\n"
36
38
  puts "Grid power: #{request.grid_power} W"
@@ -47,6 +49,8 @@ puts "Measure time: #{Time.at request.measure_time}"
47
49
  # Battery charge current: 19.8 A
48
50
  # Battery voltage: 49.2 V
49
51
  #
52
+ # Case temperature: 31.3 °C
53
+ #
50
54
  # Wallbox charge power: [ 8680, 0, 0, 0 ] W
51
55
  #
52
56
  # Grid power: 315 W
@@ -95,16 +95,11 @@ module Senec # rubocop:disable Metrics/ModuleLength
95
95
  91 => 'EARTH FAULT'
96
96
  }.freeze
97
97
 
98
- # Taken from https://gist.github.com/smashnet/82ad0b9d7f0ba2e5098e6649ba08f88a
98
+ # For a full list of available vars, see http://[IP-of-your-SENEC]/vars.html
99
+ # Comments taken from https://gist.github.com/smashnet/82ad0b9d7f0ba2e5098e6649ba08f88a
99
100
  BASIC_REQUEST = {
100
101
  STATISTIC: {
101
102
  CURRENT_STATE: '', # Current state of the system (int, see SYSTEM_STATE_NAME)
102
- LIVE_BAT_CHARGE_MASTER: '', # Battery charge amount since installation (kWh)
103
- LIVE_BAT_DISCHARGE_MASTER: '', # Battery discharge amount since installation (kWh)
104
- LIVE_GRID_EXPORT: '', # Grid export amount since installation (kWh)
105
- LIVE_GRID_IMPORT: '', # Grid import amount since installation (kWh)
106
- LIVE_HOUSE_CONS: '', # House consumption since installation (kWh)
107
- LIVE_PV_GEN: '', # PV generated power since installation (kWh)
108
103
  MEASURE_TIME: '' # Unix timestamp for above values (ms)
109
104
  },
110
105
  ENERGY: {
@@ -117,14 +112,8 @@ module Senec # rubocop:disable Metrics/ModuleLength
117
112
  GUI_INVERTER_POWER: '', # PV production (W)
118
113
  STAT_HOURS_OF_OPERATION: '' # Appliance hours of operation
119
114
  },
120
- BMS: {
121
- CHARGED_ENERGY: '', # List: Charged energy per battery
122
- DISCHARGED_ENERGY: '', # List: Discharged energy per battery
123
- CYCLES: '' # List: Cycles per battery
124
- },
125
- PV1: {
126
- POWER_RATIO: '', # Grid export limit (percent)
127
- P_TOTAL: '' # ?
115
+ TEMPMEASURE: {
116
+ CASE_TEMP: ''
128
117
  },
129
118
  WALLBOX: {
130
119
  APPARENT_CHARGING_POWER: ''
data/lib/senec/request.rb CHANGED
@@ -50,6 +50,11 @@ module Senec
50
50
  end
51
51
  end
52
52
 
53
+ def case_temp
54
+ value = response.dig('TEMPMEASURE', 'CASE_TEMP')
55
+ Senec::Value.new(value).to_f
56
+ end
57
+
53
58
  def current_state
54
59
  value = response.dig('STATISTIC', 'CURRENT_STATE')
55
60
  state = Senec::Value.new(value).to_i
data/lib/senec/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Senec
2
- VERSION = '0.4.0'.freeze
2
+ VERSION = '0.5.0'.freeze
3
3
  end
data/senec.gemspec CHANGED
@@ -15,6 +15,7 @@ Gem::Specification.new do |spec|
15
15
  spec.metadata['homepage_uri'] = spec.homepage
16
16
  spec.metadata['source_code_uri'] = 'https://github.com/solectrus/senec'
17
17
  spec.metadata['changelog_uri'] = 'https://github.com/solectrus/senec/releases'
18
+ spec.metadata['rubygems_mfa_required'] = 'true'
18
19
 
19
20
  # Specify which files should be added to the gem when it is released.
20
21
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: senec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Georg Ledermann
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-10-06 00:00:00.000000000 Z
11
+ date: 2022-03-09 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Access your local SENEC Solar Battery Storage System
14
14
  email:
@@ -41,6 +41,7 @@ metadata:
41
41
  homepage_uri: https://github.com/solectrus/senec
42
42
  source_code_uri: https://github.com/solectrus/senec
43
43
  changelog_uri: https://github.com/solectrus/senec/releases
44
+ rubygems_mfa_required: 'true'
44
45
  post_install_message:
45
46
  rdoc_options: []
46
47
  require_paths:
@@ -56,7 +57,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
56
57
  - !ruby/object:Gem::Version
57
58
  version: '0'
58
59
  requirements: []
59
- rubygems_version: 3.2.28
60
+ rubygems_version: 3.3.8
60
61
  signing_key:
61
62
  specification_version: 4
62
63
  summary: Unofficial Ruby Client for SENEC Home