Skip to content

Commit 8346c43

Browse files
Merge pull request #4667 from springfall2008/feat/myenergi-component
feat(myenergi): Zappi and Eddi monitoring, auto-config and boost controls
2 parents f7d8036 + db03a61 commit 8346c43

37 files changed

Lines changed: 5980 additions & 1 deletion

‎.cspell/custom-dictionary-workspace.txt‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ argname
2727
armhf
2828
armv
2929
ASHP
30+
asn
3031
asyncio
3132
atfork
3233
atleast
@@ -53,6 +54,7 @@ batteryb
5354
batusecap
5455
beforeunload
5556
bierner
57+
boostable
5658
brickatius
5759
byok
5860
cadata
@@ -235,6 +237,7 @@ hanchu
235237
hanchuess
236238
hanres
237239
HAOS
240+
harvi
238241
hasattr
239242
hass
240243
hassapi
@@ -272,7 +275,9 @@ isort
272275
itemsize
273276
itemtype
274277
ivtime
278+
jdayhour
275279
jedlix
280+
jstatus
276281
jsyaml
277282
kaiming
278283
keepalive
@@ -291,6 +296,7 @@ kwhb
291296
labelcolor
292297
labelnames
293298
larr
299+
libbi
294300
libc
295301
LIFEPO
296302
linebreak
@@ -352,6 +358,7 @@ mpxn
352358
mqtt
353359
mtok
354360
mult
361+
myaccount
355362
myenergi
356363
mypy
357364
nanmean
@@ -441,6 +448,7 @@ pvwatts
441448
pwindow
442449
pyjwt
443450
pylint
451+
pymyenergi
444452
pypi
445453
pyproject
446454
pytest
@@ -454,6 +462,7 @@ readbacks
454462
recp
455463
redownload
456464
Referer
465+
refetched
457466
refetches
458467
regionid
459468
regname
@@ -589,6 +598,7 @@ typecode
589598
typecodes
590599
tzfile
591600
tzpath
601+
unasserted
592602
unconfigured
593603
underivable
594604
undiscounted
@@ -636,4 +646,5 @@ ylabel
636646
YOURSERIAL
637647
yuanzhi
638648
zappi
649+
Zappis
639650
zigbee

‎apps/predbat/components.py‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from solcast import SolarAPI
2323
from gecloud import GECloudDirect, GECloudData
2424
from ohme import OhmeAPI
25+
from myenergi import MyEnergiAPI
2526
from octopus import OctopusAPI
2627
from carbon import CarbonAPI
2728
from temperature import TemperatureAPI
@@ -219,6 +220,33 @@
219220
},
220221
"phase": 1,
221222
},
223+
"myenergi": {
224+
"class": MyEnergiAPI,
225+
"name": "myenergi Zappi/Eddi",
226+
"event_filter": "predbat_myenergi_",
227+
"args": {
228+
"auth_method": {"required": False, "config": "myenergi_auth_method", "default": "direct"},
229+
"hub_serial": {"required": False, "config": "myenergi_hub_serial"},
230+
"api_key": {"required": False, "config": "myenergi_api_key"},
231+
"key": {"required": False, "config": "myenergi_key"},
232+
"token_expires_at": {"required": False, "config": "myenergi_token_expires_at"},
233+
"token_hash": {"required": False, "config": "myenergi_token_hash"},
234+
"automatic": {"required": False, "config": "myenergi_automatic", "default": True},
235+
"enable_controls": {"required": False, "config": "myenergi_enable_controls", "default": True},
236+
"poll_seconds": {"required": False, "config": "myenergi_poll_seconds", "default": 60},
237+
},
238+
# Gate activation on having at least one auth path — api_key is the direct
239+
# transport's local hub credential, key is the cloud transport's access token.
240+
# Without this the component would start for every instance since all
241+
# individual args are optional to allow either auth mode.
242+
# api_key is the direct transport's credential; key (the OAuth access token) and
243+
# token_hash (which the refresh chain exchanges for one) are the cloud transport's.
244+
# token_hash has to be listed too: a refresh-only OAuth setup carries no key, and
245+
# initialize() accepts that, so gating on key alone would never construct it.
246+
"required_or": ["api_key", "key", "token_hash"],
247+
"phase": 1,
248+
"can_restart": True,
249+
},
222250
"fox": {
223251
"class": FoxAPI,
224252
"name": "Fox API",

‎apps/predbat/config.py‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2581,6 +2581,15 @@
25812581
"solis_access_token": {"type": "string", "empty": False},
25822582
"solis_token_expires_at": {"type": "string", "empty": False},
25832583
"solis_token_hash": {"type": "string", "empty": False},
2584+
"myenergi_auth_method": {"type": "string", "empty": False},
2585+
"myenergi_hub_serial": {"type": "string", "empty": False},
2586+
"myenergi_api_key": {"type": "string", "empty": False},
2587+
"myenergi_key": {"type": "string", "empty": False},
2588+
"myenergi_token_expires_at": {"type": "string", "empty": False},
2589+
"myenergi_token_hash": {"type": "string", "empty": False},
2590+
"myenergi_automatic": {"type": "boolean"},
2591+
"myenergi_enable_controls": {"type": "boolean"},
2592+
"myenergi_poll_seconds": {"type": "integer", "zero": False},
25842593
"fox_key": {"type": "string", "empty": False},
25852594
"fox_automatic": {"type": "boolean"},
25862595
"fox_automatic_ignore_pv": {"type": "boolean"},

0 commit comments

Comments
 (0)