Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to create pixelit two iot device #1

Open
maxrd opened this issue Feb 28, 2023 · 0 comments
Open

how to create pixelit two iot device #1

maxrd opened this issue Feb 28, 2023 · 0 comments

Comments

@maxrd
Copy link

maxrd commented Feb 28, 2023

hello
I try to write to two devices as follows.
The following returns an error.
How to achieve what I want to do.

AppDaemon config.
pixelit_1:
module: pixelit
class: pixelit
ip: 192.168.31.185
path: "/config/pixelit/"
entity_id: sensor.pixelit_1
debug: False
pixelit_2:
module: pixelit
class: pixelit
ip: 192.168.31.86
path: "/config/pixelit/"
entity_id: sensor.pixelit_2
debug: False

ha config
sensor:

notify:

rest_command:
pixelit_delete:
url: http://192.168.31.6:5050/api/appdaemon/pixelit_delete
method: POST
payload: '{"title": "{{ title }}"}'
content_type: 'application/json; charset=utf-8'

pixelit_update:
url: http://192.168.31.6:5050/api/appdaemon/pixelit_update
method: POST
payload: '{"title": "{{ title }}","message": "{{ message }}"}'
content_type: 'application/json; charset=utf-8'

pixelit_next:
url: http://192.168.31.6:5050/api/appdaemon/pixelit_next
method: POST
payload: '{}'
content_type: 'application/json; charset=utf-8'

switch:

2023-02-28 09:51:43.289580 WARNING pixelit_2: ------------------------------------------------------------
2023-02-28 09:51:43.289835 WARNING pixelit_2: Unexpected error running initialize() for pixelit_2
2023-02-28 09:51:43.290016 WARNING pixelit_2: ------------------------------------------------------------
2023-02-28 09:51:43.292646 WARNING pixelit_2: Traceback (most recent call last):
File "/usr/lib/python3.10/site-packages/appdaemon/app_management.py", line 165, in initialize_app
await utils.run_in_executor(self, init)
File "/usr/lib/python3.10/site-packages/appdaemon/utils.py", line 337, in run_in_executor
response = future.result()
File "/usr/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/appdaemon/apps/PixelIt-hacs/pixelit.py", line 159, in initialize
self.register_endpoint(self.rest_add, "pixelit_add")
File "/usr/lib/python3.10/site-packages/appdaemon/utils.py", line 226, in inner_sync_wrapper
f = run_coroutine_threadsafe(self, coro(self, *args, **kwargs))
File "/usr/lib/python3.10/site-packages/appdaemon/utils.py", line 346, in run_coroutine_threadsafe
result = future.result(self.AD.internal_function_timeout)
File "/usr/lib/python3.10/concurrent/futures/_base.py", line 451, in result
return self.__get_result()
File "/usr/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
raise self._exception
File "/usr/lib/python3.10/site-packages/appdaemon/adapi.py", line 1164, in register_endpoint
return await self.AD.http.register_endpoint(callback, endpoint, self.name, **kwargs)
File "/usr/lib/python3.10/site-packages/appdaemon/http.py", line 900, in register_endpoint
raise AttributeError(f"The given endpoint '{endpoint}' already exists and used by {app_name}")
AttributeError: The given endpoint 'pixelit_add' already exists and used by pixelit_1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant