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 update yaml file from 0.2.2 to 0.2.3? #36

Closed
lpt2007 opened this issue Jan 6, 2025 · 7 comments
Closed

how to update yaml file from 0.2.2 to 0.2.3? #36

lpt2007 opened this issue Jan 6, 2025 · 7 comments

Comments

@lpt2007
Copy link

lpt2007 commented Jan 6, 2025

After update I have yaml version 0.2.2 and tft version 0.2.3?

Now nspanel shows blank screen and buttons are working.

The problem is probably because I have yaml file version 0.2.2? How can I update it to latest?

thx in advance

@happydasch
Copy link
Owner

happydasch commented Jan 6, 2025

Please download the latest version again, it will have the correct version. Please report back if anything is not working.

@lpt2007
Copy link
Author

lpt2007 commented Jan 7, 2025

I try to update manualy but now I have qrcode on screen and some errors inside AppDaemon log, buttons still working.

What I do:
I downloaded latest 0.2.3 version from releases, and I copy files from apps to /addon_configs/a0d7b954_appdaemon/apps and then I restart AppDaemon

I updated it in esphome here is my esphome configuration:

substitutions:
  heartbeat_interval: '5'
  friendly_name: 'room_youth_switch_01'
  name: nspanel-haui-01
  mqtt_name: room_youth_switch_01
  mqtt_ip: !secret mqtt_ip
  mqtt_username: !secret mqtt_username
  mqtt_password: !secret mqtt_password
  topic_prefix: nspanel_haui/$mqtt_name
  topic_cmd: $topic_prefix/cmd
  topic_recv: $topic_prefix/recv
  ota_password: !secret ota_password
  api_encryption_key: !secret api_encryption_key
  web_username: !secret web_username
  web_password: !secret web_password
  wifi_ssid: !secret wifi_ssid
  wifi_password: !secret wifi_password
  ap_password: !secret ap_password
  #tft_update_url: https://github.com/happydasch/nspanel_haui/raw/master/device/nspanel_haui.tft
  tft_update_url: http://ha.local:8123/local/nspanel/nspanel_haui.tft

packages:
  remote_package:
    url: https://github.com/happydasch/nspanel_haui
    ref: master
    files:
      - device/nspanel_haui.yaml

when ns panel is updated I see in log this:

INFO ESPHome 2024.12.2
INFO Reading configuration /config/esphome/nspanel-01.yaml...
INFO Starting log output from 192.168.2.230 using esphome API
INFO Successfully connected to nspanel-haui-01 @ 192.168.2.230 in 0.004s
INFO Successful handshake with nspanel-haui-01 @ 192.168.2.230 in 0.094s
[13:48:52][I][app:100]: ESPHome version 2024.12.2 compiled on Jan  6 2025, 15:08:59
[13:48:52][I][app:102]: Project happydasch.nspanel_haui version 0.2.2

I can see version is not correct, is 0.2.2?

here some AppDaemon error logs:

