Hab mir kürzlich eine Ausleseeinheit von Powerfox für meinen Stromzähler angeschafft und ihn (teilweise) erfolgreich installiert.
Teilsweise? Ja, weil das Auslesen der Daten über die anbietereigene App tadellos funktioniert, aber nicht das Auslesen durch FHEM - ich herhalte keine Readings.
Schaue ich in das Logfile so finde ich Folgendes:
2021.04.15 13:04:22.318 5: powerfox: Read callback: body empty
2021.04.15 13:04:22.319 4: powerfox: BodyDecode is not decoding the response body (charset not found, bodyDecode defaults to none)
2021.04.15 13:04:22.319 5: powerfox: GetCookies is looking for Cookies
2021.04.15 13:04:22.320 5: powerfox: ExtractSid called, context reading, num 0
2021.04.15 13:04:22.321 4: powerfox: checking for redirects, code=400, ignore=0
2021.04.15 13:04:22.322 4: powerfox: no redirects to handle
2021.04.15 13:04:22.323 5: powerfox: Read callback sets LAST_REQUEST to update
2021.04.15 13:04:22.323 5: powerfox: CheckAuth decided no authentication required
2021.04.15 13:04:22.324 5: powerfox: Read starts parsing response to update with defined readings: 01,02,03
2021.04.15 13:04:22.325 5: powerfox: ExtractReading power with json Watt ...
2021.04.15 13:04:22.325 5: powerfox: ExtractReading power did not match
2021.04.15 13:04:22.326 5: powerfox: ExtractReading total_consumption with json A_Plus ...
2021.04.15 13:04:22.327 5: powerfox: ExtractReading total_consumption did not match
2021.04.15 13:04:22.328 5: powerfox: ExtractReading total_feed with json A_Minus ...
2021.04.15 13:04:22.328 5: powerfox: ExtractReading total_feed did not match
2021.04.15 13:04:22.329 4: powerfox: Read response to update didn't match any Reading
2021.04.15 13:04:22.330 5: powerfox: HandleSendQueue called from ReadCallback, qlen = 0
2021.04.15 13:04:22.331 5: powerfox: HandleSendQueue found no usable entry in queue
Zum System selbst gibt es bekanntermaßen ein Wiki
https://wiki.fhem.de/wiki/Poweropti
wonach ich das Device auch eingerichtet habe.
Internals:
BUSY 0
CFGFN
DEF https://nxxxxxt%40rxxxxxr.com:uxxx#xxx9@backend.powerfox.energy/api/2.0/my/1EBZxxxxxxxxx4/current 10
FUUID 6077fe25-f33f-aab4-b615-c1ae47baa9c89b0e
Interval 60
MainURL https://nxxxxxt%40rxxxxxr.com:uxxx#xxx9@backend.powerfox.energy/api/2.0/my/1EBZxxxxxxxxx4/current
ModuleVersion 4.1.06 - 20.3.2021
NAME powerfox
NOTIFYDEV global
NR 6809
NTFY_ORDER 50-powerfox
STATE ???
TYPE HTTPMOD
value
HttpUtils:
NAME
addr https://backend.powerfox.energy:443
auth 1
buf
code 400
compress 1
conn
data
displayurl https://nxxxxxt%40rxxxxxr.com:uxxx#xxx9@backend.powerfox.energy/api/2.0/my/1EBZxxxxxxxxx4/current
header
host backend.powerfox.energy
httpheader HTTP/1.1 400 Bad Request
Cache-Control: no-cache
Pragma: no-cache
Expires: -1
Server: Microsoft-IIS/10.0
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, PUT, PATCH, DELETE, OPTIONS
Access-Control-Allow-Headers: *
RateLimit-Limit: 20
RateLimit-Remaining: 19
X-AspNet-Version: 4.0.30319
Request-Context: appId=cid-v1:9d7e501f-422d-4624-a8b7-5b542e8cb16f
Access-Control-Expose-Headers: Request-Context
X-Powered-By: ASP.NET
Date: Thu, 15 Apr 2021 11:34:22 GMT
Connection: close
Content-Length: 0
httpversion 1.0
hu_blocking 0
hu_filecount 1
hu_port 443
hu_portSfx
ignoreredirects 1
loglevel 4
path /api/2.0/my/1EBZxxxxxxxxx4/current
protocol https
pwd urON#9459
redirects 0
timeout 2
url https://nxxxxxt%40rxxxxxr.com:uxxx#xxx9@backend.powerfox.energy/api/2.0/my/1EBZxxxxxxxxx4/current
user nxxxxxt@rxxxxxxxr.com
sslargs:
QUEUE:
READINGS:
REQUEST:
context reading
data
header
ignoreredirects 0
num 0
retryCount 0
type update
url https://nxxxxxt%40rxxxxxr.com:uxxx#xxx9@backend.powerfox.energy/api/2.0/my/1EBZxxxxxxxxx4/current
Attributes:
reading01JSON Watt
reading01Name power
reading02JSON A_Plus
reading02Name total_consumption
reading03JSON A_Minus
reading03Name total_feed
room PV-Anlage
verbose 5
Nun steht im Wiki das Define
define powerfox HTTPMOD https://<user>%40<domain>:<password>@backend.powerfox.energy/api/2.0/my/<zählerid>/current <interval>
was offenbar mit meinen Angaben nicht klappt.
Vermutungen:
- die im Wiki beschriebene 12-stellige Zähler-ID im HEX-Format ist am Zähler nicht auffindbar. Alternativ habe ich meine Zählernummer eingegeben, die ist aber 14-stellig. Auch eine Verkürzung durch das Eliminieren der ersten 2 Stellen schlägt fehl. Hat jemand eine Idee, was dort anzugeben ist?
- mein Passwort bei Powerfox beinhaltet ein Sonderzeichen, kann das in der URL verwendet werden?
Wer kann mir helfen?
Hi,
ich kann Dir nicht viel helfen aber
Frage 2: Ja aber muss urL encoded werden :)
https://de.wikipedia.org/wiki/URL-Encoding
Gruß Otto
Danke, das war ja schon mal ein wichtiger Hinweis, den ich umgesetzt habe.
Leider hat sich der letztendliche Erfolg noch nicht eingestellt, womit ich dann bei der Frage 1 mit der Zähler-ID bin!
im Wiki steht dazu: oder alternativ über API oder die Einstellungen erfahrbar.
Klingt mir danach als ob Du in Deiner App suchen kannst? Du sagst ja die geht.
Ja, ich war gerade am Schreiben:
Hab es am Ende doch noch selbst mit der Zähler-ID gefunden. Man findet die HEX-Angabe ich der Powerfox-App in den Einstellungen unter "Registrierte Geräte" (Zähler)
Danke nochmals für die Hilfestellung!
Interessanterweise konnte der Netzanbieter - Eigner des Zählers - keine HEX-Angabe liefern!. Vielleicht wird sie ja auch nur von Powerfox generiert!
Hallo Thomas,
ich kann Dir nur im äußeren Rahmen helfen: Unten am Device gibt es den Punkt Copy for Forum ... - falls Dein FHEM halbwegs aktuell ist. Nimm das bitte zum posten von deinem Device Inhalt. Das was Du hier zeigst ist nicht zu lesen, gelbe Schrift auf Hellgrünen Untergrund beißt in den Augen :)
Vermutung: Dein Account / Device ID hat sich geändert mit dem neuen Zähler?
Steht denn was im Log wenn Du verbose am Device mal hochschraubst?
Gruß Otto
Zitat von: Otto123 am 20 Januar 2023, 09:22:40
Hallo Thomas,
ich kann Dir nur im äußeren Rahmen helfen: Unten am Device gibt es den Punkt Copy for Forum ... - falls Dein FHEM halbwegs aktuell ist. Nimm das bitte zum posten von deinem Device Inhalt. Das was Du hier zeigst ist nicht zu lesen, gelbe Schrift auf Hellgrünen Untergrund beißt in den Augen :)
Vermutung: Dein Account / Device ID hat sich geändert mit dem neuen Zähler?
Steht denn was im Log wenn Du verbose am Device mal hochschraubst?
Gruß Otto
hallo Otto, ich hatte das aus einem anderen Thread herüberkopiert und hole das mal nach:
[code]define powerfox HTTPMOD https://xxxxxxxgmx.net:xxxxxxxx@backend.powerfox.energy/api/2.0/my/246f283cfeac/current 60
attr powerfox reading01JSON Watt
attr powerfox reading01Name power
attr powerfox reading02JSON A_Plus
attr powerfox reading02Name total_consumption
attr powerfox reading03JSON A_Minus
attr powerfox reading03Name total_feed
attr powerfox room POWERFOX
# BUSY 0
# DEF https://cccccccccccccccccccccccccccccc@backend.powerfox.energy/api/2.0/my/246f283cfeac/current 60
# FUUID 609b7760-f33f-21fb-6367-38b393d5114b8cd4
# Interval 60
# MainURL https://cccccccccgmx.net:xxxxxxxxx@backend.powerfox.energy/api/2.0/my/246f283cfeac/current
# ModuleVersion 4.1.15 - 17.12.2022
# NAME powerfox
# NOTIFYDEV global
# NR 378
# NTFY_ORDER 50-powerfox
# STATE ???
# TYPE HTTPMOD
# eventCount 598
# value
# Helper:
# DBLOG:
# power:
# dblog_THB:
# TIME 1674204356.79815
# VALUE 326
# total_consumption:
# dblog_THB:
# TIME 1674204356.79815
# VALUE 1639712
# total_feed:
# dblog_THB:
# TIME 1674204356.79815
# VALUE 138
# HttpUtils:
# NAME
# addr https://backend.powerfox.energy:443
# auth 1
# code 200
# compress 1
# conn
# data
# displayurl https://xxxgmx.net:xxxxxx@backend.powerfox.energy/api/2.0/my/246f283cfeac/current
# header
# host backend.powerfox.energy
# httpheader HTTP/1.1 200 OK
#Cache-Control: public,max-age=3
#Content-Type: application/json; charset=utf-8
#Request-Context: appId=cid-v1:0300e8e5-ecf7-4748-9744-e0e6e396c38c
#X-Rate-Limit-Limit: 3s
#X-Rate-Limit-Remaining: 0
#X-Rate-Limit-Reset: 2023-01-20T08:45:59.5106971Z
#X-Cache: CONFIG_NOCACHE
#X-Azure-Ref: 0xFTKYwAAAAAvAOdqHC1qT6DQk1FtSECMRlJBMzFFREdFMDMxNwAwY2M2OWMxNC0yMzg3LTQ4MTktOGJlNi1jM2U2MWY2MzhjOWQ=
#Date: Fri, 20 Jan 2023 08:45:56 GMT
#Connection: close
# httpversion 1.0
# hu_blocking 0
# hu_filecount 1
# hu_port 443
# hu_portSfx
# ignoreredirects 1
# loglevel 4
# path /api/2.0/my/246f283cfeac/current
# protocol https
# pwd thbbkt25
# redirects 0
# timeout 2
# url https://gmx.net:txxxxxxxxxx@backend.powerfox.energy/api/2.0/my/246f283cfeac/current
# user bkt@gmx.net
# sslargs:
# QUEUE:
# READINGS:
# 2023-01-20 09:45:56 power 326
# 2023-01-20 09:45:56 total_consumption 1639712
# 2023-01-20 09:45:56 total_feed 138
# REQUEST:
# context reading
# data
# header
# ignoreredirects 0
# num unknown
# retryCount 0
# type update
# url https://xxxxxxxx.net:txxxxxxx@backend.powerfox.energy/api/2.0/my/246f283cfeac/current
# defptr:
# readingBase:
# power reading
# total_consumption reading
# total_feed reading
# readingNum:
# power 01
# total_consumption 02
# total_feed 03
# readingOutdated:
# requestReadings:
# update:
# power reading 01
# total_consumption reading 02
# total_feed reading 03
#
setstate powerfox 2023-01-20 09:45:56 power 326
setstate powerfox 2023-01-20 09:45:56 total_consumption 1639712
setstate powerfox 2023-01-20 09:45:56 total_feed 138
[/code]
die aktuellen Verbrauchswerte kommen richtig rüber
danke, Otto