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

Please fill out the requested Information in new Issues #675

Closed
joBr99 opened this issue Jan 6, 2023 · 12 comments
Closed

Please fill out the requested Information in new Issues #675

joBr99 opened this issue Jan 6, 2023 · 12 comments
Labels
bug Something isn't working

Comments

@joBr99
Copy link
Owner

joBr99 commented Jan 6, 2023

Please take a few minutes to complete the requested information inside of the issue templates.

The ability to provide assistance is greatly hampered without it and the same questions have to be asked over and over.

@joBr99 joBr99 added the bug Something isn't working label Jan 6, 2023
@joBr99 joBr99 closed this as completed Jan 6, 2023
@joBr99 joBr99 pinned this issue Jan 6, 2023
@johntdyer
Copy link

So where do we ask general questions ? I dont see a template for that in the issue types on Github...

@joBr99
Copy link
Owner Author

joBr99 commented Jan 20, 2023

well, what's your question?

@johntdyer
Copy link

Ha, well I wanted to two things...

First: is there a way in the grid card to toggle a cover vs hitting the icon and then going to the other screen w/ the up / down arrow.

Second: Is there a way to change the color of the heading of a page based on state of an entity or entities ?

Thanks!

@joBr99
Copy link
Owner Author

joBr99 commented Jan 24, 2023

First: is there a way in the grid card to toggle a cover vs hitting the icon and then going to the other screen w/ the up / down arrow.

Something like this should work:

          - entity: service.cover.toggle
            status: cover.rolladen
            data:
              entity_id: cover.rolladen

Second: Is there a way to change the color of the heading of a page based on state of an entity or entities ?

No, the color of the heading is fixed.

@johntdyer
Copy link

johntdyer commented Jan 24, 2023

Yea, the server.cover.toggle didnt work

 - type: cardGrid
        title: Test Grid Card
        entities:
          - entity: service.cover.toggle
            status: cover.one_car_garage_door
            color: '{{iif(states("cover.one_car_garage_door")=="open", "[255,0,0]", "[0,255,0]")}}'
            icon:
              open: mdi:garage-open
              closed: mdi:garage-lock
            data:
              entity_id: cover.one_car_garage_door

it shows the screensaver but not when I touch it , and it tries to render to page in question, I get a blank page and the following error in the app daemon logs

2023-01-24 11:03:21.387512 WARNING nspanel-1: ------------------------------------------------------------
2023-01-24 11:03:21.387711 WARNING nspanel-1: Unexpected error in worker for App nspanel-1:
2023-01-24 11:03:21.387914 WARNING nspanel-1: Worker Ags: {'id': '18dc4d80e8224b569e69760c83cd862f', 'name': 'nspanel-1', 'objectid': '774403641d6f4085923c2ebd65ffc0ef', 'type': 'event', 'event': 'MQTT_MESSAGE', 'function': <bound method LuiMqttListener.mqtt_event_callback of <luibackend.mqtt.LuiMqttListener object at 0x7f3bfc5127a0>>, 'data': {'topic': 'tele/tasmota_0DBF2C/RESULT', 'wildcard': None, 'payload': '{"CustomRecv":"event,buttonPress2,screensaver,bExit,2"}'}, 'pin_app': True, 'pin_thread': 5, 'kwargs': {'topic': 'tele/tasmota_0DBF2C/RESULT', '__thread_id': 'thread-5'}}
2023-01-24 11:03:21.388264 WARNING nspanel-1: ------------------------------------------------------------
2023-01-24 11:03:21.388623 WARNING nspanel-1: Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/appdaemon/threading.py", line 950, in worker
    funcref(args["event"], data, self.AD.events.sanitize_event_kwargs(app, args["kwargs"]))
  File "/config/appdaemon/apps/nspanel-lovelace-ui/luibackend/mqtt.py", line 57, in mqtt_event_callback
    self._controller.button_press(entity_id, btype, value)
  File "/config/appdaemon/apps/nspanel-lovelace-ui/luibackend/controller.py", line 218, in button_press
    self._pages_gen.render_card(self._current_card)
  File "/config/appdaemon/apps/nspanel-lovelace-ui/luibackend/pages.py", line 688, in render_card
    self.generate_entities_page(navigation, card.title, card.entities, card.cardType, temp_unit)
  File "/config/appdaemon/apps/nspanel-lovelace-ui/luibackend/pages.py", line 403, in generate_entities_page
    command += self.generate_entities_item(item, cardType, tempUnit)
  File "/config/appdaemon/apps/nspanel-lovelace-ui/luibackend/pages.py", line 264, in generate_entities_item
    icon_id = get_icon("script", overwrite=icon)
  File "/config/appdaemon/apps/nspanel-lovelace-ui/luibackend/icons.py", line 186, in get_icon
    if overwrite_state == state:
