hassio-addons / addon-appdaemon

AppDaemon4 - Home Assistant Community Add-ons
https://addons.community
MIT License
141 stars 45 forks source link

User defined namespaces are no longer working #315

Closed skannea closed 3 months ago

skannea commented 7 months ago

Problem/Motivation

I am running 0.16.0 After the move to addon_configs, 'user defined namespaces' are no longer working.

Expected behavior

(What you expected to happen)

Actual behavior

(What actually happened)

Steps to reproduce

from appdaemon.yaml:

namespaces:
  qstore:
    # writeback is one of
    # `safe`, `performance` or `hybrid`
    writeback: safe    

the app (testns4):

import appdaemon.plugins.hass.hassapi as hass 
class H(hass.Hass): 

  def initialize(self): 
     self.log( f'trying to set state')
     try:
       self.set_state('data.test',  state='hello',  namespace='qstore')
     except: 
       self.log('except')    
     x = self.get_state('data.test', namespace='qstore')
     self.log( f'data.test={x}')

  def terminate(self): 
     pass 

The log:

2023-12-10 23:12:35.765070 INFO testns4: data.test=None
2023-12-10 23:12:35.756221 INFO testns4: except
2023-12-10 23:12:35.743740 WARNING testns4: testns4: Entity data.test not found in namespace qstore
2023-12-10 23:12:35.711447 INFO testns4: trying to set state
2023-12-10 23:12:35.704659 INFO AppDaemon: Calling initialize() for testns4
2023-12-10 23:12:35.655183 INFO AppDaemon: Loading app testns4 using class H from module testns

The folder named namespaces is used for storing 'user defined namespaces' data. My guess is that this is no longer allowed, similar to previous logging problems.

Proposed changes

github-actions[bot] commented 6 months ago

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!

skannea commented 6 months ago

Same problem with 0.16.2.

AD user defined namespaces is a method to make data survive restarts by storing the data in a file in an efficient way.

Unlike location of secrets.yaml, apps and log files, the location of namespaces data files is hard coded as /addon_configs/a0d7b954_appdaemon/namespaces

github-actions[bot] commented 5 months ago

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!

skannea commented 5 months ago

Same problem with 0.16.4 and HA 2024.2.1.

github-actions[bot] commented 4 months ago

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!