No, didn’t checked out the local MQTT API for Tibber Pulse. I need to restart the Tibber Integration hourly (done by an HomeAssistant automation), cause it stops receiving data after some time, with that workaround it works really well (restarting Tibber Integration takes 2-3 seconds so nearly no data missing).
Maybe not Powerfox but Home Assistant “rest sensor” related, but it affects the powerfox rest sensor.
I try to describe what I experience and maybe someone can help me.
In my config I created a rest sensor.
It uses the resources as many times discussed: https://backend.powerfox.energy/api/2/my/main/current?unit=kwh
Entering this into the browser I get a perfect answer:
{“outdated”:false,“watt”:308,“timestamp”:1695358507,“a_Plus”:14922.5,“a_Minus”:101.407}
every time I type it or press refresh.
What I don’t understand is the fact, that the home assistant rest integration shows as “unavailable”.
How come?
Powerfox Stromzähler
Your yaml does not look correct for the json_attributes. The - must not be a string, but it must indicate the start of a new item in a list of attributes.
You may also check that the URL is correct, usually it contains your Poweropti ID when you are registered. Here is what I use for my powerfox Rest sensor. In my example I load this also through !secret as well
I also played around using availability and value of the Rest sensor to better indicate whether available or not. But at the end this is difficult with Rest. When you validate for json response and mark this for sensor availability, you don’t see what was actually returned (could be not reachable, access permission problems etc. If you do not specify a value template, you will always get the Rest response as value. So if you want to validate that the sensor is still providing valid data, you need to check if any of the specified attributes has a value.
Thank you for your comments.
I am using my id for the powerfox device and as you indicated the -
“minus” instead of a string “-” (I guess that was part of the code snip??)
However the data getting from the internet api is very patchy.
Let’s see if HA comes up with a working integration for powerfox at some point.
Cheers
Dietger
Don’t hope for that. Any integration will be Rest based for the cloud, and that won’t be faster or more reliable than the REST integration will be.
Because of this slow and unreliable cloud API, an NO response from Powerfox Support for repeated complaints that their .38 firmware broke the stable local RPC interface usage, I had to get rid of the poweropti for my Solar Battery automation. Its really not usable with the cloud API for automations.
Fortunately, I have a second smart meter device for my heat pump which I integrated with a Hitchi Smart Reader DYI device which you can get from ebay / amazon. Even the assembled custom build readers cost just 1/3 of the poweropti and work much better with local HA integration via Tasmota firmware and MQTT broker. I set my Hitchi MQTT data delivery to 3 seconds, and can probably go down to even 1 second reliably, but 3s is good enough for my automation.
So I simply switched the poweropti and and Hitchi readers to have a reliable solar battery automation again. The values for the heat pump are not that important to me and I can live with 30s updates or dropped values due to API instabilities.
So I was lucky to find another solution for my case, but its a shame that Powerfox support did not answer at all to my problem mails. So I wonder why I had to pay 90€ for getting a product and support that does not exist when needed. But even if they would respond, I have the impression that powerfox does not longer want to allow any local APIs and force customers through the cloud, since that will also be part of their fee services after 3 years which I definitely not need and won’t register for. If the will enforce cloud API with yearly fees, I will completely get rid of this product and replace it with another Hitchi Smart reader that better fits my needs at 3rd of the costs.
Meanwhile I got response from Powerfox support. The RPC interface never was an official function and therefore they did not take away any functionality as they claim it. Acccording to support, Powerfox is aware of the interest and need for a local API and they are thinking to provide something in the future…
Haha…an expected response and it sounds to me as it will take month to years until Poweropti users get an ‘official’ way to grab the data locally and in real time.
That being said, I don’t see the Poweropti device actually as a suitable/stable device for usage in real time power measurement and automation scenarios. Any DIY smart meter reader with Tasmota/MQTT integration will do a much better job with stable real time data at much less cost.
As for a Home Assistant integration, I have previously offered to create one (which at least works with the cloud API). Just because I don’t own anything from Powerfox, I depend on others to test code remotely.
FYI; I’ve just published a first draft of a pypi package that works with Powerfox’s cloud API. For those who are familiar with Python, I would say try it out. My next step is to create the integration and I could use some help with testing.
I haven’t been able to work on it lately and hope to be able to continue soon. There are no plans to put a draft in HACS, it will immediately become a core integration.
I also tried to get a JSON response of the heat meters, unfortunately even Powerfox via X was not helpful in giving me an example (except a confirmation of the poweropti+)
I’m still looking for someone who can give me temporary access to the API, so that I can get started with a core integration and test as much as possible.
@klaasnicolaas I can help you with the API access. I’m also interested in a core integration of the powerfox and am using one for several months now. I currently have it integrated via simple REST calls as others did too. Feel free to contact me here or on Discord.