NameError: name 'state' is not defined
2023-01-24 11:03:21.388779 WARNING nspanel-1: ------------------------------------------------------------
2023-01-24 11:03:22.102647 INFO nspanel-1: MQTT callback for: {'topic': 'tele/tasmota_0DBF2C/RESULT', 'wildcard': None, 'payload': '{"CustomRecv":"event,buttonPress2,,button"}'}
2023-01-24 11:03:22.103619 INFO nspanel-1: Received Message from Screen: event,buttonPress2,,button
2023-01-24 11:03:22.104501 INFO nspanel-1: Button Press Event; entity_id: ; button_type: button; value: None 
2023-01-24 11:03:23.680827 INFO nspanel-1: MQTT callback for: {'topic': 'tele/tasmota_0DBF2C/RESULT', 'wildcard': None, 'payload': '{"CustomRecv":"event,buttonPress2,,button"}'}
2023-01-24 11:03:23.681531 INFO nspanel-1: Received Message from Screen: event,buttonPress2,,button
2023-01-24 11:03:23.682178 INFO nspanel-1: Button Press Event; entity_id: ; button_type: button; value: None 

@joBr99
Copy link
Owner Author

joBr99 commented Jan 24, 2023

Please update to the latest development version and try again.

https://docs.nspanel.pky.eu/faq/#how-to-upgrade-from-a-release-to-the-current-development-version

@johntdyer
Copy link

Updated appDamon to main branch, I then went to the console and ran the firmware update for Landscape. I then restarted the NS Panel afterward for good measure.

Here are the logs when I save app.yaml

023-01-24 13:45:44.626998 WARNING nspanel-1: ------------------------------------------------------------
2023-01-24 13:46:01.008991 INFO nspanel-1: Sending MQTT Message: time~13:46~
2023-01-24 13:46:13.094551 INFO nspanel-1: MQTT callback for: {'topic': 'tele/tasmota_0DBF2C/RESULT', 'wildcard': None, 'payload': '{"CustomRecv":"event,startup,49,us-l"}'}
2023-01-24 13:46:13.095245 INFO nspanel-1: Received Message from Screen: event,startup,49,us-l
2023-01-24 13:46:13.096071 INFO nspanel-1: Sending MQTT Message: X
2023-01-24 13:46:13.098183 INFO nspanel-1: Update Pre-Check failed Tasmota Driver Version: None Panel Version: 49
2023-01-24 13:46:13.098935 INFO nspanel-1: Startup Event
2023-01-24 13:46:13.102994 INFO nspanel-1: Sending MQTT Message: time~13:46~
2023-01-24 13:46:13.107196 INFO nspanel-1: Sending MQTT Message: date~Tuesday, January 24, 2023
2023-01-24 13:46:13.108992 INFO nspanel-1: Sending MQTT Message: timeout~20
2023-01-24 13:46:13.111252 INFO nspanel-1: Sending MQTT Message: dimmode~10~100~6371
2023-01-24 13:46:13.113415 INFO nspanel-1: Sending MQTT Message: pageType~cardGrid
2023-01-24 13:46:13.117271 WARNING nspanel-1: ------------------------------------------------------------
2023-01-24 13:46:13.117521 WARNING nspanel-1: Unexpected error in worker for App nspanel-1:
2023-01-24 13:46:13.117710 WARNING nspanel-1: Worker Ags: {'id': 'cc3f4420d4134926af07442f9ecf5f60', 'name': 'nspanel-1', 'objectid': 'da6b9352e6464e6ea67ee6479a3a36cb', 'type': 'event', 'event': 'MQTT_MESSAGE', 'function': <bound method LuiMqttListener.mqtt_event_callback of <luibackend.mqtt.LuiMqttListener object at 0x7f3bfcb21ab0>>, 'data': {'topic': 'tele/tasmota_0DBF2C/RESULT', 'wildcard': None, 'payload': '{"CustomRecv":"event,startup,49,us-l"}'}, 'pin_app': True, 'pin_thread': 5, 'kwargs': {'topic': 'tele/tasmota_0DBF2C/RESULT', '__thread_id': 'thread-5'}}
2023-01-24 13:46:13.117889 WARNING nspanel-1: ------------------------------------------------------------
2023-01-24 13:46:13.118231 WARNING nspanel-1: Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/appdaemon/threading.py", line 950, in worker
    funcref(args["event"], data, self.AD.events.sanitize_event_kwargs(app, args["kwargs"]))
  File "/config/appdaemon/apps/nspanel-lovelace-ui/luibackend/mqtt.py", line 40, in mqtt_event_callback
    self._controller.startup()
  File "/config/appdaemon/apps/nspanel-lovelace-ui/luibackend/controller.py", line 44, in startup
    self._pages_gen.render_card(self._current_card)
  File "/config/appdaemon/apps/nspanel-lovelace-ui/luibackend/pages.py", line 688, in render_card
    return
  File "/config/appdaemon/apps/nspanel-lovelace-ui/luibackend/pages.py", line 403, in generate_entities_page
    dest_temp2   = int(dest_temp2*10)
  File "/config/appdaemon/apps/nspanel-lovelace-ui/luibackend/pages.py", line 264, in generate_entities_item
    icon_up   = get_action_icon(ha_type=entityType, action="open", device_class=device_class)
  File "/config/appdaemon/apps/nspanel-lovelace-ui/luibackend/icons.py", line 186, in get_icon
    if ha_type == "script":