2025-01-07 13:55:52.607861 WARNING nspanel-haui: ------------------------------------------------------------
--
2025-01-07 13:55:52.607633 WARNING nspanel-haui: Traceback (most recent call last): File "/usr/lib/python3.11/site-packages/appdaemon/threading.py", line 1095, in worker funcref(args["event"], data, self.AD.events.sanitize_event_kwargs(app, args["kwargs"])) File "/config/apps/nspanel_haui/haui/controller/mqtt.py", line 95, in callback_event self._event_callback(event) File "/config/apps/nspanel_haui/nspanel_haui.py", line 100, in callback_event controller.process_event(event) File "/config/apps/nspanel_haui/haui/controller/connection.py", line 157, in process_event self._set_connected(True) File "/config/apps/nspanel_haui/haui/controller/connection.py", line 91, in _set_connected self._connection_callback(connected) File "/config/apps/nspanel_haui/nspanel_haui.py", line 110, in callback_connection self.device.set_connected(connected) File "/config/apps/nspanel_haui/haui/device.py", line 122, in set_connected self.play_sound("startup") File "/config/apps/nspanel_haui/haui/device.py", line 232, in play_sound self.app.call_service(f"esphome/{device_name}_play_sound", name=name) File "/usr/lib/python3.11/site-packages/appdaemon/utils.py", line 231, in inner_sync_wrapper f = run_coroutine_threadsafe(self, coro(self, *args, **kwargs)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/appdaemon/utils.py", line 313, in run_coroutine_threadsafe result = future.result(self.AD.internal_function_timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/concurrent/futures/_base.py", line 456, in result return self.__get_result() ^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result raise self._exception File "/usr/lib/python3.11/site-packages/appdaemon/adapi.py", line 1762, in call_service return await self.AD.services.call_service(namespace, d, s, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/appdaemon/services.py", line 169, in call_service raise ServiceException(f"Unknown service ({namespace}/{domain}/{service}) in call_service from {name}") appdaemon.exceptions.ServiceException: Unknown service (default/esphome/room_youth_switch_01_play_sound) in call_service from nspanel-haui
2025-01-07 13:55:52.603217 WARNING nspanel-haui: ------------------------------------------------------------
2025-01-07 13:55:52.603125 WARNING nspanel-haui: Worker Ags: {'id': 'd62c23f32be04df6938273c1585896a8', 'name': 'nspanel-haui', 'objectid': '2ed521d54fee489ba5753dd7a71953f1', 'type': 'event', 'event': 'MQTT_MESSAGE', 'function': <bound method HAUIMQTTController.callback_event of <haui.controller.mqtt.HAUIMQTTController object at 0x7fd4a2553710>>, 'data': {'topic': 'nspanel_haui/room_youth_switch_01/recv', 'wildcard': None, 'payload': '{"name":"res_device_state","value":"{\\"page\\":1,\\"brightness\\":50,\\"button_left\\":0,\\"button_right\\":0,\\"relay_left\\":0,\\"relay_right\\":0,\\"use_relay_left\\":0,\\"use_relay_right\\":0,\\"display_state\\":2,\\"tft_version\\":\\"0.2.3\\",\\"required_tft_version\\":\\"0.2.2\\"}"}'}, 'pin_app': True, 'pin_thread': 5, 'kwargs': {'topic': 'nspanel_haui/room_youth_switch_01/recv', '__thread_id': 'thread-5'}}
2025-01-07 13:55:52.602978 WARNING nspanel-haui: Unexpected error in worker for App nspanel-haui:
2025-01-07 13:55:52.602812 WARNING nspanel-haui: ------------------------------------------------------------

I already updatet tft file to latest.

Now I see on nspanel qrcode waiting for initalization;(

Did I miss something?

@happydasch
Copy link
Owner

happydasch commented Jan 7, 2025

Set name to be room_youth_switch_01

When you install the version should be 0.2.3

My configuration is as this:

image

@lpt2007
Copy link
Author

lpt2007 commented Jan 8, 2025

Hi,

if i copy extratced files from nspanel_haui-0.2.3.zip to /config/esphome/nspanel_haui

what I must add instead of in nspanel: !include modules/devices/nspanel_haui.yaml?

What I must erase from my configuration?

substitutions:
  heartbeat_interval: '5'
  friendly_name: 'room_youth_switch_01'
  name: nspanel-haui-01
  mqtt_name: room_youth_switch_01
  mqtt_ip: !secret mqtt_ip
  mqtt_username: !secret mqtt_username
  mqtt_password: !secret mqtt_password
  topic_prefix: nspanel_haui/$mqtt_name
  topic_cmd: $topic_prefix/cmd
  topic_recv: $topic_prefix/recv
  ota_password: !secret ota_password
  api_encryption_key: !secret api_encryption_key
  web_username: !secret web_username
  web_password: !secret web_password
  wifi_ssid: !secret wifi_ssid
  wifi_password: !secret wifi_password
  ap_password: !secret ap_password
  #tft_update_url: https://github.com/happydasch/nspanel_haui/raw/master/device/nspanel_haui.tft
  tft_update_url: http://ha.local:8123/local/nspanel/nspanel_haui.tft

packages:
  remote_package:
    url: https://github.com/happydasch/nspanel_haui
    ref: master
    files:
      - device/nspanel_haui.yaml

thx for your patience;)

@happydasch
Copy link
Owner

this should do it:

substitutions:
  heartbeat_interval: '5'
  friendly_name: 'room_youth_switch_01'
  name: room-youth-switch-01
  mqtt_name: room_youth_switch_01
  mqtt_ip: !secret mqtt_ip
  mqtt_username: !secret mqtt_username
  mqtt_password: !secret mqtt_password
  topic_prefix: nspanel_haui/$mqtt_name
  topic_cmd: $topic_prefix/cmd
  topic_recv: $topic_prefix/recv
  ota_password: !secret ota_password
  api_encryption_key: !secret api_encryption_key
  web_username: !secret web_username
  web_password: !secret web_password
  wifi_ssid: !secret wifi_ssid
  wifi_password: !secret wifi_password
  ap_password: !secret ap_password
  #tft_update_url: https://github.com/happydasch/nspanel_haui/raw/master/device/nspanel_haui.tft
  tft_update_url: http://ha.local:8123/local/nspanel/nspanel_haui.tft

packages:
  remote_package:
    url: https://github.com/happydasch/nspanel_haui
    ref: master
    files:
      - device/nspanel_haui.yaml

@lpt2007
Copy link
Author

lpt2007 commented Jan 8, 2025

Now is working. But I don't understand why line name: room-youth-switch-01 is problem.

thx

@happydasch
Copy link
Owner

name and mqtt_name needs to be the same. There are some internal reasons. I will add some notes about this in the documentation. Thanks for issueing.

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

2 participants