Giter Site home page Giter Site logo

Comments (3)

Octofinger avatar Octofinger commented on August 17, 2024 1

OMG, now the problem is gone. I haven't done anything. No restarts, no config changes, no nothing... I seriously have no friggin idea what happened. The log errors are gone and the optimization and data publisher runs without issues.

I'll close this. If anything like this happens again, I'll try to set up a dev environment with a clone of this repo to try to get more details before posting anything.

Thanks a million for your engagement in this. emhass is key to making my solar facility more profitable and I really appreciate this. I bought you some coffee.

from emhass.

Octofinger avatar Octofinger commented on August 17, 2024

I ran this Python script to test the retrieval of history. I ran it from a separate PC on the same network.
It returns a complete list of sensor history, so still can't reproduce the EMHASS behavior.
(secrets masked)

import pandas as pd
from requests import get, post

days_list = pd.date_range(end='2024-04-17', freq='D', periods=5)
print(days_list)
print(days_list[0].isoformat())
day = days_list [0]
var = 'sensor.template_emhass_no_var_load_2'
hass_url= 'https://my.homeassistant.url:8123/'
long_lived_token = 'XXXXXXXXXXXXXXXX'

url = hass_url+"api/history/period/"+day.isoformat()+"?filter_entity_id="+var

headers = {

    "Authorization": "Bearer " + long_lived_token,
    "content-type": "application/json",
}

# Then once that all this is defined there is no much to it than this:
response = get(url, headers=headers)

# And extract the data >> This is where your code is failing so check this part:
data = response.json()[0]

# If successful then print
print(data)
[{'entity_id': 'sensor.template_emhass_no_var_load_2', 'state': '694.05', 'attributes': {'unit_of_measurement': 'W', 'device_class': 'power'}, 'last_changed': '2024-04-12T22:00:00.928736+00:00', 'last_updated': '2024-04-12T22:00:00.928736+00:00', 'context': {'id': '01HVG824J3QD58P2P1KHNK5EBW', 'parent_id': None, 'user_id': None}}, {'entity_id': 'sensor.template_emhass_no_var_load_2', 'state': '693.03', 'attributes': {'unit_of_measurement': 'W', 'device_class': 'power'}, 'last_changed': '2024-04-12T22:00:02.861105+00:00', 'last_updated': '2024-04-12T22:00:02.861105+00:00', 'context': {'id': '01HVG824J3QD58P2P1KHNK5EBW', 'parent_id': None, 'user_id': None}}, {'entity_id': 'sensor.template_emhass_no_var_load_2', 'state': '694.55', 'attributes': {'unit_of_measurement': 'W', 'device_class': 'power'}, 'last_changed': '2024-04-12T22:00:05.114414+00:00', 'last_updated': '2024-04-12T22:00:05.114414+00:00', 'context': {'id': '01HVG824J3QD58P2P1KHNK5EBW', 'parent_id': None, 'user_id': None}}, {'entity_id': 'sensor.template_emhass_no_var_load_2', 'state': '685.56', 'attributes': {'unit_of_measurement': 'W', 'device_class': 'power'}, 'last_changed': '2024-04-12T22:00:17.870891+00:00', 'last_updated': '2024-04-12T22:00:17.870891+00:00', 'context': {'id': '01HVG824J3QD58P2P1KHNK5EBW', 'parent_id': None, 'user_id': None}}, {'entity_id': 'sensor.template_emhass_no_var_load_2', 'state': '684.04', 'attributes': {'unit_of_measurement': 'W', 'device_class': 'power'}, 'last_changed': '2024-04-12T22:00:20.125773+00:00', 'last_updated': '2024-04-12T22:00:20.125773+00:00', 'context': {'id': '01HVG824J3QD58P2P1KHNK5EBW', 'parent_id': None, 'user_id': None}}, {'entity_id': 'sensor.template_emhass_no_var_load_2', 'state': '689.17', 'attributes': {'unit_of_measurement': 'W', 'device_class': 'power'}, 'last_changed': '2024-04-12T22:00:32.871763+00:00', 'last_updated': '2024-04-12T22:00:32.871763+00:00', 'context': {'id': '01HVG824J3QD58P2P1KHNK5EBW', 'parent_id': None, 'user_id': None}}, 
...

from emhass.

davidusb-geek avatar davidusb-geek commented on August 17, 2024

I need to find the time to try to replicate this.
In the meantime can you provide the logs from the add-on after a fresh restart of the add-on?
It's just to check the information printed on the logger about how data is retrieved from HA.
It is true that HA core and EMHASS on docker standalone mode are the least common installation methods these days.

from emhass.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.