NameError: name 'state' is not defined
2023-01-24 13:46:13.118395 WARNING nspanel-1: ------------------------------------------------------------
2023-01-24 13:46:13.166245 INFO nspanel-1: MQTT callback for: {'topic': 'tele/tasmota_0DBF2C/RESULT', 'wildcard': None, 'payload': '{"nlui_driver_version":"8"}'}
2023-01-24 13:46:13.166988 INFO nspanel-1: Update Pre-Check sucessful Tasmota Driver Version: 8 Panel Version: 49
2023-01-24 13:46:43.958269 INFO AppDaemon: Reading config
2023-01-24 13:46:43.990445 INFO AppDaemon: /config/appdaemon/apps/apps.yaml added or modified
2023-01-24 13:46:43.996886 INFO AppDaemon: Found 7 total apps

The weather screensaver now looks incomplete...
IMG_1507

and when I click on the screen I get the same blank display..
IMG_1508

(

@joBr99
Copy link
Owner Author

joBr99 commented Jan 24, 2023

You need to restart the AppDaemon Addon not the Nspanel and also not HomeAssistant. Go to the place where you also get the logs and restart the addon.

@johntdyer
Copy link

ok, but I did just find out one thing... It works w/o the icon: config

Working:

- type: cardGrid
  title: Test Grid Card
  entities:
    - entity: service.cover.toggle
      status: cover.one_car_garage_door
      color: '{{iif(states("cover.one_car_garage_door")=="open", "[255,0,0]", "[0,255,0]")}}'
      data:
        entity_id: cover.one_car_garage_door

not working

- type: cardGrid
  title: Test Grid Card
  entities:
    - entity: service.cover.toggle
      status: cover.one_car_garage_door
      color: '{{iif(states("cover.one_car_garage_door")=="open", "[255,0,0]", "[0,255,0]")}}'
      icon:
        open: mdi:garage-open
        closed: mdi:garage-lock
      data:
        entity_id: cover.one_car_garage_door

restarting now

@johntdyer
Copy link

johntdyer commented Jan 24, 2023

Works like a charm now ! Thank you very much for the help !

@joBr99
Copy link
Owner Author

joBr99 commented Jan 24, 2023

also this should two, no need to use templates there

- type: cardGrid
  title: Test Grid Card
  entities:
    - entity: service.cover.toggle
      status: cover.one_car_garage_door
      color:
        open: [255,0,0]
        closed: [0,255,0]
      icon:
        open: mdi:garage-open
        closed: mdi:garage-lock
      data:
        entity_id: cover.one_car_garage_door

@johntdyer
Copy link

Yea, I changed this.... but I am seemingly having an issue w/ service.light.toggle entities and inability to change their icon... new issue ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants